Merge branch 'master' into sdl2

Synchronizing back to upstream
This commit is contained in:
Ronald Kinard 2014-04-01 01:29:18 -05:00
commit a413811ccd
25 changed files with 251 additions and 146 deletions

View file

@ -1,4 +1,4 @@
Here it is! SRB2 v2.1.5 source code!
Here it is! SRB2 v2.1.6 source code!
Win32 with Visual C (6SP6+Processor Pack OR 7)

View file

@ -767,9 +767,11 @@ static inline void resynch_write_ctf(resynchend_pak *rst)
rst->flagplayer[i] = (SINT8)j;
break;
}
if (j == MAXPLAYERS)
I_Error("One of the flags has gone completely missing!");
if (j == MAXPLAYERS) // fine, no I_Error
{
CONS_Alert(CONS_ERROR, "One of the flags has gone completely missing...");
rst->flagplayer[i] = -2;
}
continue;
}
@ -789,7 +791,9 @@ static inline void resynch_read_ctf(resynchend_pak *p)
players[i].gotflag = 0;
// Red flag
if (p->flagplayer[0] != -1) // Held by a player
if (p->flagplayer[0] == -2)
; // The server doesn't even know what happened to it...
else if (p->flagplayer[0] != -1) // Held by a player
{
if (!playeringame[p->flagplayer[0]])
I_Error("Invalid red flag player %d who isn't in the game!", (INT32)p->flagplayer[0]);
@ -815,7 +819,9 @@ static inline void resynch_read_ctf(resynchend_pak *p)
}
// Blue flag
if (p->flagplayer[1] != -1) // Held by a player
if (p->flagplayer[1] == -2)
; // The server doesn't even know what happened to it...
else if (p->flagplayer[1] != -1) // Held by a player
{
if (!playeringame[p->flagplayer[1]])
I_Error("Invalid blue flag player %d who isn't in the game!", (INT32)p->flagplayer[1]);
@ -832,11 +838,11 @@ static inline void resynch_read_ctf(resynchend_pak *p)
blueflag = P_SpawnMobj(0,0,0,MT_BLUEFLAG);
P_UnsetThingPosition(blueflag);
blueflag->x = (fixed_t)LONG(p->flagx[0]);
blueflag->y = (fixed_t)LONG(p->flagy[0]);
blueflag->z = (fixed_t)LONG(p->flagz[0]);
blueflag->flags2 = LONG(p->flagflags[0]);
blueflag->fuse = LONG(p->flagloose[0]);
blueflag->x = (fixed_t)LONG(p->flagx[1]);
blueflag->y = (fixed_t)LONG(p->flagy[1]);
blueflag->z = (fixed_t)LONG(p->flagz[1]);
blueflag->flags2 = LONG(p->flagflags[1]);
blueflag->fuse = LONG(p->flagloose[1]);
P_SetThingPosition(blueflag);
}
}
@ -1683,7 +1689,7 @@ static void CL_ConnectToServer(boolean viams)
}
if (gametypestr)
CONS_Printf(M_GetText("Gametype: %s\n"), gametypestr);
CONS_Printf(M_GetText("Version: %d.%.2d.%u\n"), serverlist[i].info.version/100,
CONS_Printf(M_GetText("Version: %d.%d.%u\n"), serverlist[i].info.version/100,
serverlist[i].info.version%100, serverlist[i].info.subversion);
}
SL_ClearServerList(servernode);

View file

@ -1097,7 +1097,7 @@ void D_SRB2Main(void)
W_VerifyFileMD5(1, "a894044b555dfcc71865cee16a996e88"); // zones.dta
W_VerifyFileMD5(2, "4c410c1de6e0440cc5b2858dcca80c3e"); // player.dta
W_VerifyFileMD5(3, "85901ad4bf94637e5753d2ac2c03ea26"); // rings.dta
W_VerifyFileMD5(4, "4d56695e194a6fd3bc5c87610a215186"); // patch.dta
W_VerifyFileMD5(4, "386ab4ffc8c9fb0fa62f788a16e5c218"); // patch.dta
// don't check music.dta because people like to modify it, and it doesn't matter if they do
// ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for.

View file

@ -350,7 +350,7 @@ consvar_t cv_usemapnumlaps = {"usemaplaps", "Yes", CV_NETVAR, CV_YesNo, NULL, 0,
// log elemental hazards -- not a netvar, is local to current player
consvar_t cv_hazardlog = {"hazardlog", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_forceskin = {"forceskin", "-1", CV_NETVAR|CV_CALL, NULL, ForceSkin_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_forceskin = {"forceskin", "-1", CV_NETVAR|CV_CALL|CV_CHEAT, NULL, ForceSkin_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_downloading = {"downloading", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_allowexitlevel = {"allowexitlevel", "No", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -378,7 +378,6 @@ consvar_t cv_mute = {"mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange,
consvar_t cv_sleep = {"cpusleep", "-1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL, NULL, 0, 0, NULL};
static boolean triggerforcedskin = false;
INT16 gametype = GT_COOP;
boolean splitscreen = false;
boolean circuitmap = false;
@ -1042,6 +1041,26 @@ UINT8 CanChangeSkin(INT32 playernum)
return true;
}
static void ForceAllSkins(INT32 forcedskin)
{
INT32 i;
for (i = 0; i < MAXPLAYERS; ++i)
{
if (!playeringame[i])
continue;
SetPlayerSkinByNum(i, forcedskin);
// If it's me (or my brother), set appropriate skin value in cv_skin/cv_skin2
if (!dedicated) // But don't do this for dedicated servers, of course.
{
if (i == consoleplayer)
CV_StealthSet(&cv_skin, skins[forcedskin].name);
else if (i == secondarydisplayplayer)
CV_StealthSet(&cv_skin2, skins[forcedskin].name);
}
}
}
static INT32 snacpending = 0, snac2pending = 0, chmappending = 0;
@ -1101,35 +1120,6 @@ static void SendNameAndColor(void)
SetPlayerSkinByNum(consoleplayer, 0);
CV_StealthSet(&cv_skin, skins[0].name);
}
else if (cv_forceskin.value >= 0 && (netgame || multiplayer)) // Server wants everyone to use the same player
{
const INT32 forcedskin = cv_forceskin.value;
if (triggerforcedskin)
{
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i])
{
SetPlayerSkinByNum(i, forcedskin);
// If it's me (or my brother), set appropriate skin value in cv_skin/cv_skin2
if (i == consoleplayer)
CV_StealthSet(&cv_skin, skins[forcedskin].name);
else if (i == secondarydisplayplayer)
CV_StealthSet(&cv_skin2, skins[forcedskin].name);
}
}
triggerforcedskin = false;
}
else
{
SetPlayerSkinByNum(consoleplayer, forcedskin);
CV_StealthSet(&cv_skin, skins[forcedskin].name);
}
}
else if ((foundskin = R_SkinAvailable(cv_skin.string)) != -1)
{
boolean notsame;
@ -1277,7 +1267,6 @@ static void SendNameAndColor2(void)
static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
{
player_t *p = &players[playernum];
INT32 i;
char name[MAXPLAYERNAME+1];
UINT8 color, skin;
@ -1343,33 +1332,12 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
if (cv_forceskin.value >= 0 && (netgame || multiplayer)) // Server wants everyone to use the same player
{
const INT32 forcedskin = cv_forceskin.value;
SetPlayerSkinByNum(playernum, forcedskin);
if (triggerforcedskin)
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i])
{
SetPlayerSkinByNum(i, forcedskin);
// If it's me (or my brother), set appropriate skin value in cv_skin/cv_skin2
if (i == consoleplayer)
CV_StealthSet(&cv_skin, skins[forcedskin].name);
else if (i == secondarydisplayplayer)
CV_StealthSet(&cv_skin2, skins[forcedskin].name);
}
}
triggerforcedskin = false;
}
else
{
SetPlayerSkinByNum(playernum, forcedskin);
if (playernum == consoleplayer)
CV_StealthSet(&cv_skin, skins[forcedskin].name);
else if (playernum == secondarydisplayplayer)
CV_StealthSet(&cv_skin2, skins[forcedskin].name);
}
if (playernum == consoleplayer)
CV_StealthSet(&cv_skin, skins[forcedskin].name);
else if (playernum == secondarydisplayplayer)
CV_StealthSet(&cv_skin2, skins[forcedskin].name);
}
else
SetPlayerSkinByNum(playernum, skin);
@ -4179,21 +4147,27 @@ static void ForceSkin_OnChange(void)
if ((server || adminplayer == consoleplayer) && (cv_forceskin.value < -1 || cv_forceskin.value >= numskins))
{
if (cv_forceskin.value == -2)
CV_StealthSetValue(&cv_forceskin, numskins-1);
CV_SetValue(&cv_forceskin, numskins-1);
else
{
// hack because I can't restrict this and still allow added skins to be used with forceskin.
if (!menuactive)
CONS_Printf(M_GetText("Valid skin numbers are 0 to %d (-1 disables)\n"), numskins - 1);
CV_SetValue(&cv_forceskin, -1);
return;
}
return;
}
if (cv_forceskin.value >= 0 && (netgame || multiplayer)) // NOT in SP, silly!
// NOT in SP, silly!
if (!(netgame || multiplayer))
return;
if (cv_forceskin.value < 0)
CONS_Printf("The server has lifted the forced skin restrictions.\n");
else
{
triggerforcedskin = true;
SendNameAndColor(); // have it take effect immediately
CONS_Printf("The server is restricting all players to skin \"%s\".\n",skins[cv_forceskin.value].name);
ForceAllSkins(cv_forceskin.value);
}
}

View file

@ -144,8 +144,8 @@ extern FILE *logstream;
#define VERSIONSTRING "Trunk"
#else
#define VERSION 201 // Game version
#define SUBVERSION 5 // more precise version number
#define VERSIONSTRING "v2.1.5"
#define SUBVERSION 6 // more precise version number
#define VERSIONSTRING "v2.1.6"
#endif
// Modification options
@ -201,7 +201,7 @@ extern FILE *logstream;
// it's only for detection of the version the player is using so the MS can alert them of an update.
// Only set it higher, not lower, obviously.
// Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1".
#define MODVERSION 10
#define MODVERSION 11

View file

@ -1096,10 +1096,7 @@ void F_StartCredits(void)
CON_ClearHUD();
S_StopMusic();
if (!modifiedgame && (M_SecretUnlocked(SECRET_PANDORA)) && ALL7EMERALDS(emeralds))
S_ChangeMusic(mus_mapl4m, false);
else
S_ChangeMusic(mus_credit, false);
S_ChangeMusic(mus_credit, false);
finalecount = 0;
animtimer = 0;

View file

@ -1624,7 +1624,7 @@ boolean G_Responder(event_t *ev)
&& (players[consoleplayer].pflags & PF_TAGIT) != (players[displayplayer].pflags & PF_TAGIT))
continue;
}
else if (G_RingSlingerGametype())
else if (G_GametypeHasSpectators() && G_RingSlingerGametype())
{
if (!players[consoleplayer].spectator)
continue;

View file

@ -179,17 +179,37 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
if (option & V_NOSCALESTART)
sdupx = sdupy = 2.0f;
v[0].x = v[3].x = (cx*sdupx-gpatch->leftoffset*pdupx)/vid.width - 1;
v[2].x = v[1].x = (cx*sdupx+(gpatch->width-gpatch->leftoffset)*pdupx)/vid.width - 1;
v[0].y = v[1].y = 1-(cy*sdupy-gpatch->topoffset*pdupy)/vid.height;
v[2].y = v[3].y = 1-(cy*sdupy+(gpatch->height-gpatch->topoffset)*pdupy)/vid.height;
if (option & V_FLIP) // Need to flip both this and sow
{
v[0].x = v[3].x = (cx*sdupx-(gpatch->width-gpatch->leftoffset)*pdupx)/vid.width - 1;
v[2].x = v[1].x = (cx*sdupx+gpatch->leftoffset*pdupx)/vid.width - 1;
v[0].y = v[1].y = 1-(cy*sdupy-gpatch->topoffset*pdupy)/vid.height;
v[2].y = v[3].y = 1-(cy*sdupy+(gpatch->height-gpatch->topoffset)*pdupy)/vid.height;
}
else
{
v[0].x = v[3].x = (cx*sdupx-gpatch->leftoffset*pdupx)/vid.width - 1;
v[2].x = v[1].x = (cx*sdupx+(gpatch->width-gpatch->leftoffset)*pdupx)/vid.width - 1;
v[0].y = v[1].y = 1-(cy*sdupy-gpatch->topoffset*pdupy)/vid.height;
v[2].y = v[3].y = 1-(cy*sdupy+(gpatch->height-gpatch->topoffset)*pdupy)/vid.height;
}
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
v[0].sow = v[3].sow = 0.0f;
v[2].sow = v[1].sow = gpatch->max_s;
v[0].tow = v[1].tow = 0.0f;
v[2].tow = v[3].tow = gpatch->max_t;
if (option & V_FLIP)
{
v[0].sow = v[3].sow = gpatch->max_s;
v[2].sow = v[1].sow = 0.0f;
v[0].tow = v[1].tow = 0.0f;
v[2].tow = v[3].tow = gpatch->max_t;
}
else
{
v[0].sow = v[3].sow = 0.0f;
v[2].sow = v[1].sow = gpatch->max_s;
v[0].tow = v[1].tow = 0.0f;
v[2].tow = v[3].tow = gpatch->max_t;
}
flags = BLENDMODE|PF_Clip|PF_NoZClip|PF_NoDepthTest;

View file

@ -401,6 +401,12 @@ UINT32 HWR_Lighting(INT32 light, UINT32 color, UINT32 fadecolor, boolean fogbloc
(void)fogblockpoly;
// Don't go out of bounds
if (light < 0)
light = 0;
else if (light > 255)
light = 255;
realcolor.rgba = color;
fogcolor.rgba = fadecolor;
@ -488,6 +494,12 @@ static UINT8 HWR_FogBlockAlpha(INT32 light, UINT32 color, UINT32 fadecolor) // L
RGBA_t realcolor, fogcolor, surfcolor;
INT32 alpha, fogalpha;
// Don't go out of bounds
if (light < 0)
light = 0;
else if (light > 255)
light = 255;
realcolor.rgba = color;
fogcolor.rgba = fadecolor;
@ -716,28 +728,28 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, fixed_t fi
}
}
if (psector->extra_colormap)
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel),psector->extra_colormap->rgba,psector->extra_colormap->fadergba, false, true);
Surf.FlatColor.rgba = HWR_Lighting(lightlevel,psector->extra_colormap->rgba,psector->extra_colormap->fadergba, false, true);
else
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel),NORMALFOG,FADEFOG, false, true);
Surf.FlatColor.rgba = HWR_Lighting(lightlevel,NORMALFOG,FADEFOG, false, true);
}
else
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel),NORMALFOG,FADEFOG, false, true);
Surf.FlatColor.rgba = HWR_Lighting(lightlevel,NORMALFOG,FADEFOG, false, true);
#endif // NOPE
if (planecolormap)
{
if (fogplane)
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), planecolormap->rgba, planecolormap->fadergba, true, false);
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, planecolormap->rgba, planecolormap->fadergba, true, false);
else
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), planecolormap->rgba, planecolormap->fadergba, false, true);
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, planecolormap->rgba, planecolormap->fadergba, false, true);
}
else
{
if (fogplane)
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), NORMALFOG, FADEFOG, true, false);
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, true, false);
else
Surf.FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), NORMALFOG, FADEFOG, false, true);
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, false, true);
}
if (PolyFlags & PF_Translucent)
@ -971,11 +983,11 @@ static void HWR_ProjectWall(wallVert3D * wallVerts,
if (wallcolormap)
{
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), wallcolormap->rgba, wallcolormap->fadergba, false, false);
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, wallcolormap->rgba, wallcolormap->fadergba, false, false);
}
else
{
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), NORMALFOG, FADEFOG, false, false);
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, false, false);
}
HWD.pfnDrawPolygon(pSurf, trVerts, 4, blendmode|PF_Modulated|PF_Occlude|PF_Clip);
@ -3329,7 +3341,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
if (spr->mobj->frame & FF_TRANSMASK || spr->mobj->flags2 & MF2_SHADOW)
{
sector_t *sector = spr->mobj->subsector->sector;
UINT8 lightlevel = LightLevelToLum(sector->lightlevel);
UINT8 lightlevel = sector->lightlevel;
extracolormap_t *colormap = sector->extra_colormap;
if (sector->numlights)
@ -3337,16 +3349,16 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
INT32 light = R_GetPlaneLight(sector, spr->mobj->floorz, false);
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = LightLevelToLum(*sector->lightlist[light].lightlevel);
lightlevel = *sector->lightlist[light].lightlevel;
else
lightlevel = LightLevelToLum(255);
lightlevel = 255;
if (sector->lightlist[light].extra_colormap)
colormap = sector->lightlist[light].extra_colormap;
}
else
{
lightlevel = LightLevelToLum(sector->lightlevel);
lightlevel = sector->lightlevel;
if (sector->extra_colormap)
colormap = sector->extra_colormap;
@ -3379,7 +3391,7 @@ noshadow:
// colormap test
{
sector_t *sector = spr->mobj->subsector->sector;
UINT8 lightlevel = LightLevelToLum(sector->lightlevel);
UINT8 lightlevel = sector->lightlevel;
extracolormap_t *colormap = sector->extra_colormap;
if (sector->numlights)
@ -3389,9 +3401,9 @@ noshadow:
light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = LightLevelToLum(*sector->lightlist[light].lightlevel);
lightlevel = *sector->lightlist[light].lightlevel;
else
lightlevel = LightLevelToLum(255);
lightlevel = 255;
if (sector->lightlist[light].extra_colormap)
colormap = sector->lightlist[light].extra_colormap;
@ -3399,16 +3411,16 @@ noshadow:
else
{
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = LightLevelToLum(sector->lightlevel);
lightlevel = sector->lightlevel;
else
lightlevel = LightLevelToLum(255);
lightlevel = 255;
if (sector->extra_colormap)
colormap = sector->extra_colormap;
}
if (spr->mobj->frame & FF_FULLBRIGHT)
lightlevel = LightLevelToLum(255);
lightlevel = 255;
if (colormap)
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
@ -3908,7 +3920,7 @@ static void HWR_AddSprites(sector_t *sec)
sec->validcount = validcount;
// sprite lighting
sectorlight = LightLevelToLum(sec->lightlevel & 0xff);
sectorlight = sec->lightlevel & 0xff;
// Handle all things in sector.
// If a limit exists, handle things a tiny bit different.
@ -5182,16 +5194,16 @@ static void HWR_RenderWall(wallVert3D *wallVerts, FSurfaceInfo *pSurf, FBITFIE
if (wallcolormap)
{
if (fogwall)
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), wallcolormap->rgba, wallcolormap->fadergba, true, false);
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, wallcolormap->rgba, wallcolormap->fadergba, true, false);
else
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), wallcolormap->rgba, wallcolormap->fadergba, false, false);
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, wallcolormap->rgba, wallcolormap->fadergba, false, false);
}
else
{
if (fogwall)
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), NORMALFOG, FADEFOG, true, false);
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, true, false);
else
pSurf->FlatColor.rgba = HWR_Lighting(LightLevelToLum(lightlevel), NORMALFOG, FADEFOG, false, false);
pSurf->FlatColor.rgba = HWR_Lighting(lightlevel, NORMALFOG, FADEFOG, false, false);
}
pSurf->FlatColor.s.alpha = alpha; // put the alpha back after lighting

View file

@ -1082,7 +1082,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
// colormap test
{
sector_t *sector = spr->mobj->subsector->sector;
UINT8 lightlevel = LightLevelToLum(sector->lightlevel);
UINT8 lightlevel = sector->lightlevel;
extracolormap_t *colormap = sector->extra_colormap;
if (sector->numlights)
@ -1092,9 +1092,9 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = LightLevelToLum(*sector->lightlist[light].lightlevel);
lightlevel = *sector->lightlist[light].lightlevel;
else
lightlevel = LightLevelToLum(255);
lightlevel = 255;
if (sector->lightlist[light].extra_colormap)
colormap = sector->lightlist[light].extra_colormap;
@ -1102,16 +1102,16 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
else
{
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = LightLevelToLum(sector->lightlevel);
lightlevel = sector->lightlevel;
else
lightlevel = LightLevelToLum(255);
lightlevel = 255;
if (sector->extra_colormap)
colormap = sector->extra_colormap;
}
if (spr->mobj->frame & FF_FULLBRIGHT)
lightlevel = LightLevelToLum(255);
lightlevel = 255;
if (colormap)
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);

View file

@ -888,7 +888,7 @@ void HWR_CorrectSWTricks(void)
if (sider->bottomtexture == 0)
{
if (sider->midtexture == 0)
sider->bottomtexture = R_TextureNumForName("REDWALL"); // Tails
sider->bottomtexture = 0; // Tails // More redwall sky shenanigans
else
sider->bottomtexture = sider->midtexture;
}
@ -899,7 +899,7 @@ void HWR_CorrectSWTricks(void)
if (sidel->bottomtexture == 0)
{
if (sidel->midtexture == 0)
sidel->bottomtexture = R_TextureNumForName("REDWALL"); // Tails
sidel->bottomtexture = 0; // Tails // More redwall sky shenanigans
else
sidel->bottomtexture = sidel->midtexture;
}

View file

@ -200,7 +200,7 @@ static int libd_patchExists(lua_State *L)
if (!hud_running)
return luaL_error(L, "HUD rendering code should not be called outside of rendering hooks!");
lua_pushboolean(L, W_CheckNumForName(luaL_checkstring(L, 1)) != LUMPERROR);
lua_pushboolean(L, W_LumpExists(luaL_checkstring(L, 1)));
return 1;
}

View file

@ -296,7 +296,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
if (((toucher->player->pflags & PF_NIGHTSMODE) && (toucher->player->pflags & PF_DRILLING))
|| (toucher->player->pflags & (PF_JUMPED|PF_SPINNING))
|| (toucher->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING))
|| toucher->player->powers[pw_invulnerability] || toucher->player->powers[pw_super]) // Do you possess the ability to subdue the object?
{
if (P_MobjFlip(toucher)*toucher->momz < 0)
@ -339,7 +339,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_DamageMobj(toucher, special, special, 1);
}
else if (((toucher->player->pflags & PF_NIGHTSMODE) && (toucher->player->pflags & PF_DRILLING))
|| (toucher->player->pflags & (PF_JUMPED|PF_SPINNING))
|| (toucher->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING))
|| toucher->player->powers[pw_invulnerability] || toucher->player->powers[pw_super]) // Do you possess the ability to subdue the object?
{
if (P_MobjFlip(toucher)*toucher->momz < 0)
@ -1295,7 +1295,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
S_StartSound(toucher, special->info->painsound);
return;
}
else if (((toucher->player->pflags & PF_NIGHTSMODE) && (toucher->player->pflags & PF_DRILLING)) || (toucher->player->pflags & PF_JUMPED) || (toucher->player->pflags & PF_SPINNING)
else if (((toucher->player->pflags & PF_NIGHTSMODE) && (toucher->player->pflags & PF_DRILLING)) || (toucher->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING))
|| toucher->player->powers[pw_invulnerability] || toucher->player->powers[pw_super]) // Do you possess the ability to subdue the object?
{
// Shatter the shield!
@ -2649,12 +2649,13 @@ void P_RemoveShield(player_t *player)
static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage)
{
// Must do pain first to set flashing -- P_RemoveShield can cause damage
P_DoPlayerPain(player, source, inflictor);
P_RemoveShield(player);
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
P_DoPlayerPain(player, source, inflictor);
if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes
S_StartSound(player->mo, sfx_spkdth);
else

View file

@ -1069,7 +1069,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
tmsprung = true;
}
else if (thing->flags & MF_MONITOR
&& ((tmthing->player->pflags & PF_JUMPED) || (tmthing->player->pflags & PF_SPINNING)))
&& tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING))
{
boolean flip = (thing->eflags & MFE_VERTICALFLIP) != 0; // Save this flag in case monitor gets removed.
fixed_t *momz = &tmthing->momz; // tmthing gets changed by P_DamageMobj, so we need a new pointer?! X_x;;

View file

@ -6529,7 +6529,7 @@ void P_MobjThinker(mobj_t *mobj)
if (players[consoleplayer].ctfteam == 1)
S_StartSound(NULL, sfx_hoop1);
redflag = NULL;
redflag = flagmo;
}
else // MT_BLUEFLAG
{
@ -6539,7 +6539,7 @@ void P_MobjThinker(mobj_t *mobj)
if (players[consoleplayer].ctfteam == 2)
S_StartSound(NULL, sfx_hoop1);
blueflag = NULL;
blueflag = flagmo;
}
}
P_RemoveMobj(mobj);
@ -9459,7 +9459,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
boolean P_CheckMissileSpawn(mobj_t *th)
{
// move a little forward so an angle can be computed if it immediately explodes
if (th->flags & MF_GRENADEBOUNCE) // hack: bad! should be a flag.
if (!(th->flags & MF_GRENADEBOUNCE)) // hack: bad! should be a flag.
{
th->x += th->momx>>1;
th->y += th->momy>>1;

View file

@ -4071,8 +4071,17 @@ static void P_2dMovement(player_t *player)
if (player->exiting || player->pflags & PF_STASIS)
{
cmd->forwardmove = cmd->sidemove = 0;
if (player->pflags & PF_GLIDING && !player->skidtime)
player->pflags &= ~PF_GLIDING;
if (player->pflags & PF_GLIDING)
{
if (!player->skidtime)
player->pflags &= ~PF_GLIDING;
else if (player->exiting)
{
player->pflags &= ~PF_GLIDING;
P_SetPlayerMobjState(player->mo, S_PLAY_RUN1);
player->skidtime = 0;
}
}
if (player->pflags & PF_SPINNING && !player->exiting)
{
player->pflags &= ~PF_SPINNING;
@ -4255,8 +4264,17 @@ static void P_3dMovement(player_t *player)
if (player->exiting || player->pflags & PF_STASIS)
{
cmd->forwardmove = cmd->sidemove = 0;
if (player->pflags & PF_GLIDING && !player->skidtime)
player->pflags &= ~PF_GLIDING;
if (player->pflags & PF_GLIDING)
{
if (!player->skidtime)
player->pflags &= ~PF_GLIDING;
else if (player->exiting)
{
player->pflags &= ~PF_GLIDING;
P_SetPlayerMobjState(player->mo, S_PLAY_RUN1);
player->skidtime = 0;
}
}
if (player->pflags & PF_SPINNING && !player->exiting)
{
player->pflags &= ~PF_SPINNING;
@ -6184,9 +6202,24 @@ static void P_MovePlayer(player_t *player)
else if (G_GametypeHasTeams())
{
INT32 changeto = 0;
INT32 z, numplayersred = 0, numplayersblue = 0;
//find a team by score, or random if all else fails.
if (bluescore > redscore)
//find a team by num players, score, or random if all else fails.
for (z = 0; z < MAXPLAYERS; ++z)
if (playeringame[z])
{
if (players[z].ctfteam == 1)
++numplayersred;
else if (players[z].ctfteam == 2)
++numplayersblue;
}
// for z
if (numplayersblue > numplayersred)
changeto = 1;
else if (numplayersred > numplayersblue)
changeto = 2;
else if (bluescore > redscore)
changeto = 1;
else if (redscore > bluescore)
changeto = 2;

View file

@ -2390,6 +2390,12 @@ void R_InitSkins(void)
skin->spritedef.numframes = sprites[SPR_PLAY].numframes;
skin->spritedef.spriteframes = sprites[SPR_PLAY].spriteframes;
ST_LoadFaceGraphics(skin->face, skin->superface, 0);
//MD2 for sonic doesn't want to load in Linux.
#ifdef HWRENDER
if (rendermode == render_opengl)
HWR_AddPlayerMD2(0);
#endif
}
// returns true if the skin name is found (loaded from pwad)

View file

@ -229,7 +229,7 @@ void SCR_Startup(void)
vid.fdupy = FixedDiv(vid.height*FRACUNIT, BASEVIDHEIGHT*FRACUNIT);
#ifdef HWRENDER
if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions, not sure if it does anything in software
if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions in opengl
#endif
vid.fdupx = vid.fdupy = (vid.fdupx < vid.fdupy ? vid.fdupx : vid.fdupy);
@ -275,7 +275,7 @@ void SCR_Recalc(void)
vid.fdupy = FixedDiv(vid.height*FRACUNIT, BASEVIDHEIGHT*FRACUNIT);
#ifdef HWRENDER
if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions, not sure if it does anything in software
if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions in opengl
#endif
vid.fdupx = vid.fdupy = (vid.fdupx < vid.fdupy ? vid.fdupx : vid.fdupy);

View file

@ -1214,7 +1214,7 @@
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CURRENT_PROJECT_VERSION = 2.1.5;
CURRENT_PROJECT_VERSION = 2.1.6;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
NORMALSRB2,
@ -1226,7 +1226,7 @@
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CURRENT_PROJECT_VERSION = 2.1.5;
CURRENT_PROJECT_VERSION = 2.1.6;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_PREPROCESSOR_DEFINITIONS = (

View file

@ -60,7 +60,9 @@ patch_t *superprefix[MAXSKINS]; // super face status patches
patch_t *sboscore; // Score logo
patch_t *sbotime; // Time logo
patch_t *sbocolon; // Colon for time
patch_t *sboperiod; // Period for time centiseconds
patch_t *livesback; // Lives icon background
static patch_t *nrec_timer; // Timer for NiGHTS records
static patch_t *sborings;
static patch_t *sboover;
static patch_t *timeover;
@ -255,6 +257,8 @@ void ST_LoadGraphics(void)
rrings = W_CachePatchName("RRINGS", PU_HUDGFX);
sbotime = W_CachePatchName("SBOTIME", PU_HUDGFX); // Time logo
sbocolon = W_CachePatchName("SBOCOLON", PU_HUDGFX); // Colon for time
sboperiod = W_CachePatchName("SBOPERIO", PU_HUDGFX); // Period for time centiseconds
nrec_timer = W_CachePatchName("NGRTIMER", PU_HUDGFX); // Timer for NiGHTS
getall = W_CachePatchName("GETALL", PU_HUDGFX); // Special Stage HUD
timeup = W_CachePatchName("TIMEUP", PU_HUDGFX); // Special Stage HUD
race1 = W_CachePatchName("RACE1", PU_HUDGFX);
@ -634,7 +638,7 @@ static void ST_drawTime(void)
if (!splitscreen && (cv_timetic.value == 2 || modeattacking)) // there's not enough room for tics in splitscreen, don't even bother trying!
{
ST_DrawPatchFromHud(HUD_TIMETICCOLON, sbocolon); // Colon
ST_DrawPatchFromHud(HUD_TIMETICCOLON, sboperiod); // Period
ST_DrawPadNumFromHud(HUD_TICS, tictrn, 2); // Tics
}
}
@ -1201,7 +1205,34 @@ static void ST_drawNiGHTSHUD(void)
&& LUA_HudEnabled(hud_nightsscore)
#endif
)
{
ST_DrawNightsOverlayNum(SCX(304), SCY(16), 0, stplyr->marescore, nightsnum, SKINCOLOR_STEELBLUE);
}
if (!stplyr->exiting
#ifdef HAVE_BLUA
// TODO give this its own section for Lua
&& LUA_HudEnabled(hud_nightsscore)
#endif
)
{
if (modeattacking == ATTACKING_NIGHTS)
{
INT32 maretime = max(stplyr->realtime - stplyr->marebegunat, 0);
ST_DrawOverlayPatch(SCX(298), SCY(180), W_CachePatchName("NGRTIMER", PU_HUDGFX));
ST_DrawPaddedOverlayNum(SCX(298), SCY(180), G_TicsToCentiseconds(maretime), 2);
ST_DrawOverlayPatch(SCX(274), SCY(180), sboperiod);
if (maretime < 60*TICRATE)
ST_DrawOverlayNum(SCX(274), SCY(180), G_TicsToSeconds(maretime));
else
{
ST_DrawPaddedOverlayNum(SCX(274), SCY(180), G_TicsToSeconds(maretime), 2);
ST_DrawOverlayPatch(SCX(250), SCY(180), sbocolon);
ST_DrawOverlayNum(SCX(250), SCY(180), G_TicsToMinutes(maretime, true));
}
}
}
// Ideya time remaining
if (!stplyr->exiting && stplyr->nightstime > 0

View file

@ -65,6 +65,7 @@ extern patch_t *tallnum[10];
extern patch_t *sboscore;
extern patch_t *sbotime;
extern patch_t *sbocolon;
extern patch_t *sboperiod;
extern patch_t *faceprefix[MAXSKINS]; // face status patches
extern patch_t *superprefix[MAXSKINS]; // super face status patches
extern patch_t *livesback;

View file

@ -905,6 +905,14 @@ void V_DrawPatchFill(patch_t *pat)
INT32 dupz = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
INT32 x, y, pw = SHORT(pat->width) * dupz, ph = SHORT(pat->height) * dupz;
#ifdef HWRENDER
if (rendermode == render_opengl)
{
pw = FixedMul(SHORT(pat->width)*FRACUNIT, vid.fdupx)>>FRACBITS;
ph = FixedMul(SHORT(pat->height)*FRACUNIT, vid.fdupy)>>FRACBITS;
}
#endif
for (x = 0; x < vid.width; x += pw)
{
for (y = 0; y < vid.height; y += ph)

View file

@ -660,6 +660,21 @@ lumpnum_t W_GetNumForName(const char *name)
return i;
}
// Used by Lua. Case sensitive lump checking, quickly...
#include "fastcmp.h"
UINT8 W_LumpExists(const char *name)
{
INT32 i,j;
for (i = numwadfiles - 1; i >= 0; i--)
{
lumpinfo_t *lump_p = wadfiles[i]->lumpinfo;
for (j = 0; j < wadfiles[i]->numlumps; ++j, ++lump_p)
if (fastcmp(lump_p->name,name))
return true;
}
return false;
}
size_t W_LumpLengthPwad(UINT16 wad, UINT16 lump)
{
if (!TestValidLump(wad, lump))

View file

@ -102,6 +102,7 @@ const char *W_CheckNameForNum(lumpnum_t lumpnum);
UINT16 W_CheckNumForNamePwad(const char *name, UINT16 wad, UINT16 startlump); // checks only in one pwad
lumpnum_t W_CheckNumForName(const char *name);
lumpnum_t W_GetNumForName(const char *name); // like W_CheckNumForName but I_Error on LUMPERROR
UINT8 W_LumpExists(const char *name); // Lua uses this.
size_t W_LumpLengthPwad(UINT16 wad, UINT16 lump);
size_t W_LumpLength(lumpnum_t lumpnum);

View file

@ -214,7 +214,7 @@ void Y_IntermissionDrawer(void)
{
V_DrawPaddedTallNum(hudinfo[HUD_TICS].x, hudinfo[HUD_TICS].y, V_SNAPTOLEFT,
G_TicsToCentiseconds(data.coop.tics), 2);
V_DrawScaledPatch(hudinfo[HUD_TIMETICCOLON].x, hudinfo[HUD_TIMETICCOLON].y, V_SNAPTOLEFT, sbocolon);
V_DrawScaledPatch(hudinfo[HUD_TIMETICCOLON].x, hudinfo[HUD_TIMETICCOLON].y, V_SNAPTOLEFT, sboperiod);
}
V_DrawPaddedTallNum(hudinfo[HUD_SECONDS].x, hudinfo[HUD_SECONDS].y, V_SNAPTOLEFT,