Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
38ceb6a
Start cleaning up palette code
yaz0r Jun 3, 2025
6f48dad
Bump SDL/Soloud
yaz0r Jun 3, 2025
437478b
Fix incorrect pallette for books in JackInTheDark
yaz0r Jun 3, 2025
c86ddb2
Modernize BGFX
yaz0r Jun 3, 2025
03bf585
Fix shader compilation
yaz0r Jun 3, 2025
d4a8832
Fix linux CI
yaz0r Jun 3, 2025
36e3511
Update palette.h
yaz0r Jun 3, 2025
c9afc6e
Update osystemSDL.cpp
yaz0r Jun 3, 2025
20d7e10
Fix some of the save code that got messed up
yaz0r Jun 4, 2025
0e562da
Macos CI
yaz0r Jun 5, 2025
fc09452
Build fix for macos (attempted)
yaz0r Jun 5, 2025
844be1f
Fix linux
yaz0r Jun 8, 2025
dd99538
Simplify soloud build
yaz0r Jun 8, 2025
6d2cb5f
Update soloud sdl3
yaz0r Jun 8, 2025
7d1f0b6
Disable macos CI for now
yaz0r Jun 8, 2025
4617424
Cleanup render backends, enable d3d12
yaz0r Jun 8, 2025
5b0e051
Don't force d3d12 renderer
yaz0r Jun 8, 2025
e69547b
Cleanup shaders
yaz0r Jun 8, 2025
c61013a
Remove more macos CI
yaz0r Jun 8, 2025
11f27bd
Cleanups and AITD3 steam/GOG support
yaz0r Jun 9, 2025
48745c2
Some renaming
yaz0r Jun 9, 2025
079f1c3
More cleanup
yaz0r Jun 9, 2025
2c84167
Cleanup and AITD3 main menu
yaz0r Jun 10, 2025
ad18d85
Fix trapdoor zombie
yaz0r Jun 13, 2025
bd78f45
Debug asan config
yaz0r Jun 13, 2025
3265f22
Simplify the asan setup
yaz0r Jun 13, 2025
d95af85
No asan by default
yaz0r Jun 13, 2025
cea84b5
Mask rework
yaz0r Jun 14, 2025
5572ed2
Fix overlapping type name
yaz0r Jun 14, 2025
49ae160
Fix asan for msvc
yaz0r Jun 14, 2025
9eaaf16
Implement reset animations, cleanups and fix a few sanitizer issues
yaz0r Jun 14, 2025
acc927b
Rename a few things
yaz0r Jun 14, 2025
1d0f29b
Reimplement line rendering
yaz0r Jun 14, 2025
5d9b052
Disable asan again
yaz0r Jun 14, 2025
575169a
Rework debugger
yaz0r Jun 14, 2025
764da5e
Implement lines. Fix sphere ratio and incorrect math in material 3
yaz0r Jun 15, 2025
719474c
Backface culling
yaz0r Jun 15, 2025
ad71b0a
Tweak point sizes
yaz0r Jun 15, 2025
f0b3db1
Hackish implementation of the noise effect
yaz0r Jun 15, 2025
7bcd0a5
Fix potential crash in debugger
yaz0r Jun 15, 2025
19fcb93
This is a better fix for now
yaz0r Jun 15, 2025
4a65d10
Cleanup, fix a potential out of bound access
yaz0r Jun 15, 2025
485d4f1
Fix incorrect follow in AITD2+
yaz0r Jun 16, 2025
f3e84a0
Re-merge the track-handling code
yaz0r Jun 16, 2025
1de212a
Better fix for the camera index issue
yaz0r Jun 16, 2025
ac19c0d
Renames
yaz0r Jun 16, 2025
37cc8d5
Cleanup
yaz0r Jun 16, 2025
3391dc7
Update README.md
yaz0r Jun 16, 2025
2724f36
Body rework
yaz0r Jun 16, 2025
39f25ae
Fix build
yaz0r Jun 17, 2025
5506136
Switch ZV code to proper body
yaz0r Jun 17, 2025
5f9a8e1
Rewrite body
yaz0r Jun 17, 2025
97ba0bf
Revamp animation
yaz0r Jun 17, 2025
f2d6dec
More cleanup
yaz0r Jun 17, 2025
f54ae34
Clear animations between floors to avoid potentially taking the wrong…
yaz0r Jun 17, 2025
51e74e7
HQR rework and cleanup body/anim storage
yaz0r Jun 18, 2025
9d2104f
Warning for the future
yaz0r Jun 18, 2025
aee4974
Fix regression in AITD1 where door were non-functional
yaz0r Jun 18, 2025
5bad38b
Fix a couple more AITD1 regressions
yaz0r Jun 18, 2025
e6de0f0
Fix linux build
yaz0r Jun 19, 2025
7ad1c68
Implement text rendering on top of the game
yaz0r Jun 19, 2025
c3c6b57
Fix a few ui layer regressions
yaz0r Jun 19, 2025
df1271d
Early hybrids support
yaz0r Jun 20, 2025
8eea2f4
2d animations
yaz0r Jun 21, 2025
14126c1
Fix linux build
yaz0r Jun 22, 2025
341a395
add missing template
yaz0r Jun 22, 2025
612b702
Fix Jack animations
yaz0r Jun 22, 2025
24c7d8f
Cleanup to the optimized animations
yaz0r Jun 22, 2025
228f085
Various rename and cleanup
yaz0r Jul 26, 2025
543e22b
Display collision volumes for actors that don't have a body
yaz0r Aug 2, 2025
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
13 changes: 12 additions & 1 deletion .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
matrix:
os: [ubuntu-latest, windows-2025]
build_type: [Release]
build_type: [Release, Debug]
c_compiler: [gcc, clang, cl]
include:
- os: windows-2025
Expand All @@ -32,19 +32,30 @@ jobs:
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
#- os: macos-latest
# c_compiler: clang
# cpp_compiler: clang++
exclude:
- os: windows-2025
c_compiler: gcc
- os: windows-2025
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl
- os: macos-latest
c_compiler: gcc
- os: macos-latest
c_compiler: cl

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Update linux apt
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt update

- name: Install linux dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install libx11-dev libopengl-dev libglx-dev mesa-common-dev build-essential git make
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/build/vs2019
/FitdLib/shaders/generated
build/vs2022
build
data
27 changes: 26 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
project(FITD)
cmake_minimum_required(VERSION 3.9)

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBX_CONFIG_DEBUG=0")
#set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DBX_CONFIG_DEBUG=1")

IF(MSVC)
#set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /D_MSVC_STL_HARDENING=1")
#set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_MSVC_STL_HARDENING=1")
ENDIF(MSVC)

set(THIRD_PARTY "${CMAKE_SOURCE_DIR}/ThirdParty")

set(BGFX_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
Expand All @@ -19,5 +27,22 @@ set(ZLIB_LIBRARY zlibstatic)
set(ZLIB_TESTS OFF CACHE BOOL "Build zlib tests")
add_subdirectory(${THIRD_PARTY}/zlib ${CMAKE_BINARY_DIR}/zlib/zlib-build)


add_subdirectory( FitdLib )
add_subdirectory( Fitd )
add_subdirectory( Fitd )

#set(USE_SANITIZER ON)
if(USE_SANITIZER)
IF(MSVC)
set(SANITIZER_TYPE "address")
ELSE()
set(SANITIZER_TYPE "address,undefined,leak")
ENDIF()

target_link_options(Fitd PRIVATE "-fsanitize=${SANITIZER_TYPE}")
target_compile_options(Fitd PRIVATE "-fsanitize=${SANITIZER_TYPE}")
target_compile_options(FitdLib PRIVATE "-fsanitize=${SANITIZER_TYPE}")
target_compile_options(bimg PRIVATE "-fsanitize=${SANITIZER_TYPE}")
target_compile_options(bgfx PRIVATE "-fsanitize=${SANITIZER_TYPE}")
target_compile_options(soloud PRIVATE "-fsanitize=${SANITIZER_TYPE}")
endif()
8 changes: 4 additions & 4 deletions Fitd/fitd.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
extern "C" {
int FitdMain(int argc, char* argv[]);
}

}
int FitdInit(int argc, char* argv[]);

int main(int argc, char* argv[])
{
{
FitdInit(argc, argv);
FitdMain(argc, argv);
return 0;
}
}
9 changes: 5 additions & 4 deletions FitdLib/AITD1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ int ChoosePerso(void)
int firsttime = 1;
int choiceMade = 0;

uiLayer.fill(0);
InitCopyBox(aux, logicalScreen);

while (choiceMade == 0)
Expand Down Expand Up @@ -316,7 +317,7 @@ void startAITD1()
while (1)
{
#ifndef AITD_UE4
int startupMenuResult = processStartupMenu();
int startupMenuResult = MainMenu();
#else
int startupMenuResult = 0;
#endif
Expand Down Expand Up @@ -372,11 +373,11 @@ void startAITD1()

// updateShaking();

flagInitView = 2;
FlagInitView = 2;

setupCamera();
InitView();

mainLoop(1, 1);
PlayWorld(1, 1);

// freeScene();

Expand Down
64 changes: 35 additions & 29 deletions FitdLib/AITD1_Tatou.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@

void clearScreenTatou(void)
{
int i;

for(i=0;i<45120;i++)
for(int i=0;i<45120;i++)
{
frontBuffer[i] = 0;
}
}

int make3dTatou(void)
{
char* tatou2d;
char* tatou3d;
unsigned char* tatouPal;
int time;
int zoom;
int deltaTime;
int rotation;
int unk1;
unsigned char paletteBackup[768];
int beta;
int alpha;
unsigned int localChrono;
palette_t tatouPal;
palette_t paletteBackup;

char* tatou2d = CheckLoadMallocPak("ITD_RESS",AITD1_TATOU_MCG);

char* tatou3dRaw = CheckLoadMallocPak("ITD_RESS", AITD1_TATOU_3DO);
sBody* tatou3d = createBodyFromPtr(tatou3dRaw);

tatou2d = CheckLoadMallocPak("ITD_RESS",AITD1_TATOU_MCG);
tatou3d = CheckLoadMallocPak("ITD_RESS",AITD1_TATOU_3DO);
tatouPal = (unsigned char*)CheckLoadMallocPak("ITD_RESS",AITD1_TATOU_PAL);
char* tatouPalRaw = CheckLoadMallocPak("ITD_RESS",AITD1_TATOU_PAL);
copyPalette(tatouPalRaw, tatouPal);

time = 8920;
zoom = 8920;
deltaTime = 50;
rotation = 256;
unk1 = 8;
beta = 256;
alpha = 8;

setupCameraProjection(160,100,128,500,490);
SetProjection(160,100,128,500,490);

copyPalette(currentGamePalette,paletteBackup);

Expand All @@ -58,15 +58,18 @@ int make3dTatou(void)
//timeGlobal++;
timer = timeGlobal;

if(evalChrono(&localChrono)<=180) // avant eclair
if(evalChrono(&localChrono)<=180)
{
// before lightning strike
if(key || Click)
{
break;
}
}
else // eclair
else
{
// lightning strike

/* LastSample = -1;
LastPriority = -1; */

Expand All @@ -81,7 +84,7 @@ int make3dTatou(void)

clearScreenTatou();

setCameraTarget(0,0,0,unk1,rotation,0,time);
setCameraTarget(0,0,0,alpha,beta,0,zoom);

AffObjet(0,0,0,0,0,0,tatou3d);

Expand All @@ -95,20 +98,22 @@ int make3dTatou(void)
osystem_CopyBlockPhys((unsigned char*)frontBuffer,0,0,320,200);


while(key==0 && Click == 0 && JoyD == 0) // boucle de rotation du tatou
while(key==0 && Click == 0 && JoyD == 0)
{
// Armadillo rotation loop

process_events();

time+=deltaTime-25;
zoom += deltaTime;

if(time>16000)
if(zoom>16000)
break;

rotation -=8;
beta -=8;

clearScreenTatou();

setCameraTarget(0,0,0,unk1,rotation,0,time);
setCameraTarget(0,0,0,alpha,beta,0,zoom);

AffObjet(0,0,0,0,0,0,tatou3d);

Expand All @@ -121,8 +126,9 @@ int make3dTatou(void)
}
}while(1);

free(tatouPal);
free(tatou3d);
delete[] tatou3dRaw;
delete tatou3d;

free(tatou2d);

if(key || Click || JoyD)
Expand All @@ -133,13 +139,13 @@ int make3dTatou(void)
}

FadeOutPhys(32,0);
copyPalette((unsigned char*)paletteBackup,currentGamePalette);
copyPalette(paletteBackup,currentGamePalette);
return(1);
}
else
{
FadeOutPhys(16,0);
copyPalette((unsigned char*)paletteBackup,currentGamePalette);
copyPalette(paletteBackup,currentGamePalette);
return(0);
}

Expand Down
22 changes: 11 additions & 11 deletions FitdLib/AITD2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void startAITD2()

while(1)
{
int startupMenuResult = processStartupMenu();
int startupMenuResult = MainMenu();

switch(startupMenuResult)
{
Expand All @@ -225,11 +225,11 @@ void startAITD2()
{
// updateShaking();

flagInitView = 2;
FlagInitView = 2;

setupCamera();
InitView();

mainLoop(1, 1);
PlayWorld(1, 1);

// freeScene();

Expand Down Expand Up @@ -271,7 +271,7 @@ void drawInventoryAITD2()
statusRight = 159;
statusBottom = 174;

setupCameraProjection(((statusRight-statusLeft)/2)+statusLeft,((statusBottom-statusTop)/2) + statusTop,128,400,390);
SetProjection(((statusRight-statusLeft)/2)+statusLeft,((statusBottom-statusTop)/2) + statusTop,128,400,390);
}

int TabXSprite [3] = {127,118,124};
Expand All @@ -291,8 +291,8 @@ void AITD2_ReadBook(int index, int type)
case 0: // READ_MESSAGE
{
LoadPak("ITD_RESS", AITD2_LETTRE, aux);
unsigned char lpalette[0x300];
copyPalette((unsigned char*)aux+64000,lpalette);
palette_t lpalette;
copyPalette(aux+64000,lpalette);
convertPaletteIfRequired(lpalette);
copyPalette(lpalette,currentGamePalette);
setPalette(lpalette);
Expand All @@ -304,8 +304,8 @@ void AITD2_ReadBook(int index, int type)
case 1: // READ_BOOK
{
LoadPak("ITD_RESS", AITD2_LIVRE, aux);
unsigned char lpalette[0x300];
copyPalette((unsigned char*)aux+64000,lpalette);
palette_t lpalette;
copyPalette(aux+64000,lpalette);
convertPaletteIfRequired(lpalette);
copyPalette(lpalette,currentGamePalette);
setPalette(lpalette);
Expand All @@ -317,8 +317,8 @@ void AITD2_ReadBook(int index, int type)
case 2: // READ_CARNET
{
LoadPak("ITD_RESS", AITD2_CARNET, aux);
unsigned char lpalette[0x300];
copyPalette((unsigned char*)aux+64000,lpalette);
palette_t lpalette;
copyPalette(aux+64000,lpalette);
convertPaletteIfRequired(lpalette);
copyPalette(lpalette,currentGamePalette);
setPalette(lpalette);
Expand Down
12 changes: 6 additions & 6 deletions FitdLib/AITD3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
void startAITD3()
{
g_gameUseCDA = true;
//startGame(1,0,0);
startGame(1,0,0);

while(1)
{
int startupMenuResult = processStartupMenu();
int startupMenuResult = MainMenu();

switch(startupMenuResult)
{
Expand All @@ -62,11 +62,11 @@ void startAITD3()
{
// updateShaking();

flagInitView = 2;
FlagInitView = 2;

setupCamera();
InitView();

mainLoop(1, 1);
PlayWorld(1, 1);

// freeScene();

Expand Down Expand Up @@ -108,5 +108,5 @@ void drawInventoryAITD3()
statusRight = 159;
statusBottom = 174;

setupCameraProjection(((statusRight-statusLeft)/2)+statusLeft,((statusBottom-statusTop)/2) + statusTop,128,400,390);
SetProjection(((statusRight-statusLeft)/2)+statusLeft,((statusBottom-statusTop)/2) + statusTop,128,400,390);
}
Loading