Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

More console work #277

Merged
merged 7 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## [Unreleased](https://github.com/LostArtefacts/TR2X/compare/stable...develop) - ××××-××-××
- added `/sfx` command
- added `/nextlevel` alias to `/endlevel` console command
- added `/quit` alias to `/exit` console command
- changed `/set` console command to do fuzzy matching (LostArtefacts/libtrx#38)
- fixed crash in the `/set` console command (regression from 0.3)
- fixed using console in cutscenes immediately exiting the game (regression from 0.3)
- fixed Lara remaining tilted when teleporting off a vehicle while on a slope (#275, regression from 0.3)
- fixed `/endlevel` displaying a success message in the title screen

## [0.3](https://github.com/LostArtefacts/TR2X/compare/0.2-460-g4721b93...0.3) - 2024-09-20
- added new console commands:
Expand Down
4 changes: 4 additions & 0 deletions data/ship/cfg/TR2X_gameflow.json5
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@
"game_strings": {
"MISC_OFF": "Off",
"MISC_ON": "On",
"OSD_AMBIGUOUS_INPUT_2": "Ambiguous input: %s and %s",
"OSD_AMBIGUOUS_INPUT_3": "Ambiguous input: %s, %s, ...",
"OSD_COMMAND_BAD_INVOCATION": "Invalid invocation: %s",
"OSD_COMMAND_UNAVAILABLE": "This command is not currently available",
"OSD_COMPLETE_LEVEL": "Level complete!",
Expand Down Expand Up @@ -387,6 +389,7 @@
"OSD_KILL_ALL_FAIL": "Uh-oh, there are no enemies left to kill...",
"OSD_KILL_FAIL": "No enemy nearby...",
"OSD_LOAD_GAME": "Loaded game from save slot %d",
"OSD_LOAD_GAME_FAIL_INVALID_SLOT": "Invalid save slot %d",
"OSD_LOAD_GAME_FAIL_UNAVAILABLE_SLOT": "Save slot %d is not available",
"OSD_OBJECT_NOT_FOUND": "Object not found",
"OSD_PLAY_LEVEL": "Loading %s",
Expand All @@ -399,6 +402,7 @@
"OSD_POS_SET_ROOM_FAIL": "Failed to teleport to room: %d",
"OSD_SAVE_GAME": "Saved game to save slot %d",
"OSD_SAVE_GAME_FAIL": "Cannot save the game in the current state",
"OSD_SAVE_GAME_FAIL_INVALID_SLOT": "Invalid save slot %d",
"OSD_SOUND_AVAILABLE_SAMPLES": "Available sounds: %s",
"OSD_SOUND_PLAYING_SAMPLE": "Playing sound %d",
"OSD_UNKNOWN_COMMAND": "Unknown command: %s",
Expand Down
20 changes: 10 additions & 10 deletions docs/progress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions docs/progress.txt
Original file line number Diff line number Diff line change
Expand Up @@ -685,17 +685,17 @@ typedef struct __unaligned { // decompiled
XYZ_32 target;
} LOT_INFO;

typedef enum {
GFL_NOLEVEL = -1,
GFL_TITLE = 0,
GFL_NORMAL = 1,
GFL_SAVED = 2,
GFL_DEMO = 3,
GFL_CUTSCENE = 4,
GFL_STORY = 5,
GFL_QUIET = 6,
GFL_MIDSTORY = 7,
} GF_LEVEL_TYPE;
typedef enum { // decompiled
GFL_NO_LEVEL = -1,
GFL_TITLE = 0,
GFL_NORMAL = 1,
GFL_SAVED = 2,
GFL_DEMO = 3,
GFL_CUTSCENE = 4,
GFL_STORY = 5,
GFL_QUIET = 6,
GFL_MID_STORY = 7,
} GAMEFLOW_LEVEL_TYPE;

typedef struct __unaligned {
int16_t timer;
Expand Down Expand Up @@ -3189,8 +3189,8 @@ typedef enum {
# game/gameflow.c
0x0041FA60 0x01E9 + int32_t __cdecl GF_LoadScriptFile(const char *fname);
0x0041FC50 0x001F + int32_t __cdecl GF_DoFrontendSequence(void);
0x0041FC70 0x0066 + int32_t __cdecl GF_DoLevelSequence(int32_t level, GF_LEVEL_TYPE type);
0x0041FCE0 0x047C + int32_t __cdecl GF_InterpretSequence(int16_t *ptr, GF_LEVEL_TYPE type, int32_t seq_type);
0x0041FC70 0x0066 + int32_t __cdecl GF_DoLevelSequence(int32_t level, GAMEFLOW_LEVEL_TYPE type);
0x0041FCE0 0x047C + int32_t __cdecl GF_InterpretSequence(int16_t *ptr, GAMEFLOW_LEVEL_TYPE type, int32_t seq_type);
0x004201C0 0x0CD3 + void __cdecl GF_ModifyInventory(int32_t level, int32_t type);

# game/hair.c
Expand Down Expand Up @@ -3919,7 +3919,7 @@ typedef enum {
0x0044B150 0x0026 -R LPCTSTR __cdecl GetFullPath(LPCTSTR file_name);
0x0044B180 0x00E0 -R BOOL __cdecl SelectDrive(void);
0x0044B260 0x024A + bool __cdecl Level_Load(const char *file_name, int32_t level_num);
0x0044B4B0 0x0018 -R BOOL __cdecl S_LoadLevelFile(LPCTSTR file_name, int32_t level_num, GF_LEVEL_TYPE level_type);
0x0044B4B0 0x0018 -R BOOL __cdecl S_LoadLevelFile(LPCTSTR file_name, int32_t level_num, GAMEFLOW_LEVEL_TYPE level_type);
0x0044B4D0 0x002A -R void __cdecl S_UnloadLevelFile(void);
0x0044B500 0x0014 -R void __cdecl S_AdjustTexelCoordinates(void);
0x0044B520 0x00C4 -R BOOL __cdecl S_ReloadLevelGraphics(BOOL reload_palettes, BOOL reload_tex_pages);
Expand All @@ -3938,7 +3938,7 @@ typedef enum {
0x0044C3F0 0x0057 *R void __cdecl S_Wait(int32_t timeout, BOOL input_check);
0x0044C450 0x000E -R bool __cdecl S_PlayFMV(const char *file_name);
0x0044C460 0x0013 -R bool __cdecl S_IntroFMV(const char *file_name1, const char *file_name2);
0x0044C480 0x0144 + int16_t __cdecl Game_Start(int32_t level_num, GF_LEVEL_TYPE level_type);
0x0044C480 0x0144 + int16_t __cdecl Game_Start(int32_t level_num, GAMEFLOW_LEVEL_TYPE level_type);
0x0044C5D0 0x009A + int32_t __cdecl Game_Loop(bool demo_mode);
0x0044C670 0x0006 +R int32_t __cdecl LevelCompleteSequence(void);
0x0044C680 0x01C2 +R int32_t __cdecl LevelStats(int32_t level_num);
Expand Down Expand Up @@ -4007,7 +4007,7 @@ typedef enum {
0x00450B00 0x00E4 *R void __cdecl S_InitialisePolyList(BOOL clear_back_buffer);
0x00450BF0 0x0036 *R DWORD __cdecl S_DumpScreen(void);
0x00450C30 0x000B -R void __cdecl S_ClearScreen(void);
0x00450C40 0x0037 -R void __cdecl S_InitialiseScreen(GF_LEVEL_TYPE level_type);
0x00450C40 0x0037 -R void __cdecl S_InitialiseScreen(GAMEFLOW_LEVEL_TYPE level_type);
0x00450C80 0x0089 *R void __cdecl S_OutputPolyList(void);
0x00450CC0 0x0270 -R int32_t __cdecl S_GetObjectBounds(const BOUNDS_16 *bounds);
0x00450F30 0x0046 -R void __cdecl S_InsertBackPolygon(int32_t x0, int32_t y0, int32_t x1, int32_t y1);
Expand Down
5 changes: 1 addition & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ dll_sources = [
'src/game/camera.c',
'src/game/clock.c',
'src/game/collide.c',
'src/game/console/cmd/flipmap.c',
'src/game/console/cmd/load_game.c',
'src/game/console/cmd/play_level.c',
'src/game/console/cmd/save_game.c',
'src/game/console/common.c',
'src/game/console/setup.c',
'src/game/creature.c',
Expand Down Expand Up @@ -157,6 +153,7 @@ dll_sources = [
'src/game/requester.c',
'src/game/room.c',
'src/game/room_draw.c',
'src/game/savegame/common.c',
'src/game/shell.c',
'src/game/sound.c',
'src/game/text.c',
Expand Down
6 changes: 3 additions & 3 deletions src/decomp/decomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ void __cdecl Shell_Shutdown(void)
if (g_ErrorMessage[0]) {
MessageBoxA(NULL, g_ErrorMessage, NULL, MB_ICONWARNING);
}
Text_Shutdown();
UI_Shutdown();
Config_Shutdown();
}
Expand All @@ -572,7 +573,6 @@ int16_t __cdecl TitleSequence(void)
{
GF_N_LoadStrings(-1);

Text_Init();
TempVideoAdjust(1, 1.0);
g_NoInputCounter = 0;

Expand Down Expand Up @@ -1349,7 +1349,7 @@ void __cdecl CutscenePlayerGen_Initialise(const int16_t item_num)
}

int32_t __cdecl Level_Initialise(
const int32_t level_num, const GF_LEVEL_TYPE level_type)
const int32_t level_num, const GAMEFLOW_LEVEL_TYPE level_type)
{
g_GameInfo.current_level.num = level_num;
g_GameInfo.current_level.type = level_type;
Expand Down Expand Up @@ -1978,7 +1978,7 @@ bool __cdecl ApplySettings(const APP_SETTINGS *const new_settings)
g_SavedAppSettings = *new_settings;

RenderStart(false);
S_InitialiseScreen(GFL_NOLEVEL);
S_InitialiseScreen(GFL_NO_LEVEL);

if (g_SavedAppSettings.render_mode != old_settings.render_mode) {
S_ReloadLevelGraphics(1, 1);
Expand Down
3 changes: 2 additions & 1 deletion src/decomp/decomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ void __cdecl CutscenePlayer_Control(int16_t item_num);
void __cdecl Lara_Control_Cutscene(int16_t item_num);
void __cdecl CutscenePlayer1_Initialise(int16_t item_num);
void __cdecl CutscenePlayerGen_Initialise(int16_t item_num);
int32_t __cdecl Level_Initialise(int32_t level_num, GF_LEVEL_TYPE level_type);
int32_t __cdecl Level_Initialise(
int32_t level_num, GAMEFLOW_LEVEL_TYPE level_type);
void __cdecl CreateScreenBuffers(void);
void __cdecl CreatePrimarySurface(void);
void __cdecl CreateBackBuffer(void);
Expand Down
Loading
Loading