OpenBarnyard
Loading...
Searching...
No Matches
AAssetStreaming.cpp
Go to the documentation of this file.
1
#include "
pch.h
"
2
#include "
AAssetStreaming.h
"
3
#include "
ATRBLoaderJob.h
"
4
5
//-----------------------------------------------------------------------------
6
// Enables memory debugging.
7
// Note: Should be the last include!
8
//-----------------------------------------------------------------------------
9
#include <
Core/TMemoryDebugOn.h
>
10
11
// $Barnyard: FUNCTION 006066e0
12
AAssetStreaming::AAssetStreaming
()
13
{
14
m_pCurrentJob =
TNULL
;
15
m_Unk =
TNULL
;
16
m_bFlag =
TTRUE
;
17
m_FileStream.Create( 0, Toshi::TThread::THREAD_PRIORITY_NORMAL, 0 );
18
}
19
20
AAssetStreaming::~AAssetStreaming
()
21
{
22
}
23
24
// $Barnyard: FUNCTION 00606a90
25
void
AAssetStreaming::Update
()
26
{
27
if
( m_pCurrentJob ==
TNULL
)
28
{
29
if
( !m_Jobs.IsEmpty() )
30
{
31
m_pCurrentJob = m_Jobs.PopFront();
32
m_pCurrentJob->BeginJob();
33
}
34
}
35
else
if
( m_pCurrentJob->RunJob() )
36
{
37
m_pCurrentJob->m_bIsFinished =
TTRUE
;
38
m_pCurrentJob =
TNULL
;
39
}
40
}
41
42
// $Barnyard: FUNCTION 00606b20
43
void
AAssetStreaming::CancelAllJobs
()
44
{
45
for
(
auto
it = m_Jobs.Begin(); it != m_Jobs.End(); )
46
{
47
auto
next = it->Next();
48
49
if
( it->CancelJob() )
50
{
51
it->m_bIsFinished =
TTRUE
;
52
it->Remove();
53
}
54
55
it = next;
56
}
57
}
58
59
// $Barnyard: FUNCTION 006067d0
60
TBOOL
AAssetStreaming::HasActiveJobs
()
const
61
{
62
return
!m_Jobs.IsEmpty() || m_pCurrentJob !=
TNULL
;
63
}
64
65
// $Barnyard: FUNCTION 00606ae0
66
void
AAssetStreaming::AddMainThreadJob
(
AMainThreadJob
* a_pJob )
67
{
68
TASSERT
( m_pCurrentJob != a_pJob );
69
a_pJob->
m_bIsFinished
=
TFALSE
;
70
m_Jobs.PushBack( a_pJob );
71
}
pch.h
TMemoryDebugOn.h
TASSERT
#define TASSERT(X,...)
Definition
Defines.h:138
TNULL
#define TNULL
Definition
Typedefs.h:23
TFALSE
#define TFALSE
Definition
Typedefs.h:24
TTRUE
#define TTRUE
Definition
Typedefs.h:25
TBOOL
bool TBOOL
Definition
Typedefs.h:6
AAssetStreaming.h
ATRBLoaderJob.h
AAssetStreaming::~AAssetStreaming
~AAssetStreaming()
Definition
AAssetStreaming.cpp:20
AAssetStreaming::CancelAllJobs
void CancelAllJobs()
Definition
AAssetStreaming.cpp:43
AAssetStreaming::Update
void Update()
Definition
AAssetStreaming.cpp:25
AAssetStreaming::HasActiveJobs
TBOOL HasActiveJobs() const
Definition
AAssetStreaming.cpp:60
AAssetStreaming::AAssetStreaming
AAssetStreaming()
Definition
AAssetStreaming.cpp:12
AAssetStreaming::AddMainThreadJob
void AddMainThreadJob(AMainThreadJob *a_pJob)
Definition
AAssetStreaming.cpp:66
AMainThreadJob
Definition
AMainThreadJob.h:5
AMainThreadJob::m_bIsFinished
TBOOL m_bIsFinished
Definition
AMainThreadJob.h:18
D:
_dev
OpenBarnyard
Source
OpenBarnyard
Source
Assets
AAssetStreaming.cpp
Generated by
1.13.2