summaryrefslogtreecommitdiffstats
path: root/src/core/Streaming.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/Streaming.cpp')
-rw-r--r--src/core/Streaming.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index a7bde91e..227a4a9f 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -1021,7 +1021,7 @@ CStreaming::RemoveAllUnusedModels(void)
for(i = 0; i < MAXVEHICLESLOADED; i++)
RemoveLoadedVehicle();
- for(i = NUM_DEFAULT_MODELS; i < MODELINFOSIZE; i++){
+ for(i = NUMDEFAULTMODELS; i < MODELINFOSIZE; i++){
if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED &&
ms_aInfoForModel[i].m_flags & STREAMFLAGS_DONT_REMOVE &&
CModelInfo::GetModelInfo(i)->m_refCount == 0){
@@ -1719,8 +1719,10 @@ CStreaming::RetryLoadFile(int32 ch)
}
switch(ms_channel[ch].state){
+ case CHANNELSTATE_ERROR:
+ ms_channel[ch].numTries++;
+ if (CdStreamGetStatus(ch) == STREAM_READING || CdStreamGetStatus(ch) == STREAM_WAITING) break;
case CHANNELSTATE_IDLE:
-streamread:
CdStreamRead(ch, ms_pStreamingBuffer[ch], ms_channel[ch].position, ms_channel[ch].size);
ms_channel[ch].state = CHANNELSTATE_READING;
ms_channel[ch].field24 = -600;
@@ -1731,11 +1733,6 @@ streamread:
CTimer::SetCodePause(false);
}
break;
- case CHANNELSTATE_ERROR:
- ms_channel[ch].numTries++;
- if(CdStreamGetStatus(ch) != STREAM_READING && CdStreamGetStatus(ch) != STREAM_WAITING)
- goto streamread;
- break;
}
}
@@ -2408,8 +2405,8 @@ CStreaming::MemoryCardSave(uint8 *buffer, uint32 *length)
{
int i;
- *length = NUM_DEFAULT_MODELS;
- for(i = 0; i < NUM_DEFAULT_MODELS; i++)
+ *length = NUMDEFAULTMODELS;
+ for(i = 0; i < NUMDEFAULTMODELS; i++)
if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED)
buffer[i] = ms_aInfoForModel[i].m_flags;
else
@@ -2421,7 +2418,7 @@ CStreaming::MemoryCardLoad(uint8 *buffer, uint32 length)
{
uint32 i;
- assert(length == NUM_DEFAULT_MODELS);
+ assert(length == NUMDEFAULTMODELS);
for(i = 0; i < length; i++)
if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED)
if(buffer[i] != 0xFF)