diff options
author | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-01-29 19:30:27 +0300 |
---|---|---|
committer | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-01-29 19:30:27 +0300 |
commit | f61a91c97dac4a8ab244c1df09d58ac452ac5835 (patch) | |
tree | a3df1cf5a58cfb814d530eb0c967b3392aa2d0de | |
parent | d52b917c549719addf45788413210ea1700cd0d5 (diff) | |
parent | f7fc919d98cd5762d1f033f162d741f09cb93551 (diff) |
Merge branch 'master' of https://github.com/GTAmodding/re3
-rw-r--r-- | src/core/CdStreamPosix.cpp | 12 | ||||
-rw-r--r-- | src/core/re3.cpp | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/core/CdStreamPosix.cpp b/src/core/CdStreamPosix.cpp index 8a27665a..e18280e5 100644 --- a/src/core/CdStreamPosix.cpp +++ b/src/core/CdStreamPosix.cpp @@ -76,7 +76,7 @@ CdStreamInitThread(void) gChannelRequestQ.tail = 0; gChannelRequestQ.size = gNumChannels + 1; ASSERT(gChannelRequestQ.items != nil ); - gCdStreamSema = sem_open("/semaphore_cd_stream", O_CREAT, 0644, 1); + gCdStreamSema = sem_open("/semaphore_cd_stream", O_CREAT, 0644, 0); if (gCdStreamSema == SEM_FAILED) { @@ -91,7 +91,7 @@ CdStreamInitThread(void) for ( int32 i = 0; i < gNumChannels; i++ ) { sprintf(semName,"/semaphore_done%d",i); - gpReadInfo[i].pDoneSemaphore = sem_open(semName, O_CREAT, 0644, 1); + gpReadInfo[i].pDoneSemaphore = sem_open(semName, O_CREAT, 0644, 0); if (gpReadInfo[i].pDoneSemaphore == SEM_FAILED) { @@ -102,7 +102,7 @@ CdStreamInitThread(void) #ifdef ONE_THREAD_PER_CHANNEL sprintf(semName,"/semaphore_start%d",i); - gpReadInfo[i].pStartSemaphore = sem_open(semName, O_CREAT, 0644, 1); + gpReadInfo[i].pStartSemaphore = sem_open(semName, O_CREAT, 0644, 0); if (gpReadInfo[i].pStartSemaphore == SEM_FAILED) { @@ -171,6 +171,7 @@ CdStreamInit(int32 numChannels) gNumImages = 0; gNumChannels = numChannels; + ASSERT( gNumChannels != 0 ); gpReadInfo = (CdReadInfo *)calloc(numChannels, sizeof(CdReadInfo)); ASSERT( gpReadInfo != nil ); @@ -398,7 +399,12 @@ void *CdStreamThread(void *param) #ifndef ONE_THREAD_PER_CHANNEL while (gCdStreamThreadStatus != 2) { sem_wait(gCdStreamSema); + int32 channel = GetFirstInQueue(&gChannelRequestQ); + + // spurious wakeup + if (channel == -1) + continue; #else int channel = *((int*)param); while (gpReadInfo[channel].nThreadStatus != 2){ diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 7c780516..37b2cdf0 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -396,6 +396,9 @@ bool LoadINISettings() ReadIniIfExists("CustomPipesValues", "LightmapMult", &CustomPipes::LightmapMult); ReadIniIfExists("CustomPipesValues", "GlossMult", &CustomPipes::GlossMult); #endif +#ifdef NEW_RENDERER + ReadIniIfExists("Rendering", "NewRenderer", &gbNewRenderer); +#endif #ifdef PROPER_SCALING ReadIniIfExists("Draw", "ProperScaling", &CDraw::ms_bProperScaling); @@ -479,6 +482,9 @@ void SaveINISettings() StoreIni("CustomPipesValues", "LightmapMult", CustomPipes::LightmapMult); StoreIni("CustomPipesValues", "GlossMult", CustomPipes::GlossMult); #endif +#ifdef NEW_RENDERER + StoreIni("Rendering", "NewRenderer", gbNewRenderer); +#endif #ifdef PROPER_SCALING StoreIni("Draw", "ProperScaling", CDraw::ms_bProperScaling); |