Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • KartKrew/Kart-Public
  • SteelT/Kart-Public
  • SSNTails/Kart-Public
  • mazmazz_/Kart-Public
  • james/Kart-Public
  • Latius/Kart-Public
  • alphaRexJames/Kart-Public
  • heyjoeway/Kart-Public
  • Namolos/Kart-Public
  • SinnamonLat/Kart-Public
  • filpAM/Kart-Public
  • wolfy852/Kart-Public
  • bird/Kart-Public
  • TehRealSalt/Kart-Public
  • Snu/Kart-Public
  • Tyron/Kart-Public
  • kimmy/Kart-Public
  • Spice/Kart-Public
  • Callmore/Kart-Public
  • JugadorXEI/Kart-Public
  • Fafabis/Kart-Public
  • cspotcode/Kart-Public
  • Lonsfor_/Kart-Public
  • brokenspleentec/Kart-Public
  • minenice/Kart-Public
  • Lighto97/Kart-Public
  • X.organic/Kart-Public
  • Superjustinbros/srb2kart-custom-color-expansion
  • Galactice/Kart-Public
  • haya_/Kart-Public
  • QuantumToasted/Kart-Public
  • Indev/Kart-Public
  • chreas/kart-public-vr
  • alufolie91/Kart-Public2
  • Alam/Kart-Public
  • koi/Kart-Public
  • Alam/kart-public-vr
  • Hanicef/Kart-Public
  • hero0fnin/kart-public-batocera-edit
  • NepDisk/Kart-Public
  • Nep2Disk/Kart-Public
41 results
Show changes
Commits on Source (52)
......@@ -2905,6 +2905,12 @@ void D_LoadBan(boolean warning)
address = strtok(buffer, " /\t\r\n");
mask = strtok(NULL, " \t\r\n");
if (!address)
{
malformed = true;
continue;
}
if (i == 0 && !strncmp(address, "BANFORMAT", 9))
{
if (mask)
......
......@@ -1464,7 +1464,7 @@ void Command_Ping_f(void)
if (!server && playeringame[consoleplayer])
{
CONS_Printf("\nYour ping is %d frames (%d ms)\n", playerpingtable[consoleplayer], (INT32)(playerpingtable[i] * (1000.00f / TICRATE)));
CONS_Printf("\nYour ping is %d frames (%d ms)\n", playerpingtable[consoleplayer], (INT32)(playerpingtable[consoleplayer] * (1000.00f / TICRATE)));
}
}
......
......@@ -251,7 +251,7 @@ consvar_t cv_ingamecap = {"ingamecap", "0", CV_NETVAR, ingamecap_cons_t, NULL, 0
static CV_PossibleValue_t spectatorreentry_cons_t[] = {{0, "MIN"}, {10*60, "MAX"}, {0, NULL}};
consvar_t cv_spectatorreentry = {"spectatorreentry", "30", CV_NETVAR, spectatorreentry_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t antigrief_cons_t[] = {{20, "MIN"}, {60, "MAX"}, {0, "Off"}, {0, NULL}};
static CV_PossibleValue_t antigrief_cons_t[] = {{20, "MIN"}, {180, "MAX"}, {0, "Off"}, {0, NULL}};
consvar_t cv_antigrief = {"antigrief", "30", CV_NETVAR, antigrief_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_startinglives = {"startinglives", "3", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, startingliveslimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
......
......@@ -103,6 +103,7 @@ typedef struct fileused_s
{
FILE *file;
UINT8 count;
UINT32 position;
} fileused_t;
static fileused_t transferFiles[UINT8_MAX + 1];
......@@ -895,7 +896,7 @@ void SV_FileSendTicker(void)
if (filesize == -1)
I_Error("Error getting filesize of %s", f->id.filename);
f->size = (UINT32)filesize;
f->size = transferFiles[f->fileid].position = (UINT32)filesize;
}
transfer[i].position = 0;
......@@ -904,7 +905,11 @@ void SV_FileSendTicker(void)
if (!ram)
{
fseek(transferFiles[f->fileid].file, transfer[i].position, SEEK_SET);
// Seek to the right position if we aren't already there.
if (transferFiles[f->fileid].position != transfer[i].position)
{
fseek(transferFiles[f->fileid].file, transfer[i].position, SEEK_SET);
}
}
// Build a packet containing a file fragment
......@@ -924,6 +929,8 @@ void SV_FileSendTicker(void)
{
I_Error("SV_FileSendTicker: can't read %s byte on %s at %d because %s",
sizeu1(size), f->id.filename, transfer[i].position, M_FileError(transferFiles[f->fileid].file));
transferFiles[f->fileid].position = (UINT32)(transferFiles[f->fileid].position + size);
}
p->position = LONG(transfer[i].position);
......
......@@ -164,6 +164,15 @@ char *strcasestr(const char *in, const char *what);
#define HAVE_DOSSTR_FUNCS
#endif
#if defined (__APPLE__)
#define SRB2_HAVE_STRLCPY
#elif defined (__GLIBC_PREREQ)
// glibc 2.38: added strlcpy and strlcat to _DEFAULT_SOURCE
#if __GLIBC_PREREQ(2, 38)
#define SRB2_HAVE_STRLCPY
#endif
#endif
#ifndef HAVE_DOSSTR_FUNCS
int strupr(char *n); // from dosstr.c
int strlwr(char *n); // from dosstr.c
......@@ -171,7 +180,7 @@ int strlwr(char *n); // from dosstr.c
#include <stddef.h> // for size_t
#ifndef __APPLE__
#ifndef SRB2_HAVE_STRLCPY
size_t strlcat(char *dst, const char *src, size_t siz);
size_t strlcpy(char *dst, const char *src, size_t siz);
#endif
......
......@@ -479,14 +479,43 @@ void HWR_InitTextureCache(void)
// Callback function for HWR_FreeTextureCache.
static void FreeMipmapColormap(INT32 patchnum, void *patch)
{
GLPatch_t* const grpatch = patch;
GLPatch_t* const pat = patch;
(void)patchnum; //unused
while (grpatch->mipmap->nextcolormap)
// The patch must be valid, obviously
if (!pat)
return;
// The mipmap must be valid, obviously
while (pat->mipmap)
{
GLMipmap_t *grmip = grpatch->mipmap->nextcolormap;
grpatch->mipmap->nextcolormap = grmip->nextcolormap;
if (grmip->grInfo.data) Z_Free(grmip->grInfo.data);
free(grmip);
// Confusing at first, but pat->mipmap->nextcolormap
// at the beginning of the loop is the first colormap
// from the linked list of colormaps.
GLMipmap_t *next = NULL;
// No mipmap in this patch, break out of the loop.
if (!pat->mipmap)
break;
// No colormap mipmaps either.
if (!pat->mipmap->nextcolormap)
break;
// Set the first colormap to the one that comes after it.
next = pat->mipmap->nextcolormap;
if (!next)
break;
pat->mipmap->nextcolormap = next->nextcolormap;
// Free image data from memory.
if (next->grInfo.data)
Z_Free(next->grInfo.data);
next->grInfo.data = NULL;
// Free the old colormap mipmap from memory.
free(next);
}
}
......@@ -503,7 +532,7 @@ void HWR_FreeTextureCache(void)
// Alam: free the Z_Blocks before freeing it's users
// free all skin after each level: must be done after pfnClearMipMapCache!
// free all patch colormaps after each level: must be done after ClearMipMapCache!
for (i = 0; i < numwadfiles; i++)
M_AATreeIterate(wadfiles[i]->hwrcache, FreeMipmapColormap);
......
......@@ -1639,7 +1639,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (rover->master->flags & ML_TFERLINE)
{
size_t linenum = gr_curline->linedef-gr_backsector->lines[0];
size_t linenum = min((size_t)(gr_curline->linedef-gr_backsector->lines[0]), rover->master->frontsector->linecount);
newline = rover->master->frontsector->lines[0] + linenum;
texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture);
}
......@@ -1798,10 +1798,11 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (rover->master->flags & ML_TFERLINE)
{
size_t linenum = gr_curline->linedef-gr_backsector->lines[0];
size_t linenum = min((size_t)(gr_curline->linedef-gr_backsector->lines[0]), rover->master->frontsector->linecount);
newline = rover->master->frontsector->lines[0] + linenum;
texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture);
}
#ifdef ESLOPE //backsides
h = *rover->t_slope ? P_GetZAt(*rover->t_slope, v1x, v1y) : *rover->topheight;
hS = *rover->t_slope ? P_GetZAt(*rover->t_slope, v2x, v2y) : *rover->topheight;
......@@ -4538,7 +4539,7 @@ void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
#endif
// set top/bottom coords
vis->ty = FIXED_TO_FLOAT(thing->z + spritecachedinfo[lumpoff].topoffset);
vis->ty = FIXED_TO_FLOAT(interp.z + spritecachedinfo[lumpoff].topoffset);
vis->precip = true;
}
......
......@@ -1116,6 +1116,10 @@ void HU_Ticker(void)
}
if (cechotimer > 0) --cechotimer;
// Animate the desynch dots
if (hu_resynching)
resynch_ticker++; //tic tic tic tic tic
HU_TickSongCredits();
}
......
......@@ -4021,6 +4021,7 @@ void K_RepairOrbitChain(mobj_t *orbit)
// Then recount to make sure item amount is correct
if (orbit->target && orbit->target->player)
{
player_t *player = orbit->target->player;
INT32 num = 0;
mobj_t *cur = orbit->target->hnext;
......@@ -4030,14 +4031,14 @@ void K_RepairOrbitChain(mobj_t *orbit)
{
prev = cur;
cur = cur->hnext;
if (++num > orbit->target->player->kartstuff[k_itemamount])
if (++num > player->kartstuff[k_itemamount])
P_RemoveMobj(prev);
else
prev->movedir = num;
}
if (orbit->target->player->kartstuff[k_itemamount] != num)
orbit->target->player->kartstuff[k_itemamount] = num;
if (player->kartstuff[k_itemamount] != num)
player->kartstuff[k_itemamount] = num;
}
}
......
......@@ -382,7 +382,7 @@ static int lib_cvRegisterVar(lua_State *L)
cvar->PossibleValue = cvpv;
} else
FIELDERROR("PossibleValue", va("%s or CV_PossibleValue_t expected, got %s", lua_typename(L, LUA_TTABLE), luaL_typename(L, -1)))
} else if (cvar->flags & CV_CALL && (i == 5 || (k && fasticmp(k, "func")))) {
} else if ((i == 5 || (k && fasticmp(k, "func")))) {
if (!lua_isfunction(L, 4))
TYPEERROR("func", LUA_TFUNCTION)
lua_getfield(L, LUA_REGISTRYINDEX, "CV_OnChange");
......
......@@ -258,6 +258,8 @@ static int lib_iterateSectorThinglist(lua_State *L)
if (!lua_isnil(L, 1))
{
thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
if (P_MobjWasRemoved(thing))
return luaL_error(L, "current entry in thinglist was removed; avoid calling P_RemoveMobj on entries!");
thing = thing->snext;
}
else
......
......@@ -10178,7 +10178,7 @@ static void M_DrawJoystick(void)
compareval4 = cv_usejoystick4.value;
compareval3 = cv_usejoystick3.value;
compareval2 = cv_usejoystick2.value;
compareval = cv_usejoystick.value
compareval = cv_usejoystick.value;
#endif
if ((setupcontrolplayer == 4 && (i == compareval4))
......
......@@ -3142,6 +3142,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
UINT8 shouldForce = LUAh_ShouldDamage(target, inflictor, source, damage);
if (P_MobjWasRemoved(target))
return (shouldForce == 1); // mobj was removed
if (P_MobjWasRemoved(source))
source = NULL;
if (shouldForce == 1)
force = true;
else if (shouldForce == 2)
......@@ -3468,6 +3470,9 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
break;
}
if (P_MobjWasRemoved(target))
return false;
if (!P_MobjWasRemoved(target))
{
target->reactiontime = 0; // we're awake now...
......
......@@ -150,6 +150,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam);
void P_SlideCameraMove(camera_t *thiscam);
void P_DemoCameraMovement(camera_t *cam);
boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled);
void P_ResetLocalCamAiming(player_t *player);
void P_InitCameraCmd(void);
boolean P_PlayerInPain(player_t *player);
void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor);
......
......@@ -263,6 +263,9 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state)
I_Error("P_SetMobjState used for player mobj. Use P_SetPlayerMobjState instead!\n(State called: %d)", state);
#endif
if (mobj->player != NULL)
return P_SetPlayerMobjState(mobj, state);
if (recursion++) // if recursion detected,
memset(seenstate = tempstate, 0, sizeof tempstate); // clear state table
......@@ -590,29 +593,41 @@ void P_ExplodeMissile(mobj_t *mo)
P_RadiusAttack(mo, mo, 96*FRACUNIT);
explodemo = P_SpawnMobj(mo->x, mo->y, mo->z, MT_EXPLODE);
P_SetScale(explodemo, mo->scale);
explodemo->destscale = mo->destscale;
explodemo->momx += (P_RandomByte() % 32) * FixedMul(FRACUNIT/8, explodemo->scale);
explodemo->momy += (P_RandomByte() % 32) * FixedMul(FRACUNIT/8, explodemo->scale);
S_StartSound(explodemo, sfx_pop);
if (!P_MobjWasRemoved(explodemo))
{
P_SetScale(explodemo, mo->scale);
explodemo->destscale = mo->destscale;
explodemo->momx += (P_RandomByte() % 32) * FixedMul(FRACUNIT/8, explodemo->scale);
explodemo->momy += (P_RandomByte() % 32) * FixedMul(FRACUNIT/8, explodemo->scale);
S_StartSound(explodemo, sfx_pop);
}
explodemo = P_SpawnMobj(mo->x, mo->y, mo->z, MT_EXPLODE);
P_SetScale(explodemo, mo->scale);
explodemo->destscale = mo->destscale;
explodemo->momx += (P_RandomByte() % 64) * FixedMul(FRACUNIT/8, explodemo->scale);
explodemo->momy -= (P_RandomByte() % 64) * FixedMul(FRACUNIT/8, explodemo->scale);
S_StartSound(explodemo, sfx_dmpain);
if (!P_MobjWasRemoved(explodemo))
{
P_SetScale(explodemo, mo->scale);
explodemo->destscale = mo->destscale;
explodemo->momx += (P_RandomByte() % 64) * FixedMul(FRACUNIT/8, explodemo->scale);
explodemo->momy -= (P_RandomByte() % 64) * FixedMul(FRACUNIT/8, explodemo->scale);
S_StartSound(explodemo, sfx_dmpain);
}
explodemo = P_SpawnMobj(mo->x, mo->y, mo->z, MT_EXPLODE);
P_SetScale(explodemo, mo->scale);
explodemo->destscale = mo->destscale;
explodemo->momx -= (P_RandomByte() % 128) * FixedMul(FRACUNIT/8, explodemo->scale);
explodemo->momy += (P_RandomByte() % 128) * FixedMul(FRACUNIT/8, explodemo->scale);
S_StartSound(explodemo, sfx_pop);
if (!P_MobjWasRemoved(explodemo))
{
P_SetScale(explodemo, mo->scale);
explodemo->destscale = mo->destscale;
explodemo->momx -= (P_RandomByte() % 128) * FixedMul(FRACUNIT/8, explodemo->scale);
explodemo->momy += (P_RandomByte() % 128) * FixedMul(FRACUNIT/8, explodemo->scale);
S_StartSound(explodemo, sfx_pop);
}
explodemo = P_SpawnMobj(mo->x, mo->y, mo->z, MT_EXPLODE);
P_SetScale(explodemo, mo->scale);
explodemo->destscale = mo->destscale;
explodemo->momx -= (P_RandomByte() % 96) * FixedMul(FRACUNIT/8, explodemo->scale);
explodemo->momy -= (P_RandomByte() % 96) * FixedMul(FRACUNIT/8, explodemo->scale);
S_StartSound(explodemo, sfx_cybdth);
if (!P_MobjWasRemoved(explodemo))
{
P_SetScale(explodemo, mo->scale);
explodemo->destscale = mo->destscale;
explodemo->momx -= (P_RandomByte() % 96) * FixedMul(FRACUNIT/8, explodemo->scale);
explodemo->momy -= (P_RandomByte() % 96) * FixedMul(FRACUNIT/8, explodemo->scale);
S_StartSound(explodemo, sfx_cybdth);
}
// Hack: Release an animal.
P_DamageMobj(mo, NULL, NULL, 10000);
......@@ -3584,6 +3599,9 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
I_Assert(mobj->player != NULL);
I_Assert(!P_MobjWasRemoved(mobj));
if (P_MobjWasRemoved(mobj))
return;
P_MobjCheckWater(mobj);
P_ButteredSlope(mobj);
......@@ -7051,6 +7069,9 @@ void P_MobjThinker(mobj_t *mobj)
// separate thinker
if (mobj->flags & MF_PUSHABLE || (mobj->info->flags & MF_PUSHABLE && mobj->fuse))
{
if (P_MobjWasRemoved(mobj))
return;
P_MobjCheckWater(mobj);
P_PushableThinker(mobj);
......@@ -10235,6 +10256,10 @@ void P_RemoveMobj(mobj_t *mobj)
}
}
// clear the reference from the mapthing
if (mobj->spawnpoint)
mobj->spawnpoint->mobj = NULL;
// free block
// DBG: set everything in mobj_t to 0xFF instead of leaving it. debug memory error.
if (mobj->flags & MF_NOTHINK && !mobj->thinker.next)
......@@ -10751,6 +10776,7 @@ void P_SpawnPlayer(INT32 playernum)
}
mobj = P_SpawnMobj(0, 0, 0, MT_PLAYER);
I_Assert(mobj != NULL);
(mobj->player = p)->mo = mobj;
mobj->angle = 0;
......@@ -11363,6 +11389,13 @@ void P_SpawnMapThing(mapthing_t *mthing)
}
mobj = P_SpawnMobj(x, y, z, i);
if (!mobj || P_MobjWasRemoved(mobj))
{
CONS_Alert(CONS_WARNING, "Failed to spawn map thing #%d at %d, %d\n", mthing->type, x>>FRACBITS, y>>FRACBITS);
return;
}
mobj->spawnpoint = mthing;
switch(mobj->type)
......
......@@ -181,6 +181,8 @@ boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle
P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND
}
thing->player->kartstuff[k_boostangle] = angle;
if (flash)
P_FlashPal(thing->player, PAL_MIXUP, 10);
}
......
......@@ -895,6 +895,8 @@ void P_PreTicker(INT32 frames)
// Run shield positioning
//P_RunShields();
P_RunOverlays();
P_RunShadows();
P_UpdateSpecials();
P_RespawnSpecials();
......
......@@ -829,6 +829,10 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
//
boolean P_PlayerInPain(player_t *player)
{
// If the player doesn't have a mobj, it can't be in pain.
if (!player->mo)
return false;
// no silly, sliding isn't pain
if (!(player->pflags & PF_SLIDING) && player->mo->state == &states[player->mo->info->painstate] && player->powers[pw_flashing])
return true;
......@@ -8005,6 +8009,18 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
return (x == thiscam->x && y == thiscam->y && z == thiscam->z && angle == thiscam->aiming);
}
void P_ResetLocalCamAiming(player_t *player)
{
for (int i = 0; i <= splitscreen; i++)
{
UINT8 id = (i == 0) ? consoleplayer : displayplayers[i];
if (player - players == id)
{
localaiming[i] = 0;
}
}
}
boolean P_SpectatorJoinGame(player_t *player)
{
// Team changing isn't allowed.
......@@ -8055,6 +8071,9 @@ boolean P_SpectatorJoinGame(player_t *player)
player->ctfteam = changeto;
player->playerstate = PST_REBORN;
//center camera
P_ResetLocalCamAiming(player);
//Reset away view
if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer)
displayplayers[0] = consoleplayer;
......@@ -8079,6 +8098,9 @@ boolean P_SpectatorJoinGame(player_t *player)
player->kartstuff[k_spectatewait] = 0;
player->playerstate = PST_REBORN;
//center camera
P_ResetLocalCamAiming(player);
//Reset away view
if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer)
displayplayers[0] = consoleplayer;
......
......@@ -23,6 +23,10 @@
#include "z_zone.h"
#include "console.h" // con_startup_loadprogress
#ifdef HWRENDER
#include "hardware/hw_main.h" // for cv_grshearing
#endif
static CV_PossibleValue_t fpscap_cons_t[] = {
#ifdef DEVELOP
// Lower values are actually pretty useful for debugging interp problems!
......@@ -119,7 +123,11 @@ static void R_SetupFreelook(player_t *player, boolean skybox)
// clip it in the case we are looking a hardware 90 degrees full aiming
// (lmps, network and use F12...)
if (rendermode == render_soft)
if (rendermode == render_soft
#ifdef HWRENDER
|| (rendermode == render_opengl && cv_grshearing.value)
#endif
)
{
G_SoftwareClipAimingPitch((INT32 *)&aimingangle);
}
......
......@@ -681,7 +681,7 @@ static void R_DrawRepeatMaskedColumn(column_t *col)
{
while (sprtopscreen < sprbotscreen) {
R_DrawMaskedColumn(col);
if ((INT64)sprtopscreen + dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow
if (sprtopscreen + (INT64)dc_texheight*spryscale > (INT64)INT32_MAX) // prevent overflow
sprtopscreen = INT32_MAX;
else
sprtopscreen += dc_texheight*spryscale;
......@@ -733,7 +733,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
if (pfloor->master->flags & ML_TFERLINE)
{
size_t linenum = curline->linedef-backsector->lines[0];
size_t linenum = min((size_t)(curline->linedef-backsector->lines[0]), pfloor->master->frontsector->linecount);
newline = pfloor->master->frontsector->lines[0] + linenum;
texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture);
}
......