diff --git a/docs/tr2/CHANGELOG.md b/docs/tr2/CHANGELOG.md index 2da860bda..6be488e7c 100644 --- a/docs/tr2/CHANGELOG.md +++ b/docs/tr2/CHANGELOG.md @@ -13,6 +13,7 @@ - changed the number of static mesh slots from 50 to 256 (#2734) - changed the maximum number of items (moveables) per level from 256 to 10240 (1024 remains the limit for triggered items) (#1794) - changed the maximum number of visible enemies from 5 to 32 (#1624) +- changed the maximum number of effects (flames, embers, exploding parts etc) from 100 to 1000 (#1581) - fixed the inability to completely mute the sounds, even at sound volume 0 (#2722) - fixed the final two levels not allowing for secrets to be counted in the statistics (#1582) - fixed Lara's holsters being empty if a game flow level removes all weapons but also re-adds the pistols (#2677) diff --git a/docs/tr2/README.md b/docs/tr2/README.md index b73e1f0b3..2a3fa70d8 100644 --- a/docs/tr2/README.md +++ b/docs/tr2/README.md @@ -327,6 +327,7 @@ as Notepad. - expanded the number of static mesh slots from 50 to 256 - expanded maximum number of items (moveables) from 256 to 10240 (1024 remains the limit for triggered items) - expanded maximum number of visible enemies from 5 to 32 +- expanded the maximum number of effects (flames, embers, exploding parts etc) from 100 to 1000 - ported audio decoding library to ffmpeg - ported video decoding library to ffmpeg - ported input backend to SDL diff --git a/src/libtrx/include/libtrx/game/effects/const.h b/src/libtrx/include/libtrx/game/effects/const.h index 5abc401fd..a5501b2be 100644 --- a/src/libtrx/include/libtrx/game/effects/const.h +++ b/src/libtrx/include/libtrx/game/effects/const.h @@ -1,3 +1,4 @@ #pragma once #define NO_EFFECT (-1) +#define MAX_EFFECTS 1000 diff --git a/src/tr1/game/effects.c b/src/tr1/game/effects.c index 9c9446577..3acac2bab 100644 --- a/src/tr1/game/effects.c +++ b/src/tr1/game/effects.c @@ -15,15 +15,15 @@ static int16_t m_NextEffectFree = NO_EFFECT; void Effect_InitialiseArray(void) { - m_Effects = GameBuf_Alloc(NUM_EFFECTS * sizeof(EFFECT), GBUF_EFFECTS); + m_Effects = GameBuf_Alloc(MAX_EFFECTS * sizeof(EFFECT), GBUF_EFFECTS); m_NextEffectActive = NO_EFFECT; m_NextEffectFree = 0; - for (int i = 0; i < NUM_EFFECTS - 1; i++) { + for (int32_t i = 0; i < MAX_EFFECTS - 1; i++) { m_Effects[i].next_draw = i + 1; m_Effects[i].next_free = i + 1; } - m_Effects[NUM_EFFECTS - 1].next_draw = NO_EFFECT; - m_Effects[NUM_EFFECTS - 1].next_free = NO_EFFECT; + m_Effects[MAX_EFFECTS - 1].next_draw = NO_EFFECT; + m_Effects[MAX_EFFECTS - 1].next_free = NO_EFFECT; } void Effect_Control(void) diff --git a/src/tr1/game/savegame/savegame_bson.c b/src/tr1/game/savegame/savegame_bson.c index c8ec10d39..cca545fbe 100644 --- a/src/tr1/game/savegame/savegame_bson.c +++ b/src/tr1/game/savegame/savegame_bson.c @@ -34,7 +34,7 @@ typedef struct { int16_t count; - int16_t id_map[NUM_EFFECTS]; + int16_t id_map[MAX_EFFECTS]; } SAVEGAME_BSON_FX_ORDER; static void M_SaveRaw(MYFILE *fp, JSON_VALUE *root, int32_t version); @@ -137,7 +137,7 @@ static void M_SaveRaw(MYFILE *fp, JSON_VALUE *root, int32_t version) static void M_GetFXOrder(SAVEGAME_BSON_FX_ORDER *order) { order->count = 0; - for (int i = 0; i < NUM_EFFECTS; i++) { + for (int32_t i = 0; i < MAX_EFFECTS; i++) { order->id_map[i] = -1; } @@ -677,12 +677,12 @@ static bool M_LoadEffects(JSON_ARRAY *fx_arr) return false; } - if ((signed)fx_arr->length >= NUM_EFFECTS) { + if ((signed)fx_arr->length >= MAX_EFFECTS) { LOG_WARNING( "Malformed save: expected a max of %d effect, got %d. effect over " "the " "maximum will not be created.", - NUM_EFFECTS - 1, fx_arr->length); + MAX_EFFECTS - 1, fx_arr->length); } for (int i = 0; i < (signed)fx_arr->length; i++) { diff --git a/src/tr1/global/const.h b/src/tr1/global/const.h index c98fec8c0..65dd58037 100644 --- a/src/tr1/global/const.h +++ b/src/tr1/global/const.h @@ -41,7 +41,6 @@ #define DAMAGE_START 140 #define DAMAGE_LENGTH 14 #define NO_CAMERA (-1) -#define NUM_EFFECTS 1000 #define DEATH_WAIT (10 * LOGIC_FPS) #define DEATH_WAIT_MIN (2 * LOGIC_FPS) #define MAX_HEAD_ROTATION (50 * DEG_1) // = 9100 diff --git a/src/tr2/global/const.h b/src/tr2/global/const.h index 7bf7853ae..1b009fd59 100644 --- a/src/tr2/global/const.h +++ b/src/tr2/global/const.h @@ -28,7 +28,6 @@ #define MAX_PALETTES 16 #define MAX_VERTICES 0x2000 #define MAX_BOUND_ROOMS 128 -#define MAX_EFFECTS 100 #define MAX_LEVELS 24 #define MAX_LEVEL_NAME_SIZE 50 // TODO: get rid of this limit #define MAX_DEMO_FILES MAX_LEVELS