Compare commits

...
27 Commits
Author SHA1 Message Date
alufolie91 2bc9f32074 simpler fix for localskin minimap angle display crash 2026-10-12 15:15:26 +02:00
alufolie91 f0703dc5e1 fix crash when applying localskin midgame 2026-10-08 09:27:47 +02:00
alufolie91 7ca73cdfdb fix another "0 as null pointer" case 2026-10-08 09:27:44 +02:00
alufolie91 c01d6eccf6 fix arithmetic on NULL pointer when drawing 3d models
caused by localskin code.... sigh......
noticed this while messing with dynamic allocated (local)skins
2026-10-08 09:27:42 +02:00
alufolie91 4ba3eec1e3 cleanup squishdance stuff a bit
we dont need all those things saved per player really lol
2026-10-08 09:27:37 +02:00
alufolie91 601f384314 cleanup saltyhop a little, move it to player struct 2026-10-08 09:27:32 +02:00
alufolie91 19fc0da296 fix localskin menu not showing localskin 3d models
this should use the skins localnumber not the "actual" skinnumber
yeah localskin code still sucks....
fixes https://github.com/Indev450/SRB2Kart-Saturn/issues/230
2026-10-04 01:01:11 +02:00
indev 75d24743c1 Actually change command name to useprefcolor, so its a bit more intuitive 2026-09-27 17:47:01 +02:00
indev 9573d6c4cf Add command to change skin color to prefcolor 2026-09-27 17:46:32 +02:00
alufolie91 4fbcb14699 fix CMake again............ 2026-09-27 17:34:55 +02:00
alufolie91 325b4d5137 v10.1 2026-09-27 17:28:37 +02:00
alufolie91 f2e7b1d0bf fix "Modulative" blendmode in software
forgot to account it when the gamma correction stuff was ported
2026-09-27 17:27:03 +02:00
alufolie91 02834da690 fix desynchs with vanilla on Sewer System
read the sectornode list stuff
this means we reuse old stale data in some cases, which also causes strange bugs with orbiting items in some cases, but thats what vanilla does and we HAVE to keep vanilla compat after all
i really hope this does not cause any fun impossible to debug crashes, but what can you do
2026-09-27 17:26:21 +02:00
alufolie91 0c2bd7fd47 add orbit mobj check into K_MoveHeldObjects 2026-09-27 17:26:08 +02:00
alufolie91 0ce3bea34b disable phobos in cmake
stupid copy paste error
2026-09-26 12:04:05 +02:00
alufolie91 6a2ee9fa6a change version number for phobos
phobos is NOT vanilla compatible and is not meant to be
this should prevent the game be able to connect to vanilla servers hopefully
2026-09-26 12:03:59 +02:00
alufolie91 9525018c02 cleanup controller menu stuff a little more 2026-09-23 19:08:40 +02:00
alufolie91 7ea7020095 dont reset JoyInfo in I_InitJoystick
seems to fix wonky behavior when changing controllers per player
2026-09-23 19:08:37 +02:00
indev e0b9d131ca 20 2026-09-23 19:08:34 +02:00
alufolie91 34ab9d714c fun times with M_DoAssignJoystick
my tired ass forgor cv_usejoystick gets reassinged within this, so the cvar string also changes
2026-09-23 19:08:31 +02:00
orbitalviolet c68aacc922 Fix regression #1507 2026-09-23 19:08:25 +02:00
alufolie91 aeca22c7a3 few more smoler style cleanups 2026-09-23 19:08:17 +02:00
alufolie91 b93d8d1efb smol fix for pm´s in DoSayCommand
sending a pm might change the length of the string which we need to reconsider when sending the cmd
2026-09-23 19:08:12 +02:00
alufolie91 e16546db12 Merge branch 'Saturn-Next' into Saturn 2026-09-16 20:35:11 +02:00
Alug 8cf2395d42 Merge branch 'Saturn-Next' into Saturn 2025-12-06 15:45:51 +01:00
Alug 3abe74de86 release 9.2 2025-12-06 15:33:41 +01:00
Alug 5a61ebf325 Merge branch 'Saturn-Next' into Saturn 2025-12-06 15:33:08 +01:00
25 changed files with 339 additions and 226 deletions

No files matched your search

+2 -2
View File
@@ -257,7 +257,7 @@ set(SRB2_CONFIG_SATURNJOIN ON CACHE BOOL
set(SRB2_CONFIG_SCREENFBO ON CACHE BOOL set(SRB2_CONFIG_SCREENFBO ON CACHE BOOL
"Enable hardware renderer (OpenGL) FBO downsampling support") "Enable hardware renderer (OpenGL) FBO downsampling support")
set(SRB2_CONFIG_PHOBOS ON CACHE BOOL set(SRB2_CONFIG_PHOBOS OFF CACHE BOOL
" Compile the Phobos client. Which contains things not compatible with vanilla, such as raised skinlimits, 32 player support, bugfixes, etc.") " Compile the Phobos client. Which contains things not compatible with vanilla, such as raised skinlimits, 32 player support, bugfixes, etc.")
if(${SRB2_CONFIG_DEDICATED}) if(${SRB2_CONFIG_DEDICATED})
@@ -586,7 +586,7 @@ if(${SRB2_CONFIG_SATURNJOIN})
add_definitions(-DDOSATURNJOIN) add_definitions(-DDOSATURNJOIN)
endif() endif()
if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_SCREENFBO}) if(${SRB2_CONFIG_PHOBOS})
add_definitions(-DPHOBOS_BUILD) add_definitions(-DPHOBOS_BUILD)
endif() endif()
+3 -2
View File
@@ -1822,7 +1822,7 @@ static void SV_SendPlayerInfo(INT32 node)
// Extra data // Extra data
// Kart has extra skincolors, so we can't use this // Kart has extra skincolors, so we can't use this
//netbuffer->u.playerinfo[i].data = 0; //netbuffer->u.playerinfo[i].data = players[i].skincolor; //netbuffer->u.playerinfo[i].data = 0;
// well why not, we only got like 100 of these? // well why not, we only got like 100 of these?
netbuffer->u.playerinfo[i].data = players[i].skincolor; netbuffer->u.playerinfo[i].data = players[i].skincolor;
@@ -5174,7 +5174,7 @@ static void PT_ServerInfo(SINT8 node)
const tic_t ticthen = (tic_t)LONG(netbuffer->u.serverinfo.time); const tic_t ticthen = (tic_t)LONG(netbuffer->u.serverinfo.time);
const tic_t ticdiff = (ticnow - ticthen)*1000/NEWTICRATE; const tic_t ticdiff = (ticnow - ticthen)*1000/NEWTICRATE;
netbuffer->u.serverinfo.time = (tic_t)LONG(ticdiff); netbuffer->u.serverinfo.time = (tic_t)LONG(ticdiff);
netbuffer->u.serverinfo.servername[MAXSERVERNAME-1] = 0; netbuffer->u.serverinfo.servername[MAXSERVERNAME-1] = '\0';
netbuffer->u.serverinfo.application netbuffer->u.serverinfo.application
[sizeof netbuffer->u.serverinfo.application - 1] = '\0'; [sizeof netbuffer->u.serverinfo.application - 1] = '\0';
memcpy(servername, netbuffer->u.serverinfo.servername, MAXSERVERNAME); memcpy(servername, netbuffer->u.serverinfo.servername, MAXSERVERNAME);
@@ -7253,6 +7253,7 @@ static void DedicatedIdleUpdate(INT32 *realtics)
{ {
CONS_Printf("DEDICATED: Awakening from idle (Player detected...)\n"); CONS_Printf("DEDICATED: Awakening from idle (Player detected...)\n");
} }
dedicatedidle = 0; dedicatedidle = 0;
} }
} }
+54 -1
View File
@@ -147,6 +147,11 @@ static void Command_Addfilelocal(void);
static void Command_Addfile(void); static void Command_Addfile(void);
static void Command_Addskins(void); static void Command_Addskins(void);
static void Command_GLocalSkin(void); static void Command_GLocalSkin(void);
static void SetPrefcolor(int splitplayer);
static void Command_UsePrefcolor(void);
static void Command_UsePrefcolor2(void);
static void Command_UsePrefcolor3(void);
static void Command_UsePrefcolor4(void);
static void Command_ListWADS_f(void); static void Command_ListWADS_f(void);
static void Command_LocateLump_f(void); static void Command_LocateLump_f(void);
static void Command_ListDoomednums_f(void); static void Command_ListDoomednums_f(void);
@@ -866,6 +871,11 @@ void D_RegisterClientCommands(void)
COM_AddCommand("localskin", Command_GLocalSkin); COM_AddCommand("localskin", Command_GLocalSkin);
COM_AddCommand("useprefcolor", Command_UsePrefcolor);
COM_AddCommand("useprefcolor2", Command_UsePrefcolor2);
COM_AddCommand("useprefcolor3", Command_UsePrefcolor3);
COM_AddCommand("useprefcolor4", Command_UsePrefcolor4);
K_RegisterClientKartStuff(); // SRB2kart K_RegisterClientKartStuff(); // SRB2kart
CV_RegisterVar(&cv_screenshot_option); CV_RegisterVar(&cv_screenshot_option);
@@ -4334,6 +4344,49 @@ static void Command_GLocalSkin(void)
} }
} }
static void SetPrefcolor(int splitplayer)
{
// splitscreen
if (splitscreen < splitplayer)
return;
const INT32 pnum = P_GetLocalPlayerNumForNum(splitplayer);
player_t *player = &players[pnum];
consvar_t *colorvars[] = {&cv_playercolor, &cv_playercolor2, &cv_playercolor3, &cv_playercolor4};
consvar_t *playercolor = colorvars[splitplayer];
if (skins[player->skin].prefcolor)
{
CV_SetValue(playercolor, skins[player->skin].prefcolor);
CONS_Printf("Set color to %s%s\n", HU_SkinColorToConsoleColor(skins[player->skin].prefcolor), KartColor_Names[skins[player->skin].prefcolor]);
}
else
{
CONS_Printf("\x86Your skin has no prefcolor set\n");
}
}
static void Command_UsePrefcolor(void)
{
SetPrefcolor(0);
}
static void Command_UsePrefcolor2(void)
{
SetPrefcolor(1);
}
static void Command_UsePrefcolor3(void)
{
SetPrefcolor(2);
}
static void Command_UsePrefcolor4(void)
{
SetPrefcolor(3);
}
static void Got_RequestAddfilecmd(const UINT8 **cp, INT32 playernum) static void Got_RequestAddfilecmd(const UINT8 **cp, INT32 playernum)
{ {
char filename[241]; char filename[241];
@@ -4381,7 +4434,7 @@ static void Got_RequestAddfilecmd(const UINT8 **cp, INT32 playernum)
else else
snprintf(message, sizeof(message), M_GetText("Unknown error finding wad file (%s)\n"), filename); snprintf(message, sizeof(message), M_GetText("Unknown error finding wad file (%s)\n"), filename);
CONS_Printf("%s",message); CONS_Printf("%s", message);
for (j = 0; j < MAXPLAYERS; j++) for (j = 0; j < MAXPLAYERS; j++)
if (adminplayers[j]) if (adminplayers[j])
+12 -3
View File
@@ -361,11 +361,17 @@ typedef struct squishdance_s
{ {
tic_t countdown; // hold "custom 3" for 2 seconds to engange le dance tic_t countdown; // hold "custom 3" for 2 seconds to engange le dance
tic_t time; tic_t time;
fixed_t work;
fixed_t ang;
fixed_t bounce; // hehe squishy
} squishdance_t; } squishdance_t;
typedef struct salty_s
{
bool ready;
bool tapping;
fixed_t zoffset;
fixed_t momz;
bool jump;
} salty_t;
// ======================================================================== // ========================================================================
// PLAYER STRUCTURE // PLAYER STRUCTURE
// ======================================================================== // ========================================================================
@@ -561,6 +567,9 @@ typedef struct player_s
fixed_t spinoutrot; // When a player spins out, this value increments modulus 360. fixed_t spinoutrot; // When a player spins out, this value increments modulus 360.
// saltyhop! hardcode edition
salty_t salty;
squishdance_t squishdance; squishdance_t squishdance;
fixed_t fovadd; // adjust FOV for hw rendering fixed_t fovadd; // adjust FOV for hw rendering
+8 -3
View File
@@ -128,8 +128,13 @@ extern char logfilename[1024];
// most interface strings are ignored in development mode. // most interface strings are ignored in development mode.
// we use comprevision and compbranch instead. // we use comprevision and compbranch instead.
#else #else
#ifdef PHOBOS_BUILD
#define VERSION 1 // Game version
#define SUBVERSION 69 // more precise version number
#else
#define VERSION 1 // Game version #define VERSION 1 // Game version
#define SUBVERSION 6 // more precise version number #define SUBVERSION 6 // more precise version number
#endif
#ifdef PHOBOS_BUILD #ifdef PHOBOS_BUILD
#define CLIENTNAME "Phobos" #define CLIENTNAME "Phobos"
@@ -139,10 +144,10 @@ extern char logfilename[1024];
#define CLIENTNAMEW L"Saturn" #define CLIENTNAMEW L"Saturn"
#endif #endif
#define VERSIONSTRING CLIENTNAME " v10" #define VERSIONSTRING CLIENTNAME " v10.1"
#define VERSIONSTRINGW CLIENTNAMEW L" v10" #define VERSIONSTRINGW CLIENTNAMEW L" v10.1"
#define SATURN_TESTING // comment out for saturn release builds! //#define SATURN_TESTING // comment out for saturn release builds!
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates! // Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
// And change CMakeLists.txt (not src/, but in root), for CMake users! // And change CMakeLists.txt (not src/, but in root), for CMake users!
+5 -5
View File
@@ -35,7 +35,7 @@ static int finalVertexArrayAllocSize = 65536;
// not gonna use this for now, just sort by color and change state when it changes // not gonna use this for now, just sort by color and change state when it changes
// later maybe when using vertex attributes if it's needed // later maybe when using vertex attributes if it's needed
static PolygonArrayEntry* polygonArray = NULL ;// contains the polygon data from DrawPolygon, waiting to be processed static PolygonArrayEntry* polygonArray = NULL; // contains the polygon data from DrawPolygon, waiting to be processed
static PolygonArrayEntry **polygonArraySorted = NULL; // contains sorted pointers to polygonArray static PolygonArrayEntry **polygonArraySorted = NULL; // contains sorted pointers to polygonArray
static int polygonArraySize = 0; static int polygonArraySize = 0;
static int polygonArrayAllocSize = 65536; static int polygonArrayAllocSize = 65536;
@@ -171,8 +171,8 @@ static int comparePolygons(const void *p1, const void *p2)
// special case with signedness to prevent overflowing // special case with signedness to prevent overflowing
// FIXME: check for prediction slowdowns! // FIXME: check for prediction slowdowns!
const int shader1 = poly1->hash & 0x80000000 ? -1 : poly1->shader; const int shader1 = (poly1->hash & 0x80000000) ? -1 : poly1->shader;
const int shader2 = poly2->hash & 0x80000000 ? -1 : poly2->shader; const int shader2 = (poly2->hash & 0x80000000) ? -1 : poly2->shader;
// skywalls and horizon lines must retain their order for horizon lines to work // skywalls and horizon lines must retain their order for horizon lines to work
if (shader1 == -1 && shader2 == -1) if (shader1 == -1 && shader2 == -1)
@@ -214,8 +214,8 @@ static int comparePolygonsNoShaders(const void *p1, const void *p2)
const PolygonArrayEntry *poly1 = *(PolygonArrayEntry *const *)p1; const PolygonArrayEntry *poly1 = *(PolygonArrayEntry *const *)p1;
const PolygonArrayEntry *poly2 = *(PolygonArrayEntry *const *)p2; const PolygonArrayEntry *poly2 = *(PolygonArrayEntry *const *)p2;
const GLMipmap_t *texture1 = poly1->hash & 0x80000000 ? NULL : poly1->texture; const GLMipmap_t *texture1 = (poly1->hash & 0x80000000) ? NULL : poly1->texture;
const GLMipmap_t *texture2 = poly2->hash & 0x80000000 ? NULL : poly2->texture; const GLMipmap_t *texture2 = (poly2->hash & 0x80000000) ? NULL : poly2->texture;
// skywalls and horizon lines must retain their order for horizon lines to work // skywalls and horizon lines must retain their order for horizon lines to work
if (!texture1 && !texture2) if (!texture1 && !texture2)
+1 -1
View File
@@ -1236,7 +1236,7 @@ static void HWR_DrawSkyWall(FOutVector *wallVerts, FSurfaceInfo *Surf)
// Returns true if the midtexture is visible, and false if... it isn't... // Returns true if the midtexture is visible, and false if... it isn't...
static inline boolean HWR_BlendMidtextureSurface(FSurfaceInfo *pSurf) static inline boolean HWR_BlendMidtextureSurface(FSurfaceInfo *pSurf)
{ {
FUINT blendmode = PF_Masked | PF_Translucent; FUINT blendmode = PF_Masked;
pSurf->PolyColor.s.alpha = 0xFF; pSurf->PolyColor.s.alpha = 0xFF;
+3 -3
View File
@@ -1146,8 +1146,8 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
// Look at HWR_ProjectSprite for more // Look at HWR_ProjectSprite for more
{ {
md2_t *md2s; md2_t *md2s = NULL;
int skinnum; int skinnum = 0;
patch_t *gpatch, *blendgpatch; patch_t *gpatch, *blendgpatch;
GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL; GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL;
INT32 durs = spr->mobj->state->tics; INT32 durs = spr->mobj->state->tics;
@@ -1221,7 +1221,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
skinnum = (skin_t *)spr->mobj->localskin - skins; skinnum = (skin_t *)spr->mobj->localskin - skins;
} }
} }
else else if (spr->mobj->skin)
{ {
md2s = md2_playermodels; md2s = md2_playermodels;
skinnum = (skin_t *)spr->mobj->skin - skins; skinnum = (skin_t *)spr->mobj->skin - skins;
+1
View File
@@ -1931,6 +1931,7 @@ static void GenerateMipmaps(INT32 w, INT32 h, RGBA_t *tex, INT32 maxLOD, UINT32
{ {
if (samplePoint[p].s.alpha == 0) if (samplePoint[p].s.alpha == 0)
continue; continue;
sumR += samplePoint[p].s.red; sumR += samplePoint[p].s.red;
sumG += samplePoint[p].s.green; sumG += samplePoint[p].s.green;
sumB += samplePoint[p].s.blue; sumB += samplePoint[p].s.blue;
+5 -8
View File
@@ -472,9 +472,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
strlcat(msg, COM_Argv(ix + usedargs), msgspace); strlcat(msg, COM_Argv(ix + usedargs), msgspace);
} }
const size_t msglength = strlen(msg); if (strlen(msg) > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm
if (msglength > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm
{ {
// what we're gonna do now is check if the node exists // what we're gonna do now is check if the node exists
// with that logic, characters 4 and 5 are our numbers: // with that logic, characters 4 and 5 are our numbers:
@@ -528,7 +526,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
strlcpy(msg, newmsg, HU_MAXMSGLEN + 1); strlcpy(msg, newmsg, HU_MAXMSGLEN + 1);
} }
SendNetXCmd(XD_SAY, buf, msglength + 1 + msg-buf); SendNetXCmd(XD_SAY, buf, strlen(msg) + 1 + msg-buf);
} }
/** Send a message to everyone. /** Send a message to everyone.
@@ -779,12 +777,11 @@ static void Got_Saycmd(const UINT8 **p, INT32 playernum)
return; return;
} }
const size_t msglength = strlen(msg);
//check for invalid characters (0x80 or above) //check for invalid characters (0x80 or above)
{ {
size_t i; size_t i;
const size_t j = msglength; const size_t j = strlen(msg);
for (i = 0; i < j; i++) for (i = 0; i < j; i++)
{ {
if (msg[i] & 0x80) if (msg[i] & 0x80)
@@ -831,7 +828,7 @@ static void Got_Saycmd(const UINT8 **p, INT32 playernum)
} }
// Handle "/me" actions, but only in messages to everyone. // Handle "/me" actions, but only in messages to everyone.
if (target == 0 && msglength > 4 && strnicmp(msg, "/me ", 4) == 0) if (target == 0 && strlen(msg) > 4 && strnicmp(msg, "/me ", 4) == 0)
{ {
msg += 4; msg += 4;
action = true; action = true;
+1 -3
View File
@@ -3829,10 +3829,8 @@ static void K_drawKartMinimap(void)
} }
else else
{ {
const INT32 skinnum = K_GetMobjLocalSkinNum(mobj->skin, mobj->localskin, mobj->skinlocal);
// special case if startcolor is not the default (160 / Green) // special case if startcolor is not the default (160 / Green)
if (skinnum && skins[skinnum].starttranscolor != skins[0].starttranscolor) if (K_GetMobjSkin(mobj)->starttranscolor != skins[0].starttranscolor)
{ {
colormap = R_GetTranslationColormap(TC_DEFAULT, mobj->color, GTC_CACHE); colormap = R_GetTranslationColormap(TC_DEFAULT, mobj->color, GTC_CACHE);
} }
+61 -66
View File
@@ -71,12 +71,11 @@ consvar_t cv_stairjank = {"stairjank", "Off", CV_SAVE|CV_CALL, CV_OnOff, PDistor
consvar_t cv_stairjanksfx = {"stairjanksfx", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_stairjanksfx = {"stairjanksfx", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
//hardcode saltyhop mhhm //hardcode saltyhop mhhm
static void saltyhop_onchange(void); consvar_t cv_saltyhop = {"hardcodehop", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_saltyhop = {"hardcodehop", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, saltyhop_onchange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_saltyhopsfx = {"hardcodehopsfx", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_saltyhopsfx = {"hardcodehopsfx", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_saltysquish = {"hardcodehopsquish", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_saltysquish = {"hardcodehopsquish", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t saltyheight_t[] = {{FRACUNIT/4, "MIN"}, {2*FRACUNIT, "MAX"}, {0, NULL}}; static CV_PossibleValue_t saltyheight_t[] = {{FRACUNIT/4, "MIN"}, {2*FRACUNIT, "MAX"}, {0, NULL}};
consvar_t cv_saltyheight = {"hardcodehopheight", "1", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, saltyheight_t, saltyhop_onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_saltyheight = {"hardcodehopheight", "1", CV_FLOAT|CV_SAVE, saltyheight_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_saltyroll = {"hardcodehoproll", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_saltyroll = {"hardcodehoproll", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_squishdance = {"squishdance", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_squishdance = {"squishdance", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -84,23 +83,6 @@ consvar_t cv_squishdance = {"squishdance", "On", CV_SAVE, CV_OnOff, NULL, 0, NUL
static CV_PossibleValue_t squishdancespeed_cons_t[] = {{20, "MIN"}, {280, "MAX"}, {0, NULL}}; static CV_PossibleValue_t squishdancespeed_cons_t[] = {{20, "MIN"}, {280, "MAX"}, {0, NULL}};
consvar_t cv_squishdancespeed = {"squishdance_speed", "140", CV_SAVE, squishdancespeed_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_squishdancespeed = {"squishdance_speed", "140", CV_SAVE, squishdancespeed_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static void saltyhop_onchange(void)
{
// reset everything when toggling saltyhop
if (gamestate != GS_LEVEL)
return;
for (INT32 i = 0; i < MAXPLAYERS; i++)
{
player_t *player = &players[i];
if (!player || P_MobjWasRemoved(player->mo))
continue;
memset(&player->mo->salty, 0, sizeof(player->mo->salty));
}
}
// SOME IMPORTANT VARIABLES DEFINED IN DOOMDEF.H: // SOME IMPORTANT VARIABLES DEFINED IN DOOMDEF.H:
// gamespeed is cc (0 for easy, 1 for normal, 2 for hard) // gamespeed is cc (0 for easy, 1 for normal, 2 for hard)
// franticitems is Frantic Mode items, bool // franticitems is Frantic Mode items, bool
@@ -2194,7 +2176,7 @@ static void K_GetKartBoostPower(player_t *player)
// Technically, all mobjs that think can cause desynchs if they are spawned conditionally, so best we can do // Technically, all mobjs that think can cause desynchs if they are spawned conditionally, so best we can do
// is to hide them if you are in saltyhop jump // is to hide them if you are in saltyhop jump
if (dust && player->mo->salty.jump) if (dust && player->salty.jump)
dust->flags2 |= MF2_DONTDRAW; dust->flags2 |= MF2_DONTDRAW;
if (leveltime % 6 == 0) if (leveltime % 6 == 0)
@@ -3404,88 +3386,92 @@ static void K_SaltySquish(player_t *player)
static void K_QuiteSaltyHop(player_t *player) static void K_QuiteSaltyHop(player_t *player)
{ {
if (!cv_saltyhop.value) I_Assert(player != NULL);
return; I_Assert(!P_MobjWasRemoved(player->mo));
// what the fuck is this haya // what the fuck is this haya
mobj_t *pmo = player->mo; mobj_t *pmo = player->mo;
salty_t *psalt = &pmo->salty; salty_t *psalty = &player->salty;
if (!cv_saltyhop.value)
{
// reset before we leave
psalty->jump = psalty->ready = psalty->tapping = false;
psalty->momz = psalty->zoffset = 0;
return;
}
const boolean onground = P_IsObjectOnGround(pmo); const boolean onground = P_IsObjectOnGround(pmo);
// ready? // ready?
if (!player->kartstuff[k_jmp]) if (!player->kartstuff[k_jmp])
{ {
psalt->ready = true; psalty->ready = true;
psalt->tapping = false; psalty->tapping = false;
} }
else if (psalt->ready) else if (psalty->ready)
{ {
psalt->ready = false; psalty->ready = false;
psalt->tapping = true; psalty->tapping = true;
} }
else else
{ {
psalt->tapping = false; psalty->tapping = false;
} }
// GO! // GO!
if (!psalt->init) if (psalty->jump)
{
psalt->jump = false;
psalt->zoffset = 0;
psalt->momz = 0;
psalt->init = true;
}
else if (psalt->jump)
{ {
if (pmo->eflags & MFE_JUSTHITFLOOR) if (pmo->eflags & MFE_JUSTHITFLOOR)
{ {
psalt->zoffset = 0; psalty->zoffset = 0;
} }
else if (onground) else if (onground)
{ {
psalt->zoffset += psalt->momz; psalty->zoffset += psalty->momz;
psalt->momz -= (FRACUNIT*3/2); psalty->momz -= (FRACUNIT*3/2);
} }
else else
{ {
psalt->zoffset *= (49/50)*FRACUNIT; //psalty->zoffset *= (49/50)*FRACUNIT; // this just rounds down to 0 lol
psalt->momz = 0; psalty->zoffset = 0;
psalty->momz = 0;
} }
if (psalt->zoffset <= 0) if (psalty->zoffset <= 0)
{ {
if (cv_saltyhopsfx.value && !(pmo->eflags & MFE_JUSTHITFLOOR) && onground) if (cv_saltyhopsfx.value && !(pmo->eflags & MFE_JUSTHITFLOOR) && onground)
S_StartSound(pmo, sfx_s268); S_StartSound(pmo, sfx_s268);
psalt->jump = false; psalty->jump = false;
psalt->zoffset = 0; psalty->zoffset = 0;
psalt->momz = 0; psalty->momz = 0;
// shlamma damma // shlamma damma
if (cv_saltysquish.value) if (cv_saltysquish.value)
pmo->stretchslam += 8*FRACUNIT; pmo->stretchslam += 8*FRACUNIT;
} }
else if (cv_saltysquish.value && psalt->zoffset >= 0) else if (psalty->zoffset > 0)
{ {
// goofy ahh hack if (cv_saltysquish.value)
pmo->spriteyscale += (FRACUNIT/8); {
pmo->spritexscale -= (FRACUNIT/8); // goofy ahh hack
pmo->spriteyscale += (FRACUNIT/8);
pmo->spritexscale -= (FRACUNIT/8);
}
} }
pmo->spriteyoffset += FixedMul(psalt->zoffset, cv_saltyheight.value); pmo->spriteyoffset += FixedMul(psalty->zoffset, cv_saltyheight.value);
if (cv_saltyhopsfx.value) // Stop any and all drift sounds when hopping.
{ if (S_SoundPlaying(pmo, sfx_screec))
if (S_SoundPlaying(pmo, sfx_screec)) S_StopSoundByID(pmo, sfx_screec);
S_StopSoundByID(pmo, sfx_screec); if (S_SoundPlaying(pmo, sfx_drift))
if (S_SoundPlaying(pmo, sfx_drift)) S_StopSoundByID(pmo, sfx_drift);
S_StopSoundByID(pmo, sfx_drift);
}
} }
else if (psalt->tapping && onground && !player->kartstuff[k_spinouttimer] && !player->kartstuff[k_squishedtimer]) else if (psalty->tapping && onground && !player->kartstuff[k_spinouttimer] && !player->kartstuff[k_squishedtimer])
{ {
psalt->jump = true; psalty->jump = true;
psalt->zoffset = 0; psalty->zoffset = 0;
psalt->momz = 6*FRACUNIT; psalty->momz = 6*FRACUNIT;
if (cv_saltyhopsfx.value) if (cv_saltyhopsfx.value)
S_StartSound(pmo, sfx_s25a); S_StartSound(pmo, sfx_s25a);
} }
@@ -3512,7 +3498,7 @@ boolean K_ShouldSlopeRoll(mobj_t *mobj)
return false; return false;
// seeing a character rotate mid-hop looks really janky // seeing a character rotate mid-hop looks really janky
if (!cv_saltyroll.value && mobj->player && mobj->player->mo->salty.jump) if (!cv_saltyroll.value && mobj->player && mobj->player->salty.jump)
return false; return false;
return K_CheckSlopeRollDist(mobj); return K_CheckSlopeRollDist(mobj);
@@ -4337,7 +4323,6 @@ static void K_DoShrink(player_t *user)
} }
} }
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound)
{ {
if (mo->player && mo->player->spectator) if (mo->player && mo->player->spectator)
@@ -4913,7 +4898,12 @@ static void K_MoveHeldObjects(player_t *player)
case MT_JAWZ_SHIELD: case MT_JAWZ_SHIELD:
{ {
mobj_t *cur = player->mo->hnext; mobj_t *cur = player->mo->hnext;
fixed_t speed = ((8 - min(4, player->kartstuff[k_itemamount])) * cur->info->speed) / 7; fixed_t speed = 0;
if (cur == NULL)
return;
speed = ((8 - min(4, player->kartstuff[k_itemamount])) * cur->info->speed) / 7;
player->kartstuff[k_bananadrag] = 0; // Just to make sure player->kartstuff[k_bananadrag] = 0; // Just to make sure
@@ -4960,8 +4950,13 @@ static void K_MoveHeldObjects(player_t *player)
cur->flags &= ~MF_NOCLIPTHING; cur->flags &= ~MF_NOCLIPTHING;
if (!P_TryMove(cur, player->mo->x + cur->momx, player->mo->y + cur->momy, true)) if (!P_TryMove(cur, player->mo->x + cur->momx, player->mo->y + cur->momy, true))
{
P_SlideMove(cur, true); P_SlideMove(cur, true);
if (P_MobjWasRemovedCompat(cur))
continue;
}
if (P_IsObjectOnGround(player->mo)) if (P_IsObjectOnGround(player->mo))
{ {
if (P_MobjFlip(cur) > 0) if (P_MobjFlip(cur) > 0)
+1 -1
View File
@@ -100,7 +100,7 @@ static UINT8 cheatf_devmode(void)
if (menuactive && currentMenu != &MainDef) if (menuactive && currentMenu != &MainDef)
return 0; // Only on the main menu! return 0; // Only on the main menu!
S_StartSound(0, sfx_itemup); S_StartSound(NULL, sfx_itemup);
// Just unlock all the things and turn on -debug and console devmode. // Just unlock all the things and turn on -debug and console devmode.
G_SetGameModified(false, false); // might need to revist the latter later G_SetGameModified(false, false); // might need to revist the latter later
+107 -87
View File
@@ -7667,7 +7667,7 @@ static void M_DrawMPMainMenu(void)
{ {
char buf[28]; char buf[28];
strlcpy(buf, setupm_ip, sizeof(buf)); strlcpy(buf, setupm_ip, sizeof(buf));
V_DrawString(x+8,y+12, V_ALLOWLOWERCASE, buf); V_DrawString(x+8, y+12, V_ALLOWLOWERCASE, buf);
} }
else else
M_DrawTextInputScroll(x+8, y+12, &setupm_input_ip, 0, SETUPM_IP_MAXSIZE); M_DrawTextInputScroll(x+8, y+12, &setupm_input_ip, 0, SETUPM_IP_MAXSIZE);
@@ -8205,12 +8205,12 @@ static void M_DrawSetupMultiPlayerMenu(void)
case SKINMENUTYPE_EXTENDED: case SKINMENUTYPE_EXTENDED:
for (s = 0; s < SKINGRIDNEWWIDTH*SKINGRIDNEWHEIGHT; s++) for (s = 0; s < SKINGRIDNEWWIDTH*SKINGRIDNEWHEIGHT; s++)
{ {
INT32 x = ((s % SKINGRIDNEWWIDTH) * 18) + ((BASEVIDWIDTH / 2) - (18 * SKINGRIDNEWWIDTH) - 8) + 100 + SKINXSHIFT; //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4;
INT32 y = ((s / SKINGRIDNEWWIDTH) * 18) + ((BASEVIDHEIGHT / 2) - (18 * (SKINGRIDNEWWIDTH/2)) + 10); //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4;
INT32 calcs = s + (setupm_skinypos * SKINGRIDNEWWIDTH);
INT32 skinn; INT32 skinn;
patch_t *face; patch_t *face;
UINT8 *cmap; UINT8 *cmap;
const INT32 x = ((s % SKINGRIDNEWWIDTH) * 18) + ((BASEVIDWIDTH / 2) - (18 * SKINGRIDNEWWIDTH) - 8) + 100 + SKINXSHIFT; //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4;
const INT32 y = ((s / SKINGRIDNEWWIDTH) * 18) + ((BASEVIDHEIGHT / 2) - (18 * (SKINGRIDNEWWIDTH/2)) + 10); //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4;
const INT32 calcs = s + (setupm_skinypos * SKINGRIDNEWWIDTH);
if (calcs < numskins) if (calcs < numskins)
skinn = skinsorted[calcs]; skinn = skinsorted[calcs];
@@ -8231,10 +8231,10 @@ static void M_DrawSetupMultiPlayerMenu(void)
if (itemOn == 1) //has to be on skin select part if (itemOn == 1) //has to be on skin select part
{ {
patch_t *cursor; patch_t *cursor;
INT32 curx = (((setupm_skinselect % SKINGRIDNEWWIDTH) * 18) + ((BASEVIDWIDTH / 2) - (18 * SKINGRIDNEWWIDTH/2)) + SKINXSHIFT) + 20; const INT32 curx = (((setupm_skinselect % SKINGRIDNEWWIDTH) * 18) + ((BASEVIDWIDTH / 2) - (18 * SKINGRIDNEWWIDTH/2)) + SKINXSHIFT) + 20;
INT32 cury = (((setupm_skinselect / SKINGRIDNEWWIDTH) - setupm_skinypos) * 18) + ((BASEVIDHEIGHT / 2) - (18 * (SKINGRIDNEWWIDTH/2))+ 10); const INT32 cury = (((setupm_skinselect / SKINGRIDNEWWIDTH) - setupm_skinypos) * 18) + ((BASEVIDHEIGHT / 2) - (18 * (SKINGRIDNEWWIDTH/2))+ 10);
UINT8 cursorframe = (I_GetTime() / 4) % 7; const UINT8 cursorframe = (I_GetTime() / 4) % 7;
cursor = (patch_t *)W_CachePatchName(va("K_CHILI%d", cursorframe + 1), PU_PATCH); cursor = (patch_t *)W_CachePatchName(va("K_CHILI%d", cursorframe + 1), PU_PATCH);
V_DrawFixedPatch((curx << FRACBITS) - (FRACUNIT), (cury << FRACBITS) - (FRACUNIT), FRACUNIT+(FRACUNIT>>3), 0, cursor, NULL); V_DrawFixedPatch((curx << FRACBITS) - (FRACUNIT), (cury << FRACBITS) - (FRACUNIT), FRACUNIT+(FRACUNIT>>3), 0, cursor, NULL);
} }
@@ -8243,9 +8243,9 @@ static void M_DrawSetupMultiPlayerMenu(void)
case SKINMENUTYPE_GRID: case SKINMENUTYPE_GRID:
for (s = 0; s < SKINGRIDWIDTH*SKINGRIDHEIGHT; s++) for (s = 0; s < SKINGRIDWIDTH*SKINGRIDHEIGHT; s++)
{ {
INT32 x = ((s % SKINGRIDWIDTH) * 18) + ((BASEVIDWIDTH / 2) - (18 * SKINGRIDWIDTH) - 8) + 100 + SKINXSHIFT; //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4; const INT32 x = ((s % SKINGRIDWIDTH) * 18) + ((BASEVIDWIDTH / 2) - (18 * SKINGRIDWIDTH) - 8) + 100 + SKINXSHIFT; //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4;
INT32 y = ((s / SKINGRIDWIDTH) * 18) + ((BASEVIDHEIGHT / 2) - (18 * (SKINGRIDWIDTH/2))); //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4; const INT32 y = ((s / SKINGRIDWIDTH) * 18) + ((BASEVIDHEIGHT / 2) - (18 * (SKINGRIDWIDTH/2))); //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4;
INT32 calcs = s + (setupm_skinypos * SKINGRIDWIDTH); const INT32 calcs = s + (setupm_skinypos * SKINGRIDWIDTH);
INT16 skinn; INT16 skinn;
patch_t *face; patch_t *face;
UINT8 *cmap; UINT8 *cmap;
@@ -8269,36 +8269,44 @@ static void M_DrawSetupMultiPlayerMenu(void)
if (itemOn == 1) //has to be on skin select part if (itemOn == 1) //has to be on skin select part
{ {
patch_t *cursor; patch_t *cursor;
INT32 curx = (((setupm_skinselect % SKINGRIDWIDTH) * 18) + ((BASEVIDWIDTH / 2) - (18 * SKINGRIDWIDTH/2)) + SKINXSHIFT) + 20; const INT32 curx = (((setupm_skinselect % SKINGRIDWIDTH) * 18) + ((BASEVIDWIDTH / 2) - (18 * SKINGRIDWIDTH/2)) + SKINXSHIFT) + 20;
INT32 cury = (((setupm_skinselect / SKINGRIDWIDTH) - setupm_skinypos) * 18) + ((BASEVIDHEIGHT / 2) - (18 * (SKINGRIDWIDTH/2))); const INT32 cury = (((setupm_skinselect / SKINGRIDWIDTH) - setupm_skinypos) * 18) + ((BASEVIDHEIGHT / 2) - (18 * (SKINGRIDWIDTH/2)));
if (setupm_skinselect < numskins) if (setupm_skinselect < numskins)
{ {
UINT8 *cmap = R_GetTranslationColormap(setupm_skinselect, setupm_fakecolor, GTC_MENUCACHE); const UINT8 *cmap = R_GetTranslationColormap(setupm_skinselect, setupm_fakecolor, GTC_MENUCACHE);
cursor = facewantprefix[skinsorted[setupm_skinselect]]; cursor = facewantprefix[skinsorted[setupm_skinselect]];
V_DrawFixedPatch(((curx-8) << FRACBITS), ((cury-8) << FRACBITS), FRACUNIT, 0, cursor, cmap); V_DrawFixedPatch(((curx-8) << FRACBITS), ((cury-8) << FRACBITS), FRACUNIT, 0, cursor, cmap);
} }
else else
{ {
UINT8 cursorframe = (I_GetTime() / 4) % 7; const UINT8 cursorframe = (I_GetTime() / 4) % 7;
cursor = (patch_t *)W_CachePatchName(va("K_CHILI%d", cursorframe + 1), PU_PATCH); cursor = (patch_t *)W_CachePatchName(va("K_CHILI%d", cursorframe + 1), PU_PATCH);
V_DrawFixedPatch((curx << FRACBITS) - (FRACUNIT), (cury << FRACBITS) - (FRACUNIT), FRACUNIT+(FRACUNIT>>3), 0, cursor, NULL); V_DrawFixedPatch((curx << FRACBITS) - (FRACUNIT), (cury << FRACBITS) - (FRACUNIT), FRACUNIT+(FRACUNIT>>3), 0, cursor, NULL);
} }
} }
{ // stat dot { // stat dot
INT32 selectedskin = (itemOn == 1 && setupm_skinselect < numskins ? skinsorted[setupm_skinselect] : setupm_fakeskin); const INT32 selectedskin = (itemOn == 1 && setupm_skinselect < numskins ? skinsorted[setupm_skinselect] : setupm_fakeskin);
speed = skins[selectedskin].kartspeed; speed = skins[selectedskin].kartspeed;
weight = skins[selectedskin].kartweight; weight = skins[selectedskin].kartweight;
statdot = (patch_t *)W_CachePatchName("K_SDOT1", PU_PATCH);
if (skullAnimCounter < 4) // SRB2Kart: we draw this dot later so that it's not covered if there's multiple skins with the same stats
V_DrawFixedPatch((((statx+46) + (speed*4))<<FRACBITS) + (FRACUNIT>>1), (((staty+71) + (weight*4))<<FRACBITS), FRACUNIT>>1, 0, statdot, flashcol);
else
V_DrawFixedPatch((((statx+46) + (speed*4))<<FRACBITS) + (FRACUNIT>>1), (((staty+71) + (weight*4))<<FRACBITS), FRACUNIT>>1, 0, statdot, NULL);
statdot = (patch_t *)W_CachePatchName("K_SDOT2", PU_PATCH); // coloured center const INT32 x = (((statx+46) + (speed*4))<<FRACBITS) + (FRACUNIT>>1);
const INT32 y = (((staty+71) + (weight*4))<<FRACBITS);
statdot = (patch_t *)W_CachePatchName("K_SDOT1", PU_PATCH);
if (skullAnimCounter < 4) // SRB2Kart: we draw this dot later so that it's not covered if there's multiple skins with the same stats
V_DrawFixedPatch(x, y, FRACUNIT>>1, 0, statdot, flashcol);
else
V_DrawFixedPatch(x, y, FRACUNIT>>1, 0, statdot, NULL);
if (setupm_fakecolor) if (setupm_fakecolor)
V_DrawFixedPatch((((statx+46) + (speed*4))<<FRACBITS) + (FRACUNIT>>1), (((staty+71) + (weight*4))<<FRACBITS), FRACUNIT>>1, 0, statdot, R_GetTranslationColormap(0, setupm_fakecolor, GTC_MENUCACHE)); {
statdot = (patch_t *)W_CachePatchName("K_SDOT2", PU_PATCH); // coloured center
V_DrawFixedPatch(x, y, FRACUNIT>>1, 0, statdot, R_GetTranslationColormap(0, setupm_fakecolor, GTC_MENUCACHE));
}
} }
break; break;
case SKINMENUTYPE_2D: case SKINMENUTYPE_2D:
@@ -8307,12 +8315,13 @@ static void M_DrawSetupMultiPlayerMenu(void)
{ {
for (w = 0; w < MAXSTAT; w++) for (w = 0; w < MAXSTAT; w++)
{ {
INT32 x = ((s * 18) + ((BASEVIDWIDTH / 2) - (18 * 4)) - 8 + SKINXSHIFT); //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4;
INT32 y = ((w * 18) + ((BASEVIDHEIGHT / 2) - (18 * 4)) - 8); //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4;
INT32 skinn; INT32 skinn;
patch_t *face; patch_t *face;
UINT8 *cmap; UINT8 *cmap;
const INT32 x = ((s * 18) + ((BASEVIDWIDTH / 2) - (18 * 4)) - 8 + SKINXSHIFT); //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4;
const INT32 y = ((w * 18) + ((BASEVIDHEIGHT / 2) - (18 * 4)) - 8); //BASEVIDWIDTH / 2 - ((icons + 1) * 24) - 4;
if (!skinstatscount[s][w]) if (!skinstatscount[s][w])
{ {
V_DrawFill(x, y, 16, 16, 239); V_DrawFill(x, y, 16, 16, 239);
@@ -8330,20 +8339,20 @@ static void M_DrawSetupMultiPlayerMenu(void)
if (itemOn == 1) //has to be on skin select part if (itemOn == 1) //has to be on skin select part
{ {
patch_t *cursor; patch_t *cursor;
INT32 curx = ((setupm_skinxpos * 18) + ((BASEVIDWIDTH / 2) - (18 * 4)) - 8 + SKINXSHIFT); const INT32 curx = ((setupm_skinxpos * 18) + ((BASEVIDWIDTH / 2) - (18 * 4)) - 8 + SKINXSHIFT);
INT32 cury = ((setupm_skinypos * 18) + ((BASEVIDHEIGHT / 2) - (18 * 4)) - 8); const INT32 cury = ((setupm_skinypos * 18) + ((BASEVIDHEIGHT / 2) - (18 * 4)) - 8);
if (skinstatscount[setupm_skinxpos][setupm_skinypos]) if (skinstatscount[setupm_skinxpos][setupm_skinypos])
{ {
UINT8 *cmap = R_GetTranslationColormap(setupm_skinselect, setupm_fakecolor, GTC_MENUCACHE); const UINT8 *cmap = R_GetTranslationColormap(setupm_skinselect, setupm_fakecolor, GTC_MENUCACHE);
INT32 skinn = skinstats[setupm_skinxpos][setupm_skinypos][(I_GetTime() / TICRATE) % skinstatscount[setupm_skinxpos][setupm_skinypos]]; const INT32 skinn = skinstats[setupm_skinxpos][setupm_skinypos][(I_GetTime() / TICRATE) % skinstatscount[setupm_skinxpos][setupm_skinypos]];
cursor = facewantprefix[skinn]; cursor = facewantprefix[skinn];
V_DrawFixedPatch(((curx-8) << FRACBITS), ((cury-8) << FRACBITS), FRACUNIT, 0, cursor, cmap); V_DrawFixedPatch(((curx-8) << FRACBITS), ((cury-8) << FRACBITS), FRACUNIT, 0, cursor, cmap);
} }
else else
{ {
UINT8 cursorframe = (I_GetTime() / 4) % 7; const UINT8 cursorframe = (I_GetTime() / 4) % 7;
cursor = (patch_t *)W_CachePatchName(va("K_CHILI%d", cursorframe + 1), PU_PATCH); cursor = (patch_t *)W_CachePatchName(va("K_CHILI%d", cursorframe + 1), PU_PATCH);
V_DrawFixedPatch((curx << FRACBITS) - (FRACUNIT), (cury << FRACBITS) - (FRACUNIT), FRACUNIT+(FRACUNIT>>3), 0, cursor, NULL); V_DrawFixedPatch((curx << FRACBITS) - (FRACUNIT), (cury << FRACBITS) - (FRACUNIT), FRACUNIT+(FRACUNIT>>3), 0, cursor, NULL);
} }
@@ -8351,18 +8360,26 @@ static void M_DrawSetupMultiPlayerMenu(void)
break; break;
#undef SKINXSHIFT #undef SKINXSHIFT
default: default:
speed = skins[setupm_fakeskin].kartspeed; {
weight = skins[setupm_fakeskin].kartweight; speed = skins[setupm_fakeskin].kartspeed;
weight = skins[setupm_fakeskin].kartweight;
statdot = (patch_t *)W_CachePatchName("K_SDOT1", PU_PATCH); const INT32 x = ((BASEVIDWIDTH - mx - 80) + ((speed-1)*8))<<FRACBITS;
if (skullAnimCounter < 4) // SRB2Kart: we draw this dot later so that it's not covered if there's multiple skins with the same stats const INT32 y = ((my+76) + ((weight-1)*8))<<FRACBITS;
V_DrawFixedPatch(((BASEVIDWIDTH - mx - 80) + ((speed-1)*8))<<FRACBITS, ((my+76) + ((weight-1)*8))<<FRACBITS, FRACUNIT, 0, statdot, flashcol);
else
V_DrawFixedPatch(((BASEVIDWIDTH - mx - 80) + ((speed-1)*8))<<FRACBITS, ((my+76) + ((weight-1)*8))<<FRACBITS, FRACUNIT, 0, statdot, NULL);
statdot = (patch_t *)W_CachePatchName("K_SDOT2", PU_PATCH); // coloured center statdot = (patch_t *)W_CachePatchName("K_SDOT1", PU_PATCH);
if (setupm_fakecolor)
V_DrawFixedPatch(((BASEVIDWIDTH - mx - 80) + ((speed-1)*8))<<FRACBITS, ((my+76) + ((weight-1)*8))<<FRACBITS, FRACUNIT, 0, statdot, R_GetTranslationColormap(0, setupm_fakecolor, GTC_MENUCACHE)); if (skullAnimCounter < 4) // SRB2Kart: we draw this dot later so that it's not covered if there's multiple skins with the same stats
V_DrawFixedPatch(x, y, FRACUNIT, 0, statdot, flashcol);
else
V_DrawFixedPatch(x, y, FRACUNIT, 0, statdot, NULL);
if (setupm_fakecolor)
{
statdot = (patch_t *)W_CachePatchName("K_SDOT2", PU_PATCH); // coloured center
V_DrawFixedPatch(x, y, FRACUNIT, 0, statdot, R_GetTranslationColormap(0, setupm_fakecolor, GTC_MENUCACHE));
}
}
break; break;
} }
@@ -8389,10 +8406,13 @@ static void M_DrawSetupMultiPlayerMenu(void)
cw = charw; cw = charw;
else else
cw = indexwidth; cw = indexwidth;
for (ch = 0; ch < 16; ch++) for (ch = 0; ch < 16; ch++)
V_DrawFill(x, my+(cv_skinselectmenu.value?176:162)+ch, cw, 1, colortranslations[col][ch]); V_DrawFill(x, my+(cv_skinselectmenu.value?176:162)+ch, cw, 1, colortranslations[col][ch]);
if (++col >= MAXSKINCOLORS) if (++col >= MAXSKINCOLORS)
col -= MAXSKINCOLORS-1; col -= MAXSKINCOLORS-1;
x += cw; x += cw;
} }
} }
@@ -8420,6 +8440,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
if (col < 0) if (col < 0)
col += numskins; col += numskins;
while (k <= icons) while (k <= icons)
{ {
if (!(k++)) if (!(k++))
@@ -8436,12 +8457,16 @@ static void M_DrawSetupMultiPlayerMenu(void)
offx = 8; offx = 8;
offy = 8; offy = 8;
} }
colmap = R_GetTranslationColormap(col, setupm_fakecolor, GTC_MENUCACHE); colmap = R_GetTranslationColormap(col, setupm_fakecolor, GTC_MENUCACHE);
V_DrawFixedPatch((x+offx)<<FRACBITS, (my+28+offy)<<FRACBITS, FRACUNIT, 0, face, colmap); V_DrawFixedPatch((x+offx)<<FRACBITS, (my+28+offy)<<FRACBITS, FRACUNIT, 0, face, colmap);
if (scale == FRACUNIT) // bit of a hack if (scale == FRACUNIT) // bit of a hack
V_DrawFixedPatch((x+offx)<<FRACBITS, (my+28+offy)<<FRACBITS, FRACUNIT, 0, cursor, colmap); V_DrawFixedPatch((x+offx)<<FRACBITS, (my+28+offy)<<FRACBITS, FRACUNIT, 0, cursor, colmap);
if (++col >= numskins) if (++col >= numskins)
col -= numskins; col -= numskins;
x += FixedMul(iconwidth<<FRACBITS, 3*scale/2)/FRACUNIT; x += FixedMul(iconwidth<<FRACBITS, 3*scale/2)/FRACUNIT;
} }
} }
@@ -8582,6 +8607,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
} }
else else
M_NextOpt(); M_NextOpt();
S_StartSound(NULL, sfx_menu1); // Tails S_StartSound(NULL, sfx_menu1); // Tails
break; break;
} }
@@ -8608,6 +8634,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
{ {
M_NextOpt(); M_NextOpt();
} }
S_StartSound(NULL, sfx_menu1); S_StartSound(NULL, sfx_menu1);
} }
else if (itemOn == 0) else if (itemOn == 0)
@@ -8618,9 +8645,11 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
} }
else else
M_NextOpt(); M_NextOpt();
S_StartSound(NULL, sfx_menu1); // Tails S_StartSound(NULL, sfx_menu1); // Tails
break; break;
} }
M_NextOpt(); M_NextOpt();
S_StartSound(NULL, sfx_menu1); // Tails S_StartSound(NULL, sfx_menu1); // Tails
break; break;
@@ -8638,6 +8667,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
} }
else else
M_PrevOpt(); M_PrevOpt();
S_StartSound(NULL, sfx_menu1); // Tails S_StartSound(NULL, sfx_menu1); // Tails
break; break;
} }
@@ -8656,6 +8686,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
{ {
M_PrevOpt(); M_PrevOpt();
} }
S_StartSound(NULL, sfx_menu1); S_StartSound(NULL, sfx_menu1);
} }
else if (itemOn == 2) else if (itemOn == 2)
@@ -8675,9 +8706,11 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
} }
else else
M_PrevOpt(); M_PrevOpt();
S_StartSound(NULL, sfx_menu1); // Tails S_StartSound(NULL, sfx_menu1); // Tails
break; break;
} }
M_PrevOpt(); M_PrevOpt();
S_StartSound(NULL, sfx_menu1); // Tails S_StartSound(NULL, sfx_menu1); // Tails
break; break;
@@ -8696,6 +8729,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
setupm_skinselect--; setupm_skinselect--;
else else
setupm_skinselect = SELECTEDSTATSCOUNT - 1; setupm_skinselect = SELECTEDSTATSCOUNT - 1;
S_StartSound(NULL, sfx_menu1); S_StartSound(NULL, sfx_menu1);
} }
else //player skin else //player skin
@@ -8728,6 +8762,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
else if (cv_skinselectmenu.value == SKINMENUTYPE_EXTENDED) else if (cv_skinselectmenu.value == SKINMENUTYPE_EXTENDED)
setupm_skinypos = (((roundedskins/8) - SKINGRIDHEIGHT-2) > 0 ? (roundedskins/8) - SKINGRIDHEIGHT-2 : 0); setupm_skinypos = (((roundedskins/8) - SKINGRIDHEIGHT-2) > 0 ? (roundedskins/8) - SKINGRIDHEIGHT-2 : 0);
} }
S_StartSound(NULL, sfx_menu1); S_StartSound(NULL, sfx_menu1);
break; break;
} }
@@ -8758,6 +8793,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
setupm_skinselect++; setupm_skinselect++;
else else
setupm_skinselect = 0; setupm_skinselect = 0;
S_StartSound(NULL, sfx_menu1); S_StartSound(NULL, sfx_menu1);
} }
else //player skin else //player skin
@@ -8792,6 +8828,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
setupm_skinselect = 0; setupm_skinselect = 0;
setupm_skinypos = 0; setupm_skinypos = 0;
} }
S_StartSound(NULL, sfx_menu1); S_StartSound(NULL, sfx_menu1);
break; break;
} }
@@ -8814,12 +8851,14 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
setupm_skinlockedselect = false; setupm_skinlockedselect = false;
break; break;
} }
exitmenu = true; exitmenu = true;
break; break;
case KEY_BACKSPACE: case KEY_BACKSPACE:
if (cv_skinselectmenu.value) if (cv_skinselectmenu.value)
BREAKWHENLOCKED BREAKWHENLOCKED
if (itemOn == 0) if (itemOn == 0)
{ {
M_TextInputHandle(&setupm_input, choice); M_TextInputHandle(&setupm_input, choice);
@@ -8849,6 +8888,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
case KEY_DEL: case KEY_DEL:
if (cv_skinselectmenu.value) if (cv_skinselectmenu.value)
BREAKWHENLOCKED BREAKWHENLOCKED
if (itemOn == 0) if (itemOn == 0)
{ {
M_TextInputHandle(&setupm_input, choice); M_TextInputHandle(&setupm_input, choice);
@@ -9165,7 +9205,7 @@ static void M_DrawJoystick(void)
compareval4 = cv_usejoystick[3].value; compareval4 = cv_usejoystick[3].value;
compareval3 = cv_usejoystick[2].value; compareval3 = cv_usejoystick[2].value;
compareval2 = cv_usejoystick[1].value; compareval2 = cv_usejoystick[1].value;
compareval = cv_usejoystick[0].value; compareval = cv_usejoystick[0].value;
#endif #endif
if ((setupcontrolplayer == 4 && (i == compareval4)) if ((setupcontrolplayer == 4 && (i == compareval4))
@@ -9204,14 +9244,13 @@ void M_SetupJoystickMenu(INT32 choice)
// //
// Update cv_usejoystick.string here so that the user can // Update cv_usejoystick.string here so that the user can
// properly change this value. // properly change this value.
if (i == cv_usejoystick[0].value) for (INT32 f = 0; f < MAXSPLITSCREENPLAYERS; f++)
CV_SetValue(&cv_usejoystick[0], i); {
if (i == cv_usejoystick[1].value) if (i == cv_usejoystick[f].value)
CV_SetValue(&cv_usejoystick[1], i); {
if (i == cv_usejoystick[2].value) CV_SetValue(&cv_usejoystick[f], i);
CV_SetValue(&cv_usejoystick[2], i); }
if (i == cv_usejoystick[3].value) }
CV_SetValue(&cv_usejoystick[3], i);
#endif #endif
} }
@@ -9250,9 +9289,11 @@ static void M_Setup4PJoystickMenu(INT32 choice)
static void M_DoAssignJoystick(UINT8 pnum, INT32 choice) static void M_DoAssignJoystick(UINT8 pnum, INT32 choice)
{ {
INT32 oldchoice, oldstringchoice; INT32 oldchoice, oldstringchoice;
const int joynum = atoi(cv_usejoystick[pnum].string);
oldchoice = oldstringchoice = joynum > numcontrollers ? joynum : cv_usejoystick[pnum].value; #define joystrnum (atoi(cv_usejoystick[pnum].string))
#define joyoldchoice ((joystrnum > numcontrollers) ? joystrnum : cv_usejoystick[pnum].value)
oldchoice = oldstringchoice = joyoldchoice;
CV_SetValue(&cv_usejoystick[pnum], choice); CV_SetValue(&cv_usejoystick[pnum], choice);
// Just in case last-minute changes were made to cv_usejoystick.value, // Just in case last-minute changes were made to cv_usejoystick.value,
@@ -9262,59 +9303,37 @@ static void M_DoAssignJoystick(UINT8 pnum, INT32 choice)
{ {
CV_SetValue(&cv_usejoystick[pnum], cv_usejoystick[pnum].value); CV_SetValue(&cv_usejoystick[pnum], cv_usejoystick[pnum].value);
if (oldchoice > numcontrollers) /* reset this so the comparison is valid*/ // reset this so the comparison is valid
if (oldchoice > numcontrollers)
oldchoice = cv_usejoystick[pnum].value; oldchoice = cv_usejoystick[pnum].value;
if (oldchoice != choice) if (oldchoice != choice)
{ {
if (choice && oldstringchoice > numcontrollers) // if we did not select "None", we likely selected a used device if (choice && oldstringchoice > numcontrollers) // if we did not select "None", we likely selected a used device
CV_SetValue(&cv_usejoystick[pnum], (oldstringchoice > numcontrollers ? oldstringchoice : oldchoice)); {
CV_SetValue(&cv_usejoystick[pnum], ((oldstringchoice > numcontrollers) ? oldstringchoice : oldchoice));
}
if (oldstringchoice == if (oldstringchoice == joyoldchoice)
(joynum > numcontrollers ? joynum : cv_usejoystick[pnum].value)) {
M_StartMessage("This joystick is used by another\n" M_StartMessage("This joystick is used by another\n"
"player. Reset the joystick\n" "player. Reset the joystick\n"
"for that player first.\n\n" "for that player first.\n\n"
"(Press a key)\n", NULL, MM_NOTHING); "(Press a key)\n", NULL, MM_NOTHING);
}
} }
} }
#undef joystrnum
#undef joyoldchoice
} }
#endif #endif
static void M_AssignJoystick(INT32 choice) static void M_AssignJoystick(INT32 choice)
{ {
#ifdef JOYSTICK_HOTPLUG #ifdef JOYSTICK_HOTPLUG
switch (setupcontrolplayer) M_DoAssignJoystick((setupcontrolplayer-1), choice);
{
case 4:
M_DoAssignJoystick(3, choice);
break;
case 3:
M_DoAssignJoystick(2, choice);
break;
case 2:
M_DoAssignJoystick(1, choice);
break;
case 1:
M_DoAssignJoystick(0, choice);
break;
}
#else #else
switch (setupcontrolplayer) CV_SetValue(&cv_usejoystick[(setupcontrolplayer-1)], choice);
{
case 4:
CV_SetValue(&cv_usejoystick[3], choice);
break;
case 3:
CV_SetValue(&cv_usejoystick[2], choice);
break;
case 2:
CV_SetValue(&cv_usejoystick[1], choice);
break;
case 1:
CV_SetValue(&cv_usejoystick[0], choice);
break;
}
#endif #endif
} }
@@ -9352,7 +9371,7 @@ static void M_SetupControlsMenu(UINT8 pnum)
{ {
// Hide P1-only controls // Hide P1-only controls
OP_AllControlsMenu[19].status = IT_GRAYEDOUT2; // Chat OP_AllControlsMenu[19].status = IT_GRAYEDOUT2; // Chat
OP_AllControlsMenu[10].status = IT_GRAYEDOUT2; // Rankings OP_AllControlsMenu[20].status = IT_GRAYEDOUT2; // Rankings
OP_AllControlsMenu[21].status = IT_GRAYEDOUT2; // Pause OP_AllControlsMenu[21].status = IT_GRAYEDOUT2; // Pause
OP_AllControlsMenu[22].status = IT_GRAYEDOUT2; // Screenshot OP_AllControlsMenu[22].status = IT_GRAYEDOUT2; // Screenshot
OP_AllControlsMenu[23].status = IT_GRAYEDOUT2; // GIF OP_AllControlsMenu[23].status = IT_GRAYEDOUT2; // GIF
@@ -9364,7 +9383,7 @@ static void M_SetupControlsMenu(UINT8 pnum)
{ {
// Unhide P1-only controls // Unhide P1-only controls
OP_AllControlsMenu[19].status = IT_CONTROL; // Chat OP_AllControlsMenu[19].status = IT_CONTROL; // Chat
OP_AllControlsMenu[10].status = IT_CONTROL; // Rankings OP_AllControlsMenu[20].status = IT_CONTROL; // Rankings
OP_AllControlsMenu[21].status = IT_CONTROL; // Pause OP_AllControlsMenu[21].status = IT_CONTROL; // Pause
OP_AllControlsMenu[22].status = IT_CONTROL; // Screenshot OP_AllControlsMenu[22].status = IT_CONTROL; // Screenshot
OP_AllControlsMenu[23].status = IT_CONTROL; // GIF OP_AllControlsMenu[23].status = IT_CONTROL; // GIF
@@ -9910,6 +9929,7 @@ static void M_DrawLocalSkinMenu(void)
V_DrawFill(mx + 220 - (charw/2), my+54, charw, 84, 239); V_DrawFill(mx + 220 - (charw/2), my+54, charw, 84, 239);
#undef charw #undef charw
// FIXME: is skins[displayskin.localnum] even correct?
UINT8 *colormap = R_GetLocalTranslationColormap(&skins[displayskin.localnum], (displayskin.localskin ? &localskins[displayskin.localnum] : NULL), cv_playercolor.value, GTC_MENUCACHE, displayskin.localskin); UINT8 *colormap = R_GetLocalTranslationColormap(&skins[displayskin.localnum], (displayskin.localskin ? &localskins[displayskin.localnum] : NULL), cv_playercolor.value, GTC_MENUCACHE, displayskin.localskin);
V_DrawMappedPatch(mx, my+50, 0, (patch_t *)W_CachePatchName(displayskin.facewant, PU_PATCH), colormap); V_DrawMappedPatch(mx, my+50, 0, (patch_t *)W_CachePatchName(displayskin.facewant, PU_PATCH), colormap);
@@ -9927,7 +9947,7 @@ static void M_DrawLocalSkinMenu(void)
my += 120; my += 120;
#ifdef HWRENDER #ifdef HWRENDER
md2_t *md2 = (displayskin.localskin ? &md2_localplayermodels[skintodisplay] : &md2_playermodels[skintodisplay]); md2_t *md2 = (displayskin.localskin ? &md2_localplayermodels[displayskin.localnum] : &md2_playermodels[skintodisplay]);
// if we have 3d models enabled and a model exists // if we have 3d models enabled and a model exists
// try to show it instead of the sprite // try to show it instead of the sprite
+1
View File
@@ -418,6 +418,7 @@ boolean P_CheckSector(sector_t *sector, boolean crunch);
void P_DelSeclist(msecnode_t *node); void P_DelSeclist(msecnode_t *node);
void P_CreateSecNodeList(mobj_t *thing, fixed_t x, fixed_t y); void P_CreateSecNodeList(mobj_t *thing, fixed_t x, fixed_t y);
void P_Initsecnode(void);
void P_RadiusAttack(mobj_t *spot, mobj_t *source, fixed_t damagedist); void P_RadiusAttack(mobj_t *spot, mobj_t *source, fixed_t damagedist);
+33 -1
View File
@@ -3983,19 +3983,51 @@ boolean P_CheckSector(sector_t *sector, boolean crunch)
Lots of new Boom functions that work faster and add functionality. Lots of new Boom functions that work faster and add functionality.
*/ */
#ifndef PHOBOS_BUILD
static msecnode_t *headsecnode = NULL;
#endif
void P_Initsecnode(void)
{
#ifndef PHOBOS_BUILD
headsecnode = NULL;
#endif
}
// P_GetSecnode() retrieves a node from the freelist. The calling routine // P_GetSecnode() retrieves a node from the freelist. The calling routine
// should make sure it sets all fields properly. // should make sure it sets all fields properly.
static msecnode_t *P_GetSecnode(void) static msecnode_t *P_GetSecnode(void)
{ {
#ifdef PHOBOS_BUILD
return Z_LevelPoolCalloc(sizeof(msecnode_t)); return Z_LevelPoolCalloc(sizeof(msecnode_t));
#else
msecnode_t *node;
if (headsecnode)
{
// vanilla does not clear this
// so for compat reasons we also dont
// means we just reuse stale data which causes weird interactions with orbiting items in some cases
node = headsecnode;
headsecnode = headsecnode->m_thinglist_next;
}
else
node = Z_LevelPoolCalloc(sizeof(msecnode_t));
return node;
#endif
} }
// P_PutSecnode() returns a node to the freelist. // P_PutSecnode() returns a node to the freelist.
static inline void P_PutSecnode(msecnode_t *node) static inline void P_PutSecnode(msecnode_t *node)
{ {
#ifdef PHOBOS_BUILD
Z_LevelPoolFree(node, sizeof(msecnode_t)); Z_LevelPoolFree(node, sizeof(msecnode_t));
#else
node->m_thinglist_next = headsecnode;
headsecnode = node;
#endif
} }
// P_AddSecnode() searches the current list to see if this sector is // P_AddSecnode() searches the current list to see if this sector is
+1 -2
View File
@@ -1148,7 +1148,6 @@ static void P_SceneryXYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy)
{ {
// Stolen from P_SpawnFriction // Stolen from P_SpawnFriction
mo->friction = FRACUNIT - 0x100; mo->friction = FRACUNIT - 0x100;
//mo->movefactor = ((0x10092 - mo->friction)*(0x70))/0x158;
} }
else else
mo->friction = ORIG_FRICTION; mo->friction = ORIG_FRICTION;
@@ -3282,6 +3281,7 @@ void P_CalcChasePostImg(player_t *player, camera_t *thiscam)
postimgtype |= POSTIMG_FLIP; postimgtype |= POSTIMG_FLIP;
#ifdef HWRENDER #ifdef HWRENDER
// the rest of those effects wont work in gl splitscreen
if (rendermode == render_opengl && splitscreen) if (rendermode == render_opengl && splitscreen)
{ {
thiscam->postimg = postimgtype; thiscam->postimg = postimgtype;
@@ -3507,7 +3507,6 @@ static void P_CheckFloatbobPlatforms(mobj_t *mobj)
if (!(rover->flags & FF_FLOATBOB)) if (!(rover->flags & FF_FLOATBOB))
continue; continue;
if (mobj->eflags & MFE_VERTICALFLIP) if (mobj->eflags & MFE_VERTICALFLIP)
{ {
if (abs(*rover->bottomheight - (mobj->z + mobj->height)) > abs(mobj->momz)) if (abs(*rover->bottomheight - (mobj->z + mobj->height)) > abs(mobj->momz))
-12
View File
@@ -266,15 +266,6 @@ typedef enum {
PCF_THUNK = 1<<5, // Ran the thinker this tic. PCF_THUNK = 1<<5, // Ran the thinker this tic.
} precipflag_t; } precipflag_t;
typedef struct salty_s
{
bool init;
bool ready;
bool tapping;
fixed_t zoffset;
fixed_t momz;
bool jump;
} salty_t;
// Map Object definition. // Map Object definition.
typedef struct mobj_s typedef struct mobj_s
@@ -412,9 +403,6 @@ typedef struct mobj_s
tic_t slamsoundtimer; // Funni slam sound when landing tic_t slamsoundtimer; // Funni slam sound when landing
// saltyhop! hardcode edition
salty_t salty;
// WARNING: New fields must be added separately to savegame and Lua. // WARNING: New fields must be added separately to savegame and Lua.
boolean islocal; // BEWARE: islocal does not exist in vanilla, strictly to be used for locally loaded addons to not cause desynchs with the mobj linedef trigger check. DO NOT USE THIS IN ACTUAL ADDONS YOU INTEND TO USE ON YOUR SERVER boolean islocal; // BEWARE: islocal does not exist in vanilla, strictly to be used for locally loaded addons to not cause desynchs with the mobj linedef trigger check. DO NOT USE THIS IN ACTUAL ADDONS YOU INTEND TO USE ON YOUR SERVER
} mobj_t; } mobj_t;
+3
View File
@@ -3001,6 +3001,9 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
CON_Drawer(); // let the user know what we are going to do CON_Drawer(); // let the user know what we are going to do
I_FinishUpdate(); // page flip or blit buffer I_FinishUpdate(); // page flip or blit buffer
// Initialize sector node list.
P_Initsecnode();
if (netgame || multiplayer) if (netgame || multiplayer)
cv_debug = botskin = 0; cv_debug = botskin = 0;
+17 -11
View File
@@ -1017,7 +1017,7 @@ boolean P_IsLocalPlayer(const player_t *player)
} }
// //
// P_IsLocalPlayer // P_IsLocalPlayerNum
// //
// Returns true if playernum is // Returns true if playernum is
// on the local machine. // on the local machine.
@@ -4516,27 +4516,33 @@ static void DoABarrelRoll(player_t *player)
static void P_DoFunnyDance(player_t *player) static void P_DoFunnyDance(player_t *player)
{ {
fixed_t bpm; // 140bpm ish fixed_t bpm; // 140bpm ish
fixed_t work, ang, bounce; // hehe squishy
if (player->spectator || !player->mo || player->kartstuff[k_respawn] || player->mo->salty.jump) // this looks jank as hell during hop I_Assert(player != NULL);
I_Assert(!P_MobjWasRemoved(player->mo));
if (player->spectator)
return; return;
player->squishdance.bounce = 0; // this looks jank as hell during hop or respawn
if (player->kartstuff[k_respawn] || player->salty.jump)
return;
// bpm = FixedDiv((60*TICRATE)<<FRACBITS, FLOAT_TO_FIXED(mapmusic.bpm)); << maybe can get the tempo and beat detection lib to work for bpm autodetection // bpm = FixedDiv((60*TICRATE)<<FRACBITS, FLOAT_TO_FIXED(mapmusic.bpm)); << maybe can get the tempo and beat detection lib to work for bpm autodetection
bpm = FixedDiv((60*TICRATE)<<FRACBITS, FLOAT_TO_FIXED((float)cv_squishdancespeed.value)); bpm = ((60*TICRATE) / (cv_squishdancespeed.value)) << FRACBITS;
player->squishdance.work = (player->squishdance.time << FRACBITS) % bpm; work = (player->squishdance.time << FRACBITS) % bpm;
if (player->squishdance.time >= (FRACUNIT >> 1)) // prevent overflow jump - takes about 15 minutes if (player->squishdance.time >= (FRACUNIT >> 1)) // prevent overflow jump - takes about 15 minutes
player->squishdance.time = (player->squishdance.work >> FRACBITS); player->squishdance.time = (work >> FRACBITS);
player->squishdance.work = FixedDiv(player->squishdance.work*180, bpm); work = FixedDiv(work*180, bpm);
player->squishdance.ang = ((FixedAngle(player->squishdance.work) >> ANGLETOFINESHIFT) & FINEMASK); ang = ((FixedAngle(work) >> ANGLETOFINESHIFT) & FINEMASK);
player->squishdance.bounce = ((FINESINE(player->squishdance.ang) - FRACUNIT/2) / 2); bounce = ((FINESINE(ang) - FRACUNIT/2) / 2);
player->mo->spritexscale -= player->squishdance.bounce; player->mo->spritexscale -= bounce;
player->mo->spriteyscale += player->squishdance.bounce; player->mo->spriteyscale += bounce;
player->squishdance.time++; player->squishdance.time++;
} }
+10 -12
View File
@@ -174,15 +174,10 @@ static void BlendTab_Translucent(UINT8 *table, int style, UINT8 blendamt)
{ {
frontrgba = pGammaCorrectedPalette[fg]; frontrgba = pGammaCorrectedPalette[fg];
#if 0 // perfect implementation
result.rgba = ASTBlendPixel(backrgba, frontrgba, style, 0xFF);
result.rgba = ASTBlendPixel(result, frontrgba, AST_TRANSLUCENT, blendamt);
table[((bg * 0x100) + fg)] = GetColorLUT(&transtab_lut, result.s.red, result.s.green, result.s.blue);
#else // performance scrabbler
result.rgba = ASTBlendPixel(backrgba, frontrgba, style, 0xFF); result.rgba = ASTBlendPixel(backrgba, frontrgba, style, 0xFF);
result.rgba = ASTBlendPixel(result, frontrgba, AST_TRANSLUCENT, blendamt); result.rgba = ASTBlendPixel(result, frontrgba, AST_TRANSLUCENT, blendamt);
table[((bg * 0x100) + fg)] = GetColorLUT(&transtab_lut_corrected, result.s.red, result.s.green, result.s.blue); // pGammaCorrectedPalette table[((bg * 0x100) + fg)] = GetColorLUT(&transtab_lut_corrected, result.s.red, result.s.green, result.s.blue); // pGammaCorrectedPalette
#endif
} }
} }
} }
@@ -190,6 +185,7 @@ static void BlendTab_Translucent(UINT8 *table, int style, UINT8 blendamt)
static void BlendTab_Subtractive(UINT8 *table, int style, UINT8 blendamt) static void BlendTab_Subtractive(UINT8 *table, int style, UINT8 blendamt)
{ {
INT16 bg, fg; INT16 bg, fg;
RGBA_t backrgba, frontrgba, result;
if (table == NULL) if (table == NULL)
I_Error("BlendTab_Subtractive: input table was NULL!"); I_Error("BlendTab_Subtractive: input table was NULL!");
@@ -202,11 +198,11 @@ static void BlendTab_Subtractive(UINT8 *table, int style, UINT8 blendamt)
for (bg = 0; bg < 0x100; bg++) for (bg = 0; bg < 0x100; bg++)
{ {
backrgba = pLocalPalette[bg]; // intentionally uses pLocalPalette
for (fg = 0; fg < 0x100; fg++) for (fg = 0; fg < 0x100; fg++)
{ {
RGBA_t backrgba = V_GetColor(bg); frontrgba = pLocalPalette[fg];
RGBA_t frontrgba = V_GetColor(fg);
RGBA_t result;
result.rgba = ASTBlendPixel(backrgba, frontrgba, style, 0xFF); result.rgba = ASTBlendPixel(backrgba, frontrgba, style, 0xFF);
result.s.red = std::max(0, result.s.red - blendamt); result.s.red = std::max(0, result.s.red - blendamt);
@@ -221,17 +217,19 @@ static void BlendTab_Subtractive(UINT8 *table, int style, UINT8 blendamt)
static void BlendTab_Modulative(UINT8 *table) static void BlendTab_Modulative(UINT8 *table)
{ {
INT16 bg, fg; INT16 bg, fg;
RGBA_t backrgba, frontrgba, result;
if (table == NULL) if (table == NULL)
I_Error("BlendTab_Modulative: input table was NULL!"); I_Error("BlendTab_Modulative: input table was NULL!");
for (bg = 0; bg < 0x100; bg++) for (bg = 0; bg < 0x100; bg++)
{ {
backrgba = pGammaCorrectedPalette[bg];
for (fg = 0; fg < 0x100; fg++) for (fg = 0; fg < 0x100; fg++)
{ {
RGBA_t backrgba = V_GetColor(bg); frontrgba = pGammaCorrectedPalette[fg];
RGBA_t frontrgba = V_GetColor(fg);
RGBA_t result;
result.rgba = ASTBlendPixel(backrgba, frontrgba, AST_MODULATE, 0); result.rgba = ASTBlendPixel(backrgba, frontrgba, AST_MODULATE, 0);
table[((bg * 0x100) + fg)] = GetColorLUT(&transtab_lut_corrected, result.s.red, result.s.green, result.s.blue); table[((bg * 0x100) + fg)] = GetColorLUT(&transtab_lut_corrected, result.s.red, result.s.green, result.s.blue);
} }
+3
View File
@@ -1021,6 +1021,8 @@ void I_InitJoystick(UINT8 index)
} }
} }
#if 0 // no dont do this
// reset everything just in case
JoyInfo[index].dev = NULL; JoyInfo[index].dev = NULL;
JoyInfo[index].oldjoy = -1; JoyInfo[index].oldjoy = -1;
#if (SDL_VERSION_ATLEAST(2,32,4)) #if (SDL_VERSION_ATLEAST(2,32,4))
@@ -1028,6 +1030,7 @@ void I_InitJoystick(UINT8 index)
#endif #endif
JoyInfo[index].hasled = false; JoyInfo[index].hasled = false;
JoyInfo[index].hasrumble = false; JoyInfo[index].hasrumble = false;
#endif
if (cv_usejoystick[index].value) if (cv_usejoystick[index].value)
newcontroller = SDL_GameControllerOpen(cv_usejoystick[index].value-1); newcontroller = SDL_GameControllerOpen(cv_usejoystick[index].value-1);
+1 -1
View File
@@ -568,7 +568,7 @@ static void ST_overlayDrawer(void)
{ {
if (!(multiplayer && demo.playback)) if (!(multiplayer && demo.playback))
{ {
if(!P_IsLocalPlayer(stplyr)) if (!P_IsLocalPlayer(stplyr))
{ {
/*char name[MAXPLAYERNAME+1]; /*char name[MAXPLAYERNAME+1];
// shorten the name if its more than twelve characters. // shorten the name if its more than twelve characters.
+2
View File
@@ -256,6 +256,7 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
} }
if (demo.recording && !rankingsmode) if (demo.recording && !rankingsmode)
{
G_WriteStanding( G_WriteStanding(
data.pos[data.numplayers], data.pos[data.numplayers],
data.name[data.numplayers], data.name[data.numplayers],
@@ -263,6 +264,7 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
*data.color[data.numplayers], *data.color[data.numplayers],
data.val[data.numplayers] data.val[data.numplayers]
); );
}
data.numplayers++; data.numplayers++;
} }
+4 -2
View File
@@ -582,7 +582,8 @@ void Z_ChangeTag(void *ptr, INT32 tag)
block = MEMBLOCK(ptr); block = MEMBLOCK(ptr);
#ifdef PARANOIA #ifdef PARANOIA
if (block->id != ZONEID) I_Error("Z_ChangeTag at %s:%d: wrong id", file, line); if (block->id != ZONEID)
I_Error("Z_ChangeTag at %s:%d: wrong id", file, line);
#endif #endif
if (tag >= PU_PURGELEVEL && block->user == NULL) if (tag >= PU_PURGELEVEL && block->user == NULL)
@@ -613,7 +614,8 @@ void Z_SetUser(void *ptr, void **newuser)
block = MEMBLOCK(ptr); block = MEMBLOCK(ptr);
#ifdef PARANOIA #ifdef PARANOIA
if (block->id != ZONEID) I_Error("Z_SetUser at %s:%d: wrong id", file, line); if (block->id != ZONEID)
I_Error("Z_SetUser at %s:%d: wrong id", file, line);
#endif #endif
if (block->tag >= PU_PURGELEVEL && newuser == NULL) if (block->tag >= PU_PURGELEVEL && newuser == NULL)