- PsyCross variables update, cleanup

This commit is contained in:
InspirationByte 2022-01-23 13:12:02 +03:00
parent 85ee485fbc
commit 7911127a3e
6 changed files with 59 additions and 65 deletions

View File

@ -387,8 +387,6 @@ void FadeOutHiresScreen(void)
PutDispEnv(&disp); PutDispEnv(&disp);
PutDrawEnv(&draw); PutDrawEnv(&draw);
//g_wireframeMode = 1;
DrawSync(0); DrawSync(0);
SetDispMask(1); SetDispMask(1);

View File

@ -789,10 +789,6 @@ void DrawBodySprite(PEDESTRIAN* pDrawingPed, int boneId, VERTTYPE v1[2], VERTTYP
if (bDoingShadow != 0) if (bDoingShadow != 0)
{ {
addPrim(current->ot + OTSIZE - 1, prims); addPrim(current->ot + OTSIZE - 1, prims);
#ifdef PGXP
prims->pgxp_index = 0xffff;
#endif
} }
else else
{ {

View File

@ -1343,7 +1343,7 @@ void DrawOverheadMap(void)
th = MapTex[i].h - 1; th = MapTex[i].h - 1;
#ifndef PSX #ifndef PSX
// make map fully detailed when filtering is not available // make map fully detailed when filtering is not available
if (!g_bilinearFiltering) if (!g_cfg_bilinearFiltering)
{ {
tw += 1; tw += 1;
th += 1; th += 1;
@ -1500,7 +1500,7 @@ void DrawFullscreenMap(void)
#ifndef PSX #ifndef PSX
/* It will look funny when enabled /* It will look funny when enabled
// make map fully detailed when filtering is not available // make map fully detailed when filtering is not available
if (!g_bilinearFiltering) if (!g_cfg_bilinearFiltering)
{ {
tw += 1; tw += 1;
th += 1; th += 1;

View File

@ -497,7 +497,7 @@ char* WaitForTextEntry(char* textBufPtr, int maxLength)
#if !USE_PAD_INPUT #if !USE_PAD_INPUT
// PsyX input handler // PsyX input handler
gameOnTextInput = ScoreNameInputHandler; g_cfg_gameOnTextInput = ScoreNameInputHandler;
gCurrentTextChar = 0; gCurrentTextChar = 0;
#endif #endif
@ -667,7 +667,7 @@ char* WaitForTextEntry(char* textBufPtr, int maxLength)
} while (true); } while (true);
#if !USE_PAD_INPUT #if !USE_PAD_INPUT
gameOnTextInput = NULL; g_cfg_gameOnTextInput = NULL;
#endif #endif
return username; return username;

@ -1 +1 @@
Subproject commit 003dc827f80b789ad6019739721b2be637c193f3 Subproject commit 88d377548487580c5b4dfa471f3a052b4e805882

View File

@ -338,124 +338,125 @@ char g_Replay_buffer[0x50000]; // 0x1fABBC
void ParseKeyboardMappings(ini_t* config, char* section, PsyXKeyboardMapping& outMapping) void ParseKeyboardMappings(ini_t* config, char* section, PsyXKeyboardMapping& outMapping)
{ {
extern PsyXKeyboardMapping g_keyboard_mapping; // since it is configured by default
const PsyXKeyboardMapping& defaultMapping = g_cfg_keyboardMapping;
const char* str; const char* str;
str = ini_get(config, section, "square"); str = ini_get(config, section, "square");
outMapping.kc_square = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_square); outMapping.kc_square = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_square);
str = ini_get(config, section, "circle"); str = ini_get(config, section, "circle");
outMapping.kc_circle = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_circle); outMapping.kc_circle = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_circle);
str = ini_get(config, section, "triangle"); str = ini_get(config, section, "triangle");
outMapping.kc_triangle = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_triangle); outMapping.kc_triangle = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_triangle);
str = ini_get(config, section, "cross"); str = ini_get(config, section, "cross");
outMapping.kc_cross = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_cross); outMapping.kc_cross = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_cross);
str = ini_get(config, section, "l1"); str = ini_get(config, section, "l1");
outMapping.kc_l1 = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_l1); outMapping.kc_l1 = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_l1);
str = ini_get(config, section, "l2"); str = ini_get(config, section, "l2");
outMapping.kc_l2 = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_l2); outMapping.kc_l2 = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_l2);
str = ini_get(config, section, "l3"); str = ini_get(config, section, "l3");
outMapping.kc_l3 = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_l3); outMapping.kc_l3 = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_l3);
str = ini_get(config, section, "r1"); str = ini_get(config, section, "r1");
outMapping.kc_r1 = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_r1); outMapping.kc_r1 = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_r1);
str = ini_get(config, section, "r2"); str = ini_get(config, section, "r2");
outMapping.kc_r2 = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_r2); outMapping.kc_r2 = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_r2);
str = ini_get(config, section, "r3"); str = ini_get(config, section, "r3");
outMapping.kc_r3 = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_r3); outMapping.kc_r3 = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_r3);
str = ini_get(config, section, "up"); str = ini_get(config, section, "up");
outMapping.kc_dpad_up = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_dpad_up); outMapping.kc_dpad_up = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_dpad_up);
str = ini_get(config, section, "down"); str = ini_get(config, section, "down");
outMapping.kc_dpad_down = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_dpad_down); outMapping.kc_dpad_down = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_dpad_down);
str = ini_get(config, section, "left"); str = ini_get(config, section, "left");
outMapping.kc_dpad_left = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_dpad_left); outMapping.kc_dpad_left = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_dpad_left);
str = ini_get(config, section, "right"); str = ini_get(config, section, "right");
outMapping.kc_dpad_right = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_dpad_right); outMapping.kc_dpad_right = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_dpad_right);
str = ini_get(config, section, "select"); str = ini_get(config, section, "select");
outMapping.kc_select = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_select); outMapping.kc_select = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_select);
str = ini_get(config, section, "start"); str = ini_get(config, section, "start");
outMapping.kc_start = PsyX_LookupKeyboardMapping(str, g_keyboard_mapping.kc_start); outMapping.kc_start = PsyX_LookupKeyboardMapping(str, defaultMapping.kc_start);
} }
void ParseControllerMappings(ini_t* config, char* section, PsyXControllerMapping& outMapping) void ParseControllerMappings(ini_t* config, char* section, PsyXControllerMapping& outMapping)
{ {
extern PsyXControllerMapping g_controller_mapping; const PsyXControllerMapping& defaultMapping = g_cfg_controllerMapping;
const char* str; const char* str;
str = ini_get(config, section, "square"); str = ini_get(config, section, "square");
outMapping.gc_square = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_square); outMapping.gc_square = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_square);
str = ini_get(config, section, "circle"); str = ini_get(config, section, "circle");
outMapping.gc_circle = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_circle); outMapping.gc_circle = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_circle);
str = ini_get(config, section, "triangle"); str = ini_get(config, section, "triangle");
outMapping.gc_triangle = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_triangle); outMapping.gc_triangle = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_triangle);
str = ini_get(config, section, "cross"); str = ini_get(config, section, "cross");
outMapping.gc_cross = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_cross); outMapping.gc_cross = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_cross);
str = ini_get(config, section, "l1"); str = ini_get(config, section, "l1");
outMapping.gc_l1 = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_l1); outMapping.gc_l1 = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_l1);
str = ini_get(config, section, "l2"); str = ini_get(config, section, "l2");
outMapping.gc_l2 = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_l2); outMapping.gc_l2 = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_l2);
str = ini_get(config, section, "l3"); str = ini_get(config, section, "l3");
outMapping.gc_l3 = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_l3); outMapping.gc_l3 = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_l3);
str = ini_get(config, section, "r1"); str = ini_get(config, section, "r1");
outMapping.gc_r1 = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_r1); outMapping.gc_r1 = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_r1);
str = ini_get(config, section, "r2"); str = ini_get(config, section, "r2");
outMapping.gc_r2 = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_r2); outMapping.gc_r2 = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_r2);
str = ini_get(config, section, "r3"); str = ini_get(config, section, "r3");
outMapping.gc_r3 = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_r3); outMapping.gc_r3 = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_r3);
str = ini_get(config, section, "up"); str = ini_get(config, section, "up");
outMapping.gc_dpad_up = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_dpad_up); outMapping.gc_dpad_up = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_dpad_up);
str = ini_get(config, section, "down"); str = ini_get(config, section, "down");
outMapping.gc_dpad_down = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_dpad_down); outMapping.gc_dpad_down = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_dpad_down);
str = ini_get(config, section, "left"); str = ini_get(config, section, "left");
outMapping.gc_dpad_left = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_dpad_left); outMapping.gc_dpad_left = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_dpad_left);
str = ini_get(config, section, "right"); str = ini_get(config, section, "right");
outMapping.gc_dpad_right = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_dpad_right); outMapping.gc_dpad_right = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_dpad_right);
str = ini_get(config, section, "select"); str = ini_get(config, section, "select");
outMapping.gc_select = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_select); outMapping.gc_select = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_select);
str = ini_get(config, section, "start"); str = ini_get(config, section, "start");
outMapping.gc_start = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_start); outMapping.gc_start = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_start);
str = ini_get(config, section, "axis_left_x"); str = ini_get(config, section, "axis_left_x");
outMapping.gc_axis_left_x = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_axis_left_x); outMapping.gc_axis_left_x = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_axis_left_x);
str = ini_get(config, section, "axis_left_y"); str = ini_get(config, section, "axis_left_y");
outMapping.gc_axis_left_y = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_axis_left_y); outMapping.gc_axis_left_y = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_axis_left_y);
str = ini_get(config, section, "axis_right_x"); str = ini_get(config, section, "axis_right_x");
outMapping.gc_axis_right_x = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_axis_right_x); outMapping.gc_axis_right_x = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_axis_right_x);
str = ini_get(config, section, "axis_right_y"); str = ini_get(config, section, "axis_right_y");
outMapping.gc_axis_right_y = PsyX_LookupGameControllerMapping(str, g_controller_mapping.gc_axis_right_y); outMapping.gc_axis_right_y = PsyX_LookupGameControllerMapping(str, defaultMapping.gc_axis_right_y);
} }
PsyXKeyboardMapping g_kbGameMappings = { 0x123 }; PsyXKeyboardMapping g_kbGameMappings = { 0x123 };
@ -466,18 +467,15 @@ PsyXControllerMapping g_gcMenuMappings = { 0x654 };
void SwitchMappings(int menu) void SwitchMappings(int menu)
{ {
extern PsyXKeyboardMapping g_keyboard_mapping;
extern PsyXControllerMapping g_controller_mapping;
if(menu) if(menu)
{ {
g_keyboard_mapping = g_kbMenuMappings; g_cfg_keyboardMapping = g_kbMenuMappings;
g_controller_mapping = g_gcMenuMappings; g_cfg_controllerMapping = g_gcMenuMappings;
} }
else else
{ {
g_keyboard_mapping = g_kbGameMappings; g_cfg_keyboardMapping = g_kbGameMappings;
g_controller_mapping = g_gcGameMappings; g_cfg_controllerMapping = g_gcGameMappings;
} }
} }
@ -551,6 +549,7 @@ int main(int argc, char** argv)
int screenWidth = 800; int screenWidth = 800;
int screenHeight = 600; int screenHeight = 600;
int fullScreen = 0; int fullScreen = 0;
int vsync = 0;
int enableFreecamera = 0; int enableFreecamera = 0;
extern int gUserLanguage; extern int gUserLanguage;
@ -569,8 +568,8 @@ int main(int argc, char** argv)
InitUserReplays(userReplaysStr); InitUserReplays(userReplaysStr);
// configure Psy-X pads // configure Psy-X pads
ini_sget(config, "pad", "pad1device", "%d", &g_controllerToSlotMapping[0]); ini_sget(config, "pad", "pad1device", "%d", &g_cfg_controllerToSlotMapping[0]);
ini_sget(config, "pad", "pad2device", "%d", &g_controllerToSlotMapping[1]); ini_sget(config, "pad", "pad2device", "%d", &g_cfg_controllerToSlotMapping[1]);
// configure Psy-X renderer // configure Psy-X renderer
ini_sget(config, "render", "windowWidth", "%d", &windowWidth); ini_sget(config, "render", "windowWidth", "%d", &windowWidth);
@ -578,9 +577,10 @@ int main(int argc, char** argv)
ini_sget(config, "render", "screenWidth", "%d", &screenWidth); ini_sget(config, "render", "screenWidth", "%d", &screenWidth);
ini_sget(config, "render", "screenHeight", "%d", &screenHeight); ini_sget(config, "render", "screenHeight", "%d", &screenHeight);
ini_sget(config, "render", "fullscreen", "%d", &fullScreen); ini_sget(config, "render", "fullscreen", "%d", &fullScreen);
ini_sget(config, "render", "pgxpTextureMapping", "%d", &g_pgxpTextureCorrection); ini_sget(config, "render", "vsync", "%d", &g_cfg_swapInterval);
ini_sget(config, "render", "pgxpZbuffer", "%d", &g_pgxpZBuffer); ini_sget(config, "render", "pgxpTextureMapping", "%d", &g_cfg_pgxpTextureCorrection);
ini_sget(config, "render", "bilinearFiltering", "%d", &g_bilinearFiltering); ini_sget(config, "render", "pgxpZbuffer", "%d", &g_cfg_pgxpZBuffer);
ini_sget(config, "render", "bilinearFiltering", "%d", &g_cfg_bilinearFiltering);
// configure host game // configure host game
ini_sget(config, "game", "drawDistance", "%d", &gDrawDistance); ini_sget(config, "game", "drawDistance", "%d", &gDrawDistance);
@ -630,13 +630,13 @@ int main(int argc, char** argv)
#ifndef _DEBUG #ifndef _DEBUG
if (enableFreecamera) if (enableFreecamera)
{ {
gameDebugKeys = FreeCameraKeyboardHandler; g_dbg_gameDebugKeys = FreeCameraKeyboardHandler;
gameDebugMouse = FreeCameraMouseHandler; g_dbg_gameDebugMouse = FreeCameraMouseHandler;
} }
#else #else
gameDebugKeys = GameDebugKeys; g_dbg_gameDebugKeys = GameDebugKeys;
gameDebugMouse = FreeCameraMouseHandler; g_dbg_gameDebugMouse = FreeCameraMouseHandler;
#endif #endif