mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-17 10:11:02 +00:00
Merge remote-tracking branch 'origin/next' into SF_NONIGHTSSUPER
This commit is contained in:
commit
3fc9c7d298
32 changed files with 769 additions and 256 deletions
|
@ -26,12 +26,12 @@
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* Manually defined asset hashes for non-CMake builds
|
/* Manually defined asset hashes for non-CMake builds
|
||||||
* Last updated 2019 / 12 / 06 - v2.2.0 - main assets
|
* Last updated 2020 / 02 / 15 - v2.2.1 - main assets
|
||||||
* Last updated 20?? / ?? / ?? - v2.2.? - patch.pk3
|
* Last updated 20?? / ?? / ?? - v2.2.? - patch.pk3
|
||||||
*/
|
*/
|
||||||
#define ASSET_HASH_SRB2_PK3 "51419a33b4982d840c6772c159ba7c0a"
|
#define ASSET_HASH_SRB2_PK3 "0277c9416756627004e83cbb5b2e3e28"
|
||||||
#define ASSET_HASH_ZONES_PK3 "df74843919fd51af26a0baa8e21e4c19"
|
#define ASSET_HASH_ZONES_PK3 "f7e88afb6af7996a834c7d663144bead"
|
||||||
#define ASSET_HASH_PLAYER_DTA "56a247e074dd0dc794b6617efef1e918"
|
#define ASSET_HASH_PLAYER_DTA "ad49e07b17cc662f1ad70c454910b4ae"
|
||||||
#ifdef USE_PATCH_DTA
|
#ifdef USE_PATCH_DTA
|
||||||
#define ASSET_HASH_PATCH_PK3 "there is no patch.pk3, only zuul"
|
#define ASSET_HASH_PATCH_PK3 "there is no patch.pk3, only zuul"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -613,6 +613,15 @@ void CON_Ticker(void)
|
||||||
con_tick++;
|
con_tick++;
|
||||||
con_tick &= 7;
|
con_tick &= 7;
|
||||||
|
|
||||||
|
// if the menu is open then close the console.
|
||||||
|
if (menuactive && con_destlines)
|
||||||
|
{
|
||||||
|
consoletoggle = false;
|
||||||
|
con_destlines = 0;
|
||||||
|
CON_ClearHUD();
|
||||||
|
I_UpdateMouseGrab();
|
||||||
|
}
|
||||||
|
|
||||||
// console key was pushed
|
// console key was pushed
|
||||||
if (consoletoggle)
|
if (consoletoggle)
|
||||||
{
|
{
|
||||||
|
@ -784,7 +793,7 @@ boolean CON_Responder(event_t *ev)
|
||||||
// check other keys only if console prompt is active
|
// check other keys only if console prompt is active
|
||||||
if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!!
|
if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!!
|
||||||
{
|
{
|
||||||
if (! menuactive && bindtable[key])
|
if (bindtable[key])
|
||||||
{
|
{
|
||||||
COM_BufAddText(bindtable[key]);
|
COM_BufAddText(bindtable[key]);
|
||||||
COM_BufAddText("\n");
|
COM_BufAddText("\n");
|
||||||
|
|
|
@ -404,8 +404,8 @@ static void ExtraDataTicker(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If you are a client, you can safely forget the net commands for this tic
|
// If you are a client, you can safely forget the net commands for this tic
|
||||||
// If you are the server, you need to remember them until every client has been aknowledged,
|
// If you are the server, you need to remember them until every client has been acknowledged,
|
||||||
// because if you need to resend a PT_SERVERTICS packet, you need to put the commands in it
|
// because if you need to resend a PT_SERVERTICS packet, you will need to put the commands in it
|
||||||
if (client)
|
if (client)
|
||||||
D_FreeTextcmd(gametic);
|
D_FreeTextcmd(gametic);
|
||||||
}
|
}
|
||||||
|
@ -4510,7 +4510,7 @@ static void CL_SendClientCmd(void)
|
||||||
packetsize = sizeof (clientcmd_pak) - sizeof (ticcmd_t) - sizeof (INT16);
|
packetsize = sizeof (clientcmd_pak) - sizeof (ticcmd_t) - sizeof (INT16);
|
||||||
HSendPacket(servernode, false, 0, packetsize);
|
HSendPacket(servernode, false, 0, packetsize);
|
||||||
}
|
}
|
||||||
else if (gamestate != GS_NULL && addedtogame)
|
else if (gamestate != GS_NULL && (addedtogame || dedicated))
|
||||||
{
|
{
|
||||||
G_MoveTiccmd(&netbuffer->u.clientpak.cmd, &localcmds, 1);
|
G_MoveTiccmd(&netbuffer->u.clientpak.cmd, &localcmds, 1);
|
||||||
netbuffer->u.clientpak.consistancy = SHORT(consistancy[gametic%BACKUPTICS]);
|
netbuffer->u.clientpak.consistancy = SHORT(consistancy[gametic%BACKUPTICS]);
|
||||||
|
|
23
src/d_main.c
23
src/d_main.c
|
@ -188,14 +188,14 @@ void D_ProcessEvents(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// console input
|
|
||||||
if (CON_Responder(ev))
|
|
||||||
continue; // ate the event
|
|
||||||
|
|
||||||
// Menu input
|
// Menu input
|
||||||
if (M_Responder(ev))
|
if (M_Responder(ev))
|
||||||
continue; // menu ate the event
|
continue; // menu ate the event
|
||||||
|
|
||||||
|
// console input
|
||||||
|
if (CON_Responder(ev))
|
||||||
|
continue; // ate the event
|
||||||
|
|
||||||
G_Responder(ev);
|
G_Responder(ev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -266,6 +266,9 @@ static void D_Display(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rendermode == render_soft && !splitscreen)
|
||||||
|
R_CheckViewMorph();
|
||||||
|
|
||||||
// change the view size if needed
|
// change the view size if needed
|
||||||
if (setsizeneeded || setrenderstillneeded)
|
if (setsizeneeded || setrenderstillneeded)
|
||||||
{
|
{
|
||||||
|
@ -446,6 +449,9 @@ static void D_Display(void)
|
||||||
// Image postprocessing effect
|
// Image postprocessing effect
|
||||||
if (rendermode == render_soft)
|
if (rendermode == render_soft)
|
||||||
{
|
{
|
||||||
|
if (!splitscreen)
|
||||||
|
R_ApplyViewMorph();
|
||||||
|
|
||||||
if (postimgtype)
|
if (postimgtype)
|
||||||
V_DoPostProcessor(0, postimgtype, postimgparam);
|
V_DoPostProcessor(0, postimgtype, postimgparam);
|
||||||
if (postimgtype2)
|
if (postimgtype2)
|
||||||
|
@ -502,12 +508,13 @@ static void D_Display(void)
|
||||||
// vid size change is now finished if it was on...
|
// vid size change is now finished if it was on...
|
||||||
vid.recalc = 0;
|
vid.recalc = 0;
|
||||||
|
|
||||||
M_Drawer(); // menu is drawn even on top of everything
|
// FIXME: draw either console or menu, not the two
|
||||||
// focus lost moved to M_Drawer
|
|
||||||
|
|
||||||
if (gamestate != GS_TIMEATTACK)
|
if (gamestate != GS_TIMEATTACK)
|
||||||
CON_Drawer();
|
CON_Drawer();
|
||||||
|
|
||||||
|
M_Drawer(); // menu is drawn even on top of everything
|
||||||
|
// focus lost moved to M_Drawer
|
||||||
|
|
||||||
//
|
//
|
||||||
// wipe update
|
// wipe update
|
||||||
//
|
//
|
||||||
|
@ -1213,7 +1220,7 @@ void D_SRB2Main(void)
|
||||||
#endif
|
#endif
|
||||||
D_CleanFile();
|
D_CleanFile();
|
||||||
|
|
||||||
#ifndef DEVELOP // md5s last updated 06/12/19 (ddmmyy)
|
#ifndef DEVELOP // md5s last updated 16/02/20 (ddmmyy)
|
||||||
|
|
||||||
// Check MD5s of autoloaded files
|
// Check MD5s of autoloaded files
|
||||||
W_VerifyFileMD5(0, ASSET_HASH_SRB2_PK3); // srb2.pk3
|
W_VerifyFileMD5(0, ASSET_HASH_SRB2_PK3); // srb2.pk3
|
||||||
|
|
|
@ -325,6 +325,8 @@ typedef struct player_s
|
||||||
// bounded/scaled total momentum.
|
// bounded/scaled total momentum.
|
||||||
fixed_t bob;
|
fixed_t bob;
|
||||||
|
|
||||||
|
angle_t viewrollangle;
|
||||||
|
|
||||||
// Mouse aiming, where the guy is looking at!
|
// Mouse aiming, where the guy is looking at!
|
||||||
// It is updated with cmd->aiming.
|
// It is updated with cmd->aiming.
|
||||||
angle_t aiming;
|
angle_t aiming;
|
||||||
|
|
|
@ -1293,9 +1293,6 @@ static void readgametype(MYFILE *f, char *gtname)
|
||||||
UINT32 wordgt = 0;
|
UINT32 wordgt = 0;
|
||||||
for (j = 0; GAMETYPERULE_LIST[j]; j++)
|
for (j = 0; GAMETYPERULE_LIST[j]; j++)
|
||||||
if (fastcmp(word, GAMETYPERULE_LIST[j])) {
|
if (fastcmp(word, GAMETYPERULE_LIST[j])) {
|
||||||
if (!j) // GTR_CAMPAIGN
|
|
||||||
wordgt |= 1;
|
|
||||||
else
|
|
||||||
wordgt |= (1<<j);
|
wordgt |= (1<<j);
|
||||||
if (i || word2[0] == 'T' || word2[0] == 'Y')
|
if (i || word2[0] == 'T' || word2[0] == 'Y')
|
||||||
newgtrules |= wordgt;
|
newgtrules |= wordgt;
|
||||||
|
|
|
@ -490,6 +490,7 @@ extern INT32 cv_debug;
|
||||||
#define DBG_SETUP 0x0400
|
#define DBG_SETUP 0x0400
|
||||||
#define DBG_LUA 0x0800
|
#define DBG_LUA 0x0800
|
||||||
#define DBG_RANDOMIZER 0x1000
|
#define DBG_RANDOMIZER 0x1000
|
||||||
|
#define DBG_VIEWMORPH 0x2000
|
||||||
|
|
||||||
// =======================
|
// =======================
|
||||||
// Misc stuff for later...
|
// Misc stuff for later...
|
||||||
|
|
|
@ -1261,7 +1261,7 @@ static const char *credits[] = {
|
||||||
"Cody \"SRB2 Playah\" Koester",
|
"Cody \"SRB2 Playah\" Koester",
|
||||||
"Skye \"OmegaVelocity\" Meredith",
|
"Skye \"OmegaVelocity\" Meredith",
|
||||||
"Stephen \"HEDGESMFG\" Moellering",
|
"Stephen \"HEDGESMFG\" Moellering",
|
||||||
"Nick \"ST218\" Molina",
|
"Rosalie \"ST218\" Molina",
|
||||||
"Samuel \"Prime 2.0\" Peters",
|
"Samuel \"Prime 2.0\" Peters",
|
||||||
"Colin \"Sonict\" Pfaff",
|
"Colin \"Sonict\" Pfaff",
|
||||||
"Bill \"Tets\" Reed",
|
"Bill \"Tets\" Reed",
|
||||||
|
|
13
src/g_game.c
13
src/g_game.c
|
@ -3203,17 +3203,17 @@ UINT32 gametypedefaultrules[NUMGAMETYPES] =
|
||||||
GTR_RACE|GTR_SPAWNENEMIES|GTR_SPAWNINVUL|GTR_ALLOWEXIT,
|
GTR_RACE|GTR_SPAWNENEMIES|GTR_SPAWNINVUL|GTR_ALLOWEXIT,
|
||||||
|
|
||||||
// Match
|
// Match
|
||||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD|GTR_DEATHPENALTY,
|
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD|GTR_DEATHPENALTY,
|
||||||
// Team Match
|
// Team Match
|
||||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD,
|
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD,
|
||||||
|
|
||||||
// Tag
|
// Tag
|
||||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY,
|
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY,
|
||||||
// Hide and Seek
|
// Hide and Seek
|
||||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY,
|
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY,
|
||||||
|
|
||||||
// CTF
|
// CTF
|
||||||
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_TEAMFLAGS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD,
|
GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_TEAMFLAGS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD,
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -3739,7 +3739,10 @@ static void G_DoCompleted(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 7)
|
if (i == 7)
|
||||||
|
{
|
||||||
gottoken = false;
|
gottoken = false;
|
||||||
|
token = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spec && !gottoken)
|
if (spec && !gottoken)
|
||||||
|
|
|
@ -5022,12 +5022,7 @@ void HWR_AddTransparentFloor(levelflat_t *levelflat, extrasubsector_t *xsub, boo
|
||||||
|
|
||||||
planeinfo[numplanes].isceiling = isceiling;
|
planeinfo[numplanes].isceiling = isceiling;
|
||||||
planeinfo[numplanes].fixedheight = fixedheight;
|
planeinfo[numplanes].fixedheight = fixedheight;
|
||||||
|
planeinfo[numplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? lightlevel : 255;
|
||||||
if (planecolormap && (planecolormap->fog & 1))
|
|
||||||
planeinfo[numplanes].lightlevel = lightlevel;
|
|
||||||
else
|
|
||||||
planeinfo[numplanes].lightlevel = 255;
|
|
||||||
|
|
||||||
planeinfo[numplanes].levelflat = levelflat;
|
planeinfo[numplanes].levelflat = levelflat;
|
||||||
planeinfo[numplanes].xsub = xsub;
|
planeinfo[numplanes].xsub = xsub;
|
||||||
planeinfo[numplanes].alpha = alpha;
|
planeinfo[numplanes].alpha = alpha;
|
||||||
|
@ -5059,12 +5054,7 @@ void HWR_AddTransparentPolyobjectFloor(levelflat_t *levelflat, polyobj_t *polyse
|
||||||
|
|
||||||
polyplaneinfo[numpolyplanes].isceiling = isceiling;
|
polyplaneinfo[numpolyplanes].isceiling = isceiling;
|
||||||
polyplaneinfo[numpolyplanes].fixedheight = fixedheight;
|
polyplaneinfo[numpolyplanes].fixedheight = fixedheight;
|
||||||
|
polyplaneinfo[numpolyplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? lightlevel : 255;
|
||||||
if (planecolormap && (planecolormap->fog & 1))
|
|
||||||
polyplaneinfo[numpolyplanes].lightlevel = lightlevel;
|
|
||||||
else
|
|
||||||
polyplaneinfo[numpolyplanes].lightlevel = 255;
|
|
||||||
|
|
||||||
polyplaneinfo[numpolyplanes].levelflat = levelflat;
|
polyplaneinfo[numpolyplanes].levelflat = levelflat;
|
||||||
polyplaneinfo[numpolyplanes].polysector = polysector;
|
polyplaneinfo[numpolyplanes].polysector = polysector;
|
||||||
polyplaneinfo[numpolyplanes].alpha = alpha;
|
polyplaneinfo[numpolyplanes].alpha = alpha;
|
||||||
|
@ -5819,6 +5809,12 @@ static void HWR_DrawSkyBackground(player_t *player)
|
||||||
dometransform.scalez = 1;
|
dometransform.scalez = 1;
|
||||||
dometransform.fovxangle = fpov; // Tails
|
dometransform.fovxangle = fpov; // Tails
|
||||||
dometransform.fovyangle = fpov; // Tails
|
dometransform.fovyangle = fpov; // Tails
|
||||||
|
if (player->viewrollangle != 0)
|
||||||
|
{
|
||||||
|
fixed_t rol = AngleFixed(player->viewrollangle);
|
||||||
|
dometransform.rollangle = FIXED_TO_FLOAT(rol);
|
||||||
|
dometransform.roll = true;
|
||||||
|
}
|
||||||
dometransform.splitscreen = splitscreen;
|
dometransform.splitscreen = splitscreen;
|
||||||
|
|
||||||
HWR_GetTexture(texturetranslation[skytexture]);
|
HWR_GetTexture(texturetranslation[skytexture]);
|
||||||
|
@ -6042,6 +6038,12 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player)
|
||||||
atransform.scalez = 1;
|
atransform.scalez = 1;
|
||||||
atransform.fovxangle = fpov; // Tails
|
atransform.fovxangle = fpov; // Tails
|
||||||
atransform.fovyangle = fpov; // Tails
|
atransform.fovyangle = fpov; // Tails
|
||||||
|
if (player->viewrollangle != 0)
|
||||||
|
{
|
||||||
|
fixed_t rol = AngleFixed(player->viewrollangle);
|
||||||
|
atransform.rollangle = FIXED_TO_FLOAT(rol);
|
||||||
|
atransform.roll = true;
|
||||||
|
}
|
||||||
atransform.splitscreen = splitscreen;
|
atransform.splitscreen = splitscreen;
|
||||||
|
|
||||||
gr_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l)));
|
gr_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l)));
|
||||||
|
@ -6262,6 +6264,12 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
|
||||||
atransform.scalez = 1;
|
atransform.scalez = 1;
|
||||||
atransform.fovxangle = fpov; // Tails
|
atransform.fovxangle = fpov; // Tails
|
||||||
atransform.fovyangle = fpov; // Tails
|
atransform.fovyangle = fpov; // Tails
|
||||||
|
if (player->viewrollangle != 0)
|
||||||
|
{
|
||||||
|
fixed_t rol = AngleFixed(player->viewrollangle);
|
||||||
|
atransform.rollangle = FIXED_TO_FLOAT(rol);
|
||||||
|
atransform.roll = true;
|
||||||
|
}
|
||||||
atransform.splitscreen = splitscreen;
|
atransform.splitscreen = splitscreen;
|
||||||
|
|
||||||
gr_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l)));
|
gr_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l)));
|
||||||
|
|
|
@ -2238,6 +2238,8 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
|
||||||
else
|
else
|
||||||
pglScalef(stransform->scalex, stransform->scaley, -stransform->scalez);
|
pglScalef(stransform->scalex, stransform->scaley, -stransform->scalez);
|
||||||
|
|
||||||
|
if (stransform->roll)
|
||||||
|
pglRotatef(stransform->rollangle, 0.0f, 0.0f, 1.0f);
|
||||||
pglRotatef(stransform->anglex , 1.0f, 0.0f, 0.0f);
|
pglRotatef(stransform->anglex , 1.0f, 0.0f, 0.0f);
|
||||||
pglRotatef(stransform->angley+270.0f, 0.0f, 1.0f, 0.0f);
|
pglRotatef(stransform->angley+270.0f, 0.0f, 1.0f, 0.0f);
|
||||||
pglTranslatef(-stransform->x, -stransform->z, -stransform->y);
|
pglTranslatef(-stransform->x, -stransform->z, -stransform->y);
|
||||||
|
|
|
@ -268,10 +268,14 @@ static int patch_get(lua_State *L)
|
||||||
#endif
|
#endif
|
||||||
enum patch field = luaL_checkoption(L, 2, NULL, patch_opt);
|
enum patch field = luaL_checkoption(L, 2, NULL, patch_opt);
|
||||||
|
|
||||||
// patches are CURRENTLY always valid, expected to be cached with PU_STATIC
|
// patches are invalidated when switching renderers
|
||||||
// this may change in the future, so patch.valid still exists
|
if (!patch) {
|
||||||
if (!patch)
|
if (field == patch_valid) {
|
||||||
|
lua_pushboolean(L, 0);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
return LUA_ErrInvalid(L, "patch_t");
|
return LUA_ErrInvalid(L, "patch_t");
|
||||||
|
}
|
||||||
|
|
||||||
switch (field)
|
switch (field)
|
||||||
{
|
{
|
||||||
|
@ -424,7 +428,7 @@ static int libd_cachePatch(lua_State *L)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// v.getSpritePatch(sprite, [frame, [angle]])
|
// v.getSpritePatch(sprite, [frame, [angle, [rollangle]]])
|
||||||
static int libd_getSpritePatch(lua_State *L)
|
static int libd_getSpritePatch(lua_State *L)
|
||||||
{
|
{
|
||||||
UINT32 i; // sprite prefix
|
UINT32 i; // sprite prefix
|
||||||
|
@ -475,13 +479,31 @@ static int libd_getSpritePatch(lua_State *L)
|
||||||
if (angle >= ((sprframe->rotate & SRF_3DGE) ? 16 : 8)) // out of range?
|
if (angle >= ((sprframe->rotate & SRF_3DGE) ? 16 : 8)) // out of range?
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#ifdef ROTSPRITE
|
||||||
|
if (lua_isnumber(L, 4))
|
||||||
|
{
|
||||||
|
// rotsprite?????
|
||||||
|
angle_t rollangle = luaL_checkangle(L, 4);
|
||||||
|
INT32 rot = R_GetRollAngle(rollangle);
|
||||||
|
|
||||||
|
if (rot) {
|
||||||
|
if (!(sprframe->rotsprite.cached & (1<<angle)))
|
||||||
|
R_CacheRotSprite(i, frame, NULL, sprframe, angle, sprframe->flip & (1<<angle));
|
||||||
|
LUA_PushUserdata(L, sprframe->rotsprite.patch[angle][rot], META_PATCH);
|
||||||
|
lua_pushboolean(L, false);
|
||||||
|
lua_pushboolean(L, true);
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// push both the patch and it's "flip" value
|
// push both the patch and it's "flip" value
|
||||||
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_PATCH), META_PATCH);
|
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_PATCH), META_PATCH);
|
||||||
lua_pushboolean(L, (sprframe->flip & (1<<angle)) != 0);
|
lua_pushboolean(L, (sprframe->flip & (1<<angle)) != 0);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// v.getSprite2Patch(skin, sprite, [super?,] [frame, [angle]])
|
// v.getSprite2Patch(skin, sprite, [super?,] [frame, [angle, [rollangle]]])
|
||||||
static int libd_getSprite2Patch(lua_State *L)
|
static int libd_getSprite2Patch(lua_State *L)
|
||||||
{
|
{
|
||||||
INT32 i; // skin number
|
INT32 i; // skin number
|
||||||
|
@ -570,6 +592,24 @@ static int libd_getSprite2Patch(lua_State *L)
|
||||||
if (angle >= ((sprframe->rotate & SRF_3DGE) ? 16 : 8)) // out of range?
|
if (angle >= ((sprframe->rotate & SRF_3DGE) ? 16 : 8)) // out of range?
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#ifdef ROTSPRITE
|
||||||
|
if (lua_isnumber(L, 4))
|
||||||
|
{
|
||||||
|
// rotsprite?????
|
||||||
|
angle_t rollangle = luaL_checkangle(L, 4);
|
||||||
|
INT32 rot = R_GetRollAngle(rollangle);
|
||||||
|
|
||||||
|
if (rot) {
|
||||||
|
if (!(sprframe->rotsprite.cached & (1<<angle)))
|
||||||
|
R_CacheRotSprite(SPR_PLAY, frame, &skins[i].sprinfo[j], sprframe, angle, sprframe->flip & (1<<angle));
|
||||||
|
LUA_PushUserdata(L, sprframe->rotsprite.patch[angle][rot], META_PATCH);
|
||||||
|
lua_pushboolean(L, false);
|
||||||
|
lua_pushboolean(L, true);
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// push both the patch and it's "flip" value
|
// push both the patch and it's "flip" value
|
||||||
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_PATCH), META_PATCH);
|
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_PATCH), META_PATCH);
|
||||||
lua_pushboolean(L, (sprframe->flip & (1<<angle)) != 0);
|
lua_pushboolean(L, (sprframe->flip & (1<<angle)) != 0);
|
||||||
|
@ -1214,7 +1254,7 @@ void LUAh_GameHUD(player_t *stplayr)
|
||||||
|
|
||||||
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
||||||
I_Assert(lua_istable(gL, -1));
|
I_Assert(lua_istable(gL, -1));
|
||||||
lua_rawgeti(gL, -1, 2); // HUD[2] = rendering funcs
|
lua_rawgeti(gL, -1, 2+hudhook_game); // HUD[2] = rendering funcs
|
||||||
I_Assert(lua_istable(gL, -1));
|
I_Assert(lua_istable(gL, -1));
|
||||||
|
|
||||||
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
||||||
|
@ -1248,7 +1288,7 @@ void LUAh_ScoresHUD(void)
|
||||||
|
|
||||||
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
||||||
I_Assert(lua_istable(gL, -1));
|
I_Assert(lua_istable(gL, -1));
|
||||||
lua_rawgeti(gL, -1, 3); // HUD[3] = rendering funcs
|
lua_rawgeti(gL, -1, 2+hudhook_scores); // HUD[3] = rendering funcs
|
||||||
I_Assert(lua_istable(gL, -1));
|
I_Assert(lua_istable(gL, -1));
|
||||||
|
|
||||||
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
||||||
|
@ -1273,7 +1313,7 @@ void LUAh_TitleHUD(void)
|
||||||
|
|
||||||
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
||||||
I_Assert(lua_istable(gL, -1));
|
I_Assert(lua_istable(gL, -1));
|
||||||
lua_rawgeti(gL, -1, 4); // HUD[4] = rendering funcs
|
lua_rawgeti(gL, -1, 2+hudhook_title); // HUD[5] = rendering funcs
|
||||||
I_Assert(lua_istable(gL, -1));
|
I_Assert(lua_istable(gL, -1));
|
||||||
|
|
||||||
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
||||||
|
@ -1298,7 +1338,7 @@ void LUAh_TitleCardHUD(player_t *stplayr)
|
||||||
|
|
||||||
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
||||||
I_Assert(lua_istable(gL, -1));
|
I_Assert(lua_istable(gL, -1));
|
||||||
lua_rawgeti(gL, -1, 5); // HUD[5] = rendering funcs
|
lua_rawgeti(gL, -1, 2+hudhook_titlecard); // HUD[6] = rendering funcs
|
||||||
I_Assert(lua_istable(gL, -1));
|
I_Assert(lua_istable(gL, -1));
|
||||||
|
|
||||||
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
||||||
|
@ -1332,7 +1372,7 @@ void LUAh_IntermissionHUD(void)
|
||||||
|
|
||||||
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
||||||
I_Assert(lua_istable(gL, -1));
|
I_Assert(lua_istable(gL, -1));
|
||||||
lua_rawgeti(gL, -1, 4); // HUD[4] = rendering funcs
|
lua_rawgeti(gL, -1, 2+hudhook_intermission); // HUD[4] = rendering funcs
|
||||||
I_Assert(lua_istable(gL, -1));
|
I_Assert(lua_istable(gL, -1));
|
||||||
|
|
||||||
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
||||||
|
|
|
@ -120,6 +120,8 @@ static int player_get(lua_State *L)
|
||||||
lua_pushfixed(L, plr->deltaviewheight);
|
lua_pushfixed(L, plr->deltaviewheight);
|
||||||
else if (fastcmp(field,"bob"))
|
else if (fastcmp(field,"bob"))
|
||||||
lua_pushfixed(L, plr->bob);
|
lua_pushfixed(L, plr->bob);
|
||||||
|
else if (fastcmp(field,"viewrollangle"))
|
||||||
|
lua_pushangle(L, plr->viewrollangle);
|
||||||
else if (fastcmp(field,"aiming"))
|
else if (fastcmp(field,"aiming"))
|
||||||
lua_pushangle(L, plr->aiming);
|
lua_pushangle(L, plr->aiming);
|
||||||
else if (fastcmp(field,"drawangle"))
|
else if (fastcmp(field,"drawangle"))
|
||||||
|
@ -417,6 +419,8 @@ static int player_set(lua_State *L)
|
||||||
plr->deltaviewheight = luaL_checkfixed(L, 3);
|
plr->deltaviewheight = luaL_checkfixed(L, 3);
|
||||||
else if (fastcmp(field,"bob"))
|
else if (fastcmp(field,"bob"))
|
||||||
plr->bob = luaL_checkfixed(L, 3);
|
plr->bob = luaL_checkfixed(L, 3);
|
||||||
|
else if (fastcmp(field,"viewrollangle"))
|
||||||
|
plr->viewrollangle = luaL_checkangle(L, 3);
|
||||||
else if (fastcmp(field,"aiming")) {
|
else if (fastcmp(field,"aiming")) {
|
||||||
plr->aiming = luaL_checkangle(L, 3);
|
plr->aiming = luaL_checkangle(L, 3);
|
||||||
if (plr == &players[consoleplayer])
|
if (plr == &players[consoleplayer])
|
||||||
|
|
|
@ -102,6 +102,9 @@ int LUA_PushGlobals(lua_State *L, const char *word)
|
||||||
} else if (fastcmp(word,"circuitmap")) {
|
} else if (fastcmp(word,"circuitmap")) {
|
||||||
lua_pushboolean(L, circuitmap);
|
lua_pushboolean(L, circuitmap);
|
||||||
return 1;
|
return 1;
|
||||||
|
} else if (fastcmp(word,"stoppedclock")) {
|
||||||
|
lua_pushboolean(L, stoppedclock);
|
||||||
|
return 1;
|
||||||
} else if (fastcmp(word,"netgame")) {
|
} else if (fastcmp(word,"netgame")) {
|
||||||
lua_pushboolean(L, netgame);
|
lua_pushboolean(L, netgame);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
96
src/m_menu.c
96
src/m_menu.c
|
@ -231,6 +231,8 @@ static void M_Credits(INT32 choice);
|
||||||
static void M_SoundTest(INT32 choice);
|
static void M_SoundTest(INT32 choice);
|
||||||
static void M_PandorasBox(INT32 choice);
|
static void M_PandorasBox(INT32 choice);
|
||||||
static void M_EmblemHints(INT32 choice);
|
static void M_EmblemHints(INT32 choice);
|
||||||
|
static void M_HandleEmblemHints(INT32 choice);
|
||||||
|
UINT32 hintpage = 1;
|
||||||
static void M_HandleChecklist(INT32 choice);
|
static void M_HandleChecklist(INT32 choice);
|
||||||
menu_t SR_MainDef, SR_UnlockChecklistDef;
|
menu_t SR_MainDef, SR_UnlockChecklistDef;
|
||||||
|
|
||||||
|
@ -727,8 +729,9 @@ static menuitem_t SR_SoundTestMenu[] =
|
||||||
|
|
||||||
static menuitem_t SR_EmblemHintMenu[] =
|
static menuitem_t SR_EmblemHintMenu[] =
|
||||||
{
|
{
|
||||||
{IT_STRING|IT_CVAR, NULL, "Emblem Radar", &cv_itemfinder, 10},
|
{IT_STRING | IT_ARROWS, NULL, "Page", M_HandleEmblemHints, 10},
|
||||||
{IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SPauseDef, 20}
|
{IT_STRING|IT_CVAR, NULL, "Emblem Radar", &cv_itemfinder, 20},
|
||||||
|
{IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SPauseDef, 30}
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
|
@ -7234,18 +7237,33 @@ finishchecklist:
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NUMHINTS 5
|
#define NUMHINTS 5
|
||||||
|
|
||||||
static void M_EmblemHints(INT32 choice)
|
static void M_EmblemHints(INT32 choice)
|
||||||
{
|
{
|
||||||
|
INT32 i;
|
||||||
|
UINT32 local = 0;
|
||||||
|
emblem_t *emblem;
|
||||||
|
for (i = 0; i < numemblems; i++)
|
||||||
|
{
|
||||||
|
emblem = &emblemlocations[i];
|
||||||
|
if (emblem->level != gamemap || emblem->type > ET_SKIN)
|
||||||
|
continue;
|
||||||
|
if (++local > NUMHINTS*2)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
(void)choice;
|
(void)choice;
|
||||||
SR_EmblemHintMenu[0].status = (M_SecretUnlocked(SECRET_ITEMFINDER)) ? (IT_CVAR|IT_STRING) : (IT_SECRET);
|
SR_EmblemHintMenu[0].status = (local > NUMHINTS*2) ? (IT_STRING | IT_ARROWS) : (IT_DISABLED);
|
||||||
|
SR_EmblemHintMenu[1].status = (M_SecretUnlocked(SECRET_ITEMFINDER)) ? (IT_CVAR|IT_STRING) : (IT_SECRET);
|
||||||
|
hintpage = 1;
|
||||||
M_SetupNextMenu(&SR_EmblemHintDef);
|
M_SetupNextMenu(&SR_EmblemHintDef);
|
||||||
itemOn = 1; // always start on back.
|
itemOn = 2; // always start on back.
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_DrawEmblemHints(void)
|
static void M_DrawEmblemHints(void)
|
||||||
{
|
{
|
||||||
INT32 i, j = 0, x, y, left_hints = NUMHINTS;
|
INT32 i, j = 0, x, y, left_hints = NUMHINTS, pageflag = 0;
|
||||||
UINT32 collected = 0, local = 0;
|
UINT32 collected = 0, totalemblems = 0, local = 0;
|
||||||
emblem_t *emblem;
|
emblem_t *emblem;
|
||||||
const char *hint;
|
const char *hint;
|
||||||
|
|
||||||
|
@ -7254,17 +7272,34 @@ static void M_DrawEmblemHints(void)
|
||||||
emblem = &emblemlocations[i];
|
emblem = &emblemlocations[i];
|
||||||
if (emblem->level != gamemap || emblem->type > ET_SKIN)
|
if (emblem->level != gamemap || emblem->type > ET_SKIN)
|
||||||
continue;
|
continue;
|
||||||
if (++local >= NUMHINTS*2)
|
|
||||||
break;
|
local++;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = (local > NUMHINTS ? 4 : 12);
|
x = (local > NUMHINTS ? 4 : 12);
|
||||||
y = 8;
|
y = 8;
|
||||||
|
|
||||||
// If there are more than 1 page's but less than 2 pages' worth of emblems,
|
if (local > NUMHINTS){
|
||||||
|
if (local > ((hintpage-1)*NUMHINTS*2) && local < ((hintpage)*NUMHINTS*2)){
|
||||||
|
if (NUMHINTS % 2 == 1)
|
||||||
|
left_hints = (local - ((hintpage-1)*NUMHINTS*2) + 1) / 2;
|
||||||
|
else
|
||||||
|
left_hints = (local - ((hintpage-1)*NUMHINTS*2)) / 2;
|
||||||
|
}else{
|
||||||
|
left_hints = NUMHINTS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (local > NUMHINTS*2){
|
||||||
|
if (itemOn == 0){
|
||||||
|
pageflag = V_YELLOWMAP;
|
||||||
|
}
|
||||||
|
V_DrawString(currentMenu->x + 40, currentMenu->y + 10, pageflag, va("%d of %d",hintpage, local/(NUMHINTS*2) + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there are more than 1 page's but less than 2 pages' worth of emblems on the last possible page,
|
||||||
// put half (rounded up) of the hints on the left, and half (rounded down) on the right
|
// put half (rounded up) of the hints on the left, and half (rounded down) on the right
|
||||||
if (local > NUMHINTS && local < (NUMHINTS*2)-1)
|
|
||||||
left_hints = (local + 1) / 2;
|
|
||||||
|
|
||||||
if (!local)
|
if (!local)
|
||||||
V_DrawCenteredString(160, 48, V_YELLOWMAP, "No hidden emblems on this map.");
|
V_DrawCenteredString(160, 48, V_YELLOWMAP, "No hidden emblems on this map.");
|
||||||
|
@ -7274,6 +7309,10 @@ static void M_DrawEmblemHints(void)
|
||||||
if (emblem->level != gamemap || emblem->type > ET_SKIN)
|
if (emblem->level != gamemap || emblem->type > ET_SKIN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
totalemblems++;
|
||||||
|
|
||||||
|
if (totalemblems >= ((hintpage-1)*(NUMHINTS*2) + 1) && totalemblems < (hintpage*NUMHINTS*2)+1){
|
||||||
|
|
||||||
if (emblem->collected)
|
if (emblem->collected)
|
||||||
{
|
{
|
||||||
collected = V_GREENMAP;
|
collected = V_GREENMAP;
|
||||||
|
@ -7291,6 +7330,7 @@ static void M_DrawEmblemHints(void)
|
||||||
else
|
else
|
||||||
hint = M_GetText("No hint available for this emblem.");
|
hint = M_GetText("No hint available for this emblem.");
|
||||||
hint = V_WordWrap(40, BASEVIDWIDTH-12, 0, hint);
|
hint = V_WordWrap(40, BASEVIDWIDTH-12, 0, hint);
|
||||||
|
//always draw tiny if we have more than NUMHINTS*2, visually more appealing
|
||||||
if (local > NUMHINTS)
|
if (local > NUMHINTS)
|
||||||
V_DrawThinString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint);
|
V_DrawThinString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint);
|
||||||
else
|
else
|
||||||
|
@ -7298,6 +7338,9 @@ static void M_DrawEmblemHints(void)
|
||||||
|
|
||||||
y += 28;
|
y += 28;
|
||||||
|
|
||||||
|
// If there are more than 1 page's but less than 2 pages' worth of emblems on the last possible page,
|
||||||
|
// put half (rounded up) of the hints on the left, and half (rounded down) on the right
|
||||||
|
|
||||||
if (++j == left_hints)
|
if (++j == left_hints)
|
||||||
{
|
{
|
||||||
x = 4+(BASEVIDWIDTH/2);
|
x = 4+(BASEVIDWIDTH/2);
|
||||||
|
@ -7306,10 +7349,40 @@ static void M_DrawEmblemHints(void)
|
||||||
else if (j >= NUMHINTS*2)
|
else if (j >= NUMHINTS*2)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
M_DrawGenericMenu();
|
M_DrawGenericMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void M_HandleEmblemHints(INT32 choice)
|
||||||
|
{
|
||||||
|
INT32 i;
|
||||||
|
emblem_t *emblem;
|
||||||
|
UINT32 stageemblems = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < numemblems; i++)
|
||||||
|
{
|
||||||
|
emblem = &emblemlocations[i];
|
||||||
|
if (emblem->level != gamemap || emblem->type > ET_SKIN)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
stageemblems++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (choice == 0){
|
||||||
|
if (hintpage > 1){
|
||||||
|
hintpage--;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (hintpage < ((stageemblems-1)/(NUMHINTS*2) + 1)){
|
||||||
|
hintpage++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*static void M_DrawSkyRoom(void)
|
/*static void M_DrawSkyRoom(void)
|
||||||
{
|
{
|
||||||
INT32 i, y = 0;
|
INT32 i, y = 0;
|
||||||
|
@ -10846,7 +10919,6 @@ static void M_HandleConnectIP(INT32 choice)
|
||||||
default: // otherwise do nothing.
|
default: // otherwise do nothing.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break; // don't check for typed keys
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l >= 28-1)
|
if (l >= 28-1)
|
||||||
|
|
70
src/p_mobj.c
70
src/p_mobj.c
|
@ -10461,6 +10461,61 @@ void P_SceneryThinker(mobj_t *mobj)
|
||||||
// GAME SPAWN FUNCTIONS
|
// GAME SPAWN FUNCTIONS
|
||||||
//
|
//
|
||||||
|
|
||||||
|
static fixed_t P_DefaultMobjShadowScale (mobj_t *thing)
|
||||||
|
{
|
||||||
|
switch (thing->type)
|
||||||
|
{
|
||||||
|
case MT_PLAYER:
|
||||||
|
case MT_ROLLOUTROCK:
|
||||||
|
|
||||||
|
case MT_EGGMOBILE4_MACE:
|
||||||
|
case MT_SMALLMACE:
|
||||||
|
case MT_BIGMACE:
|
||||||
|
|
||||||
|
case MT_SMALLGRABCHAIN:
|
||||||
|
case MT_BIGGRABCHAIN:
|
||||||
|
|
||||||
|
case MT_YELLOWSPRINGBALL:
|
||||||
|
case MT_REDSPRINGBALL:
|
||||||
|
|
||||||
|
return FRACUNIT;
|
||||||
|
|
||||||
|
case MT_RING:
|
||||||
|
case MT_FLINGRING:
|
||||||
|
|
||||||
|
case MT_BLUESPHERE:
|
||||||
|
case MT_FLINGBLUESPHERE:
|
||||||
|
case MT_BOMBSPHERE:
|
||||||
|
|
||||||
|
case MT_REDTEAMRING:
|
||||||
|
case MT_BLUETEAMRING:
|
||||||
|
case MT_REDFLAG:
|
||||||
|
case MT_BLUEFLAG:
|
||||||
|
|
||||||
|
case MT_EMBLEM:
|
||||||
|
|
||||||
|
case MT_TOKEN:
|
||||||
|
case MT_EMERALD1:
|
||||||
|
case MT_EMERALD2:
|
||||||
|
case MT_EMERALD3:
|
||||||
|
case MT_EMERALD4:
|
||||||
|
case MT_EMERALD5:
|
||||||
|
case MT_EMERALD6:
|
||||||
|
case MT_EMERALD7:
|
||||||
|
case MT_EMERHUNT:
|
||||||
|
case MT_FLINGEMERALD:
|
||||||
|
|
||||||
|
return 2*FRACUNIT/3;
|
||||||
|
|
||||||
|
default:
|
||||||
|
|
||||||
|
if (thing->flags & (MF_ENEMY|MF_BOSS))
|
||||||
|
return FRACUNIT;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_SpawnMobj
|
// P_SpawnMobj
|
||||||
//
|
//
|
||||||
|
@ -10562,20 +10617,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
mobj->z = z;
|
mobj->z = z;
|
||||||
|
|
||||||
// Set shadowscale here, before spawn hook so that Lua can change it
|
// Set shadowscale here, before spawn hook so that Lua can change it
|
||||||
if (
|
mobj->shadowscale = P_DefaultMobjShadowScale(mobj);
|
||||||
type == MT_PLAYER ||
|
|
||||||
type == MT_ROLLOUTROCK ||
|
|
||||||
type == MT_EGGMOBILE4_MACE ||
|
|
||||||
(type >= MT_SMALLMACE && type <= MT_REDSPRINGBALL) ||
|
|
||||||
(mobj->flags & (MF_ENEMY|MF_BOSS))
|
|
||||||
)
|
|
||||||
mobj->shadowscale = FRACUNIT;
|
|
||||||
else if (
|
|
||||||
type >= MT_RING && type <= MT_FLINGEMERALD && type != MT_EMERALDSPAWN
|
|
||||||
)
|
|
||||||
mobj->shadowscale = 2*FRACUNIT/3;
|
|
||||||
else
|
|
||||||
mobj->shadowscale = 0;
|
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
// DANGER! This can cause P_SpawnMobj to return NULL!
|
// DANGER! This can cause P_SpawnMobj to return NULL!
|
||||||
|
|
|
@ -1001,15 +1001,35 @@ static void Polyobj_pushThing(polyobj_t *po, line_t *line, mobj_t *mo)
|
||||||
//
|
//
|
||||||
static void Polyobj_slideThing(mobj_t *mo, fixed_t dx, fixed_t dy)
|
static void Polyobj_slideThing(mobj_t *mo, fixed_t dx, fixed_t dy)
|
||||||
{
|
{
|
||||||
if (mo->player) { // Do something similar to conveyor movement. -Red
|
if (mo->player) { // Finally this doesn't suck eggs -fickle
|
||||||
mo->player->cmomx += dx;
|
fixed_t cdx, cdy;
|
||||||
mo->player->cmomy += dy;
|
|
||||||
|
|
||||||
dx = FixedMul(dx, CARRYFACTOR);
|
cdx = FixedMul(dx, FRACUNIT-CARRYFACTOR);
|
||||||
dy = FixedMul(dy, CARRYFACTOR);
|
cdy = FixedMul(dy, FRACUNIT-CARRYFACTOR);
|
||||||
|
|
||||||
mo->player->cmomx -= dx;
|
if (mo->player->onconveyor == 1)
|
||||||
mo->player->cmomy -= dy;
|
{
|
||||||
|
mo->momx += cdx;
|
||||||
|
mo->momy += cdy;
|
||||||
|
|
||||||
|
// Multiple slides in the same tic, somehow
|
||||||
|
mo->player->cmomx += cdx;
|
||||||
|
mo->player->cmomy += cdy;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (mo->player->onconveyor == 3)
|
||||||
|
{
|
||||||
|
mo->momx += cdx - mo->player->cmomx;
|
||||||
|
mo->momy += cdy - mo->player->cmomy;
|
||||||
|
}
|
||||||
|
|
||||||
|
mo->player->cmomx = cdx;
|
||||||
|
mo->player->cmomy = cdy;
|
||||||
|
}
|
||||||
|
|
||||||
|
dx = FixedMul(dx, FRACUNIT - mo->friction);
|
||||||
|
dy = FixedMul(dy, FRACUNIT - mo->friction);
|
||||||
|
|
||||||
if (mo->player->pflags & PF_SPINNING && (mo->player->rmomx || mo->player->rmomy) && !(mo->player->pflags & PF_STARTDASH)) {
|
if (mo->player->pflags & PF_SPINNING && (mo->player->rmomx || mo->player->rmomy) && !(mo->player->pflags & PF_STARTDASH)) {
|
||||||
#define SPINMULT 5184 // Consider this a substitute for properly calculating FRACUNIT-friction. I'm tired. -Red
|
#define SPINMULT 5184 // Consider this a substitute for properly calculating FRACUNIT-friction. I'm tired. -Red
|
||||||
|
@ -1282,7 +1302,8 @@ static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta,
|
||||||
{
|
{
|
||||||
static INT32 pomovecount = 10000;
|
static INT32 pomovecount = 10000;
|
||||||
INT32 x, y;
|
INT32 x, y;
|
||||||
angle_t deltafine = delta >> ANGLETOFINESHIFT;
|
angle_t deltafine = (((po->angle + delta) >> ANGLETOFINESHIFT) - (po->angle >> ANGLETOFINESHIFT)) & FINEMASK;
|
||||||
|
// This fineshift trickery replaces the old delta>>ANGLETOFINESHIFT; doing it this way avoids loss of precision causing objects to slide off -fickle
|
||||||
|
|
||||||
pomovecount++;
|
pomovecount++;
|
||||||
|
|
||||||
|
@ -1334,19 +1355,10 @@ static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta,
|
||||||
oldxoff = mo->x-origin.x;
|
oldxoff = mo->x-origin.x;
|
||||||
oldyoff = mo->y-origin.y;
|
oldyoff = mo->y-origin.y;
|
||||||
|
|
||||||
if (mo->player) // Hack to fix players sliding off of spinning polys -Red
|
newxoff = FixedMul(oldxoff, c)-FixedMul(oldyoff, s) - oldxoff;
|
||||||
{
|
newyoff = FixedMul(oldyoff, c)+FixedMul(oldxoff, s) - oldyoff;
|
||||||
fixed_t temp;
|
|
||||||
|
|
||||||
temp = FixedMul(oldxoff, c)-FixedMul(oldyoff, s);
|
Polyobj_slideThing(mo, newxoff, newyoff);
|
||||||
oldyoff = FixedMul(oldyoff, c)+FixedMul(oldxoff, s);
|
|
||||||
oldxoff = temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
newxoff = FixedMul(oldxoff, c)-FixedMul(oldyoff, s);
|
|
||||||
newyoff = FixedMul(oldyoff, c)+FixedMul(oldxoff, s);
|
|
||||||
|
|
||||||
Polyobj_slideThing(mo, newxoff-oldxoff, newyoff-oldyoff);
|
|
||||||
|
|
||||||
if (turnthings == 2 || (turnthings == 1 && !mo->player)) {
|
if (turnthings == 2 || (turnthings == 1 && !mo->player)) {
|
||||||
mo->angle += delta;
|
mo->angle += delta;
|
||||||
|
|
|
@ -116,6 +116,7 @@ static void P_NetArchivePlayers(void)
|
||||||
|
|
||||||
WRITEANGLE(save_p, players[i].aiming);
|
WRITEANGLE(save_p, players[i].aiming);
|
||||||
WRITEANGLE(save_p, players[i].drawangle);
|
WRITEANGLE(save_p, players[i].drawangle);
|
||||||
|
WRITEANGLE(save_p, players[i].viewrollangle);
|
||||||
WRITEANGLE(save_p, players[i].awayviewaiming);
|
WRITEANGLE(save_p, players[i].awayviewaiming);
|
||||||
WRITEINT32(save_p, players[i].awayviewtics);
|
WRITEINT32(save_p, players[i].awayviewtics);
|
||||||
WRITEINT16(save_p, players[i].rings);
|
WRITEINT16(save_p, players[i].rings);
|
||||||
|
@ -326,6 +327,7 @@ static void P_NetUnArchivePlayers(void)
|
||||||
|
|
||||||
players[i].aiming = READANGLE(save_p);
|
players[i].aiming = READANGLE(save_p);
|
||||||
players[i].drawangle = READANGLE(save_p);
|
players[i].drawangle = READANGLE(save_p);
|
||||||
|
players[i].viewrollangle = READANGLE(save_p);
|
||||||
players[i].awayviewaiming = READANGLE(save_p);
|
players[i].awayviewaiming = READANGLE(save_p);
|
||||||
players[i].awayviewtics = READINT32(save_p);
|
players[i].awayviewtics = READINT32(save_p);
|
||||||
players[i].rings = READINT16(save_p);
|
players[i].rings = READINT16(save_p);
|
||||||
|
@ -609,7 +611,7 @@ static void P_NetArchiveColormaps(void)
|
||||||
|
|
||||||
WRITEUINT8(save_p, exc->fadestart);
|
WRITEUINT8(save_p, exc->fadestart);
|
||||||
WRITEUINT8(save_p, exc->fadeend);
|
WRITEUINT8(save_p, exc->fadeend);
|
||||||
WRITEUINT8(save_p, exc->fog);
|
WRITEUINT8(save_p, exc->flags);
|
||||||
|
|
||||||
WRITEINT32(save_p, exc->rgba);
|
WRITEINT32(save_p, exc->rgba);
|
||||||
WRITEINT32(save_p, exc->fadergba);
|
WRITEINT32(save_p, exc->fadergba);
|
||||||
|
@ -639,7 +641,7 @@ static void P_NetUnArchiveColormaps(void)
|
||||||
|
|
||||||
for (exc = net_colormaps; i < num_net_colormaps; i++, exc = exc_next)
|
for (exc = net_colormaps; i < num_net_colormaps; i++, exc = exc_next)
|
||||||
{
|
{
|
||||||
UINT8 fadestart, fadeend, fog;
|
UINT8 fadestart, fadeend, flags;
|
||||||
INT32 rgba, fadergba;
|
INT32 rgba, fadergba;
|
||||||
#ifdef EXTRACOLORMAPLUMPS
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
char lumpname[9];
|
char lumpname[9];
|
||||||
|
@ -647,7 +649,7 @@ static void P_NetUnArchiveColormaps(void)
|
||||||
|
|
||||||
fadestart = READUINT8(save_p);
|
fadestart = READUINT8(save_p);
|
||||||
fadeend = READUINT8(save_p);
|
fadeend = READUINT8(save_p);
|
||||||
fog = READUINT8(save_p);
|
flags = READUINT8(save_p);
|
||||||
|
|
||||||
rgba = READINT32(save_p);
|
rgba = READINT32(save_p);
|
||||||
fadergba = READINT32(save_p);
|
fadergba = READINT32(save_p);
|
||||||
|
@ -679,7 +681,7 @@ static void P_NetUnArchiveColormaps(void)
|
||||||
|
|
||||||
exc->fadestart = fadestart;
|
exc->fadestart = fadestart;
|
||||||
exc->fadeend = fadeend;
|
exc->fadeend = fadeend;
|
||||||
exc->fog = fog;
|
exc->flags = flags;
|
||||||
|
|
||||||
exc->rgba = rgba;
|
exc->rgba = rgba;
|
||||||
exc->fadergba = fadergba;
|
exc->fadergba = fadergba;
|
||||||
|
@ -689,7 +691,7 @@ static void P_NetUnArchiveColormaps(void)
|
||||||
exc->lumpname[0] = 0;
|
exc->lumpname[0] = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
existing_exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog);
|
existing_exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags);
|
||||||
|
|
||||||
if (existing_exc)
|
if (existing_exc)
|
||||||
exc->colormap = existing_exc->colormap;
|
exc->colormap = existing_exc->colormap;
|
||||||
|
@ -1255,6 +1257,7 @@ typedef enum
|
||||||
#endif
|
#endif
|
||||||
MD2_COLORIZED = 1<<12,
|
MD2_COLORIZED = 1<<12,
|
||||||
MD2_ROLLANGLE = 1<<13,
|
MD2_ROLLANGLE = 1<<13,
|
||||||
|
MD2_SHADOWSCALE = 1<<14,
|
||||||
} mobj_diff2_t;
|
} mobj_diff2_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@ -1476,6 +1479,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
||||||
diff2 |= MD2_COLORIZED;
|
diff2 |= MD2_COLORIZED;
|
||||||
if (mobj->rollangle)
|
if (mobj->rollangle)
|
||||||
diff2 |= MD2_ROLLANGLE;
|
diff2 |= MD2_ROLLANGLE;
|
||||||
|
if (mobj->shadowscale)
|
||||||
|
diff2 |= MD2_SHADOWSCALE;
|
||||||
if (diff2 != 0)
|
if (diff2 != 0)
|
||||||
diff |= MD_MORE;
|
diff |= MD_MORE;
|
||||||
|
|
||||||
|
@ -1642,6 +1647,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
||||||
WRITEUINT8(save_p, mobj->colorized);
|
WRITEUINT8(save_p, mobj->colorized);
|
||||||
if (diff2 & MD2_ROLLANGLE)
|
if (diff2 & MD2_ROLLANGLE)
|
||||||
WRITEANGLE(save_p, mobj->rollangle);
|
WRITEANGLE(save_p, mobj->rollangle);
|
||||||
|
if (diff2 & MD2_SHADOWSCALE)
|
||||||
|
WRITEFIXED(save_p, mobj->shadowscale);
|
||||||
|
|
||||||
WRITEUINT32(save_p, mobj->mobjnum);
|
WRITEUINT32(save_p, mobj->mobjnum);
|
||||||
}
|
}
|
||||||
|
@ -2721,6 +2728,8 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker)
|
||||||
mobj->colorized = READUINT8(save_p);
|
mobj->colorized = READUINT8(save_p);
|
||||||
if (diff2 & MD2_ROLLANGLE)
|
if (diff2 & MD2_ROLLANGLE)
|
||||||
mobj->rollangle = READANGLE(save_p);
|
mobj->rollangle = READANGLE(save_p);
|
||||||
|
if (diff2 & MD2_SHADOWSCALE)
|
||||||
|
mobj->shadowscale = READFIXED(save_p);
|
||||||
|
|
||||||
if (diff & MD_REDFLAG)
|
if (diff & MD_REDFLAG)
|
||||||
{
|
{
|
||||||
|
|
17
src/p_spec.c
17
src/p_spec.c
|
@ -3516,7 +3516,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
false, // subtract FadeA (no flag for this, just pass negative alpha)
|
false, // subtract FadeA (no flag for this, just pass negative alpha)
|
||||||
false, // subtract FadeStart (we ran out of flags)
|
false, // subtract FadeStart (we ran out of flags)
|
||||||
false, // subtract FadeEnd (we ran out of flags)
|
false, // subtract FadeEnd (we ran out of flags)
|
||||||
false, // ignore Fog (we ran out of flags)
|
false, // ignore Flags (we ran out of flags)
|
||||||
line->flags & ML_DONTPEGBOTTOM,
|
line->flags & ML_DONTPEGBOTTOM,
|
||||||
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].textureoffset >> FRACBITS) : 0,
|
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].textureoffset >> FRACBITS) : 0,
|
||||||
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].rowoffset >> FRACBITS) : 0,
|
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].rowoffset >> FRACBITS) : 0,
|
||||||
|
@ -3883,7 +3883,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
false, // subtract FadeA (no flag for this, just pass negative alpha)
|
false, // subtract FadeA (no flag for this, just pass negative alpha)
|
||||||
false, // subtract FadeStart (we ran out of flags)
|
false, // subtract FadeStart (we ran out of flags)
|
||||||
false, // subtract FadeEnd (we ran out of flags)
|
false, // subtract FadeEnd (we ran out of flags)
|
||||||
false, // ignore Fog (we ran out of flags)
|
false, // ignore Flags (we ran out of flags)
|
||||||
line->flags & ML_DONTPEGBOTTOM,
|
line->flags & ML_DONTPEGBOTTOM,
|
||||||
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].textureoffset >> FRACBITS) : 0,
|
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].textureoffset >> FRACBITS) : 0,
|
||||||
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].rowoffset >> FRACBITS) : 0,
|
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].rowoffset >> FRACBITS) : 0,
|
||||||
|
@ -7081,10 +7081,9 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
case 202: // Fog
|
case 202: // Fog
|
||||||
ffloorflags = FF_EXISTS|FF_RENDERALL|FF_FOG|FF_BOTHPLANES|FF_INVERTPLANES|FF_ALLSIDES|FF_INVERTSIDES|FF_CUTEXTRA|FF_EXTRA|FF_DOUBLESHADOW|FF_CUTSPRITES;
|
ffloorflags = FF_EXISTS|FF_RENDERALL|FF_FOG|FF_BOTHPLANES|FF_INVERTPLANES|FF_ALLSIDES|FF_INVERTSIDES|FF_CUTEXTRA|FF_EXTRA|FF_DOUBLESHADOW|FF_CUTSPRITES;
|
||||||
sec = sides[*lines[i].sidenum].sector - sectors;
|
sec = sides[*lines[i].sidenum].sector - sectors;
|
||||||
// SoM: Because it's fog, check for an extra colormap and set
|
// SoM: Because it's fog, check for an extra colormap and set the fog flag...
|
||||||
// the fog flag...
|
|
||||||
if (sectors[sec].extra_colormap)
|
if (sectors[sec].extra_colormap)
|
||||||
sectors[sec].extra_colormap->fog = 1;
|
sectors[sec].extra_colormap->flags = CMF_FOG;
|
||||||
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
|
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -8472,7 +8471,7 @@ void T_FadeColormap(fadecolormap_t *d)
|
||||||
extracolormap_t *exc;
|
extracolormap_t *exc;
|
||||||
INT32 duration = d->ticbased ? d->duration : 256;
|
INT32 duration = d->ticbased ? d->duration : 256;
|
||||||
fixed_t factor = min(FixedDiv(duration - d->timer, duration), 1*FRACUNIT);
|
fixed_t factor = min(FixedDiv(duration - d->timer, duration), 1*FRACUNIT);
|
||||||
INT16 cr, cg, cb, ca, fadestart, fadeend, fog;
|
INT16 cr, cg, cb, ca, fadestart, fadeend, flags;
|
||||||
INT32 rgba, fadergba;
|
INT32 rgba, fadergba;
|
||||||
|
|
||||||
// NULL failsafes (or intentionally set to signify default)
|
// NULL failsafes (or intentionally set to signify default)
|
||||||
|
@ -8521,7 +8520,7 @@ void T_FadeColormap(fadecolormap_t *d)
|
||||||
|
|
||||||
fadestart = APPLYFADE(d->dest_exc->fadestart, d->source_exc->fadestart, d->sector->extra_colormap->fadestart);
|
fadestart = APPLYFADE(d->dest_exc->fadestart, d->source_exc->fadestart, d->sector->extra_colormap->fadestart);
|
||||||
fadeend = APPLYFADE(d->dest_exc->fadeend, d->source_exc->fadeend, d->sector->extra_colormap->fadeend);
|
fadeend = APPLYFADE(d->dest_exc->fadeend, d->source_exc->fadeend, d->sector->extra_colormap->fadeend);
|
||||||
fog = abs(factor) > FRACUNIT/2 ? d->dest_exc->fog : d->source_exc->fog; // set new fog flag halfway through fade
|
flags = abs(factor) > FRACUNIT/2 ? d->dest_exc->flags : d->source_exc->flags; // set new flags halfway through fade
|
||||||
|
|
||||||
#undef APPLYFADE
|
#undef APPLYFADE
|
||||||
|
|
||||||
|
@ -8529,12 +8528,12 @@ void T_FadeColormap(fadecolormap_t *d)
|
||||||
// setup new colormap
|
// setup new colormap
|
||||||
//////////////////
|
//////////////////
|
||||||
|
|
||||||
if (!(d->sector->extra_colormap = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog)))
|
if (!(d->sector->extra_colormap = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags)))
|
||||||
{
|
{
|
||||||
exc = R_CreateDefaultColormap(false);
|
exc = R_CreateDefaultColormap(false);
|
||||||
exc->fadestart = fadestart;
|
exc->fadestart = fadestart;
|
||||||
exc->fadeend = fadeend;
|
exc->fadeend = fadeend;
|
||||||
exc->fog = (boolean)fog;
|
exc->flags = flags;
|
||||||
exc->rgba = rgba;
|
exc->rgba = rgba;
|
||||||
exc->fadergba = fadergba;
|
exc->fadergba = fadergba;
|
||||||
exc->colormap = R_CreateLightTable(exc);
|
exc->colormap = R_CreateLightTable(exc);
|
||||||
|
|
|
@ -7436,6 +7436,8 @@ static void P_NiGHTSMovement(player_t *player)
|
||||||
else // AngleFixed(R_PointToAngle2()) results in slight inaccuracy! Don't use it unless movement is on both axises.
|
else // AngleFixed(R_PointToAngle2()) results in slight inaccuracy! Don't use it unless movement is on both axises.
|
||||||
newangle = (INT16)FixedInt(AngleFixed(R_PointToAngle2(0,0, cmd->sidemove*FRACUNIT, cmd->forwardmove*FRACUNIT)));
|
newangle = (INT16)FixedInt(AngleFixed(R_PointToAngle2(0,0, cmd->sidemove*FRACUNIT, cmd->forwardmove*FRACUNIT)));
|
||||||
|
|
||||||
|
newangle -= player->viewrollangle / ANG1;
|
||||||
|
|
||||||
if (newangle < 0 && moved)
|
if (newangle < 0 && moved)
|
||||||
newangle = (INT16)(360+newangle);
|
newangle = (INT16)(360+newangle);
|
||||||
}
|
}
|
||||||
|
@ -12174,6 +12176,8 @@ void P_PlayerThink(player_t *player)
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
#ifdef POLYOBJECTS
|
||||||
if (player->onconveyor == 1)
|
if (player->onconveyor == 1)
|
||||||
|
player->onconveyor = 3;
|
||||||
|
else if (player->onconveyor == 3)
|
||||||
player->cmomy = player->cmomx = 0;
|
player->cmomy = player->cmomx = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
48
src/r_data.c
48
src/r_data.c
|
@ -1799,7 +1799,7 @@ extracolormap_t *R_CreateDefaultColormap(boolean lighttable)
|
||||||
extracolormap_t *exc = Z_Calloc(sizeof (*exc), PU_LEVEL, NULL);
|
extracolormap_t *exc = Z_Calloc(sizeof (*exc), PU_LEVEL, NULL);
|
||||||
exc->fadestart = 0;
|
exc->fadestart = 0;
|
||||||
exc->fadeend = 31;
|
exc->fadeend = 31;
|
||||||
exc->fog = 0;
|
exc->flags = 0;
|
||||||
exc->rgba = 0;
|
exc->rgba = 0;
|
||||||
exc->fadergba = 0x19000000;
|
exc->fadergba = 0x19000000;
|
||||||
exc->colormap = lighttable ? R_CreateLightTable(exc) : NULL;
|
exc->colormap = lighttable ? R_CreateLightTable(exc) : NULL;
|
||||||
|
@ -1903,17 +1903,17 @@ void R_AddColormapToList(extracolormap_t *extra_colormap)
|
||||||
//
|
//
|
||||||
#ifdef EXTRACOLORMAPLUMPS
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
||||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump)
|
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump)
|
||||||
#else
|
#else
|
||||||
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
||||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog)
|
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
(!checkparams ? true :
|
(!checkparams ? true :
|
||||||
(fadestart == 0
|
(fadestart == 0
|
||||||
&& fadeend == 31
|
&& fadeend == 31
|
||||||
&& !fog)
|
&& !flags)
|
||||||
)
|
)
|
||||||
&& (!checkrgba ? true : rgba == 0)
|
&& (!checkrgba ? true : rgba == 0)
|
||||||
&& (!checkfadergba ? true : fadergba == 0x19000000)
|
&& (!checkfadergba ? true : fadergba == 0x19000000)
|
||||||
|
@ -1930,9 +1930,9 @@ boolean R_CheckDefaultColormap(extracolormap_t *extra_colormap, boolean checkrgb
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
#ifdef EXTRACOLORMAPLUMPS
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog, extra_colormap->lump);
|
return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags, extra_colormap->lump);
|
||||||
#else
|
#else
|
||||||
return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog);
|
return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1952,7 +1952,7 @@ boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b, bo
|
||||||
(!checkparams ? true :
|
(!checkparams ? true :
|
||||||
(exc_a->fadestart == exc_b->fadestart
|
(exc_a->fadestart == exc_b->fadestart
|
||||||
&& exc_a->fadeend == exc_b->fadeend
|
&& exc_a->fadeend == exc_b->fadeend
|
||||||
&& exc_a->fog == exc_b->fog)
|
&& exc_a->flags == exc_b->flags)
|
||||||
)
|
)
|
||||||
&& (!checkrgba ? true : exc_a->rgba == exc_b->rgba)
|
&& (!checkrgba ? true : exc_a->rgba == exc_b->rgba)
|
||||||
&& (!checkfadergba ? true : exc_a->fadergba == exc_b->fadergba)
|
&& (!checkfadergba ? true : exc_a->fadergba == exc_b->fadergba)
|
||||||
|
@ -1968,9 +1968,9 @@ boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b, bo
|
||||||
// NOTE: Returns NULL if no match is found
|
// NOTE: Returns NULL if no match is found
|
||||||
//
|
//
|
||||||
#ifdef EXTRACOLORMAPLUMPS
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump)
|
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump)
|
||||||
#else
|
#else
|
||||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog)
|
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
extracolormap_t *exc;
|
extracolormap_t *exc;
|
||||||
|
@ -1982,7 +1982,7 @@ extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8
|
||||||
&& fadergba == exc->fadergba
|
&& fadergba == exc->fadergba
|
||||||
&& fadestart == exc->fadestart
|
&& fadestart == exc->fadestart
|
||||||
&& fadeend == exc->fadeend
|
&& fadeend == exc->fadeend
|
||||||
&& fog == exc->fog
|
&& flags == exc->flags
|
||||||
#ifdef EXTRACOLORMAPLUMPS
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
&& (lump != LUMPERROR && lump == exc->lump)
|
&& (lump != LUMPERROR && lump == exc->lump)
|
||||||
#endif
|
#endif
|
||||||
|
@ -2001,9 +2001,9 @@ extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8
|
||||||
extracolormap_t *R_GetColormapFromList(extracolormap_t *extra_colormap)
|
extracolormap_t *R_GetColormapFromList(extracolormap_t *extra_colormap)
|
||||||
{
|
{
|
||||||
#ifdef EXTRACOLORMAPLUMPS
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog, extra_colormap->lump);
|
return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags, extra_colormap->lump);
|
||||||
#else
|
#else
|
||||||
return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog);
|
return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2035,7 +2035,7 @@ extracolormap_t *R_ColormapForName(char *name)
|
||||||
// is no real way to tell how GL should handle a colormap lump anyway..
|
// is no real way to tell how GL should handle a colormap lump anyway..
|
||||||
exc->fadestart = 0;
|
exc->fadestart = 0;
|
||||||
exc->fadeend = 31;
|
exc->fadeend = 31;
|
||||||
exc->fog = 0;
|
exc->flags = 0;
|
||||||
exc->rgba = 0;
|
exc->rgba = 0;
|
||||||
exc->fadergba = 0x19000000;
|
exc->fadergba = 0x19000000;
|
||||||
|
|
||||||
|
@ -2192,7 +2192,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
||||||
// default values
|
// default values
|
||||||
UINT8 cr = 0, cg = 0, cb = 0, ca = 0, cfr = 0, cfg = 0, cfb = 0, cfa = 25;
|
UINT8 cr = 0, cg = 0, cb = 0, ca = 0, cfr = 0, cfg = 0, cfb = 0, cfa = 25;
|
||||||
UINT32 fadestart = 0, fadeend = 31;
|
UINT32 fadestart = 0, fadeend = 31;
|
||||||
UINT8 fog = 0;
|
UINT8 flags = 0;
|
||||||
INT32 rgba = 0, fadergba = 0x19000000;
|
INT32 rgba = 0, fadergba = 0x19000000;
|
||||||
|
|
||||||
#define HEX2INT(x) (UINT32)(x >= '0' && x <= '9' ? x - '0' : x >= 'a' && x <= 'f' ? x - 'a' + 10 : x >= 'A' && x <= 'F' ? x - 'A' + 10 : 0)
|
#define HEX2INT(x) (UINT32)(x >= '0' && x <= '9' ? x - '0' : x >= 'a' && x <= 'f' ? x - 'a' + 10 : x >= 'A' && x <= 'F' ? x - 'A' + 10 : 0)
|
||||||
|
@ -2241,12 +2241,12 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
||||||
|
|
||||||
#define NUMFROMCHAR(c) (c >= '0' && c <= '9' ? c - '0' : 0)
|
#define NUMFROMCHAR(c) (c >= '0' && c <= '9' ? c - '0' : 0)
|
||||||
|
|
||||||
// Get parameters like fadestart, fadeend, and the fogflag
|
// Get parameters like fadestart, fadeend, and flags
|
||||||
if (p2[0] == '#')
|
if (p2[0] == '#')
|
||||||
{
|
{
|
||||||
if (p2[1])
|
if (p2[1])
|
||||||
{
|
{
|
||||||
fog = NUMFROMCHAR(p2[1]);
|
flags = NUMFROMCHAR(p2[1]);
|
||||||
if (p2[2] && p2[3])
|
if (p2[2] && p2[3])
|
||||||
{
|
{
|
||||||
fadestart = NUMFROMCHAR(p2[3]) + (NUMFROMCHAR(p2[2]) * 10);
|
fadestart = NUMFROMCHAR(p2[3]) + (NUMFROMCHAR(p2[2]) * 10);
|
||||||
|
@ -2313,18 +2313,18 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
||||||
|
|
||||||
// Did we just make a default colormap?
|
// Did we just make a default colormap?
|
||||||
#ifdef EXTRACOLORMAPLUMPS
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, fog, LUMPERROR))
|
if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, flags, LUMPERROR))
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
#else
|
||||||
if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, fog))
|
if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, flags))
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Look for existing colormaps
|
// Look for existing colormaps
|
||||||
#ifdef EXTRACOLORMAPLUMPS
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog, LUMPERROR);
|
exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags, LUMPERROR);
|
||||||
#else
|
#else
|
||||||
exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog);
|
exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags);
|
||||||
#endif
|
#endif
|
||||||
if (exc)
|
if (exc)
|
||||||
return exc;
|
return exc;
|
||||||
|
@ -2336,7 +2336,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
||||||
|
|
||||||
extra_colormap->fadestart = (UINT16)fadestart;
|
extra_colormap->fadestart = (UINT16)fadestart;
|
||||||
extra_colormap->fadeend = (UINT16)fadeend;
|
extra_colormap->fadeend = (UINT16)fadeend;
|
||||||
extra_colormap->fog = fog;
|
extra_colormap->flags = flags;
|
||||||
|
|
||||||
extra_colormap->rgba = rgba;
|
extra_colormap->rgba = rgba;
|
||||||
extra_colormap->fadergba = fadergba;
|
extra_colormap->fadergba = fadergba;
|
||||||
|
@ -2363,7 +2363,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
||||||
extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend,
|
extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend,
|
||||||
boolean subR, boolean subG, boolean subB, boolean subA,
|
boolean subR, boolean subG, boolean subB, boolean subA,
|
||||||
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
||||||
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFog,
|
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFlags,
|
||||||
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
||||||
boolean lighttable)
|
boolean lighttable)
|
||||||
{
|
{
|
||||||
|
@ -2451,8 +2451,8 @@ extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *ex
|
||||||
// HACK: fadeend defaults to 31, so don't add anything in this case
|
// HACK: fadeend defaults to 31, so don't add anything in this case
|
||||||
, 31), 0);
|
, 31), 0);
|
||||||
|
|
||||||
if (!ignoreFog) // overwrite fog with new value
|
if (!ignoreFlags) // overwrite flags with new value
|
||||||
exc_augend->fog = exc_addend->fog;
|
exc_augend->flags = exc_addend->flags;
|
||||||
|
|
||||||
///////////////////
|
///////////////////
|
||||||
// put it together
|
// put it together
|
||||||
|
|
10
src/r_data.h
10
src/r_data.h
|
@ -135,12 +135,12 @@ void R_AddColormapToList(extracolormap_t *extra_colormap);
|
||||||
|
|
||||||
#ifdef EXTRACOLORMAPLUMPS
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
||||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump);
|
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump);
|
||||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump);
|
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump);
|
||||||
#else
|
#else
|
||||||
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
||||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog);
|
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags);
|
||||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog);
|
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags);
|
||||||
#endif
|
#endif
|
||||||
boolean R_CheckDefaultColormap(extracolormap_t *extra_colormap, boolean checkrgba, boolean checkfadergba, boolean checkparams);
|
boolean R_CheckDefaultColormap(extracolormap_t *extra_colormap, boolean checkrgba, boolean checkfadergba, boolean checkparams);
|
||||||
boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b, boolean checkrgba, boolean checkfadergba, boolean checkparams);
|
boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b, boolean checkrgba, boolean checkfadergba, boolean checkparams);
|
||||||
|
@ -151,7 +151,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3);
|
||||||
extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend,
|
extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend,
|
||||||
boolean subR, boolean subG, boolean subB, boolean subA,
|
boolean subR, boolean subG, boolean subB, boolean subA,
|
||||||
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
||||||
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFog,
|
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFlags,
|
||||||
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
||||||
boolean lighttable);
|
boolean lighttable);
|
||||||
#ifdef EXTRACOLORMAPLUMPS
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
|
|
|
@ -53,11 +53,14 @@ typedef struct
|
||||||
// Could even use more than 32 levels.
|
// Could even use more than 32 levels.
|
||||||
typedef UINT8 lighttable_t;
|
typedef UINT8 lighttable_t;
|
||||||
|
|
||||||
|
#define CMF_FADEFULLBRIGHTSPRITES 1
|
||||||
|
#define CMF_FOG 4
|
||||||
|
|
||||||
// ExtraColormap type. Use for extra_colormaps from now on.
|
// ExtraColormap type. Use for extra_colormaps from now on.
|
||||||
typedef struct extracolormap_s
|
typedef struct extracolormap_s
|
||||||
{
|
{
|
||||||
UINT8 fadestart, fadeend;
|
UINT8 fadestart, fadeend;
|
||||||
UINT8 fog; // categorical value, not boolean
|
UINT8 flags;
|
||||||
|
|
||||||
// store rgba values in combined bitwise
|
// store rgba values in combined bitwise
|
||||||
// also used in OpenGL instead lighttables
|
// also used in OpenGL instead lighttables
|
||||||
|
|
|
@ -644,6 +644,7 @@ void R_CalcTiltedLighting(fixed_t start, fixed_t end)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define PLANELIGHTFLOAT (BASEVIDWIDTH * BASEVIDWIDTH / vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f * FIXED_TO_FLOAT(fovtan))
|
||||||
|
|
||||||
/** \brief The R_DrawTiltedSpan_8 function
|
/** \brief The R_DrawTiltedSpan_8 function
|
||||||
Draw slopes! Holy sheit!
|
Draw slopes! Holy sheit!
|
||||||
|
@ -669,7 +670,7 @@ void R_DrawTiltedSpan_8(void)
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = PLANELIGHTFLOAT;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
|
@ -805,7 +806,7 @@ void R_DrawTiltedTranslucentSpan_8(void)
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = PLANELIGHTFLOAT;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
|
@ -942,7 +943,7 @@ void R_DrawTiltedTranslucentWaterSpan_8(void)
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = PLANELIGHTFLOAT;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
|
@ -1078,7 +1079,7 @@ void R_DrawTiltedSplat_8(void)
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = PLANELIGHTFLOAT;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
|
|
|
@ -62,6 +62,9 @@ void R_DrawSpan_NPO2_8 (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
|
|
||||||
|
#define PLANELIGHTFLOAT (BASEVIDWIDTH * BASEVIDWIDTH / vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f * FIXED_TO_FLOAT(fovtan))
|
||||||
|
|
||||||
/** \brief The R_DrawTiltedSpan_NPO2_8 function
|
/** \brief The R_DrawTiltedSpan_NPO2_8 function
|
||||||
Draw slopes! Holy sheit!
|
Draw slopes! Holy sheit!
|
||||||
*/
|
*/
|
||||||
|
@ -86,7 +89,7 @@ void R_DrawTiltedSpan_NPO2_8(void)
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = PLANELIGHTFLOAT;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
|
@ -282,7 +285,7 @@ void R_DrawTiltedTranslucentSpan_NPO2_8(void)
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = PLANELIGHTFLOAT;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
|
@ -476,7 +479,7 @@ void R_DrawTiltedSplat_NPO2_8(void)
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = PLANELIGHTFLOAT;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
|
@ -869,7 +872,7 @@ void R_DrawTiltedTranslucentWaterSpan_NPO2_8(void)
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = PLANELIGHTFLOAT;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
|
|
318
src/r_main.c
318
src/r_main.c
|
@ -547,6 +547,303 @@ static inline void R_InitLightTables(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#define WOUGHMP_WOUGHMP // I got a fish-eye lens - I'll make a rap video with a couple of friends
|
||||||
|
// it's kinda laggy sometimes
|
||||||
|
|
||||||
|
static struct {
|
||||||
|
angle_t rollangle; // pre-shifted by fineshift
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
fixed_t fisheye;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
fixed_t zoomneeded;
|
||||||
|
INT32 *scrmap;
|
||||||
|
INT32 scrmapsize;
|
||||||
|
|
||||||
|
INT32 x1; // clip rendering horizontally for efficiency
|
||||||
|
INT16 ceilingclip[MAXVIDWIDTH], floorclip[MAXVIDWIDTH];
|
||||||
|
|
||||||
|
boolean use;
|
||||||
|
} viewmorph = {
|
||||||
|
0,
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
0,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
FRACUNIT,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
|
||||||
|
0,
|
||||||
|
{}, {},
|
||||||
|
|
||||||
|
false
|
||||||
|
};
|
||||||
|
|
||||||
|
void R_CheckViewMorph(void)
|
||||||
|
{
|
||||||
|
float zoomfactor, rollcos, rollsin;
|
||||||
|
float x1, y1, x2, y2;
|
||||||
|
fixed_t temp;
|
||||||
|
INT32 end, vx, vy, pos, usedpos;
|
||||||
|
INT32 usedx, usedy, halfwidth = vid.width/2, halfheight = vid.height/2;
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
float fisheyemap[MAXVIDWIDTH/2 + 1];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
angle_t rollangle = players[displayplayer].viewrollangle;
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
fixed_t fisheye = cv_cam2_turnmultiplier.value; // temporary test value
|
||||||
|
#endif
|
||||||
|
|
||||||
|
rollangle >>= ANGLETOFINESHIFT;
|
||||||
|
rollangle = ((rollangle+2) & ~3) & FINEMASK; // Limit the distinct number of angles to reduce recalcs from angles changing a lot.
|
||||||
|
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
fisheye &= ~0x7FF; // Same
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (rollangle == viewmorph.rollangle &&
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
fisheye == viewmorph.fisheye &&
|
||||||
|
#endif
|
||||||
|
viewmorph.scrmapsize == vid.width*vid.height)
|
||||||
|
return; // No change
|
||||||
|
|
||||||
|
viewmorph.rollangle = rollangle;
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
viewmorph.fisheye = fisheye;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (viewmorph.rollangle == 0
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
&& viewmorph.fisheye == 0
|
||||||
|
#endif
|
||||||
|
)
|
||||||
|
{
|
||||||
|
viewmorph.use = false;
|
||||||
|
viewmorph.x1 = 0;
|
||||||
|
if (viewmorph.zoomneeded != FRACUNIT)
|
||||||
|
R_SetViewSize();
|
||||||
|
viewmorph.zoomneeded = FRACUNIT;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewmorph.scrmapsize != vid.width*vid.height)
|
||||||
|
{
|
||||||
|
if (viewmorph.scrmap)
|
||||||
|
free(viewmorph.scrmap);
|
||||||
|
viewmorph.scrmap = malloc(vid.width*vid.height * sizeof(INT32));
|
||||||
|
viewmorph.scrmapsize = vid.width*vid.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
temp = FINECOSINE(rollangle);
|
||||||
|
rollcos = FIXED_TO_FLOAT(temp);
|
||||||
|
temp = FINESINE(rollangle);
|
||||||
|
rollsin = FIXED_TO_FLOAT(temp);
|
||||||
|
|
||||||
|
// Calculate maximum zoom needed
|
||||||
|
x1 = (vid.width*fabsf(rollcos) + vid.height*fabsf(rollsin)) / vid.width;
|
||||||
|
y1 = (vid.height*fabsf(rollcos) + vid.width*fabsf(rollsin)) / vid.height;
|
||||||
|
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
if (fisheye)
|
||||||
|
{
|
||||||
|
float f = FIXED_TO_FLOAT(fisheye);
|
||||||
|
for (vx = 0; vx <= halfwidth; vx++)
|
||||||
|
fisheyemap[vx] = 1.0f / cos(atan(vx * f / halfwidth));
|
||||||
|
|
||||||
|
f = cos(atan(f));
|
||||||
|
if (f < 1.0f)
|
||||||
|
{
|
||||||
|
x1 /= f;
|
||||||
|
y1 /= f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
temp = max(x1, y1)*FRACUNIT;
|
||||||
|
if (temp < FRACUNIT)
|
||||||
|
temp = FRACUNIT;
|
||||||
|
else
|
||||||
|
temp |= 0x3FFF; // Limit how many times the viewport needs to be recalculated
|
||||||
|
|
||||||
|
//CONS_Printf("Setting zoom to %f\n", FIXED_TO_FLOAT(temp));
|
||||||
|
|
||||||
|
if (temp != viewmorph.zoomneeded)
|
||||||
|
{
|
||||||
|
viewmorph.zoomneeded = temp;
|
||||||
|
R_SetViewSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
zoomfactor = FIXED_TO_FLOAT(viewmorph.zoomneeded);
|
||||||
|
|
||||||
|
end = vid.width * vid.height - 1;
|
||||||
|
|
||||||
|
pos = 0;
|
||||||
|
|
||||||
|
// Pre-multiply rollcos and rollsin to use for positional stuff
|
||||||
|
rollcos /= zoomfactor;
|
||||||
|
rollsin /= zoomfactor;
|
||||||
|
|
||||||
|
x1 = -(halfwidth * rollcos - halfheight * rollsin);
|
||||||
|
y1 = -(halfheight * rollcos + halfwidth * rollsin);
|
||||||
|
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
if (fisheye)
|
||||||
|
viewmorph.x1 = (INT32)(halfwidth - (halfwidth * fabsf(rollcos) + halfheight * fabsf(rollsin)) * fisheyemap[halfwidth]);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
viewmorph.x1 = (INT32)(halfwidth - (halfwidth * fabsf(rollcos) + halfheight * fabsf(rollsin)));
|
||||||
|
//CONS_Printf("saving %d cols\n", viewmorph.x1);
|
||||||
|
|
||||||
|
// Set ceilingclip and floorclip
|
||||||
|
for (vx = 0; vx < vid.width; vx++)
|
||||||
|
{
|
||||||
|
viewmorph.ceilingclip[vx] = vid.height;
|
||||||
|
viewmorph.floorclip[vx] = -1;
|
||||||
|
}
|
||||||
|
x2 = x1;
|
||||||
|
y2 = y1;
|
||||||
|
for (vx = 0; vx < vid.width; vx++)
|
||||||
|
{
|
||||||
|
INT16 xa, ya, xb, yb;
|
||||||
|
xa = x2+halfwidth;
|
||||||
|
ya = y2+halfheight-1;
|
||||||
|
xb = vid.width-1-xa;
|
||||||
|
yb = vid.height-1-ya;
|
||||||
|
|
||||||
|
viewmorph.ceilingclip[xa] = min(viewmorph.ceilingclip[xa], ya);
|
||||||
|
viewmorph.floorclip[xa] = max(viewmorph.floorclip[xa], ya);
|
||||||
|
viewmorph.ceilingclip[xb] = min(viewmorph.ceilingclip[xb], yb);
|
||||||
|
viewmorph.floorclip[xb] = max(viewmorph.floorclip[xb], yb);
|
||||||
|
x2 += rollcos;
|
||||||
|
y2 += rollsin;
|
||||||
|
}
|
||||||
|
x2 = x1;
|
||||||
|
y2 = y1;
|
||||||
|
for (vy = 0; vy < vid.height; vy++)
|
||||||
|
{
|
||||||
|
INT16 xa, ya, xb, yb;
|
||||||
|
xa = x2+halfwidth;
|
||||||
|
ya = y2+halfheight;
|
||||||
|
xb = vid.width-1-xa;
|
||||||
|
yb = vid.height-1-ya;
|
||||||
|
|
||||||
|
viewmorph.ceilingclip[xa] = min(viewmorph.ceilingclip[xa], ya);
|
||||||
|
viewmorph.floorclip[xa] = max(viewmorph.floorclip[xa], ya);
|
||||||
|
viewmorph.ceilingclip[xb] = min(viewmorph.ceilingclip[xb], yb);
|
||||||
|
viewmorph.floorclip[xb] = max(viewmorph.floorclip[xb], yb);
|
||||||
|
x2 -= rollsin;
|
||||||
|
y2 += rollcos;
|
||||||
|
}
|
||||||
|
|
||||||
|
//CONS_Printf("Top left corner is %f %f\n", x1, y1);
|
||||||
|
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
if (fisheye)
|
||||||
|
{
|
||||||
|
for (vy = 0; vy < halfheight; vy++)
|
||||||
|
{
|
||||||
|
x2 = x1;
|
||||||
|
y2 = y1;
|
||||||
|
x1 -= rollsin;
|
||||||
|
y1 += rollcos;
|
||||||
|
|
||||||
|
for (vx = 0; vx < vid.width; vx++)
|
||||||
|
{
|
||||||
|
usedx = halfwidth + x2*fisheyemap[(int) floorf(fabsf(y2*zoomfactor))];
|
||||||
|
usedy = halfheight + y2*fisheyemap[(int) floorf(fabsf(x2*zoomfactor))];
|
||||||
|
|
||||||
|
usedpos = usedx + usedy*vid.width;
|
||||||
|
|
||||||
|
viewmorph.scrmap[pos] = usedpos;
|
||||||
|
viewmorph.scrmap[end-pos] = end-usedpos;
|
||||||
|
|
||||||
|
x2 += rollcos;
|
||||||
|
y2 += rollsin;
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
x1 += halfwidth;
|
||||||
|
y1 += halfheight;
|
||||||
|
|
||||||
|
for (vy = 0; vy < halfheight; vy++)
|
||||||
|
{
|
||||||
|
x2 = x1;
|
||||||
|
y2 = y1;
|
||||||
|
x1 -= rollsin;
|
||||||
|
y1 += rollcos;
|
||||||
|
|
||||||
|
for (vx = 0; vx < vid.width; vx++)
|
||||||
|
{
|
||||||
|
usedx = x2;
|
||||||
|
usedy = y2;
|
||||||
|
|
||||||
|
usedpos = usedx + usedy*vid.width;
|
||||||
|
|
||||||
|
viewmorph.scrmap[pos] = usedpos;
|
||||||
|
viewmorph.scrmap[end-pos] = end-usedpos;
|
||||||
|
|
||||||
|
x2 += rollcos;
|
||||||
|
y2 += rollsin;
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef WOUGHMP_WOUGHMP
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
viewmorph.use = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void R_ApplyViewMorph(void)
|
||||||
|
{
|
||||||
|
UINT8 *tmpscr = screens[4];
|
||||||
|
UINT8 *srcscr = screens[0];
|
||||||
|
INT32 p, end = vid.width * vid.height;
|
||||||
|
|
||||||
|
if (!viewmorph.use)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (cv_debug & DBG_VIEWMORPH)
|
||||||
|
{
|
||||||
|
UINT8 border = 32;
|
||||||
|
UINT8 grid = 160;
|
||||||
|
INT32 ws = vid.width / 4;
|
||||||
|
INT32 hs = vid.width * (vid.height / 4);
|
||||||
|
|
||||||
|
memcpy(tmpscr, srcscr, vid.width*vid.height);
|
||||||
|
for (p = 0; p < vid.width; p++)
|
||||||
|
{
|
||||||
|
tmpscr[viewmorph.scrmap[p]] = border;
|
||||||
|
tmpscr[viewmorph.scrmap[p + hs]] = grid;
|
||||||
|
tmpscr[viewmorph.scrmap[p + hs*2]] = grid;
|
||||||
|
tmpscr[viewmorph.scrmap[p + hs*3]] = grid;
|
||||||
|
tmpscr[viewmorph.scrmap[end - 1 - p]] = border;
|
||||||
|
}
|
||||||
|
for (p = vid.width; p < end; p += vid.width)
|
||||||
|
{
|
||||||
|
tmpscr[viewmorph.scrmap[p]] = border;
|
||||||
|
tmpscr[viewmorph.scrmap[p + ws]] = grid;
|
||||||
|
tmpscr[viewmorph.scrmap[p + ws*2]] = grid;
|
||||||
|
tmpscr[viewmorph.scrmap[p + ws*3]] = grid;
|
||||||
|
tmpscr[viewmorph.scrmap[end - 1 - p]] = border;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
for (p = 0; p < end; p++)
|
||||||
|
tmpscr[p] = srcscr[viewmorph.scrmap[p]];
|
||||||
|
|
||||||
|
VID_BlitLinearScreen(tmpscr, screens[0],
|
||||||
|
vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.width);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// R_SetViewSize
|
// R_SetViewSize
|
||||||
|
@ -595,7 +892,7 @@ void R_ExecuteSetViewSize(void)
|
||||||
centeryfrac = centery<<FRACBITS;
|
centeryfrac = centery<<FRACBITS;
|
||||||
|
|
||||||
fov = FixedAngle(cv_fov.value/2) + ANGLE_90;
|
fov = FixedAngle(cv_fov.value/2) + ANGLE_90;
|
||||||
fovtan = FINETANGENT(fov >> ANGLETOFINESHIFT);
|
fovtan = FixedMul(FINETANGENT(fov >> ANGLETOFINESHIFT), viewmorph.zoomneeded);
|
||||||
if (splitscreen == 1) // Splitscreen FOV should be adjusted to maintain expected vertical view
|
if (splitscreen == 1) // Splitscreen FOV should be adjusted to maintain expected vertical view
|
||||||
fovtan = 17*fovtan/10;
|
fovtan = 17*fovtan/10;
|
||||||
|
|
||||||
|
@ -744,7 +1041,7 @@ subsector_t *R_PointInSubsectorOrNull(fixed_t x, fixed_t y)
|
||||||
//
|
//
|
||||||
|
|
||||||
// WARNING: a should be unsigned but to add with 2048, it isn't!
|
// WARNING: a should be unsigned but to add with 2048, it isn't!
|
||||||
#define AIMINGTODY(a) FixedDiv((FINETANGENT((2048+(((INT32)a)>>ANGLETOFINESHIFT)) & FINEMASK)*160)>>FRACBITS, fovtan)
|
#define AIMINGTODY(a) ((FINETANGENT((2048+(((INT32)a)>>ANGLETOFINESHIFT)) & FINEMASK)*160)/fovtan)
|
||||||
|
|
||||||
// recalc necessary stuff for mouseaiming
|
// recalc necessary stuff for mouseaiming
|
||||||
// slopes are already calculated for the full possible view (which is 4*viewheight).
|
// slopes are already calculated for the full possible view (which is 4*viewheight).
|
||||||
|
@ -1081,9 +1378,22 @@ void R_RenderPlayerView(player_t *player)
|
||||||
validcount++;
|
validcount++;
|
||||||
|
|
||||||
// Clear buffers.
|
// Clear buffers.
|
||||||
R_ClearClipSegs();
|
|
||||||
R_ClearDrawSegs();
|
|
||||||
R_ClearPlanes();
|
R_ClearPlanes();
|
||||||
|
if (viewmorph.use)
|
||||||
|
{
|
||||||
|
portalclipstart = viewmorph.x1;
|
||||||
|
portalclipend = viewwidth-viewmorph.x1-1;
|
||||||
|
R_PortalClearClipSegs(portalclipstart, portalclipend);
|
||||||
|
memcpy(ceilingclip, viewmorph.ceilingclip, sizeof(INT16)*vid.width);
|
||||||
|
memcpy(floorclip, viewmorph.floorclip, sizeof(INT16)*vid.width);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
portalclipstart = 0;
|
||||||
|
portalclipend = viewwidth-1;
|
||||||
|
R_ClearClipSegs();
|
||||||
|
}
|
||||||
|
R_ClearDrawSegs();
|
||||||
R_ClearSprites();
|
R_ClearSprites();
|
||||||
#ifdef FLOORSPLATS
|
#ifdef FLOORSPLATS
|
||||||
R_ClearVisibleFloorSplats();
|
R_ClearVisibleFloorSplats();
|
||||||
|
|
|
@ -26,6 +26,7 @@ extern INT32 centerx, centery;
|
||||||
|
|
||||||
extern fixed_t centerxfrac, centeryfrac;
|
extern fixed_t centerxfrac, centeryfrac;
|
||||||
extern fixed_t projection, projectiony;
|
extern fixed_t projection, projectiony;
|
||||||
|
extern fixed_t fovtan; // field of view
|
||||||
|
|
||||||
extern size_t validcount, linecount, loopcount, framecount;
|
extern size_t validcount, linecount, loopcount, framecount;
|
||||||
|
|
||||||
|
@ -45,6 +46,8 @@ extern size_t validcount, linecount, loopcount, framecount;
|
||||||
#define MAXLIGHTZ 128
|
#define MAXLIGHTZ 128
|
||||||
#define LIGHTZSHIFT 20
|
#define LIGHTZSHIFT 20
|
||||||
|
|
||||||
|
#define LIGHTRESOLUTIONFIX (640*fovtan/vid.width)
|
||||||
|
|
||||||
extern lighttable_t *scalelight[LIGHTLEVELS][MAXLIGHTSCALE];
|
extern lighttable_t *scalelight[LIGHTLEVELS][MAXLIGHTSCALE];
|
||||||
extern lighttable_t *scalelightfixed[MAXLIGHTSCALE];
|
extern lighttable_t *scalelightfixed[MAXLIGHTSCALE];
|
||||||
extern lighttable_t *zlight[LIGHTLEVELS][MAXLIGHTZ];
|
extern lighttable_t *zlight[LIGHTLEVELS][MAXLIGHTZ];
|
||||||
|
@ -91,6 +94,9 @@ void R_InitHardwareMode(void);
|
||||||
#endif
|
#endif
|
||||||
void R_ReloadHUDGraphics(void);
|
void R_ReloadHUDGraphics(void);
|
||||||
|
|
||||||
|
void R_CheckViewMorph(void);
|
||||||
|
void R_ApplyViewMorph(void);
|
||||||
|
|
||||||
// just sets setsizeneeded true
|
// just sets setsizeneeded true
|
||||||
extern boolean setsizeneeded;
|
extern boolean setsizeneeded;
|
||||||
void R_SetViewSize(void);
|
void R_SetViewSize(void);
|
||||||
|
|
|
@ -44,9 +44,6 @@
|
||||||
// Quincunx antialiasing of flats!
|
// Quincunx antialiasing of flats!
|
||||||
//#define QUINCUNX
|
//#define QUINCUNX
|
||||||
|
|
||||||
// good night sweet prince
|
|
||||||
#define SHITPLANESPARENCY
|
|
||||||
|
|
||||||
//SoM: 3/23/2000: Use Boom visplane hashing.
|
//SoM: 3/23/2000: Use Boom visplane hashing.
|
||||||
|
|
||||||
visplane_t *visplanes[MAXVISPLANES];
|
visplane_t *visplanes[MAXVISPLANES];
|
||||||
|
@ -995,11 +992,7 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
else // Opaque, but allow transparent flat pixels
|
else // Opaque, but allow transparent flat pixels
|
||||||
spanfunctype = SPANDRAWFUNC_SPLAT;
|
spanfunctype = SPANDRAWFUNC_SPLAT;
|
||||||
|
|
||||||
#ifdef SHITPLANESPARENCY
|
if ((spanfunctype == SPANDRAWFUNC_SPLAT) || (pl->extra_colormap && (pl->extra_colormap->flags & CMF_FOG)))
|
||||||
if ((spanfunctype == SPANDRAWFUNC_SPLAT) != (pl->extra_colormap && (pl->extra_colormap->fog & 4)))
|
|
||||||
#else
|
|
||||||
if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2))
|
|
||||||
#endif
|
|
||||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||||
else
|
else
|
||||||
light = LIGHTLEVELS-1;
|
light = LIGHTLEVELS-1;
|
||||||
|
@ -1053,11 +1046,7 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
else // Opaque, but allow transparent flat pixels
|
else // Opaque, but allow transparent flat pixels
|
||||||
spanfunctype = SPANDRAWFUNC_SPLAT;
|
spanfunctype = SPANDRAWFUNC_SPLAT;
|
||||||
|
|
||||||
#ifdef SHITPLANESPARENCY
|
if ((spanfunctype == SPANDRAWFUNC_SPLAT) || (pl->extra_colormap && (pl->extra_colormap->flags & CMF_FOG)))
|
||||||
if ((spanfunctype == SPANDRAWFUNC_SPLAT) != (pl->extra_colormap && (pl->extra_colormap->fog & 4)))
|
|
||||||
#else
|
|
||||||
if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2))
|
|
||||||
#endif
|
|
||||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||||
else
|
else
|
||||||
light = LIGHTLEVELS-1;
|
light = LIGHTLEVELS-1;
|
||||||
|
|
40
src/r_segs.c
40
src/r_segs.c
|
@ -199,7 +199,7 @@ static void R_DrawWallSplats(void)
|
||||||
// draw the columns
|
// draw the columns
|
||||||
for (dc_x = x1; dc_x <= x2; dc_x++, spryscale += rw_scalestep)
|
for (dc_x = x1; dc_x <= x2; dc_x++, spryscale += rw_scalestep)
|
||||||
{
|
{
|
||||||
pindex = FixedMul(spryscale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT;
|
pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT;
|
||||||
if (pindex >= MAXLIGHTSCALE)
|
if (pindex >= MAXLIGHTSCALE)
|
||||||
pindex = MAXLIGHTSCALE - 1;
|
pindex = MAXLIGHTSCALE - 1;
|
||||||
dc_colormap = walllights[pindex];
|
dc_colormap = walllights[pindex];
|
||||||
|
@ -418,14 +418,14 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||||
rlight->extra_colormap = *light->extra_colormap;
|
rlight->extra_colormap = *light->extra_colormap;
|
||||||
rlight->flags = light->flags;
|
rlight->flags = light->flags;
|
||||||
|
|
||||||
if (rlight->flags & FF_FOG || (rlight->extra_colormap && rlight->extra_colormap->fog))
|
if ((colfunc != colfuncs[COLDRAWFUNC_FUZZY])
|
||||||
|
|| (rlight->flags & FF_FOG)
|
||||||
|
|| (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG)))
|
||||||
lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
|
lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
|
||||||
else if (colfunc == colfuncs[COLDRAWFUNC_FUZZY])
|
|
||||||
lightnum = LIGHTLEVELS - 1;
|
|
||||||
else
|
else
|
||||||
lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
|
lightnum = LIGHTLEVELS - 1;
|
||||||
|
|
||||||
if (rlight->extra_colormap && rlight->extra_colormap->fog)
|
if (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG))
|
||||||
;
|
;
|
||||||
else if (curline->v1->y == curline->v2->y)
|
else if (curline->v1->y == curline->v2->y)
|
||||||
lightnum--;
|
lightnum--;
|
||||||
|
@ -437,18 +437,14 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (colfunc == colfuncs[COLDRAWFUNC_FUZZY])
|
if ((colfunc != colfuncs[COLDRAWFUNC_FUZZY])
|
||||||
{
|
|| (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
|
||||||
if (frontsector->extra_colormap && frontsector->extra_colormap->fog)
|
|
||||||
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
|
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
|
||||||
else
|
else
|
||||||
lightnum = LIGHTLEVELS - 1;
|
lightnum = LIGHTLEVELS - 1;
|
||||||
}
|
|
||||||
else
|
|
||||||
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
|
|
||||||
|
|
||||||
if (colfunc == colfuncs[COLDRAWFUNC_FOG]
|
if (colfunc == colfuncs[COLDRAWFUNC_FOG]
|
||||||
|| (frontsector->extra_colormap && frontsector->extra_colormap->fog))
|
|| (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
|
||||||
;
|
;
|
||||||
else if (curline->v1->y == curline->v2->y)
|
else if (curline->v1->y == curline->v2->y)
|
||||||
lightnum--;
|
lightnum--;
|
||||||
|
@ -599,7 +595,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||||
else
|
else
|
||||||
xwalllights = scalelight[rlight->lightnum];
|
xwalllights = scalelight[rlight->lightnum];
|
||||||
|
|
||||||
pindex = FixedMul(spryscale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT;
|
pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT;
|
||||||
|
|
||||||
if (pindex >= MAXLIGHTSCALE)
|
if (pindex >= MAXLIGHTSCALE)
|
||||||
pindex = MAXLIGHTSCALE - 1;
|
pindex = MAXLIGHTSCALE - 1;
|
||||||
|
@ -644,7 +640,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate lighting
|
// calculate lighting
|
||||||
pindex = FixedMul(spryscale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT;
|
pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT;
|
||||||
|
|
||||||
if (pindex >= MAXLIGHTSCALE)
|
if (pindex >= MAXLIGHTSCALE)
|
||||||
pindex = MAXLIGHTSCALE - 1;
|
pindex = MAXLIGHTSCALE - 1;
|
||||||
|
@ -947,7 +943,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||||
else
|
else
|
||||||
rlight->lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
|
rlight->lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
|
||||||
|
|
||||||
if (pfloor->flags & FF_FOG || rlight->flags & FF_FOG || (rlight->extra_colormap && rlight->extra_colormap->fog))
|
if (pfloor->flags & FF_FOG || rlight->flags & FF_FOG || (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG)))
|
||||||
;
|
;
|
||||||
else if (curline->v1->y == curline->v2->y)
|
else if (curline->v1->y == curline->v2->y)
|
||||||
rlight->lightnum--;
|
rlight->lightnum--;
|
||||||
|
@ -962,7 +958,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Get correct light level!
|
// Get correct light level!
|
||||||
if ((frontsector->extra_colormap && frontsector->extra_colormap->fog))
|
if ((frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
|
||||||
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
|
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
|
||||||
else if (pfloor->flags & FF_FOG)
|
else if (pfloor->flags & FF_FOG)
|
||||||
lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT);
|
lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT);
|
||||||
|
@ -972,7 +968,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||||
lightnum = R_FakeFlat(frontsector, &tempsec, &templight, &templight, false)
|
lightnum = R_FakeFlat(frontsector, &tempsec, &templight, &templight, false)
|
||||||
->lightlevel >> LIGHTSEGSHIFT;
|
->lightlevel >> LIGHTSEGSHIFT;
|
||||||
|
|
||||||
if (pfloor->flags & FF_FOG || (frontsector->extra_colormap && frontsector->extra_colormap->fog));
|
if (pfloor->flags & FF_FOG || (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)));
|
||||||
else if (curline->v1->y == curline->v2->y)
|
else if (curline->v1->y == curline->v2->y)
|
||||||
lightnum--;
|
lightnum--;
|
||||||
else if (curline->v1->x == curline->v2->x)
|
else if (curline->v1->x == curline->v2->x)
|
||||||
|
@ -1188,7 +1184,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||||
else
|
else
|
||||||
xwalllights = scalelight[lightnum];
|
xwalllights = scalelight[lightnum];
|
||||||
|
|
||||||
pindex = FixedMul(spryscale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT;
|
pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT;
|
||||||
|
|
||||||
if (pindex >= MAXLIGHTSCALE)
|
if (pindex >= MAXLIGHTSCALE)
|
||||||
pindex = MAXLIGHTSCALE-1;
|
pindex = MAXLIGHTSCALE-1;
|
||||||
|
@ -1281,7 +1277,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate lighting
|
// calculate lighting
|
||||||
pindex = FixedMul(spryscale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT;
|
pindex = FixedMul(spryscale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT;
|
||||||
|
|
||||||
if (pindex >= MAXLIGHTSCALE)
|
if (pindex >= MAXLIGHTSCALE)
|
||||||
pindex = MAXLIGHTSCALE - 1;
|
pindex = MAXLIGHTSCALE - 1;
|
||||||
|
@ -1486,7 +1482,7 @@ static void R_RenderSegLoop (void)
|
||||||
if (segtextured)
|
if (segtextured)
|
||||||
{
|
{
|
||||||
// calculate lighting
|
// calculate lighting
|
||||||
pindex = FixedMul(rw_scale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT;
|
pindex = FixedMul(rw_scale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT;
|
||||||
|
|
||||||
if (pindex >= MAXLIGHTSCALE)
|
if (pindex >= MAXLIGHTSCALE)
|
||||||
pindex = MAXLIGHTSCALE-1;
|
pindex = MAXLIGHTSCALE-1;
|
||||||
|
@ -1521,7 +1517,7 @@ static void R_RenderSegLoop (void)
|
||||||
else
|
else
|
||||||
xwalllights = scalelight[lightnum];
|
xwalllights = scalelight[lightnum];
|
||||||
|
|
||||||
pindex = FixedMul(rw_scale, FixedDiv(640, vid.width))>>LIGHTSCALESHIFT;
|
pindex = FixedMul(rw_scale, LIGHTRESOLUTIONFIX)>>LIGHTSCALESHIFT;
|
||||||
|
|
||||||
if (pindex >= MAXLIGHTSCALE)
|
if (pindex >= MAXLIGHTSCALE)
|
||||||
pindex = MAXLIGHTSCALE-1;
|
pindex = MAXLIGHTSCALE-1;
|
||||||
|
|
|
@ -76,5 +76,5 @@ void R_SetupSkyDraw(void)
|
||||||
void R_SetSkyScale(void)
|
void R_SetSkyScale(void)
|
||||||
{
|
{
|
||||||
fixed_t difference = vid.fdupx-(vid.dupx<<FRACBITS);
|
fixed_t difference = vid.fdupx-(vid.dupx<<FRACBITS);
|
||||||
skyscale = FixedDiv(FRACUNIT, vid.fdupx+difference);
|
skyscale = FixedDiv(fovtan, vid.fdupx+difference);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1094,10 +1094,10 @@ static void R_SplitSprite(vissprite_t *sprite)
|
||||||
|
|
||||||
newsprite->extra_colormap = *sector->lightlist[i].extra_colormap;
|
newsprite->extra_colormap = *sector->lightlist[i].extra_colormap;
|
||||||
|
|
||||||
if (!((newsprite->cut & SC_FULLBRIGHT)
|
if (!(newsprite->cut & SC_FULLBRIGHT)
|
||||||
&& (!newsprite->extra_colormap || !(newsprite->extra_colormap->fog & 1))))
|
|| (newsprite->extra_colormap && (newsprite->extra_colormap->flags & CMF_FADEFULLBRIGHTSPRITES)))
|
||||||
{
|
{
|
||||||
lindex = FixedMul(sprite->xscale, FixedDiv(640, vid.width))>>(LIGHTSCALESHIFT);
|
lindex = FixedMul(sprite->xscale, LIGHTRESOLUTIONFIX)>>(LIGHTSCALESHIFT);
|
||||||
|
|
||||||
if (lindex >= MAXLIGHTSCALE)
|
if (lindex >= MAXLIGHTSCALE)
|
||||||
lindex = MAXLIGHTSCALE-1;
|
lindex = MAXLIGHTSCALE-1;
|
||||||
|
@ -1307,17 +1307,8 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
|
||||||
|
|
||||||
shadow->mobj = thing; // Easy access! Tails 06-07-2002
|
shadow->mobj = thing; // Easy access! Tails 06-07-2002
|
||||||
|
|
||||||
shadow->x1 = x1 < 0 ? 0 : x1;
|
shadow->x1 = x1 < portalclipstart ? portalclipstart : x1;
|
||||||
shadow->x2 = x2 >= viewwidth ? viewwidth-1 : x2;
|
shadow->x2 = x2 >= portalclipend ? portalclipend-1 : x2;
|
||||||
|
|
||||||
// PORTAL SEMI-CLIPPING
|
|
||||||
if (portalrender)
|
|
||||||
{
|
|
||||||
if (shadow->x1 < portalclipstart)
|
|
||||||
shadow->x1 = portalclipstart;
|
|
||||||
if (shadow->x2 >= portalclipend)
|
|
||||||
shadow->x2 = portalclipend-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
shadow->xscale = FixedMul(xscale, shadowxscale); //SoM: 4/17/2000
|
shadow->xscale = FixedMul(xscale, shadowxscale); //SoM: 4/17/2000
|
||||||
shadow->scale = FixedMul(yscale, shadowyscale);
|
shadow->scale = FixedMul(yscale, shadowyscale);
|
||||||
|
@ -1815,17 +1806,8 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
|
|
||||||
vis->mobj = thing; // Easy access! Tails 06-07-2002
|
vis->mobj = thing; // Easy access! Tails 06-07-2002
|
||||||
|
|
||||||
vis->x1 = x1 < 0 ? 0 : x1;
|
vis->x1 = x1 < portalclipstart ? portalclipstart : x1;
|
||||||
vis->x2 = x2 >= viewwidth ? viewwidth-1 : x2;
|
vis->x2 = x2 >= portalclipend ? portalclipend-1 : x2;
|
||||||
|
|
||||||
// PORTAL SEMI-CLIPPING
|
|
||||||
if (portalrender)
|
|
||||||
{
|
|
||||||
if (vis->x1 < portalclipstart)
|
|
||||||
vis->x1 = portalclipstart;
|
|
||||||
if (vis->x2 >= portalclipend)
|
|
||||||
vis->x2 = portalclipend-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
vis->xscale = xscale; //SoM: 4/17/2000
|
vis->xscale = xscale; //SoM: 4/17/2000
|
||||||
vis->sector = thing->subsector->sector;
|
vis->sector = thing->subsector->sector;
|
||||||
|
@ -1882,7 +1864,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
vis->cut |= SC_FULLBRIGHT;
|
vis->cut |= SC_FULLBRIGHT;
|
||||||
|
|
||||||
if (vis->cut & SC_FULLBRIGHT
|
if (vis->cut & SC_FULLBRIGHT
|
||||||
&& (!vis->extra_colormap || !(vis->extra_colormap->fog & 1)))
|
&& (!vis->extra_colormap || !(vis->extra_colormap->flags & CMF_FADEFULLBRIGHTSPRITES)))
|
||||||
{
|
{
|
||||||
// full bright: goggles
|
// full bright: goggles
|
||||||
vis->colormap = colormaps;
|
vis->colormap = colormaps;
|
||||||
|
@ -1890,7 +1872,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// diminished light
|
// diminished light
|
||||||
lindex = FixedMul(xscale, FixedDiv(640, vid.width))>>(LIGHTSCALESHIFT);
|
lindex = FixedMul(xscale, LIGHTRESOLUTIONFIX)>>(LIGHTSCALESHIFT);
|
||||||
|
|
||||||
if (lindex >= MAXLIGHTSCALE)
|
if (lindex >= MAXLIGHTSCALE)
|
||||||
lindex = MAXLIGHTSCALE-1;
|
lindex = MAXLIGHTSCALE-1;
|
||||||
|
@ -2034,17 +2016,8 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
|
||||||
vis->shear.tan = 0;
|
vis->shear.tan = 0;
|
||||||
vis->shear.offset = 0;
|
vis->shear.offset = 0;
|
||||||
|
|
||||||
vis->x1 = x1 < 0 ? 0 : x1;
|
vis->x1 = x1 < portalclipstart ? portalclipstart : x1;
|
||||||
vis->x2 = x2 >= viewwidth ? viewwidth-1 : x2;
|
vis->x2 = x2 >= portalclipend ? portalclipend-1 : x2;
|
||||||
|
|
||||||
// PORTAL SEMI-CLIPPING
|
|
||||||
if (portalrender)
|
|
||||||
{
|
|
||||||
if (vis->x1 < portalclipstart)
|
|
||||||
vis->x1 = portalclipstart;
|
|
||||||
if (vis->x2 >= portalclipend)
|
|
||||||
vis->x2 = portalclipend-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
vis->xscale = xscale; //SoM: 4/17/2000
|
vis->xscale = xscale; //SoM: 4/17/2000
|
||||||
vis->sector = thing->subsector->sector;
|
vis->sector = thing->subsector->sector;
|
||||||
|
@ -3463,6 +3436,7 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
|
||||||
GETFLAG(DASHMODE)
|
GETFLAG(DASHMODE)
|
||||||
GETFLAG(FASTEDGE)
|
GETFLAG(FASTEDGE)
|
||||||
GETFLAG(MULTIABILITY)
|
GETFLAG(MULTIABILITY)
|
||||||
|
GETFLAG(NONIGHTSROTATION)
|
||||||
GETFLAG(NONIGHTSSUPER)
|
GETFLAG(NONIGHTSSUPER)
|
||||||
#undef GETFLAG
|
#undef GETFLAG
|
||||||
|
|
||||||
|
|
21
src/w_wad.c
21
src/w_wad.c
|
@ -1691,7 +1691,7 @@ W_VerifyName (const char *name, lumpchecklist_t *checklist, boolean status)
|
||||||
size_t j;
|
size_t j;
|
||||||
for (j = 0; checklist[j].len && checklist[j].name; ++j)
|
for (j = 0; checklist[j].len && checklist[j].name; ++j)
|
||||||
{
|
{
|
||||||
if (( strncmp(name, checklist[j].name,
|
if (( strncasecmp(name, checklist[j].name,
|
||||||
checklist[j].len) != false ) == status)
|
checklist[j].len) != false ) == status)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -1746,6 +1746,19 @@ W_VerifyWAD (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List of blacklisted folders to use when checking the PK3
|
||||||
|
static lumpchecklist_t folderblacklist[] =
|
||||||
|
{
|
||||||
|
{"Lua/", 4},
|
||||||
|
{"SOC/", 4},
|
||||||
|
{"Sprites/", 8},
|
||||||
|
{"Textures/", 9},
|
||||||
|
{"Patches/", 8},
|
||||||
|
{"Flats/", 6},
|
||||||
|
{"Fades/", 6},
|
||||||
|
{NULL, 0},
|
||||||
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||||
{
|
{
|
||||||
|
@ -1797,7 +1810,7 @@ W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||||
else
|
else
|
||||||
trimname = fullname; // Care taken for root files.
|
trimname = fullname; // Care taken for root files.
|
||||||
|
|
||||||
if (*trimname) // Ignore directories
|
if (*trimname) // Ignore directories, well kinda
|
||||||
{
|
{
|
||||||
if ((dotpos = strrchr(trimname, '.')) == 0)
|
if ((dotpos = strrchr(trimname, '.')) == 0)
|
||||||
dotpos = fullname + strlen(fullname); // Watch for files without extension.
|
dotpos = fullname + strlen(fullname); // Watch for files without extension.
|
||||||
|
@ -1807,6 +1820,10 @@ W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||||
|
|
||||||
if (! W_VerifyName(lumpname, checklist, status))
|
if (! W_VerifyName(lumpname, checklist, status))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Check for directories next, if it's blacklisted it will return false
|
||||||
|
if (W_VerifyName(fullname, folderblacklist, status))
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(fullname);
|
free(fullname);
|
||||||
|
|
Loading…
Reference in a new issue