effects: raise TR2 effects limit

This raises the TR2 effects limits from 100 to 1000, like TR1. The
constant has been renamed for TR1 as well for consistency.

Resolves #1581.
This commit is contained in:
lahm86 2025-04-12 09:40:40 +01:00
parent 28fc94a89f
commit d57b2b9234
7 changed files with 11 additions and 10 deletions

View file

@ -13,6 +13,7 @@
- changed the number of static mesh slots from 50 to 256 (#2734) - 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 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 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 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 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) - fixed Lara's holsters being empty if a game flow level removes all weapons but also re-adds the pistols (#2677)

View file

@ -327,6 +327,7 @@ as Notepad.
- expanded the number of static mesh slots from 50 to 256 - 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 items (moveables) from 256 to 10240 (1024 remains the limit for triggered items)
- expanded maximum number of visible enemies from 5 to 32 - 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 audio decoding library to ffmpeg
- ported video decoding library to ffmpeg - ported video decoding library to ffmpeg
- ported input backend to SDL - ported input backend to SDL

View file

@ -1,3 +1,4 @@
#pragma once #pragma once
#define NO_EFFECT (-1) #define NO_EFFECT (-1)
#define MAX_EFFECTS 1000

View file

@ -15,15 +15,15 @@ static int16_t m_NextEffectFree = NO_EFFECT;
void Effect_InitialiseArray(void) 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_NextEffectActive = NO_EFFECT;
m_NextEffectFree = 0; 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_draw = i + 1;
m_Effects[i].next_free = i + 1; m_Effects[i].next_free = i + 1;
} }
m_Effects[NUM_EFFECTS - 1].next_draw = NO_EFFECT; m_Effects[MAX_EFFECTS - 1].next_draw = NO_EFFECT;
m_Effects[NUM_EFFECTS - 1].next_free = NO_EFFECT; m_Effects[MAX_EFFECTS - 1].next_free = NO_EFFECT;
} }
void Effect_Control(void) void Effect_Control(void)

View file

@ -34,7 +34,7 @@
typedef struct { typedef struct {
int16_t count; int16_t count;
int16_t id_map[NUM_EFFECTS]; int16_t id_map[MAX_EFFECTS];
} SAVEGAME_BSON_FX_ORDER; } SAVEGAME_BSON_FX_ORDER;
static void M_SaveRaw(MYFILE *fp, JSON_VALUE *root, int32_t version); 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) static void M_GetFXOrder(SAVEGAME_BSON_FX_ORDER *order)
{ {
order->count = 0; 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; order->id_map[i] = -1;
} }
@ -677,12 +677,12 @@ static bool M_LoadEffects(JSON_ARRAY *fx_arr)
return false; return false;
} }
if ((signed)fx_arr->length >= NUM_EFFECTS) { if ((signed)fx_arr->length >= MAX_EFFECTS) {
LOG_WARNING( LOG_WARNING(
"Malformed save: expected a max of %d effect, got %d. effect over " "Malformed save: expected a max of %d effect, got %d. effect over "
"the " "the "
"maximum will not be created.", "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++) { for (int i = 0; i < (signed)fx_arr->length; i++) {

View file

@ -41,7 +41,6 @@
#define DAMAGE_START 140 #define DAMAGE_START 140
#define DAMAGE_LENGTH 14 #define DAMAGE_LENGTH 14
#define NO_CAMERA (-1) #define NO_CAMERA (-1)
#define NUM_EFFECTS 1000
#define DEATH_WAIT (10 * LOGIC_FPS) #define DEATH_WAIT (10 * LOGIC_FPS)
#define DEATH_WAIT_MIN (2 * LOGIC_FPS) #define DEATH_WAIT_MIN (2 * LOGIC_FPS)
#define MAX_HEAD_ROTATION (50 * DEG_1) // = 9100 #define MAX_HEAD_ROTATION (50 * DEG_1) // = 9100

View file

@ -28,7 +28,6 @@
#define MAX_PALETTES 16 #define MAX_PALETTES 16
#define MAX_VERTICES 0x2000 #define MAX_VERTICES 0x2000
#define MAX_BOUND_ROOMS 128 #define MAX_BOUND_ROOMS 128
#define MAX_EFFECTS 100
#define MAX_LEVELS 24 #define MAX_LEVELS 24
#define MAX_LEVEL_NAME_SIZE 50 // TODO: get rid of this limit #define MAX_LEVEL_NAME_SIZE 50 // TODO: get rid of this limit
#define MAX_DEMO_FILES MAX_LEVELS #define MAX_DEMO_FILES MAX_LEVELS