Skip to content

Commit

Permalink
Remove tweaks, update Site Rayman2 check with other languages
Browse files Browse the repository at this point in the history
  • Loading branch information
spitfirex86 committed Feb 22, 2024
1 parent ba3b0c6 commit 77a28c1
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 185 deletions.
2 changes: 0 additions & 2 deletions GliFixVf/GliFixVf.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
<ClInclude Include="imports.h" />
<ClInclude Include="r2fn.h" />
<ClInclude Include="shared.h" />
<ClInclude Include="tweaks.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="config.c" />
Expand All @@ -175,7 +174,6 @@
<ClCompile Include="fix.c" />
<ClCompile Include="imports.c" />
<ClCompile Include="r2fn.c" />
<ClCompile Include="tweaks.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
6 changes: 0 additions & 6 deletions GliFixVf/GliFixVf.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
<ClInclude Include="config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="tweaks.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="shared.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down Expand Up @@ -65,9 +62,6 @@
<ClCompile Include="config.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="tweaks.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="fix.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down
9 changes: 0 additions & 9 deletions GliFixVf/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ BOOL CFG_bHalfRefRate = FALSE;
BOOL CFG_bIsMainModuleR2 = FALSE;
BOOL CFG_bIsFixEnabled = TRUE;

BOOL CFG_bTainted = FALSE;
tdeTweaks CFG_eTweaks = e_TWK_NoTweaks;


/*
* Functions
Expand Down Expand Up @@ -124,12 +121,6 @@ void fn_vReadFixConfig( void )
{
CFG_bHalfRefRate = TRUE;
}

// Tweaks
GetPrivateProfileString("Ray2Fix", "Tweaks", "0", szBuffer, sizeof(szBuffer), szUbiPath);

CFG_eTweaks = strtol(szBuffer, NULL, 10);
CFG_bTainted = CFG_eTweaks > 0;
}

void CFG_fn_vInitGlobals( void )
Expand Down
3 changes: 0 additions & 3 deletions GliFixVf/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ extern BOOL CFG_bHalfRefRate;
extern BOOL CFG_bIsMainModuleR2;
extern BOOL CFG_bIsFixEnabled;

extern BOOL CFG_bTainted;
extern tdeTweaks CFG_eTweaks;


/*
* Functions
Expand Down
4 changes: 0 additions & 4 deletions GliFixVf/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "imports.h"
#include "fix.h"
#include "config.h"
#include "tweaks.h"


void fn_vInitDll( void )
Expand All @@ -14,9 +13,6 @@ void fn_vInitDll( void )
{
/* Loaded in the game, patch all */
FIX_fn_vAttachHooks();

if ( CFG_eTweaks )
TWK_fn_vInitTweaks();
}
else
{
Expand Down
39 changes: 8 additions & 31 deletions GliFixVf/fix.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@


char *szConfigMenu = "/C:Ray2Fix Config";

char szVersionString[50];
tdstJFFTXT txtVersion = {
NULL,
5, 980, 7, 160,
0, 0, 0, 0, 0
};


/*
Expand Down Expand Up @@ -49,9 +43,13 @@ char * FIX_fn_szGetStringFromTextOrStringParam( void *param )
if ( !_stricmp(R2_fn_p_szGetLevelName(), "menu") )
{
// Part 1: Replace menu text.
if ( !strcmp(result, "/C:Site Rayman2") )
if ( !strcmp(result, "/C:Site Rayman2")
|| !strcmp(result, "/C:Web de Rayman2")
|| !strcmp(result, "/C:Sito di Rayman2")
|| !strcmp(result, "/C:Rayman2 - Webseite") )
{
return szConfigMenu;
//return szConfigMenu;
return szVersionString;
}

// Part 2: Open R2FixCfg with ShellExecute.
Expand All @@ -65,26 +63,15 @@ char * FIX_fn_szGetStringFromTextOrStringParam( void *param )
return result;
}

void FIX_JFFTXT_vAffiche( void *lpContext )
{
R2_JFFTXT_vDrawString(lpContext, &txtVersion);

// Call original function
R2_JFFTXT_vAffiche(lpContext);
}


/*
* Functions
*/

void fn_vPreAttachHooks( void )
{
if ( CFG_bTainted )
{
sprintf_s(szVersionString, sizeof(szVersionString), "/O200:%s v%s", GLI_szName, GLI_szVersion);
txtVersion.lpText = szVersionString;
}
//sprintf_s(szVersionString, sizeof(szVersionString), "/O200:%s v%s", GLI_szName, GLI_szVersion);
snprintf(szVersionString, sizeof(szVersionString), "/C:%s v%s", GLI_szName, GLI_szVersion);
}

void FIX_fn_vAttachHooks( void )
Expand All @@ -97,11 +84,6 @@ void FIX_fn_vAttachHooks( void )
DetourAttach((PVOID*)&R2_fn_InputEnum, (PVOID)FIX_fn_InputEnum);
DetourAttach((PVOID*)&R2_fn_SuspendGame, (PVOID)FIX_fn_SuspendGame);
DetourAttach((PVOID*)&R2_fn_szGetStringFromTextOrStringParam, (PVOID)FIX_fn_szGetStringFromTextOrStringParam);

if ( CFG_bTainted )
{
DetourAttach((PVOID*)&R2_JFFTXT_vAffiche, (PVOID)FIX_JFFTXT_vAffiche);
}

DetourTransactionCommit();
}
Expand All @@ -115,11 +97,6 @@ void FIX_fn_vDetachHooks( void )
DetourDetach((PVOID*)&R2_fn_SuspendGame, (PVOID)FIX_fn_SuspendGame);
DetourDetach((PVOID*)&R2_fn_szGetStringFromTextOrStringParam, (PVOID)FIX_fn_szGetStringFromTextOrStringParam);

if ( CFG_bTainted )
{
DetourDetach((PVOID*)&R2_JFFTXT_vAffiche, (PVOID)FIX_JFFTXT_vAffiche);
}

DetourTransactionCommit();
}

Expand Down
13 changes: 1 addition & 12 deletions GliFixVf/r2fn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,15 @@
#include "r2fn.h"


/*
* Variables
*/

void *R2_lpGlobalContext = 0x5004D4;


/*
* Function pointers
*/

DIEnumDevicesCallback R2_fn_InputEnum = 0x495170;
BOOL (*R2_fn_SuspendGame)() = 0x4016E0;

char* (*R2_fn_p_szGetLevelName)( void ) = 0x404DA0;
char * (*R2_fn_p_szGetLevelName)( void ) = 0x404DA0;
void (*R2_fn_vEngine)( void ) = 0x40ADA0;
void (*R2_JFFTXT_vAffiche)( void *lpContext ) = 0x465C10;

void (*R2_JFFTXT_vDrawString)( void *lpContext, tdstJFFTXT *lpTextStruct ) = 0x4660B0;
void (*R2_GLI_vDraw2DSpriteWithPercent)(void *lpContext, float x, float y, float u, float v, void *lpTextureData) = 0x429670;

char* (*R2_fn_szGetStringFromTextOrStringParam)( void *param ) = 0x4829D0;

Expand Down
37 changes: 1 addition & 36 deletions GliFixVf/r2fn.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,15 @@
#include "fix.h"


typedef struct tdstJFFTXT_
{
char *lpText;
float X;
float Y;
float size;
BYTE crAlpha;
BYTE _byte11;
BYTE highlight;
BYTE options;
DWORD _dword14;
BYTE crHighlight;
}
tdstJFFTXT;

typedef struct tdstVector3D_
{
float X;
float Y;
float Z;
}
tdstVector3D;


/*
* Variables
*/

extern void *R2_lpGlobalContext;


/*
* Function pointers
*/

extern DIEnumDevicesCallback R2_fn_InputEnum;
extern BOOL (*R2_fn_SuspendGame)();

extern char* (*R2_fn_p_szGetLevelName)( void );
extern char * (*R2_fn_p_szGetLevelName)( void );
extern void (*R2_fn_vEngine)( void );
extern void (*R2_JFFTXT_vAffiche)( void *lpContext );

extern void (*R2_JFFTXT_vDrawString)( void *lpContext, tdstJFFTXT *lpTextStruct );
extern void (*R2_GLI_vDraw2DSpriteWithPercent)( void *lpContext, float x, float y, float u, float v, void *lpTextureData );

extern char* (*R2_fn_szGetStringFromTextOrStringParam)( void *param );

Expand Down
61 changes: 0 additions & 61 deletions GliFixVf/tweaks.c

This file was deleted.

21 changes: 0 additions & 21 deletions GliFixVf/tweaks.h

This file was deleted.

0 comments on commit 77a28c1

Please sign in to comment.