output: raise TR2 texture limits

This removes the cap on object and sprite textures in TR1 and TR2, and
raises the TR2 page limit to 128.

Resolves #1795.
Resolves #1796.
This commit is contained in:
lahm86 2025-01-28 14:45:31 +00:00
parent efae2071c6
commit 0e025b65ac
7 changed files with 21 additions and 27 deletions

View file

@ -11,7 +11,8 @@
- added exit fade-out effects (#2348)
- added optional dynamic lighting for gun flashes and explosions, similar to TR2+ (#2357)
- ⚠️ changed the game data to use a separate strings file for text information, removing it from the game flow file
- changed the sprite limit from 512 to 1024
- changed the sprite texture limit from 2048 to unlimited (within game's overall memory cap)
- changed the sprite texture limit from 512 to unlimited (within game's overall memory cap)
- changed demo to be interrupted only by esc or action keys
- changed the turbo cheat to also affect ingame timer (#2167)
- changed the pause screen to wait before yielding control during fade out effect

View file

@ -607,7 +607,8 @@ Not all options are turned on by default. Refer to `TR1X_ConfigTool.exe` for det
- added ability to make freshly triggered (runaway) Pierre replace an already existing (runaway) Pierre
- expanded internal game memory limit from 3.5 MB to 128 MB
- expanded moveable limit from 256 to 10240
- expanded maximum textures from 2048 to 8192
- 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 texture pages from 32 to 128
- expanded maximum vertices of a single drawable object from 1500 to unlimited
- expanded the number of visible enemies from 8 to 32

View file

@ -8,6 +8,9 @@
- added the ability to disable exit fade effects alone (#2348)
- added a fade-out effect when completing Lara's Home
- added support for animated sprites (#2401)
- changed the object texture limit from 2048 to unlimited (within game's overall memory cap) (#1795)
- changed the sprite texture limit from 512 to unlimited (within game's overall memory cap) (#1795)
- changed the texture page limit from 32 to 128 (#1796)
- changed default input bindings to let the photo mode binding be compatible with TR1X:
| Key | Old binding | New binding |
| ----------------------------- | ----------- | ------------ |

View file

@ -147,6 +147,9 @@ game with new enhancements and features.
- added ability to skip FMVs with both the Action key
- added ability to skip end credits with the Action and Escape keys
- expanded internal game memory limit from 7.5 MB to 128 MB
- 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 texture pages from 32 to 128
- ported audio decoding library to ffmpeg
- ported video decoding library to ffmpeg
- ported input backend to SDL

View file

@ -11,13 +11,6 @@ static ANIMATED_TEXTURE_RANGE *m_AnimTextureRanges = NULL;
void Output_InitialiseObjectTextures(const int32_t num_textures)
{
if (num_textures > MAX_OBJECT_TEXTURES) {
Shell_ExitSystemFmt(
"Too many object textures: %d (max=%d)", num_textures,
MAX_OBJECT_TEXTURES);
return;
}
m_ObjectTextureCount = num_textures;
m_ObjectTextures = num_textures == 0
? NULL
@ -27,13 +20,6 @@ void Output_InitialiseObjectTextures(const int32_t num_textures)
void Output_InitialiseSpriteTextures(const int32_t num_textures)
{
if (num_textures > MAX_SPRITE_TEXTURES) {
Shell_ExitSystemFmt(
"Too many sprite textures: %d (max=%d)", num_textures,
MAX_SPRITE_TEXTURES);
return;
}
m_SpriteTextures = num_textures == 0
? NULL
: GameBuf_Alloc(

View file

@ -1,14 +1,6 @@
#pragma once
#if TR_VERSION == 1
#define MAX_OBJECT_TEXTURES 8192
#define MAX_SPRITE_TEXTURES 1024
#define MAX_TEXTURE_PAGES 128
#else
#define MAX_OBJECT_TEXTURES 2048
#define MAX_SPRITE_TEXTURES 512
#define MAX_TEXTURE_PAGES 32
#endif
#define MAX_TEXTURE_PAGES 128
#define TEXTURE_PAGE_WIDTH 256
#define TEXTURE_PAGE_HEIGHT 256

View file

@ -3,10 +3,11 @@
#include "global/vars.h"
#include <libtrx/config.h>
#include <libtrx/game/game_buf.h>
#include <libtrx/utils.h>
bool g_DiscardTransparent = false;
static uint8_t m_LabTextureUVFlag[MAX_OBJECT_TEXTURES] = {};
static uint8_t *m_LabTextureUVFlag = NULL;
static void M_QuickSort(int32_t left, int32_t right);
static inline void M_ClipG(
@ -117,7 +118,14 @@ int32_t Render_GetUVAdjustment(void)
void Render_ResetTextureUVs(void)
{
for (int32_t i = 0; i < Output_GetObjectTextureCount(); i++) {
const int32_t num_textures = Output_GetObjectTextureCount();
if (num_textures == 0) {
m_LabTextureUVFlag = NULL;
return;
}
m_LabTextureUVFlag = GameBuf_Alloc(num_textures, GBUF_OBJECT_TEXTURES);
for (int32_t i = 0; i < num_textures; i++) {
OBJECT_TEXTURE *const texture = Output_GetObjectTexture(i);
uint16_t *const uv = &texture->uv[0].u;
uint8_t byte = 0;