mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 20:58:07 +03:00
objects: raise static mesh slot capacity
This raises the static mesh slot capacity from 50 to 256. 2D statics remain fixed at 50 for the time being. Resolves #2734.
This commit is contained in:
parent
adf2703305
commit
c69fe9c891
15 changed files with 32 additions and 31 deletions
|
@ -9,6 +9,7 @@
|
||||||
DOS | 153 | 179 | 255 |  `#99B3FF`
|
DOS | 153 | 179 | 255 |  `#99B3FF`
|
||||||
- changed the `draw_distance_min` and `draw_distance_max` to `fog_start` and `fog_end`
|
- changed the `draw_distance_min` and `draw_distance_max` to `fog_start` and `fog_end`
|
||||||
- changed `Select Detail` dialog title to `Graphic Options`
|
- changed `Select Detail` dialog title to `Graphic Options`
|
||||||
|
- changed the number of static mesh slots from 50 to 256 (#2734)
|
||||||
- fixed the bilinear filter to not readjust the UVs (#2258)
|
- fixed the bilinear filter to not readjust the UVs (#2258)
|
||||||
- fixed anisotropy filter causing black lines on certain GPUs (#902)
|
- fixed anisotropy filter causing black lines on certain GPUs (#902)
|
||||||
- fixed mesh faces not being drawn under some circumstances (#2452, #2438)
|
- fixed mesh faces not being drawn under some circumstances (#2452, #2438)
|
||||||
|
|
|
@ -636,6 +636,7 @@ Not all options are turned on by default. Refer to `TR1X_ConfigTool.exe` for det
|
||||||
- expanded maximum texture pages from 32 to 128
|
- expanded maximum texture pages from 32 to 128
|
||||||
- expanded maximum vertices of a single drawable object from 1500 to unlimited
|
- expanded maximum vertices of a single drawable object from 1500 to unlimited
|
||||||
- expanded the number of visible enemies from 8 to 32
|
- expanded the number of visible enemies from 8 to 32
|
||||||
|
- expanded the number of static mesh slots from 50 to 256
|
||||||
- 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 image decoding library to ffmpeg
|
- ported image decoding library to ffmpeg
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
- added NG+, Japanese, and Japanese NG+ game mode options to the New Game page in the passport (#2731)
|
- added NG+, Japanese, and Japanese NG+ game mode options to the New Game page in the passport (#2731)
|
||||||
- changed savegame files to be stored in the `saves` directory (#2087)
|
- changed savegame files to be stored in the `saves` directory (#2087)
|
||||||
- changed the default fog distance to 22 tiles cutting off at 30 tiles to match TR1X (#1622)
|
- changed the default fog distance to 22 tiles cutting off at 30 tiles to match TR1X (#1622)
|
||||||
|
- changed the number of static mesh slots from 50 to 256 (#2734)
|
||||||
- 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)
|
||||||
|
|
|
@ -324,6 +324,7 @@ as Notepad.
|
||||||
- expanded maximum object textures from 2048 to unlimited (within game's overall memory cap)
|
- expanded maximum object textures from 2048 to unlimited (within game's overall memory cap)
|
||||||
- expanded maximum sprite textures from 512 to unlimited (within game's overall memory cap)
|
- expanded maximum sprite textures from 512 to unlimited (within game's overall memory cap)
|
||||||
- expanded maximum texture pages from 32 to 128
|
- expanded maximum texture pages from 32 to 128
|
||||||
|
- expanded the number of static mesh slots from 50 to 256
|
||||||
- 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
|
||||||
|
|
|
@ -147,7 +147,7 @@ static void M_HandleSpriteSequences(
|
||||||
obj->mesh_count = num_meshes;
|
obj->mesh_count = num_meshes;
|
||||||
obj->mesh_idx = mesh_idx + level_info->textures.sprite_count;
|
obj->mesh_idx = mesh_idx + level_info->textures.sprite_count;
|
||||||
obj->loaded = true;
|
obj->loaded = true;
|
||||||
} else if (obj_id - O_NUMBER_OF < MAX_STATIC_OBJECTS) {
|
} else if (obj_id - O_NUMBER_OF < MAX_STATIC_OBJECTS_2D) {
|
||||||
STATIC_OBJECT_2D *const obj =
|
STATIC_OBJECT_2D *const obj =
|
||||||
Object_Get2DStatic(obj_id - O_NUMBER_OF);
|
Object_Get2DStatic(obj_id - O_NUMBER_OF);
|
||||||
obj->frame_count = ABS(num_meshes);
|
obj->frame_count = ABS(num_meshes);
|
||||||
|
|
|
@ -104,7 +104,7 @@ static void M_ApplyMeshEdit(const MESH_EDIT *const edit)
|
||||||
}
|
}
|
||||||
|
|
||||||
mesh = Object_GetMesh(obj->mesh_idx + edit->mesh_idx);
|
mesh = Object_GetMesh(obj->mesh_idx + edit->mesh_idx);
|
||||||
} else if (edit->object_id - O_NUMBER_OF < MAX_STATIC_OBJECTS) {
|
} else if (edit->object_id - O_NUMBER_OF < MAX_STATIC_OBJECTS_3D) {
|
||||||
const STATIC_OBJECT_3D *const obj =
|
const STATIC_OBJECT_3D *const obj =
|
||||||
Object_Get3DStatic(edit->object_id - O_NUMBER_OF);
|
Object_Get3DStatic(edit->object_id - O_NUMBER_OF);
|
||||||
mesh = Object_GetMesh(obj->mesh_idx);
|
mesh = Object_GetMesh(obj->mesh_idx);
|
||||||
|
|
|
@ -842,10 +842,10 @@ void Level_ReadStaticObjects(VFILE *const file)
|
||||||
LOG_INFO("static objects: %d", num_objects);
|
LOG_INFO("static objects: %d", num_objects);
|
||||||
for (int32_t i = 0; i < num_objects; i++) {
|
for (int32_t i = 0; i < num_objects; i++) {
|
||||||
const int32_t static_id = VFile_ReadS32(file);
|
const int32_t static_id = VFile_ReadS32(file);
|
||||||
if (static_id < 0 || static_id >= MAX_STATIC_OBJECTS) {
|
if (static_id < 0 || static_id >= MAX_STATIC_OBJECTS_3D) {
|
||||||
Shell_ExitSystemFmt(
|
Shell_ExitSystemFmt(
|
||||||
"Invalid static ID: %d (max=%d)", static_id,
|
"Invalid static ID: %d (max=%d)", static_id,
|
||||||
MAX_STATIC_OBJECTS);
|
MAX_STATIC_OBJECTS_3D - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC_OBJECT_3D *const obj = Object_Get3DStatic(static_id);
|
STATIC_OBJECT_3D *const obj = Object_Get3DStatic(static_id);
|
||||||
|
@ -936,7 +936,7 @@ void Level_ReadSpriteSequences(VFILE *const file)
|
||||||
obj->mesh_idx = mesh_idx;
|
obj->mesh_idx = mesh_idx;
|
||||||
obj->anim_idx = NO_ANIM;
|
obj->anim_idx = NO_ANIM;
|
||||||
obj->loaded = true;
|
obj->loaded = true;
|
||||||
} else if (object_id - O_NUMBER_OF < MAX_STATIC_OBJECTS) {
|
} else if (object_id - O_NUMBER_OF < MAX_STATIC_OBJECTS_2D) {
|
||||||
STATIC_OBJECT_2D *const obj =
|
STATIC_OBJECT_2D *const obj =
|
||||||
Object_Get2DStatic(object_id - O_NUMBER_OF);
|
Object_Get2DStatic(object_id - O_NUMBER_OF);
|
||||||
obj->frame_count = ABS(num_meshes);
|
obj->frame_count = ABS(num_meshes);
|
||||||
|
|
|
@ -9,11 +9,24 @@
|
||||||
#include "game/output/objects.h"
|
#include "game/output/objects.h"
|
||||||
|
|
||||||
static OBJECT m_Objects[O_NUMBER_OF] = {};
|
static OBJECT m_Objects[O_NUMBER_OF] = {};
|
||||||
static STATIC_OBJECT_3D m_StaticObjects3D[MAX_STATIC_OBJECTS] = {};
|
static STATIC_OBJECT_3D m_StaticObjects3D[MAX_STATIC_OBJECTS_3D] = {};
|
||||||
static STATIC_OBJECT_2D m_StaticObjects2D[MAX_STATIC_OBJECTS] = {};
|
static STATIC_OBJECT_2D m_StaticObjects2D[MAX_STATIC_OBJECTS_2D] = {};
|
||||||
static OBJECT_MESH **m_MeshPointers = nullptr;
|
static OBJECT_MESH **m_MeshPointers = nullptr;
|
||||||
static int32_t m_MeshCount = 0;
|
static int32_t m_MeshCount = 0;
|
||||||
|
|
||||||
|
void Object_Reset(void)
|
||||||
|
{
|
||||||
|
for (int32_t i = 0; i < O_NUMBER_OF; i++) {
|
||||||
|
m_Objects[i].loaded = false;
|
||||||
|
}
|
||||||
|
for (int32_t i = 0; i < MAX_STATIC_OBJECTS_3D; i++) {
|
||||||
|
m_StaticObjects3D[i].loaded = false;
|
||||||
|
}
|
||||||
|
for (int32_t i = 0; i < MAX_STATIC_OBJECTS_2D; i++) {
|
||||||
|
m_StaticObjects2D[i].loaded = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
OBJECT *Object_Get(const GAME_OBJECT_ID obj_id)
|
OBJECT *Object_Get(const GAME_OBJECT_ID obj_id)
|
||||||
{
|
{
|
||||||
return &m_Objects[obj_id];
|
return &m_Objects[obj_id];
|
||||||
|
|
|
@ -216,7 +216,7 @@ void Output_CycleAnimatedTextures(void)
|
||||||
m_ObjectTextures[range->textures[i]] = temp;
|
m_ObjectTextures[range->textures[i]] = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < MAX_STATIC_OBJECTS; i++) {
|
for (int32_t i = 0; i < MAX_STATIC_OBJECTS_2D; i++) {
|
||||||
const STATIC_OBJECT_2D *const obj = Object_Get2DStatic(i);
|
const STATIC_OBJECT_2D *const obj = Object_Get2DStatic(i);
|
||||||
if (!obj->loaded || obj->frame_count == 1) {
|
if (!obj->loaded || obj->frame_count == 1) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -14,4 +14,5 @@
|
||||||
#define GRAVITY 6
|
#define GRAVITY 6
|
||||||
#define FAST_FALL_SPEED 128
|
#define FAST_FALL_SPEED 128
|
||||||
|
|
||||||
#define MAX_STATIC_OBJECTS 50
|
#define MAX_STATIC_OBJECTS_2D 50
|
||||||
|
#define MAX_STATIC_OBJECTS_3D 256
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "ids.h"
|
#include "ids.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
void Object_Reset(void);
|
||||||
OBJECT *Object_Get(GAME_OBJECT_ID obj_id);
|
OBJECT *Object_Get(GAME_OBJECT_ID obj_id);
|
||||||
STATIC_OBJECT_3D *Object_Get3DStatic(int32_t static_id);
|
STATIC_OBJECT_3D *Object_Get3DStatic(int32_t static_id);
|
||||||
STATIC_OBJECT_2D *Object_Get2DStatic(int32_t static_id);
|
STATIC_OBJECT_2D *Object_Get2DStatic(int32_t static_id);
|
||||||
|
|
|
@ -400,15 +400,7 @@ bool Level_Initialise(
|
||||||
|
|
||||||
Music_ResetTrackFlags();
|
Music_ResetTrackFlags();
|
||||||
|
|
||||||
/* Clear Object Loaded flags */
|
Object_Reset();
|
||||||
for (int32_t i = 0; i < O_NUMBER_OF; i++) {
|
|
||||||
Object_Get(i)->loaded = false;
|
|
||||||
}
|
|
||||||
for (int32_t i = 0; i < MAX_STATIC_OBJECTS; i++) {
|
|
||||||
Object_Get2DStatic(i)->loaded = false;
|
|
||||||
Object_Get3DStatic(i)->loaded = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Camera_Reset();
|
Camera_Reset();
|
||||||
Pierre_Reset();
|
Pierre_Reset();
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ static void M_PrepareObjectAnimationRanges(void)
|
||||||
static void M_PrepareSpriteAnimationRanges(void)
|
static void M_PrepareSpriteAnimationRanges(void)
|
||||||
{
|
{
|
||||||
size_t required_size = 0;
|
size_t required_size = 0;
|
||||||
for (int32_t i = 0; i < MAX_STATIC_OBJECTS; i++) {
|
for (int32_t i = 0; i < MAX_STATIC_OBJECTS_2D; i++) {
|
||||||
const STATIC_OBJECT_2D *const obj = Object_Get2DStatic(i);
|
const STATIC_OBJECT_2D *const obj = Object_Get2DStatic(i);
|
||||||
if (!obj->loaded || obj->frame_count == 1) {
|
if (!obj->loaded || obj->frame_count == 1) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -82,7 +82,7 @@ static void M_PrepareSpriteAnimationRanges(void)
|
||||||
Vector_Clear(m_AnimationRanges.sprites);
|
Vector_Clear(m_AnimationRanges.sprites);
|
||||||
Vector_EnsureCapacity(m_AnimationRanges.sprites, required_size);
|
Vector_EnsureCapacity(m_AnimationRanges.sprites, required_size);
|
||||||
|
|
||||||
for (int32_t i = 0; i < MAX_STATIC_OBJECTS; i++) {
|
for (int32_t i = 0; i < MAX_STATIC_OBJECTS_2D; i++) {
|
||||||
const STATIC_OBJECT_2D *const obj = Object_Get2DStatic(i);
|
const STATIC_OBJECT_2D *const obj = Object_Get2DStatic(i);
|
||||||
if (!obj->loaded || obj->frame_count == 1) {
|
if (!obj->loaded || obj->frame_count == 1) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -147,10 +147,6 @@ void DecreaseScreenSize(void)
|
||||||
void InitialiseGameFlags(void)
|
void InitialiseGameFlags(void)
|
||||||
{
|
{
|
||||||
Music_ResetTrackFlags();
|
Music_ResetTrackFlags();
|
||||||
for (GAME_OBJECT_ID obj_id = 0; obj_id < O_NUMBER_OF; obj_id++) {
|
|
||||||
Object_Get(obj_id)->loaded = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Output_SetSunsetTimer(0);
|
Output_SetSunsetTimer(0);
|
||||||
g_LevelComplete = false;
|
g_LevelComplete = false;
|
||||||
g_DetonateAllMines = false;
|
g_DetonateAllMines = false;
|
||||||
|
|
|
@ -294,13 +294,7 @@ bool Level_Load(const GF_LEVEL *const level)
|
||||||
Audio_Sample_CloseAll();
|
Audio_Sample_CloseAll();
|
||||||
Audio_Sample_UnloadAll();
|
Audio_Sample_UnloadAll();
|
||||||
|
|
||||||
for (int32_t i = 0; i < O_NUMBER_OF; i++) {
|
Object_Reset();
|
||||||
Object_Get(i)->loaded = false;
|
|
||||||
}
|
|
||||||
for (int32_t i = 0; i < MAX_STATIC_OBJECTS; i++) {
|
|
||||||
Object_Get2DStatic(i)->loaded = false;
|
|
||||||
Object_Get3DStatic(i)->loaded = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Inject_InitLevel(level);
|
Inject_InitLevel(level);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue