diff --git a/src/gameflow.h b/src/gameflow.h index c8b9d577..0ae744ac 100644 --- a/src/gameflow.h +++ b/src/gameflow.h @@ -873,21 +873,21 @@ namespace TR { CHECK_FILE("FMV/CORELOGO.FMV"); CHECK_FILE("FMV/CORE.RPL"); CHECK_FILE("video/1/CORELOGO.FMV"); - return "video/1/CORE.RPL"; + CHECK_FILE("video/1/CORE.RPL"); } if (version & VER_TR2) { CHECK_FILE("FMV/LOGO.FMV"); CHECK_FILE("FMV/LOGO.RPL"); CHECK_FILE("video/2/LOGO.FMV"); - return "video/2/LOGO.RPL"; + CHECK_FILE("video/2/LOGO.RPL"); } if (version & VER_TR3) { CHECK_FILE("FMV/LOGO.FMV"); CHECK_FILE("fmv/logo.rpl"); CHECK_FILE("video/3/LOGO.FMV"); - return "video/3/logo.rpl"; + CHECK_FILE("video/3/logo.rpl"); } return NULL; @@ -900,106 +900,127 @@ namespace TR { CHECK_FILE("FMV/CAFE.FMV"); CHECK_FILE("FMV/CAFE.RPL"); CHECK_FILE("video/1/CAFE.FMV"); - return "video/1/CAFE.RPL"; + CHECK_FILE("video/1/CAFE.RPL"); + break; case LVL_TR1_GYM : CHECK_FILE("FMV/MANSION.FMV"); CHECK_FILE("FMV/MANSION.RPL"); CHECK_FILE("video/1/MANSION.FMV"); - return "video/1/MANSION.RPL"; + CHECK_FILE("video/1/MANSION.RPL"); + break; case LVL_TR1_1 : CHECK_FILE("FMV/SNOW.FMV"); CHECK_FILE("FMV/SNOW.RPL"); CHECK_FILE("video/1/SNOW.FMV"); - return "video/1/SNOW.RPL"; + CHECK_FILE("video/1/SNOW.RPL"); + break; case LVL_TR1_4 : CHECK_FILE("FMV/LIFT.FMV"); CHECK_FILE("FMV/LIFT.RPL"); CHECK_FILE("video/1/LIFT.FMV"); - return "video/1/LIFT.RPL"; + CHECK_FILE("video/1/LIFT.RPL"); + break; case LVL_TR1_8A : CHECK_FILE("FMV/VISION.FMV"); CHECK_FILE("FMV/VISION.RPL"); CHECK_FILE("video/1/VISION.FMV"); - return "video/1/VISION.RPL"; + CHECK_FILE("video/1/VISION.RPL"); + break; case LVL_TR1_10A : CHECK_FILE("FMV/CANYON.FMV"); CHECK_FILE("FMV/CANYON.RPL"); CHECK_FILE("video/1/CANYON.FMV"); - return "video/1/CANYON.RPL"; + CHECK_FILE("video/1/CANYON.RPL"); + break; case LVL_TR1_10B : CHECK_FILE("FMV/PIRAMID.FMV"); CHECK_FILE("FMV/PIRAMID.RPL"); CHECK_FILE("video/1/PIRAMID.FMV"); - return "video/1/PIRAMID.RPL"; + CHECK_FILE("video/1/PIRAMID.RPL"); + break; case LVL_TR1_CUT_4 : CHECK_FILE("FMV/PRISON.FMV"); CHECK_FILE("FMV/PRISON.RPL"); CHECK_FILE("video/1/PRISON.FMV"); - return "video/1/PRISON.RPL"; + CHECK_FILE("video/1/PRISON.RPL"); + break; case LVL_TR1_EGYPT : CHECK_FILE("FMV/END.FMV"); CHECK_FILE("FMV/END.RPL"); CHECK_FILE("video/1/END.FMV"); - return "video/1/END.RPL"; + CHECK_FILE("video/1/END.RPL"); + break; // TR2 case LVL_TR2_TITLE : CHECK_FILE("FMV/ANCIENT.FMV"); CHECK_FILE("fmv/ANCIENT.RPL"); CHECK_FILE("video/2/ANCIENT.FMV"); - return "video/2/ANCIENT.RPL"; + CHECK_FILE("video/2/ANCIENT.RPL"); + break; case LVL_TR2_WALL : CHECK_FILE("FMV/MODERN.FMV"); CHECK_FILE("fmv/MODERN.RPL"); CHECK_FILE("video/2/MODERN.FMV"); - return "video/2/MODERN.RPL"; + CHECK_FILE("video/2/MODERN.RPL"); + break; case LVL_TR2_RIG : CHECK_FILE("FMV/LANDING.FMV"); CHECK_FILE("fmv/LANDING.RPL"); CHECK_FILE("video/2/LANDING.FMV"); - return "video/2/LANDING.RPL"; + CHECK_FILE("video/2/LANDING.RPL"); + break; case LVL_TR2_UNWATER : CHECK_FILE("FMV/MS.FMV"); CHECK_FILE("fmv/MS.RPL"); CHECK_FILE("video/2/MS.FMV"); - return "video/2/MS.RPL"; + CHECK_FILE("video/2/MS.RPL"); + break; case LVL_TR2_SKIDOO : CHECK_FILE("FMV/CRASH.FMV"); CHECK_FILE("fmv/CRASH.RPL"); CHECK_FILE("video/2/CRASH.FMV"); - return "video/2/CRASH.RPL"; + CHECK_FILE("video/2/CRASH.RPL"); + break; case LVL_TR2_EMPRTOMB : CHECK_FILE("FMV/JEEP.FMV"); CHECK_FILE("fmv/JEEP.RPL"); CHECK_FILE("video/2/JEEP.FMV"); - return "video/2/JEEP.RPL"; + CHECK_FILE("video/2/JEEP.RPL"); + break; case LVL_TR2_HOUSE : CHECK_FILE("FMV/END.FMV"); CHECK_FILE("fmv/END.RPL"); CHECK_FILE("video/2/END.FMV"); - return "video/2/END.RPL"; + CHECK_FILE("video/2/END.RPL"); + break; // TR3 case LVL_TR3_TITLE : CHECK_FILE("FMV/INTRO.FMV"); CHECK_FILE("fmv/Intr_Eng.rpl"); CHECK_FILE("video/3/INTRO.FMV"); - return "video/3/Intr_Eng.rpl"; + CHECK_FILE("video/3/Intr_Eng.rpl"); + break; case LVL_TR3_SHORE : CHECK_FILE("FMV/LAGOON.FMV"); CHECK_FILE("fmv/Sail_Eng.rpl"); CHECK_FILE("video/3/LAGOON.FMV"); - return "video/3/Sail_Eng.rpl"; + CHECK_FILE("video/3/Sail_Eng.rpl"); + break; case LVL_TR3_ANTARC : CHECK_FILE("FMV/HUEY.FMV"); CHECK_FILE("fmv/Crsh_Eng.rpl"); CHECK_FILE("video/3/HUEY.FMV"); - return "video/3/Crsh_Eng.rpl"; + CHECK_FILE("video/3/Crsh_Eng.rpl"); + break; case LVL_TR3_STPAUL : CHECK_FILE("FMV/END.FMV"); CHECK_FILE("fmv/Endgame.rpl"); CHECK_FILE("video/3/END.FMV"); - return "video/3/Endgame.rpl"; - default : return NULL; + CHECK_FILE("video/3/Endgame.rpl"); + break; + default : ; } + return NULL; } #define FOG_DIST (1.0f / (18 * 1024)) diff --git a/src/inventory.h b/src/inventory.h index 246a948b..4fd33c76 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -1532,8 +1532,10 @@ struct Inventory { alpha = 255; float sy = 1.0f; + #ifndef _OS_WEB if (background[0]) sy = (480.0f / 640.0f) * ((float)background[0]->width / (float)background[0]->height); + #endif if (Core::settings.detail.stereo == Core::Settings::STEREO_VR) { if (game->getLevel()->isTitle()) diff --git a/src/utils.h b/src/utils.h index f15d23d6..bed3002f 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1393,7 +1393,9 @@ void osLoadGame(Stream *stream) { void* osMutexInit() { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); +#ifndef _OS_WEB pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); +#endif pthread_mutex_t *mutex = new pthread_mutex_t(); pthread_mutex_init(mutex, &attr); diff --git a/src/video.h b/src/video.h index 14061be7..bcdd4d2d 100644 --- a/src/video.h +++ b/src/video.h @@ -1144,7 +1144,7 @@ struct Video { bool needUpdate; Sound::Sample *sample; - Video(Stream *stream) : decoder(NULL), time(0.0f), stepTimer(0.0f), isPlaying(false) { + Video(Stream *stream) : decoder(NULL), stepTimer(0.0f), time(0.0f), isPlaying(false) { frameTex[0] = frameTex[1] = NULL; if (!stream) return;