Merge branch 'next' into font_drawer

This commit is contained in:
spherallic 2022-11-02 00:44:28 +01:00
commit 48cceef746
59 changed files with 2445 additions and 1776 deletions

View file

@ -2481,6 +2481,7 @@ linedeftypes
prefix = "(439)";
flags8text = "[3] Set delay by backside sector";
flags64text = "[6] Only existing";
flags8192text = "[13] Use backside textures";
}
440
@ -6949,7 +6950,7 @@ thingtypes
{
color = 10; // Green
title = "Tutorial";
799
{
title = "Tutorial Plant";

View file

@ -2593,7 +2593,7 @@ udmf
}
}
}
190
{
title = "Rising";
@ -4588,6 +4588,12 @@ udmf
type = 11;
enum = "yesno";
}
arg3
{
title = "Use backside textures?";
type = 11;
enum = "noyes";
}
}
440

View file

@ -31,8 +31,8 @@
# MINGW=1, MINGW64=1 - Windows (MinGW toolchain)
# UNIX=1 - Generic Unix like system
# FREEBSD=1
# SDL=1 - Use SDL backend. SDL is the only backend though
# and thus, always enabled.
# SDL=1 - Use SDL backend. SDL is the only implemented backend though.
# If disabled, a dummy backend will be used.
#
# A list of supported GCC versions can be found in
# Makefile.d/detect.mk -- search 'gcc_versions'.

View file

@ -17,7 +17,6 @@ all_systems:=\
UNIX\
LINUX\
FREEBSD\
SDL\
# check for user specified system
ifeq (,$(filter $(all_systems),$(.VARIABLES)))

5
src/Makefile.d/dummy.mk Normal file
View file

@ -0,0 +1,5 @@
makedir:=$(makedir)/Dummy
sources+=$(call List,dummy/Sourcefile)
NOHW=1

View file

@ -18,7 +18,7 @@ opts+=-I/usr/X11R6/include
libs+=-L/usr/X11R6/lib
endif
SDL=1
SDL?=1
# In common usage.
ifdef LINUX

View file

@ -64,6 +64,8 @@ ifdef UNIX
include Makefile.d/nix.mk
endif
ifdef SDL
ifeq ($(SDL), 1)
include Makefile.d/sdl.mk
else
include Makefile.d/dummy.mk
endif

View file

@ -19,7 +19,7 @@ libs+=-ladvapi32 -lkernel32 -lmsvcrt -luser32
nasm_format:=win32
SDL=1
SDL?=1
ifndef NOHW
opts+=-DUSE_WGL_SWAP
@ -76,6 +76,7 @@ else
lib:=../libs/SDL2_mixer/$(mingw)
endif
ifdef SDL
mixer_opts:=-I$(lib)/include/SDL2
mixer_libs:=-L$(lib)/lib
@ -85,6 +86,7 @@ SDL_opts:=-I$(lib)/include/SDL2\
SDL_libs:=-L$(lib)/lib $(mixer_libs)\
-lmingw32 -lSDL2main -lSDL2 -mwindows
$(eval $(call _set,SDL))
endif
lib:=../libs/zlib
ZLIB_opts:=-I$(lib)

View file

@ -60,7 +60,7 @@ static void DumpVector(const void* b, int n, size_t size, DumpState* D)
static void DumpString(const TString* s, DumpState* D)
{
if (s==NULL || getstr(s)==NULL)
if (s==NULL)
{
size_t size=0;
DumpVar(size,D);

View file

@ -31,9 +31,9 @@ void luaT_init (lua_State *L) {
static const char *const luaT_eventname[] = { /* ORDER TM */
"__index", "__newindex",
"__usedindex",
"__gc", "__mode", "__eq",
"__gc", "__mode", "__len", "__eq",
"__add", "__sub", "__mul", "__div", "__mod",
"__pow", "__unm", "__len", "__lt", "__le",
"__pow", "__unm", "__lt", "__le",
"__concat", "__call"
,"__strhook"
,"__and", "__or", "__xor", "__shl", "__shr", "__not"

View file

@ -21,6 +21,7 @@ typedef enum {
TM_USEDINDEX,
TM_GC,
TM_MODE,
TM_LEN,
TM_EQ, /* last tag method with `fast' access */
TM_ADD,
TM_SUB,
@ -29,7 +30,6 @@ typedef enum {
TM_MOD,
TM_POW,
TM_UNM,
TM_LEN,
TM_LT,
TM_LE,
TM_CONCAT,

View file

@ -311,6 +311,33 @@ void luaV_concat (lua_State *L, int total, int last) {
}
static void objlen (lua_State *L, StkId ra, TValue *rb) {
const TValue *tm;
switch (ttype(rb)) {
case LUA_TTABLE: {
Table *h = hvalue(rb);
tm = fasttm(L, h->metatable, TM_LEN);
if (tm) break; /* metamethod? break switch to call it */
setnvalue(ra, cast_num(luaH_getn(h))); /* else primitive len */
return;
}
case LUA_TSTRING: {
tm = fasttm(L, G(L)->mt[LUA_TSTRING], TM_LEN);
if (tm) break; /* metamethod? break switch to call it */
setnvalue(ra, cast_num(tsvalue(rb)->len));
return;
}
default: { /* try metamethod */
tm = luaT_gettmbyobj(L, rb, TM_LEN);
if (ttisnil(tm)) /* no metamethod? */
luaG_typeerror(L, rb, "get length of");
break;
}
}
callTMres(L, ra, tm, rb, luaO_nilobject);
}
static void Arith (lua_State *L, StkId ra, TValue *rb,
TValue *rc, TMS op) {
TValue tempb, tempc;
@ -568,23 +595,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
continue;
}
case OP_LEN: {
TValue *rb = RB(i);
switch (ttype(rb)) {
case LUA_TTABLE: {
setnvalue(ra, cast_num(luaH_getn(hvalue(rb))));
break;
}
case LUA_TSTRING: {
setnvalue(ra, cast_num(tsvalue(rb)->len));
break;
}
default: { /* try metamethod */
Protect(
if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN))
luaG_typeerror(L, rb, "get length of");
)
}
}
Protect(objlen(L, ra, RB(i)));
continue;
}
case OP_CONCAT: {

View file

@ -660,7 +660,7 @@ static void COM_ExecuteString(char *ptext)
// check cvars
// Hurdler: added at Ebola's request ;)
// (don't flood the console in software mode with bad gl_xxx command)
if (!CV_Command() && con_destlines)
if (!CV_Command() && (con_destlines || dedicated))
CONS_Printf(M_GetText("Unknown command '%s'\n"), COM_Argv(0));
}

View file

@ -4575,7 +4575,7 @@ void Command_Retry_f(void)
CONS_Printf(M_GetText("You must be in a level to use this.\n"));
else if (netgame || multiplayer)
CONS_Printf(M_GetText("This only works in single player.\n"));
else if (!&players[consoleplayer] || players[consoleplayer].lives <= 1)
else if (players[consoleplayer].lives <= 1)
CONS_Printf(M_GetText("You can't retry without any lives remaining!\n"));
else if (G_IsSpecialStage(gamemap))
CONS_Printf(M_GetText("You can't retry special stages!\n"));

View file

@ -245,7 +245,8 @@ typedef enum
CR_MINECART,
CR_ROLLOUT,
CR_PTERABYTE,
CR_DUSTDEVIL
CR_DUSTDEVIL,
CR_FAN
} carrytype_t; // pw_carry
// Player powers. (don't edit this comment)

View file

@ -2687,10 +2687,10 @@ void readhuditem(MYFILE *f, INT32 num)
}
else if (fastcmp(word, "F"))
{
hudinfo[num].f = i;
hudinfo[num].f = get_number(word2);
}
else
deh_warning("Level header %d: unknown word '%s'", num, word);
deh_warning("HUD item %d: unknown word '%s'", num, word);
}
} while (!myfeof(f)); // finish when the line is empty
@ -3307,7 +3307,7 @@ static void readcondition(UINT8 set, UINT32 id, char *word2)
else
re = atoi(params[1]);
if (re < 0 || re >= NUMMAPS)
if (re <= 0 || re > NUMMAPS)
{
deh_warning("Level number %d out of range (1 - %d)", re, NUMMAPS);
return;
@ -3327,7 +3327,7 @@ static void readcondition(UINT8 set, UINT32 id, char *word2)
else
x1 = (INT16)atoi(params[1]);
if (x1 < 0 || x1 >= NUMMAPS)
if (x1 <= 0 || x1 > NUMMAPS)
{
deh_warning("Level number %d out of range (1 - %d)", re, NUMMAPS);
return;
@ -3362,7 +3362,7 @@ static void readcondition(UINT8 set, UINT32 id, char *word2)
else
x1 = (INT16)atoi(params[1]);
if (x1 < 0 || x1 >= NUMMAPS)
if (x1 <= 0 || x1 > NUMMAPS)
{
deh_warning("Level number %d out of range (1 - %d)", re, NUMMAPS);
return;

View file

@ -5119,6 +5119,7 @@ struct int_const_s const INT_CONST[] = {
{"CR_ROLLOUT",CR_ROLLOUT},
{"CR_PTERABYTE",CR_PTERABYTE},
{"CR_DUSTDEVIL",CR_DUSTDEVIL},
{"CR_FAN",CR_FAN},
// Ring weapons (ringweapons_t)
// Useful for A_GiveWeapon
@ -5326,42 +5327,81 @@ struct int_const_s const INT_CONST[] = {
{"SKSJUMP",SKSJUMP},
// 3D Floor/Fake Floor/FOF/whatever flags
{"FF_EXISTS",FF_EXISTS}, ///< Always set, to check for validity.
{"FF_BLOCKPLAYER",FF_BLOCKPLAYER}, ///< Solid to player, but nothing else
{"FF_BLOCKOTHERS",FF_BLOCKOTHERS}, ///< Solid to everything but player
{"FF_SOLID",FF_SOLID}, ///< Clips things.
{"FF_RENDERSIDES",FF_RENDERSIDES}, ///< Renders the sides.
{"FF_RENDERPLANES",FF_RENDERPLANES}, ///< Renders the floor/ceiling.
{"FF_RENDERALL",FF_RENDERALL}, ///< Renders everything.
{"FF_SWIMMABLE",FF_SWIMMABLE}, ///< Is a water block.
{"FF_NOSHADE",FF_NOSHADE}, ///< Messes with the lighting?
{"FF_CUTSOLIDS",FF_CUTSOLIDS}, ///< Cuts out hidden solid pixels.
{"FF_CUTEXTRA",FF_CUTEXTRA}, ///< Cuts out hidden translucent pixels.
{"FF_CUTLEVEL",FF_CUTLEVEL}, ///< Cuts out all hidden pixels.
{"FF_CUTSPRITES",FF_CUTSPRITES}, ///< Final step in making 3D water.
{"FF_BOTHPLANES",FF_BOTHPLANES}, ///< Render inside and outside planes.
{"FF_EXTRA",FF_EXTRA}, ///< Gets cut by ::FF_CUTEXTRA.
{"FF_TRANSLUCENT",FF_TRANSLUCENT}, ///< See through!
{"FF_FOG",FF_FOG}, ///< Fog "brush."
{"FF_INVERTPLANES",FF_INVERTPLANES}, ///< Only render inside planes.
{"FF_ALLSIDES",FF_ALLSIDES}, ///< Render inside and outside sides.
{"FF_INVERTSIDES",FF_INVERTSIDES}, ///< Only render inside sides.
{"FF_DOUBLESHADOW",FF_DOUBLESHADOW}, ///< Make two lightlist entries to reset light?
{"FF_FLOATBOB",FF_FLOATBOB}, ///< Floats on water and bobs if you step on it.
{"FF_NORETURN",FF_NORETURN}, ///< Used with ::FF_CRUMBLE. Will not return to its original position after falling.
{"FF_CRUMBLE",FF_CRUMBLE}, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist).
{"FF_GOOWATER",FF_GOOWATER}, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop.
{"FF_MARIO",FF_MARIO}, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector.
{"FF_BUSTUP",FF_BUSTUP}, ///< You can spin through/punch this block and it will crumble!
{"FF_QUICKSAND",FF_QUICKSAND}, ///< Quicksand!
{"FF_PLATFORM",FF_PLATFORM}, ///< You can jump up through this to the top.
{"FF_REVERSEPLATFORM",FF_REVERSEPLATFORM}, ///< A fall-through floor in normal gravity, a platform in reverse gravity.
{"FF_INTANGIBLEFLATS",FF_INTANGIBLEFLATS}, ///< Both flats are intangible, but the sides are still solid.
{"FF_INTANGABLEFLATS",FF_INTANGIBLEFLATS}, ///< Both flats are intangable, but the sides are still solid.
{"FF_RIPPLE",FF_RIPPLE}, ///< Ripple the flats
{"FF_COLORMAPONLY",FF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel
{"FF_BOUNCY",FF_BOUNCY}, ///< Bounces players
{"FF_SPLAT",FF_SPLAT}, ///< Use splat flat renderer (treat cyan pixels as invisible)
{"FOF_EXISTS",FOF_EXISTS}, ///< Always set, to check for validity.
{"FOF_BLOCKPLAYER",FOF_BLOCKPLAYER}, ///< Solid to player, but nothing else
{"FOF_BLOCKOTHERS",FOF_BLOCKOTHERS}, ///< Solid to everything but player
{"FOF_SOLID",FOF_SOLID}, ///< Clips things.
{"FOF_RENDERSIDES",FOF_RENDERSIDES}, ///< Renders the sides.
{"FOF_RENDERPLANES",FOF_RENDERPLANES}, ///< Renders the floor/ceiling.
{"FOF_RENDERALL",FOF_RENDERALL}, ///< Renders everything.
{"FOF_SWIMMABLE",FOF_SWIMMABLE}, ///< Is a water block.
{"FOF_NOSHADE",FOF_NOSHADE}, ///< Messes with the lighting?
{"FOF_CUTSOLIDS",FOF_CUTSOLIDS}, ///< Cuts out hidden solid pixels.
{"FOF_CUTEXTRA",FOF_CUTEXTRA}, ///< Cuts out hidden translucent pixels.
{"FOF_CUTLEVEL",FOF_CUTLEVEL}, ///< Cuts out all hidden pixels.
{"FOF_CUTSPRITES",FOF_CUTSPRITES}, ///< Final step in making 3D water.
{"FOF_BOTHPLANES",FOF_BOTHPLANES}, ///< Render inside and outside planes.
{"FOF_EXTRA",FOF_EXTRA}, ///< Gets cut by ::FOF_CUTEXTRA.
{"FOF_TRANSLUCENT",FOF_TRANSLUCENT}, ///< See through!
{"FOF_FOG",FOF_FOG}, ///< Fog "brush."
{"FOF_INVERTPLANES",FOF_INVERTPLANES}, ///< Only render inside planes.
{"FOF_ALLSIDES",FOF_ALLSIDES}, ///< Render inside and outside sides.
{"FOF_INVERTSIDES",FOF_INVERTSIDES}, ///< Only render inside sides.
{"FOF_DOUBLESHADOW",FOF_DOUBLESHADOW}, ///< Make two lightlist entries to reset light?
{"FOF_FLOATBOB",FOF_FLOATBOB}, ///< Floats on water and bobs if you step on it.
{"FOF_NORETURN",FOF_NORETURN}, ///< Used with ::FOF_CRUMBLE. Will not return to its original position after falling.
{"FOF_CRUMBLE",FOF_CRUMBLE}, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist).
{"FOF_GOOWATER",FOF_GOOWATER}, ///< Used with ::FOF_SWIMMABLE. Makes thick bouncey goop.
{"FOF_MARIO",FOF_MARIO}, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector.
{"FOF_BUSTUP",FOF_BUSTUP}, ///< You can spin through/punch this block and it will crumble!
{"FOF_QUICKSAND",FOF_QUICKSAND}, ///< Quicksand!
{"FOF_PLATFORM",FOF_PLATFORM}, ///< You can jump up through this to the top.
{"FOF_REVERSEPLATFORM",FOF_REVERSEPLATFORM}, ///< A fall-through floor in normal gravity, a platform in reverse gravity.
{"FOF_INTANGIBLEFLATS",FOF_INTANGIBLEFLATS}, ///< Both flats are intangible, but the sides are still solid.
{"FOF_RIPPLE",FOF_RIPPLE}, ///< Ripple the flats
{"FOF_COLORMAPONLY",FOF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel
{"FOF_BOUNCY",FOF_BOUNCY}, ///< Bounces players
{"FOF_SPLAT",FOF_SPLAT}, ///< Use splat flat renderer (treat cyan pixels as invisible)
// Old FOF flags for backwards compatibility
{"FF_EXISTS",FF_OLD_EXISTS},
{"FF_BLOCKPLAYER",FF_OLD_BLOCKPLAYER},
{"FF_BLOCKOTHERS",FF_OLD_BLOCKOTHERS},
{"FF_SOLID",FF_OLD_SOLID},
{"FF_RENDERSIDES",FF_OLD_RENDERSIDES},
{"FF_RENDERPLANES",FF_OLD_RENDERPLANES},
{"FF_RENDERALL",FF_OLD_RENDERALL},
{"FF_SWIMMABLE",FF_OLD_SWIMMABLE},
{"FF_NOSHADE",FF_OLD_NOSHADE},
{"FF_CUTSOLIDS",FF_OLD_CUTSOLIDS},
{"FF_CUTEXTRA",FF_OLD_CUTEXTRA},
{"FF_CUTLEVEL",FF_OLD_CUTLEVEL},
{"FF_CUTSPRITES",FF_OLD_CUTSPRITES},
{"FF_BOTHPLANES",FF_OLD_BOTHPLANES},
{"FF_EXTRA",FF_OLD_EXTRA},
{"FF_TRANSLUCENT",FF_OLD_TRANSLUCENT},
{"FF_FOG",FF_OLD_FOG},
{"FF_INVERTPLANES",FF_OLD_INVERTPLANES},
{"FF_ALLSIDES",FF_OLD_ALLSIDES},
{"FF_INVERTSIDES",FF_OLD_INVERTSIDES},
{"FF_DOUBLESHADOW",FF_OLD_DOUBLESHADOW},
{"FF_FLOATBOB",FF_OLD_FLOATBOB},
{"FF_NORETURN",FF_OLD_NORETURN},
{"FF_CRUMBLE",FF_OLD_CRUMBLE},
{"FF_SHATTERBOTTOM",FF_OLD_SHATTERBOTTOM},
{"FF_GOOWATER",FF_OLD_GOOWATER},
{"FF_MARIO",FF_OLD_MARIO},
{"FF_BUSTUP",FF_OLD_BUSTUP},
{"FF_QUICKSAND",FF_OLD_QUICKSAND},
{"FF_PLATFORM",FF_OLD_PLATFORM},
{"FF_REVERSEPLATFORM",FF_OLD_REVERSEPLATFORM},
{"FF_INTANGIBLEFLATS",FF_OLD_INTANGIBLEFLATS},
{"FF_INTANGABLEFLATS",FF_OLD_INTANGIBLEFLATS},
{"FF_SHATTER",FF_OLD_SHATTER},
{"FF_SPINBUST",FF_OLD_SPINBUST},
{"FF_STRONGBUST",FF_OLD_STRONGBUST},
{"FF_RIPPLE",FF_OLD_RIPPLE},
{"FF_COLORMAPONLY",FF_OLD_COLORMAPONLY},
// FOF bustable flags
{"FB_PUSHABLES",FB_PUSHABLES},

View file

@ -392,8 +392,6 @@ unset_bit_array (bitarray_t * const array, const int value)
array[value >> 3] &= ~(1<<(value & 7));
}
#ifdef HAVE_SDL
typedef UINT64 precise_t;
#endif
#endif //__DOOMTYPE__

5
src/dummy/Sourcefile Normal file
View file

@ -0,0 +1,5 @@
i_net.c
i_system.c
i_main.c
i_video.c
i_sound.c

View file

@ -139,29 +139,24 @@ boolean I_LoadSong(char *data, size_t len)
void I_UnloadSong(void)
{
(void)handle;
}
boolean I_PlaySong(boolean looping)
{
(void)handle;
(void)looping;
return false;
}
void I_StopSong(void)
{
(void)handle;
}
void I_PauseSong(void)
{
(void)handle;
}
void I_ResumeSong(void)
{
(void)handle;
}
void I_SetMusicVolume(UINT8 volume)
@ -188,18 +183,20 @@ void I_StopFadingSong(void)
{
}
boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void));
boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void))
{
(void)target_volume;
(void)source_volume;
(void)ms;
(void)callback;
return false;
}
boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void));
boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void))
{
(void)target_volume;
(void)ms;
(void)callback;
return false;
}

View file

@ -1,6 +1,9 @@
#include "../doomdef.h"
#include "../doomtype.h"
#include "../i_system.h"
FILE *logstream = NULL;
UINT8 graphics_started = 0;
UINT8 keyboard_started = 0;
@ -16,11 +19,17 @@ tic_t I_GetTime(void)
return 0;
}
int I_GetTimeMicros(void)
precise_t I_GetPreciseTime(void)
{
return 0;
}
int I_PreciseToMicros(precise_t d)
{
(void)d;
return 0;
}
void I_Sleep(void){}
void I_GetEvent(void){}
@ -96,8 +105,6 @@ void I_StartupMouse(void){}
void I_StartupMouse2(void){}
void I_StartupKeyboard(void){}
INT32 I_GetKey(void)
{
return 0;
@ -176,12 +183,18 @@ INT32 I_ClipboardCopy(const char *data, size_t size)
return -1;
}
char *I_ClipboardPaste(void)
const char *I_ClipboardPaste(void)
{
return NULL;
}
void I_RegisterSysCommands(void) {}
void I_GetCursorPosition(INT32 *x, INT32 *y)
{
(void)x;
(void)y;
}
#include "../sdl/dosstr.c"

View file

@ -712,9 +712,9 @@ lumpinfo_t *getdirectoryfiles(const char *path, UINT16 *nlmp, UINT16 *nfolders)
// Close any open directories and return if something went wrong.
if (failure)
{
for (; depthleft < maxdirdepth; closedir(dirhandle[depthleft++]));
free(dirpathindex);
free(dirhandle);
for (; depthleft < maxdirdepth; closedir(dirhandle[depthleft++]));
return NULL;
}

View file

@ -74,6 +74,8 @@ typedef struct gl_vissprite_s
float spritexscale, spriteyscale;
float spritexoffset, spriteyoffset;
skincolornum_t color;
UINT32 renderflags;
UINT8 rotateflags;

View file

@ -887,9 +887,9 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
if (endtop < endrealbot && top < realbot)
return;
if (!(list[i].flags & FF_NOSHADE))
if (!(list[i].flags & FOF_NOSHADE))
{
if (pfloor && (pfloor->flags & FF_FOG))
if (pfloor && (pfloor->fofflags & FOF_FOG))
{
lightnum = HWR_CalcWallLight(pfloor->master->frontsector->lightlevel, v1x, v1y, v2x, v2y);
colormap = pfloor->master->frontsector->extra_colormap;
@ -903,13 +903,13 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
solid = false;
if ((sector->lightlist[i].flags & FF_CUTSOLIDS) && !(cutflag & FF_EXTRA))
if ((sector->lightlist[i].flags & FOF_CUTSOLIDS) && !(cutflag & FOF_EXTRA))
solid = true;
else if ((sector->lightlist[i].flags & FF_CUTEXTRA) && (cutflag & FF_EXTRA))
else if ((sector->lightlist[i].flags & FOF_CUTEXTRA) && (cutflag & FOF_EXTRA))
{
if (sector->lightlist[i].flags & FF_EXTRA)
if (sector->lightlist[i].flags & FOF_EXTRA)
{
if ((sector->lightlist[i].flags & (FF_FOG|FF_SWIMMABLE)) == (cutflag & (FF_FOG|FF_SWIMMABLE))) // Only merge with your own types
if ((sector->lightlist[i].flags & (FOF_FOG|FOF_SWIMMABLE)) == (cutflag & (FOF_FOG|FOF_SWIMMABLE))) // Only merge with your own types
solid = true;
}
else
@ -978,7 +978,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
wallVerts[0].y = bot;
wallVerts[1].y = endbot;
if (cutflag & FF_FOG)
if (cutflag & FOF_FOG)
HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture|polyflags, true, lightnum, colormap);
else if (polyflags & (PF_Translucent|PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Environment))
HWR_AddTransparentWall(wallVerts, Surf, texnum, polyflags, false, lightnum, colormap);
@ -1007,7 +1007,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
wallVerts[0].y = bot;
wallVerts[1].y = endbot;
if (cutflag & FF_FOG)
if (cutflag & FOF_FOG)
HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture|polyflags, true, lightnum, colormap);
else if (polyflags & (PF_Translucent|PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Environment))
HWR_AddTransparentWall(wallVerts, Surf, texnum, polyflags, false, lightnum, colormap);
@ -1192,7 +1192,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[1].y = FIXED_TO_FLOAT(worldhighslope);
if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, gl_toptexture, &Surf, FF_CUTLEVEL, NULL, 0);
HWR_SplitWall(gl_frontsector, wallVerts, gl_toptexture, &Surf, FOF_CUTLEVEL, NULL, 0);
else if (grTex->mipmap.flags & TF_TRANSPARENT)
HWR_AddTransparentWall(wallVerts, &Surf, gl_toptexture, PF_Environment, false, lightnum, colormap);
else
@ -1258,7 +1258,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[1].y = FIXED_TO_FLOAT(worldbottomslope);
if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, gl_bottomtexture, &Surf, FF_CUTLEVEL, NULL, 0);
HWR_SplitWall(gl_frontsector, wallVerts, gl_bottomtexture, &Surf, FOF_CUTLEVEL, NULL, 0);
else if (grTex->mipmap.flags & TF_TRANSPARENT)
HWR_AddTransparentWall(wallVerts, &Surf, gl_bottomtexture, PF_Environment, false, lightnum, colormap);
else
@ -1465,9 +1465,9 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (gl_frontsector->numlights)
{
if (!(blendmode & PF_Masked))
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_TRANSLUCENT, NULL, blendmode);
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FOF_TRANSLUCENT, NULL, blendmode);
else
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL, blendmode);
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FOF_CUTLEVEL, NULL, blendmode);
}
else if (!(blendmode & PF_Masked))
HWR_AddTransparentWall(wallVerts, &Surf, gl_midtexture, blendmode, false, lightnum, colormap);
@ -1549,7 +1549,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
// I don't think that solid walls can use translucent linedef types...
if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL, 0);
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FOF_CUTLEVEL, NULL, 0);
else
{
if (grTex->mipmap.flags & TF_TRANSPARENT)
@ -1613,9 +1613,9 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (bothsides) continue;
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERSIDES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES))
continue;
if (!(rover->flags & FF_ALLSIDES) && rover->flags & FF_INVERTSIDES)
if (!(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES)
continue;
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
@ -1656,7 +1656,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[2].y = FIXED_TO_FLOAT(hS);
wallVerts[0].y = FIXED_TO_FLOAT(l);
wallVerts[1].y = FIXED_TO_FLOAT(lS);
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
wallVerts[3].t = wallVerts[2].t = 0;
wallVerts[0].t = wallVerts[1].t = 0;
@ -1715,7 +1715,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
}
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
FBITFIELD blendmode;
@ -1727,7 +1727,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, 0, &Surf, rover->flags, rover, blendmode);
HWR_SplitWall(gl_frontsector, wallVerts, 0, &Surf, rover->fofflags, rover, blendmode);
else
HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap);
}
@ -1735,14 +1735,14 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
{
FBITFIELD blendmode = PF_Masked;
if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend)
if ((rover->fofflags & FOF_TRANSLUCENT && rover->alpha < 256) || rover->blend)
{
blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent;
Surf.PolyColor.s.alpha = (UINT8)rover->alpha-1 > 255 ? 255 : rover->alpha-1;
}
if (gl_frontsector->numlights)
HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, rover->flags, rover, blendmode);
HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, rover->fofflags, rover, blendmode);
else
{
if (blendmode != PF_Masked)
@ -1770,9 +1770,9 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (bothsides) continue;
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERSIDES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES))
continue;
if (!(rover->flags & FF_ALLSIDES || rover->flags & FF_INVERTSIDES))
if (!(rover->fofflags & FOF_ALLSIDES || rover->fofflags & FOF_INVERTSIDES))
continue;
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
@ -1812,7 +1812,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[2].y = FIXED_TO_FLOAT(hS);
wallVerts[0].y = FIXED_TO_FLOAT(l);
wallVerts[1].y = FIXED_TO_FLOAT(lS);
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
wallVerts[3].t = wallVerts[2].t = 0;
wallVerts[0].t = wallVerts[1].t = 0;
@ -1838,7 +1838,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
}
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
FBITFIELD blendmode;
@ -1850,7 +1850,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
if (gl_backsector->numlights)
HWR_SplitWall(gl_backsector, wallVerts, 0, &Surf, rover->flags, rover, blendmode);
HWR_SplitWall(gl_backsector, wallVerts, 0, &Surf, rover->fofflags, rover, blendmode);
else
HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap);
}
@ -1858,14 +1858,14 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
{
FBITFIELD blendmode = PF_Masked;
if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend)
if ((rover->fofflags & FOF_TRANSLUCENT && rover->alpha < 256) || rover->blend)
{
blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent;
Surf.PolyColor.s.alpha = (UINT8)rover->alpha-1 > 255 ? 255 : rover->alpha-1;
}
if (gl_backsector->numlights)
HWR_SplitWall(gl_backsector, wallVerts, texnum, &Surf, rover->flags, rover, blendmode);
HWR_SplitWall(gl_backsector, wallVerts, texnum, &Surf, rover->fofflags, rover, blendmode);
else
{
if (blendmode != PF_Masked)
@ -2946,7 +2946,7 @@ static FBITFIELD HWR_RippleBlend(sector_t *sector, ffloor_t *rover, boolean ceil
{
(void)sector;
(void)ceiling;
return /*R_IsRipplePlane(sector, rover, ceiling)*/ (rover->flags & FF_RIPPLE) ? PF_Ripple : 0;
return /*R_IsRipplePlane(sector, rover, ceiling)*/ (rover->fofflags & FOF_RIPPLE) ? PF_Ripple : 0;
}
// -----------------+
@ -3114,17 +3114,17 @@ static void HWR_Subsector(size_t num)
cullHeight = P_GetFFloorBottomZAt(rover, viewx, viewy);
centerHeight = P_GetFFloorBottomZAt(rover, gl_frontsector->soundorg.x, gl_frontsector->soundorg.y);
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES))
continue;
if (sub->validcount == validcount)
continue;
if (centerHeight <= locCeilingHeight &&
centerHeight >= locFloorHeight &&
((dup_viewz < cullHeight && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(dup_viewz > cullHeight && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((dup_viewz < cullHeight && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(dup_viewz > cullHeight && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
UINT8 alpha;
@ -3139,7 +3139,7 @@ static void HWR_Subsector(size_t num)
alpha, rover->master->frontsector, PF_Fog|PF_NoTexture,
true, rover->master->frontsector->extra_colormap);
}
else if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend) // SoM: Flags are more efficient
else if ((rover->fofflags & FOF_TRANSLUCENT && rover->alpha < 256) || rover->blend) // SoM: Flags are more efficient
{
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
@ -3167,10 +3167,10 @@ static void HWR_Subsector(size_t num)
if (centerHeight >= locFloorHeight &&
centerHeight <= locCeilingHeight &&
((dup_viewz > cullHeight && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(dup_viewz < cullHeight && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((dup_viewz > cullHeight && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(dup_viewz < cullHeight && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
if (rover->flags & FF_FOG)
if (rover->fofflags & FOF_FOG)
{
UINT8 alpha;
@ -3185,7 +3185,7 @@ static void HWR_Subsector(size_t num)
alpha, rover->master->frontsector, PF_Fog|PF_NoTexture,
true, rover->master->frontsector->extra_colormap);
}
else if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend)
else if ((rover->fofflags & FOF_TRANSLUCENT && rover->alpha < 256) || rover->blend)
{
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
@ -3939,7 +3939,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
return;
// even if we aren't changing colormap or lightlevel, we still need to continue drawing down the sprite
if (!(list[i].flags & FF_NOSHADE) && (list[i].flags & FF_CUTSPRITES))
if (!(list[i].flags & FOF_NOSHADE) && (list[i].flags & FOF_CUTSPRITES))
{
if (!lightset)
lightlevel = *list[i].lightlevel > 255 ? 255 : *list[i].lightlevel;
@ -5370,6 +5370,10 @@ static void HWR_ProjectSprite(mobj_t *thing)
vis->gpatch = (patch_t *)W_CachePatchNum(sprframe->lumppat[rot], PU_SPRITE);
vis->mobj = thing;
if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer && thing->color == SKINCOLOR_NONE)
vis->color = thing->tracer->color;
else
vis->color = thing->color;
//Hurdler: 25/04/2000: now support colormap in hardware mode
if ((vis->mobj->flags & (MF_ENEMY|MF_BOSS)) && (vis->mobj->flags2 & MF2_FRET) && !(vis->mobj->flags & MF_GRENADEBOUNCE) && (leveltime & 1)) // Bosses "flash"
@ -5379,13 +5383,13 @@ static void HWR_ProjectSprite(mobj_t *thing)
else if (vis->mobj->type == MT_METALSONIC_BATTLE)
vis->colormap = R_GetTranslationColormap(TC_METALSONIC, 0, GTC_CACHE);
else
vis->colormap = R_GetTranslationColormap(TC_BOSS, vis->mobj->color, GTC_CACHE);
vis->colormap = R_GetTranslationColormap(TC_BOSS, vis->color, GTC_CACHE);
}
else if (thing->color)
else if (vis->color)
{
// New colormap stuff for skins Tails 06-07-2002
if (thing->colorized)
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE);
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, vis->color, GTC_CACHE);
else if (thing->player && thing->player->dashmode >= DASHMODE_THRESHOLD
&& (thing->player->charflags & SF_DASHMODE)
&& ((leveltime/2) & 1))
@ -5393,15 +5397,15 @@ static void HWR_ProjectSprite(mobj_t *thing)
if (thing->player->charflags & SF_MACHINE)
vis->colormap = R_GetTranslationColormap(TC_DASHMODE, 0, GTC_CACHE);
else
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE);
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, vis->color, GTC_CACHE);
}
else if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player!
{
size_t skinnum = (skin_t*)thing->skin-skins;
vis->colormap = R_GetTranslationColormap((INT32)skinnum, thing->color, GTC_CACHE);
vis->colormap = R_GetTranslationColormap((INT32)skinnum, vis->color, GTC_CACHE);
}
else
vis->colormap = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE);
vis->colormap = R_GetTranslationColormap(TC_DEFAULT, vis->color ? vis->color : SKINCOLOR_CYAN, GTC_CACHE);
}
else
vis->colormap = NULL;
@ -5511,6 +5515,7 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
vis->gpatch = (patch_t *)W_CachePatchNum(sprframe->lumppat[rot], PU_SPRITE);
vis->flip = flip;
vis->mobj = (mobj_t *)thing;
vis->color = SKINCOLOR_NONE;
vis->colormap = NULL;

View file

@ -214,6 +214,7 @@ enum ffloor_e {
ffloor_tslope,
ffloor_bslope,
ffloor_sector,
ffloor_fofflags,
ffloor_flags,
ffloor_master,
ffloor_target,
@ -239,6 +240,7 @@ static const char *const ffloor_opt[] = {
"t_slope",
"b_slope",
"sector", // secnum pushed as control sector userdata
"fofflags",
"flags",
"master", // control linedef
"target", // target sector
@ -1841,6 +1843,80 @@ static int lib_numnodes(lua_State *L)
// ffloor_t //
//////////////
static INT32 P_GetOldFOFFlags(ffloor_t *fflr)
{
INT32 result = 0;
if (fflr->fofflags & FOF_EXISTS)
result |= FF_OLD_EXISTS;
if (fflr->fofflags & FOF_BLOCKPLAYER)
result |= FF_OLD_BLOCKPLAYER;
if (fflr->fofflags & FOF_BLOCKOTHERS)
result |= FF_OLD_BLOCKOTHERS;
if (fflr->fofflags & FOF_RENDERSIDES)
result |= FF_OLD_RENDERSIDES;
if (fflr->fofflags & FOF_RENDERPLANES)
result |= FF_OLD_RENDERPLANES;
if (fflr->fofflags & FOF_SWIMMABLE)
result |= FF_OLD_SWIMMABLE;
if (fflr->fofflags & FOF_NOSHADE)
result |= FF_OLD_NOSHADE;
if (fflr->fofflags & FOF_CUTSOLIDS)
result |= FF_OLD_CUTSOLIDS;
if (fflr->fofflags & FOF_CUTEXTRA)
result |= FF_OLD_CUTEXTRA;
if (fflr->fofflags & FOF_CUTSPRITES)
result |= FF_OLD_CUTSPRITES;
if (fflr->fofflags & FOF_BOTHPLANES)
result |= FF_OLD_BOTHPLANES;
if (fflr->fofflags & FOF_EXTRA)
result |= FF_OLD_EXTRA;
if (fflr->fofflags & FOF_TRANSLUCENT)
result |= FF_OLD_TRANSLUCENT;
if (fflr->fofflags & FOF_FOG)
result |= FF_OLD_FOG;
if (fflr->fofflags & FOF_INVERTPLANES)
result |= FF_OLD_INVERTPLANES;
if (fflr->fofflags & FOF_ALLSIDES)
result |= FF_OLD_ALLSIDES;
if (fflr->fofflags & FOF_INVERTSIDES)
result |= FF_OLD_INVERTSIDES;
if (fflr->fofflags & FOF_DOUBLESHADOW)
result |= FF_OLD_DOUBLESHADOW;
if (fflr->fofflags & FOF_FLOATBOB)
result |= FF_OLD_FLOATBOB;
if (fflr->fofflags & FOF_NORETURN)
result |= FF_OLD_NORETURN;
if (fflr->fofflags & FOF_CRUMBLE)
result |= FF_OLD_CRUMBLE;
if (fflr->bustflags & FB_ONLYBOTTOM)
result |= FF_OLD_SHATTERBOTTOM;
if (fflr->fofflags & FOF_GOOWATER)
result |= FF_OLD_GOOWATER;
if (fflr->fofflags & FOF_MARIO)
result |= FF_OLD_MARIO;
if (fflr->fofflags & FOF_BUSTUP)
result |= FF_OLD_BUSTUP;
if (fflr->fofflags & FOF_QUICKSAND)
result |= FF_OLD_QUICKSAND;
if (fflr->fofflags & FOF_PLATFORM)
result |= FF_OLD_PLATFORM;
if (fflr->fofflags & FOF_REVERSEPLATFORM)
result |= FF_OLD_REVERSEPLATFORM;
if (fflr->fofflags & FOF_INTANGIBLEFLATS)
result |= FF_OLD_INTANGIBLEFLATS;
if (fflr->busttype == BT_TOUCH)
result |= FF_OLD_SHATTER;
if (fflr->busttype == BT_SPINBUST)
result |= FF_OLD_SPINBUST;
if (fflr->busttype == BT_STRONG)
result |= FF_OLD_STRONGBUST;
if (fflr->fofflags & FF_OLD_RIPPLE)
result |= FOF_RIPPLE;
if (fflr->fofflags & FF_OLD_COLORMAPONLY)
result |= FOF_COLORMAPONLY;
return result;
}
static int ffloor_get(lua_State *L)
{
ffloor_t *ffloor = *((ffloor_t **)luaL_checkudata(L, 1, META_FFLOOR));
@ -1895,8 +1971,11 @@ static int ffloor_get(lua_State *L)
case ffloor_sector:
LUA_PushUserdata(L, &sectors[ffloor->secnum], META_SECTOR);
return 1;
case ffloor_fofflags:
lua_pushinteger(L, ffloor->fofflags);
return 1;
case ffloor_flags:
lua_pushinteger(L, ffloor->flags);
lua_pushinteger(L, P_GetOldFOFFlags(ffloor));
return 1;
case ffloor_master:
LUA_PushUserdata(L, ffloor->master, META_LINE);
@ -1938,6 +2017,88 @@ static int ffloor_get(lua_State *L)
return 0;
}
static void P_SetOldFOFFlags(ffloor_t *fflr, oldffloortype_e oldflags)
{
ffloortype_e originalflags = fflr->fofflags;
fflr->fofflags = 0;
if (oldflags & FF_OLD_EXISTS)
fflr->fofflags |= FOF_EXISTS;
if (oldflags & FF_OLD_BLOCKPLAYER)
fflr->fofflags |= FOF_BLOCKPLAYER;
if (oldflags & FF_OLD_BLOCKOTHERS)
fflr->fofflags |= FOF_BLOCKOTHERS;
if (oldflags & FF_OLD_RENDERSIDES)
fflr->fofflags |= FOF_RENDERSIDES;
if (oldflags & FF_OLD_RENDERPLANES)
fflr->fofflags |= FOF_RENDERPLANES;
if (oldflags & FF_OLD_SWIMMABLE)
fflr->fofflags |= FOF_SWIMMABLE;
if (oldflags & FF_OLD_NOSHADE)
fflr->fofflags |= FOF_NOSHADE;
if (oldflags & FF_OLD_CUTSOLIDS)
fflr->fofflags |= FOF_CUTSOLIDS;
if (oldflags & FF_OLD_CUTEXTRA)
fflr->fofflags |= FOF_CUTEXTRA;
if (oldflags & FF_OLD_CUTSPRITES)
fflr->fofflags |= FOF_CUTSPRITES;
if (oldflags & FF_OLD_BOTHPLANES)
fflr->fofflags |= FOF_BOTHPLANES;
if (oldflags & FF_OLD_EXTRA)
fflr->fofflags |= FOF_EXTRA;
if (oldflags & FF_OLD_TRANSLUCENT)
fflr->fofflags |= FOF_TRANSLUCENT;
if (oldflags & FF_OLD_FOG)
fflr->fofflags |= FOF_FOG;
if (oldflags & FF_OLD_INVERTPLANES)
fflr->fofflags |= FOF_INVERTPLANES;
if (oldflags & FF_OLD_ALLSIDES)
fflr->fofflags |= FOF_ALLSIDES;
if (oldflags & FF_OLD_INVERTSIDES)
fflr->fofflags |= FOF_INVERTSIDES;
if (oldflags & FF_OLD_DOUBLESHADOW)
fflr->fofflags |= FOF_DOUBLESHADOW;
if (oldflags & FF_OLD_FLOATBOB)
fflr->fofflags |= FOF_FLOATBOB;
if (oldflags & FF_OLD_NORETURN)
fflr->fofflags |= FOF_NORETURN;
if (oldflags & FF_OLD_CRUMBLE)
fflr->fofflags |= FOF_CRUMBLE;
if (oldflags & FF_OLD_GOOWATER)
fflr->fofflags |= FOF_GOOWATER;
if (oldflags & FF_OLD_MARIO)
fflr->fofflags |= FOF_MARIO;
if (oldflags & FF_OLD_BUSTUP)
fflr->fofflags |= FOF_BUSTUP;
if (oldflags & FF_OLD_QUICKSAND)
fflr->fofflags |= FOF_QUICKSAND;
if (oldflags & FF_OLD_PLATFORM)
fflr->fofflags |= FOF_PLATFORM;
if (oldflags & FF_OLD_REVERSEPLATFORM)
fflr->fofflags |= FOF_REVERSEPLATFORM;
if (oldflags & FF_OLD_RIPPLE)
fflr->fofflags |= FOF_RIPPLE;
if (oldflags & FF_OLD_COLORMAPONLY)
fflr->fofflags |= FOF_COLORMAPONLY;
if (originalflags & FOF_BOUNCY)
fflr->fofflags |= FOF_BOUNCY;
if (originalflags & FOF_SPLAT)
fflr->fofflags |= FOF_SPLAT;
if (oldflags & FF_OLD_SHATTER)
fflr->busttype = BT_TOUCH;
else if (oldflags & FF_OLD_SPINBUST)
fflr->busttype = BT_SPINBUST;
else if (oldflags & FF_OLD_STRONGBUST)
fflr->busttype = BT_STRONG;
else
fflr->busttype = BT_REGULAR;
if (oldflags & FF_OLD_SHATTERBOTTOM)
fflr->bustflags |= FB_ONLYBOTTOM;
else
fflr->bustflags &= ~FB_ONLYBOTTOM;
}
static int ffloor_set(lua_State *L)
{
ffloor_t *ffloor = *((ffloor_t **)luaL_checkudata(L, 1, META_FFLOOR));
@ -2002,10 +2163,20 @@ static int ffloor_set(lua_State *L)
case ffloor_bottompic:
*ffloor->bottompic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3));
break;
case ffloor_fofflags: {
ffloortype_e oldflags = ffloor->fofflags; // store FOF's old flags
ffloor->fofflags = luaL_checkinteger(L, 3);
if (ffloor->fofflags != oldflags)
ffloor->target->moved = true; // reset target sector's lightlist
break;
}
case ffloor_flags: {
ffloortype_e oldflags = ffloor->flags; // store FOF's old flags
ffloor->flags = luaL_checkinteger(L, 3);
if (ffloor->flags != oldflags)
ffloortype_e oldflags = ffloor->fofflags; // store FOF's old flags
busttype_e oldbusttype = ffloor->busttype;
ffloorbustflags_e oldbustflags = ffloor->bustflags;
oldffloortype_e newflags = luaL_checkinteger(L, 3);
P_SetOldFOFFlags(ffloor, newflags);
if (ffloor->fofflags != oldflags || ffloor->busttype != oldbusttype || ffloor->bustflags != oldbustflags)
ffloor->target->moved = true; // reset target sector's lightlist
break;
}

View file

@ -387,6 +387,7 @@ int LUA_PushGlobals(lua_State *L, const char *word)
return 1;
} else if (fastcmp(word, "stagefailed")) {
lua_pushboolean(L, stagefailed);
return 1;
} else if (fastcmp(word, "mouse")) {
LUA_PushUserdata(L, &mouse, META_MOUSE);
return 1;

View file

@ -276,6 +276,15 @@ vector3_t *FV3_Load(vector3_t *vec, fixed_t x, fixed_t y, fixed_t z)
return vec;
}
vector4_t *FV4_Load(vector4_t *vec, fixed_t x, fixed_t y, fixed_t z, fixed_t a)
{
vec->x = x;
vec->y = y;
vec->z = z;
vec->a = a;
return vec;
}
vector3_t *FV3_UnLoad(vector3_t *vec, fixed_t *x, fixed_t *y, fixed_t *z)
{
*x = vec->x;
@ -284,11 +293,25 @@ vector3_t *FV3_UnLoad(vector3_t *vec, fixed_t *x, fixed_t *y, fixed_t *z)
return vec;
}
vector4_t *FV4_UnLoad(vector4_t *vec, fixed_t *x, fixed_t *y, fixed_t *z, fixed_t *a)
{
*x = vec->x;
*y = vec->y;
*z = vec->z;
*a = vec->a;
return vec;
}
vector3_t *FV3_Copy(vector3_t *a_o, const vector3_t *a_i)
{
return M_Memcpy(a_o, a_i, sizeof(vector3_t));
}
vector4_t *FV4_Copy(vector4_t *a_o, const vector4_t *a_i)
{
return M_Memcpy(a_o, a_i, sizeof(vector4_t));
}
vector3_t *FV3_AddEx(const vector3_t *a_i, const vector3_t *a_c, vector3_t *a_o)
{
a_o->x = a_i->x + a_c->x;
@ -297,11 +320,25 @@ vector3_t *FV3_AddEx(const vector3_t *a_i, const vector3_t *a_c, vector3_t *a_o)
return a_o;
}
vector4_t *FV4_AddEx(const vector4_t *a_i, const vector4_t *a_c, vector4_t *a_o)
{
a_o->x = a_i->x + a_c->x;
a_o->y = a_i->y + a_c->y;
a_o->z = a_i->z + a_c->z;
a_o->a = a_i->a + a_c->a;
return a_o;
}
vector3_t *FV3_Add(vector3_t *a_i, const vector3_t *a_c)
{
return FV3_AddEx(a_i, a_c, a_i);
}
vector4_t *FV4_Add(vector4_t *a_i, const vector4_t *a_c)
{
return FV4_AddEx(a_i, a_c, a_i);
}
vector3_t *FV3_SubEx(const vector3_t *a_i, const vector3_t *a_c, vector3_t *a_o)
{
a_o->x = a_i->x - a_c->x;
@ -310,11 +347,25 @@ vector3_t *FV3_SubEx(const vector3_t *a_i, const vector3_t *a_c, vector3_t *a_o)
return a_o;
}
vector4_t *FV4_SubEx(const vector4_t *a_i, const vector4_t *a_c, vector4_t *a_o)
{
a_o->x = a_i->x - a_c->x;
a_o->y = a_i->y - a_c->y;
a_o->z = a_i->z - a_c->z;
a_o->a = a_i->a - a_c->a;
return a_o;
}
vector3_t *FV3_Sub(vector3_t *a_i, const vector3_t *a_c)
{
return FV3_SubEx(a_i, a_c, a_i);
}
vector4_t *FV4_Sub(vector4_t *a_i, const vector4_t *a_c)
{
return FV4_SubEx(a_i, a_c, a_i);
}
vector3_t *FV3_MulEx(const vector3_t *a_i, fixed_t a_c, vector3_t *a_o)
{
a_o->x = FixedMul(a_i->x, a_c);
@ -323,11 +374,25 @@ vector3_t *FV3_MulEx(const vector3_t *a_i, fixed_t a_c, vector3_t *a_o)
return a_o;
}
vector4_t *FV4_MulEx(const vector4_t *a_i, fixed_t a_c, vector4_t *a_o)
{
a_o->x = FixedMul(a_i->x, a_c);
a_o->y = FixedMul(a_i->y, a_c);
a_o->z = FixedMul(a_i->z, a_c);
a_o->a = FixedMul(a_i->a, a_c);
return a_o;
}
vector3_t *FV3_Mul(vector3_t *a_i, fixed_t a_c)
{
return FV3_MulEx(a_i, a_c, a_i);
}
vector4_t *FV4_Mul(vector4_t *a_i, fixed_t a_c)
{
return FV4_MulEx(a_i, a_c, a_i);
}
vector3_t *FV3_DivideEx(const vector3_t *a_i, fixed_t a_c, vector3_t *a_o)
{
a_o->x = FixedDiv(a_i->x, a_c);
@ -336,11 +401,25 @@ vector3_t *FV3_DivideEx(const vector3_t *a_i, fixed_t a_c, vector3_t *a_o)
return a_o;
}
vector4_t *FV4_DivideEx(const vector4_t *a_i, fixed_t a_c, vector4_t *a_o)
{
a_o->x = FixedDiv(a_i->x, a_c);
a_o->y = FixedDiv(a_i->y, a_c);
a_o->z = FixedDiv(a_i->z, a_c);
a_o->a = FixedDiv(a_i->a, a_c);
return a_o;
}
vector3_t *FV3_Divide(vector3_t *a_i, fixed_t a_c)
{
return FV3_DivideEx(a_i, a_c, a_i);
}
vector4_t *FV4_Divide(vector4_t *a_i, fixed_t a_c)
{
return FV4_DivideEx(a_i, a_c, a_i);
}
// Vector Complex Math
vector3_t *FV3_Midpoint(const vector3_t *a_1, const vector3_t *a_2, vector3_t *a_o)
{
@ -353,6 +432,19 @@ vector3_t *FV3_Midpoint(const vector3_t *a_1, const vector3_t *a_2, vector3_t *a
return a_o;
}
vector4_t *FV4_Midpoint(const vector4_t *a_1, const vector4_t *a_2, vector4_t *a_o)
{
a_o->x = FixedDiv(a_2->x - a_1->x, 2 * FRACUNIT);
a_o->y = FixedDiv(a_2->y - a_1->y, 2 * FRACUNIT);
a_o->z = FixedDiv(a_2->z - a_1->z, 2 * FRACUNIT);
a_o->a = FixedDiv(a_2->a - a_1->a, 2 * FRACUNIT);
a_o->x = a_1->x + a_o->x;
a_o->y = a_1->y + a_o->y;
a_o->z = a_1->z + a_o->z;
a_o->a = a_1->z + a_o->a;
return a_o;
}
fixed_t FV3_Distance(const vector3_t *p1, const vector3_t *p2)
{
fixed_t xs = FixedMul(p2->x - p1->x, p2->x - p1->x);
@ -361,6 +453,15 @@ fixed_t FV3_Distance(const vector3_t *p1, const vector3_t *p2)
return FixedSqrt(xs + ys + zs);
}
fixed_t FV4_Distance(const vector4_t *p1, const vector4_t *p2)
{
fixed_t xs = FixedMul(p2->x - p1->x, p2->x - p1->x);
fixed_t ys = FixedMul(p2->y - p1->y, p2->y - p1->y);
fixed_t zs = FixedMul(p2->z - p1->z, p2->z - p1->z);
fixed_t za = FixedMul(p2->a - p1->a, p2->a - p1->a);
return FixedSqrt(xs + ys + zs + za);
}
fixed_t FV3_Magnitude(const vector3_t *a_normal)
{
fixed_t xs = FixedMul(a_normal->x, a_normal->x);
@ -369,6 +470,15 @@ fixed_t FV3_Magnitude(const vector3_t *a_normal)
return FixedSqrt(xs + ys + zs);
}
fixed_t FV4_Magnitude(const vector4_t *a_normal)
{
fixed_t xs = FixedMul(a_normal->x, a_normal->x);
fixed_t ys = FixedMul(a_normal->y, a_normal->y);
fixed_t zs = FixedMul(a_normal->z, a_normal->z);
fixed_t as = FixedMul(a_normal->a, a_normal->a);
return FixedSqrt(xs + ys + zs + as);
}
// Also returns the magnitude
fixed_t FV3_NormalizeEx(const vector3_t *a_normal, vector3_t *a_o)
{
@ -379,11 +489,26 @@ fixed_t FV3_NormalizeEx(const vector3_t *a_normal, vector3_t *a_o)
return magnitude;
}
fixed_t FV4_NormalizeEx(const vector4_t *a_normal, vector4_t *a_o)
{
fixed_t magnitude = FV4_Magnitude(a_normal);
a_o->x = FixedDiv(a_normal->x, magnitude);
a_o->y = FixedDiv(a_normal->y, magnitude);
a_o->z = FixedDiv(a_normal->z, magnitude);
a_o->a = FixedDiv(a_normal->a, magnitude);
return magnitude;
}
fixed_t FV3_Normalize(vector3_t *a_normal)
{
return FV3_NormalizeEx(a_normal, a_normal);
}
fixed_t FV4_Normalize(vector4_t *a_normal)
{
return FV4_NormalizeEx(a_normal, a_normal);
}
vector3_t *FV3_NegateEx(const vector3_t *a_1, vector3_t *a_o)
{
a_o->x = -a_1->x;
@ -392,11 +517,25 @@ vector3_t *FV3_NegateEx(const vector3_t *a_1, vector3_t *a_o)
return a_o;
}
vector4_t *FV4_NegateEx(const vector4_t *a_1, vector4_t *a_o)
{
a_o->x = -a_1->x;
a_o->y = -a_1->y;
a_o->z = -a_1->z;
a_o->a = -a_1->a;
return a_o;
}
vector3_t *FV3_Negate(vector3_t *a_1)
{
return FV3_NegateEx(a_1, a_1);
}
vector4_t *FV4_Negate(vector4_t *a_1)
{
return FV4_NegateEx(a_1, a_1);
}
boolean FV3_Equal(const vector3_t *a_1, const vector3_t *a_2)
{
fixed_t Epsilon = FRACUNIT / FRACUNIT;
@ -411,11 +550,31 @@ boolean FV3_Equal(const vector3_t *a_1, const vector3_t *a_2)
return false;
}
boolean FV4_Equal(const vector4_t *a_1, const vector4_t *a_2)
{
fixed_t Epsilon = FRACUNIT / FRACUNIT;
if ((abs(a_2->x - a_1->x) > Epsilon) ||
(abs(a_2->y - a_1->y) > Epsilon) ||
(abs(a_2->z - a_1->z) > Epsilon) ||
(abs(a_2->a - a_1->a) > Epsilon))
{
return true;
}
return false;
}
fixed_t FV3_Dot(const vector3_t *a_1, const vector3_t *a_2)
{
return (FixedMul(a_1->x, a_2->x) + FixedMul(a_1->y, a_2->y) + FixedMul(a_1->z, a_2->z));
}
fixed_t FV4_Dot(const vector4_t *a_1, const vector4_t *a_2)
{
return (FixedMul(a_1->x, a_2->x) + FixedMul(a_1->y, a_2->y) + FixedMul(a_1->z, a_2->z) + FixedMul(a_1->a, a_2->a));
}
vector3_t *FV3_Cross(const vector3_t *a_1, const vector3_t *a_2, vector3_t *a_o)
{
a_o->x = FixedMul(a_1->y, a_2->z) - FixedMul(a_1->z, a_2->y);
@ -432,7 +591,7 @@ vector3_t *FV3_Cross(const vector3_t *a_1, const vector3_t *a_2, vector3_t *a_o)
//
vector3_t *FV3_ClosestPointOnLine(const vector3_t *Line, const vector3_t *p, vector3_t *out)
{
// Determine t (the length of the vector from <EFBFBD>Line[0]<5D> to <20>p<EFBFBD>)
// Determine t (the length of the vector from "Line[0]" to "p")
vector3_t c, V;
fixed_t t, d = 0;
FV3_SubEx(p, &Line[0], &c);
@ -442,7 +601,7 @@ vector3_t *FV3_ClosestPointOnLine(const vector3_t *Line, const vector3_t *p, vec
d = FV3_Distance(&Line[0], &Line[1]);
t = FV3_Dot(&V, &c);
// Check to see if <EFBFBD>t<EFBFBD> is beyond the extents of the line segment
// Check to see if "t" is beyond the extents of the line segment
if (t < 0)
{
return FV3_Copy(out, &Line[0]);
@ -452,7 +611,7 @@ vector3_t *FV3_ClosestPointOnLine(const vector3_t *Line, const vector3_t *p, vec
return FV3_Copy(out, &Line[1]);
}
// Return the point between <EFBFBD>Line[0]<5D> and <20>Line[1]<5D>
// Return the point between "Line[0]" and "Line[1]"
FV3_Mul(&V, t);
return FV3_AddEx(&Line[0], &V, out);
@ -810,7 +969,7 @@ void FM_CreateObjectMatrix(matrix_t *matrix, fixed_t x, fixed_t y, fixed_t z, fi
//
// Multiplies a vector by the specified matrix
//
void FM_MultMatrixVec3(const matrix_t *matrix, const vector3_t *vec, vector3_t *out)
const vector3_t *FM_MultMatrixVec3(const matrix_t *matrix, const vector3_t *vec, vector3_t *out)
{
#define M(row,col) matrix->m[col * 4 + row]
out->x = FixedMul(vec->x, M(0, 0))
@ -828,6 +987,34 @@ void FM_MultMatrixVec3(const matrix_t *matrix, const vector3_t *vec, vector3_t *
+ FixedMul(vec->z, M(2, 2))
+ M(2, 3);
#undef M
return out;
}
const vector4_t *FM_MultMatrixVec4(const matrix_t *matrix, const vector4_t *vec, vector4_t *out)
{
#define M(row,col) matrix->m[col * 4 + row]
out->x = FixedMul(vec->x, M(0, 0))
+ FixedMul(vec->y, M(0, 1))
+ FixedMul(vec->z, M(0, 2))
+ FixedMul(vec->a, M(0, 3));
out->y = FixedMul(vec->x, M(1, 0))
+ FixedMul(vec->y, M(1, 1))
+ FixedMul(vec->z, M(1, 2))
+ FixedMul(vec->a, M(1, 3));
out->z = FixedMul(vec->x, M(2, 0))
+ FixedMul(vec->y, M(2, 1))
+ FixedMul(vec->z, M(2, 2))
+ FixedMul(vec->a, M(2, 3));
out->a = FixedMul(vec->x, M(3, 0))
+ FixedMul(vec->y, M(3, 1))
+ FixedMul(vec->z, M(3, 2))
+ FixedMul(vec->a, M(3, 3));
#undef M
return out;
}
//

View file

@ -395,6 +395,32 @@ vector3_t *FV3_IntersectionPoint(const vector3_t *vNormal, const vector3_t *vLin
UINT8 FV3_PointOnLineSide(const vector3_t *point, const vector3_t *line);
boolean FV3_PointInsideBox(const vector3_t *point, const vector3_t *box);
typedef struct
{
fixed_t x, y, z, a;
} vector4_t;
vector4_t *FV4_Load(vector4_t *vec, fixed_t x, fixed_t y, fixed_t z, fixed_t a);
vector4_t *FV4_UnLoad(vector4_t *vec, fixed_t *x, fixed_t *y, fixed_t *z, fixed_t *a);
vector4_t *FV4_Copy(vector4_t *a_o, const vector4_t *a_i);
vector4_t *FV4_AddEx(const vector4_t *a_i, const vector4_t *a_c, vector4_t *a_o);
vector4_t *FV4_Add(vector4_t *a_i, const vector4_t *a_c);
vector4_t *FV4_SubEx(const vector4_t *a_i, const vector4_t *a_c, vector4_t *a_o);
vector4_t *FV4_Sub(vector4_t *a_i, const vector4_t *a_c);
vector4_t *FV4_MulEx(const vector4_t *a_i, fixed_t a_c, vector4_t *a_o);
vector4_t *FV4_Mul(vector4_t *a_i, fixed_t a_c);
vector4_t *FV4_DivideEx(const vector4_t *a_i, fixed_t a_c, vector4_t *a_o);
vector4_t *FV4_Divide(vector4_t *a_i, fixed_t a_c);
vector4_t *FV4_Midpoint(const vector4_t *a_1, const vector4_t *a_2, vector4_t *a_o);
fixed_t FV4_Distance(const vector4_t *p1, const vector4_t *p2);
fixed_t FV4_Magnitude(const vector4_t *a_normal);
fixed_t FV4_NormalizeEx(const vector4_t *a_normal, vector4_t *a_o);
fixed_t FV4_Normalize(vector4_t *a_normal);
vector4_t *FV4_NegateEx(const vector4_t *a_1, vector4_t *a_o);
vector4_t *FV4_Negate(vector4_t *a_1);
boolean FV4_Equal(const vector4_t *a_1, const vector4_t *a_2);
fixed_t FV4_Dot(const vector4_t *a_1, const vector4_t *a_2);
typedef struct
{
fixed_t m[16];
@ -402,7 +428,8 @@ typedef struct
void FM_LoadIdentity(matrix_t* matrix);
void FM_CreateObjectMatrix(matrix_t *matrix, fixed_t x, fixed_t y, fixed_t z, fixed_t anglex, fixed_t angley, fixed_t anglez, fixed_t upx, fixed_t upy, fixed_t upz, fixed_t radius);
void FM_MultMatrixVec3(const matrix_t *matrix, const vector3_t *vec, vector3_t *out);
const vector3_t *FM_MultMatrixVec3(const matrix_t *matrix, const vector3_t *vec, vector3_t *out);
const vector4_t *FM_MultMatrixVec4(const matrix_t *matrix, const vector4_t *vec, vector4_t *out);
void FM_MultMatrix(matrix_t *dest, const matrix_t *multme);
void FM_Translate(matrix_t *dest, fixed_t x, fixed_t y, fixed_t z);
void FM_Scale(matrix_t *dest, fixed_t x, fixed_t y, fixed_t z);

View file

@ -3686,17 +3686,12 @@ void M_StartControlPanel(void)
}
else
{
INT32 numlives = 2;
INT32 numlives = players[consoleplayer].lives;
if (players[consoleplayer].playerstate != PST_LIVE)
++numlives;
SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA) && !marathonmode) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
if (&players[consoleplayer])
{
numlives = players[consoleplayer].lives;
if (players[consoleplayer].playerstate != PST_LIVE)
++numlives;
}
// The list of things that can disable retrying is (was?) a little too complex
// for me to want to use the short if statement syntax
if (numlives <= 1 || G_IsSpecialStage(gamemap))
@ -3754,7 +3749,7 @@ void M_StartControlPanel(void)
if (G_GametypeHasTeams())
MPauseMenu[mpause_switchteam].status = IT_STRING | IT_SUBMENU;
else if (G_GametypeHasSpectators())
MPauseMenu[((&players[consoleplayer] && players[consoleplayer].spectator) ? mpause_entergame : mpause_spectate)].status = IT_STRING | IT_CALL;
MPauseMenu[players[consoleplayer].spectator ? mpause_entergame : mpause_spectate].status = IT_STRING | IT_CALL;
else // in this odd case, we still want something to be on the menu even if it's useless
MPauseMenu[mpause_spectate].status = IT_GRAYEDOUT;
}
@ -7014,7 +7009,7 @@ static void M_RetryResponse(INT32 ch)
if (ch != 'y' && ch != KEY_ENTER)
return;
if (!&players[consoleplayer] || netgame || multiplayer) // Should never happen!
if (netgame || multiplayer) // Should never happen!
return;
M_ClearMenus(true);

View file

@ -566,10 +566,13 @@ void M_FirstLoadConfig(void)
gameconfig_loaded = true;
// reset to default player stuff
COM_BufAddText (va("%s \"%s\"\n",cv_skin.name,cv_defaultskin.string));
COM_BufAddText (va("%s \"%s\"\n",cv_playercolor.name,cv_defaultplayercolor.string));
COM_BufAddText (va("%s \"%s\"\n",cv_skin2.name,cv_defaultskin2.string));
COM_BufAddText (va("%s \"%s\"\n",cv_playercolor2.name,cv_defaultplayercolor2.string));
if (!dedicated)
{
COM_BufAddText (va("%s \"%s\"\n",cv_skin.name,cv_defaultskin.string));
COM_BufAddText (va("%s \"%s\"\n",cv_playercolor.name,cv_defaultplayercolor.string));
COM_BufAddText (va("%s \"%s\"\n",cv_skin2.name,cv_defaultskin2.string));
COM_BufAddText (va("%s \"%s\"\n",cv_playercolor2.name,cv_defaultplayercolor2.string));
}
}
/** Saves the game configuration.
@ -833,7 +836,7 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png
else
snprintf(lvlttltext, 48, "Unknown");
if (gamestate == GS_LEVEL && &players[displayplayer] && players[displayplayer].mo)
if (gamestate == GS_LEVEL && players[displayplayer].mo)
snprintf(locationtxt, 40, "X:%d Y:%d Z:%d A:%d",
players[displayplayer].mo->x>>FRACBITS,
players[displayplayer].mo->y>>FRACBITS,
@ -2161,63 +2164,6 @@ const char *GetRevisionString(void)
return rev;
}
// Vector/matrix math
TVector *VectorMatrixMultiply(TVector v, TMatrix m)
{
static TVector ret;
ret[0] = FixedMul(v[0],m[0][0]) + FixedMul(v[1],m[1][0]) + FixedMul(v[2],m[2][0]) + FixedMul(v[3],m[3][0]);
ret[1] = FixedMul(v[0],m[0][1]) + FixedMul(v[1],m[1][1]) + FixedMul(v[2],m[2][1]) + FixedMul(v[3],m[3][1]);
ret[2] = FixedMul(v[0],m[0][2]) + FixedMul(v[1],m[1][2]) + FixedMul(v[2],m[2][2]) + FixedMul(v[3],m[3][2]);
ret[3] = FixedMul(v[0],m[0][3]) + FixedMul(v[1],m[1][3]) + FixedMul(v[2],m[2][3]) + FixedMul(v[3],m[3][3]);
return &ret;
}
TMatrix *RotateXMatrix(angle_t rad)
{
static TMatrix ret;
const angle_t fa = rad>>ANGLETOFINESHIFT;
const fixed_t cosrad = FINECOSINE(fa), sinrad = FINESINE(fa);
ret[0][0] = FRACUNIT; ret[0][1] = 0; ret[0][2] = 0; ret[0][3] = 0;
ret[1][0] = 0; ret[1][1] = cosrad; ret[1][2] = sinrad; ret[1][3] = 0;
ret[2][0] = 0; ret[2][1] = -sinrad; ret[2][2] = cosrad; ret[2][3] = 0;
ret[3][0] = 0; ret[3][1] = 0; ret[3][2] = 0; ret[3][3] = FRACUNIT;
return &ret;
}
#if 0
TMatrix *RotateYMatrix(angle_t rad)
{
static TMatrix ret;
const angle_t fa = rad>>ANGLETOFINESHIFT;
const fixed_t cosrad = FINECOSINE(fa), sinrad = FINESINE(fa);
ret[0][0] = cosrad; ret[0][1] = 0; ret[0][2] = -sinrad; ret[0][3] = 0;
ret[1][0] = 0; ret[1][1] = FRACUNIT; ret[1][2] = 0; ret[1][3] = 0;
ret[2][0] = sinrad; ret[2][1] = 0; ret[2][2] = cosrad; ret[2][3] = 0;
ret[3][0] = 0; ret[3][1] = 0; ret[3][2] = 0; ret[3][3] = FRACUNIT;
return &ret;
}
#endif
TMatrix *RotateZMatrix(angle_t rad)
{
static TMatrix ret;
const angle_t fa = rad>>ANGLETOFINESHIFT;
const fixed_t cosrad = FINECOSINE(fa), sinrad = FINESINE(fa);
ret[0][0] = cosrad; ret[0][1] = sinrad; ret[0][2] = 0; ret[0][3] = 0;
ret[1][0] = -sinrad; ret[1][1] = cosrad; ret[1][2] = 0; ret[1][3] = 0;
ret[2][0] = 0; ret[2][1] = 0; ret[2][2] = FRACUNIT; ret[2][3] = 0;
ret[3][0] = 0; ret[3][1] = 0; ret[3][2] = 0; ret[3][3] = FRACUNIT;
return &ret;
}
/** Set of functions to take in a size_t as an argument,
* put the argument in a character buffer, and return the
* pointer to that buffer.

View file

@ -80,17 +80,6 @@ INT32 axtoi(const char *hexStg);
const char *GetRevisionString(void);
// Vector/matrix math
typedef fixed_t TVector[4];
typedef fixed_t TMatrix[4][4];
TVector *VectorMatrixMultiply(TVector v, TMatrix m);
TMatrix *RotateXMatrix(angle_t rad);
#if 0
TMatrix *RotateYMatrix(angle_t rad);
#endif
TMatrix *RotateZMatrix(angle_t rad);
// s1 = s2+s3+s1 (1024 lenghtmax)
void strcatbf(char *s1, const char *s2, const char *s3);

View file

@ -498,7 +498,7 @@ static boolean P_WaterInSector(mobj_t *mobj, fixed_t x, fixed_t y)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE))
continue;
if (*rover->topheight >= mobj->floorz && *rover->topheight <= mobj->z)
@ -1521,8 +1521,9 @@ void A_PointyThink(mobj_t *actor)
INT32 i;
player_t *player = NULL;
mobj_t *ball;
TVector v;
TVector *res;
matrix_t m;
vector4_t v;
vector4_t res;
angle_t fa;
fixed_t radius = FixedMul(actor->info->radius*actor->info->reactiontime, actor->scale);
boolean firsttime = true;
@ -1592,20 +1593,21 @@ void A_PointyThink(mobj_t *actor)
while (ball)
{
fa = actor->lastlook+i;
v[0] = FixedMul(FINECOSINE(fa),radius);
v[1] = 0;
v[2] = FixedMul(FINESINE(fa),radius);
v[3] = FRACUNIT;
v.x = FixedMul(FINECOSINE(fa),radius);
v.y = 0;
v.z = FixedMul(FINESINE(fa),radius);
v.a = FRACUNIT;
res = VectorMatrixMultiply(v, *RotateXMatrix(FixedAngle(actor->lastlook+i)));
M_Memcpy(&v, res, sizeof (v));
res = VectorMatrixMultiply(v, *RotateZMatrix(actor->angle+ANGLE_180));
M_Memcpy(&v, res, sizeof (v));
FM_RotateX(&m, FixedAngle(actor->lastlook+i));
FV4_Copy(&v, FM_MultMatrixVec4(&m, &v, &res));
FM_RotateZ(&m, actor->angle+ANGLE_180);
FV4_Copy(&v, FM_MultMatrixVec4(&m, &v, &res));
P_UnsetThingPosition(ball);
ball->x = actor->x + v[0];
ball->y = actor->y + v[1];
ball->z = actor->z + (actor->height>>1) + v[2];
ball->x = actor->x + v.x;
ball->y = actor->y + v.y;
ball->z = actor->z + (actor->height>>1) + v.z;
P_SetThingPosition(ball);
ball = ball->tracer;
@ -12686,7 +12688,7 @@ void A_WhoCaresIfYourSonIsABee(mobj_t *actor)
// Function: A_ParentTriesToSleep
//
// Description: If extravalue1 is less than or equal to var1, go to var2.
// Description: If extravalue1 is greater than 0 go to var1
//
// var1 = state to go to when extravalue1
// var2 = unused

View file

@ -551,7 +551,7 @@ static fixed_t P_SectorCheckWater(sector_t *analyzesector,
for (rover = analyzesector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_SOLID)
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_SOLID)
continue;
// If the sector is below the water, don't bother.
@ -757,10 +757,10 @@ void T_StartCrumble(crumble_t *crumble)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_CRUMBLE))
if (!(rover->fofflags & FOF_CRUMBLE))
continue;
if (!(rover->flags & FF_FLOATBOB))
if (!(rover->fofflags & FOF_FLOATBOB))
continue;
if (rover->master != crumble->sourceline)
@ -769,7 +769,7 @@ void T_StartCrumble(crumble_t *crumble)
rover->alpha = crumble->origalpha;
if (rover->alpha == 0xff)
rover->flags &= ~FF_TRANSLUCENT;
rover->fofflags &= ~FOF_TRANSLUCENT;
}
}
@ -793,13 +793,13 @@ void T_StartCrumble(crumble_t *crumble)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (rover->flags & FF_NORETURN)
if (rover->fofflags & FOF_NORETURN)
continue;
if (!(rover->flags & FF_CRUMBLE))
if (!(rover->fofflags & FOF_CRUMBLE))
continue;
if (!(rover->flags & FF_FLOATBOB))
if (!(rover->fofflags & FOF_FLOATBOB))
continue;
if (rover->master != crumble->sourceline)
@ -807,7 +807,7 @@ void T_StartCrumble(crumble_t *crumble)
if (rover->alpha == crumble->origalpha)
{
rover->flags |= FF_TRANSLUCENT;
rover->fofflags |= FOF_TRANSLUCENT;
rover->alpha = 0x00;
}
else
@ -815,7 +815,7 @@ void T_StartCrumble(crumble_t *crumble)
rover->alpha = crumble->origalpha;
if (rover->alpha == 0xff)
rover->flags &= ~FF_TRANSLUCENT;
rover->fofflags &= ~FOF_TRANSLUCENT;
}
}
}
@ -1082,7 +1082,7 @@ void T_ThwompSector(thwomp_t *thwomp)
if (thwomp->direction == 0) // Not going anywhere, so look for players.
{
if (rover->flags & FF_EXISTS)
if (rover->fofflags & FOF_EXISTS)
{
UINT8 i;
// scan the players to find victims!
@ -1175,7 +1175,7 @@ void T_ThwompSector(thwomp_t *thwomp)
if (res == pastdest)
{
if (rover->flags & FF_EXISTS)
if (rover->fofflags & FOF_EXISTS)
S_StartSound((void *)&actionsector->soundorg, thwomp->sound);
thwomp->direction = 1; // start heading back up
@ -1928,7 +1928,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
}
// no longer exists (can't collide with again)
rover->flags &= ~FF_EXISTS;
rover->fofflags &= ~FOF_EXISTS;
rover->master->frontsector->moved = true;
P_RecalcPrecipInSector(sec);
}
@ -2054,8 +2054,8 @@ void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher)
if (roversec->floordata || roversec->ceilingdata)
return;
if (!(rover->flags & FF_SOLID))
rover->flags |= (FF_SOLID|FF_RENDERALL|FF_CUTLEVEL);
if (!(rover->fofflags & FOF_SOLID))
rover->fofflags |= (FOF_SOLID|FOF_RENDERALL|FOF_CUTLEVEL);
// Find an item to pop out!
thing = SearchMarioNode(roversec->touching_thinglist);

View file

@ -505,11 +505,12 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
if (flipval*object->momz > FixedMul(speed, spring->scale))
object->momz = flipval*FixedMul(speed, spring->scale);
if (p && !p->powers[pw_tailsfly]) // doesn't reset anim for Tails' flight
if (p && !p->powers[pw_tailsfly] && !p->powers[pw_carry]) // doesn't reset anim for Tails' flight
{
P_ResetPlayer(p);
if (p->panim != PA_FALL)
P_SetPlayerMobjState(object, S_PLAY_FALL);
P_SetPlayerMobjState(object, S_PLAY_FALL);
P_SetTarget(&object->tracer, spring);
p->powers[pw_carry] = CR_FAN;
}
break;
case MT_STEAM: // Steam
@ -2073,13 +2074,13 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
topheight = P_GetFOFTopZ(thing, newsubsec->sector, rover, x, y, NULL);
bottomheight = P_GetFOFBottomZ(thing, newsubsec->sector, rover, x, y, NULL);
if ((rover->flags & (FF_SWIMMABLE|FF_GOOWATER)) == (FF_SWIMMABLE|FF_GOOWATER) && !(thing->flags & MF_NOGRAVITY))
if ((rover->fofflags & (FOF_SWIMMABLE|FOF_GOOWATER)) == (FOF_SWIMMABLE|FOF_GOOWATER) && !(thing->flags & MF_NOGRAVITY))
{
// If you're inside goowater and slowing down
fixed_t sinklevel = FixedMul(thing->info->height/6, thing->scale);
@ -2118,14 +2119,14 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
if (thing->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(thing->player, rover)))
;
else if (thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE))
else if (thing->type == MT_SKIM && (rover->fofflags & FOF_SWIMMABLE))
;
else if (!((rover->flags & FF_BLOCKPLAYER && thing->player)
|| (rover->flags & FF_BLOCKOTHERS && !thing->player)
|| rover->flags & FF_QUICKSAND))
else if (!((rover->fofflags & FOF_BLOCKPLAYER && thing->player)
|| (rover->fofflags & FOF_BLOCKOTHERS && !thing->player)
|| rover->fofflags & FOF_QUICKSAND))
continue;
if (rover->flags & FF_QUICKSAND)
if (rover->fofflags & FOF_QUICKSAND)
{
if (thing->z < topheight && bottomheight < thingtop)
{
@ -2145,15 +2146,15 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
+ ((topheight - bottomheight)/2));
if (topheight > tmfloorz && abs(delta1) < abs(delta2)
&& !(rover->flags & FF_REVERSEPLATFORM))
&& !(rover->fofflags & FOF_REVERSEPLATFORM))
{
tmfloorz = tmdropoffz = topheight;
tmfloorrover = rover;
tmfloorslope = *rover->t_slope;
}
if (bottomheight < tmceilingz && abs(delta1) >= abs(delta2)
&& !(rover->flags & FF_PLATFORM)
&& !(thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)))
&& !(rover->fofflags & FOF_PLATFORM)
&& !(thing->type == MT_SKIM && (rover->fofflags & FOF_SWIMMABLE)))
{
tmceilingz = tmdrpoffceilz = bottomheight;
tmceilingrover = rover;
@ -2371,7 +2372,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERALL) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, x, y, NULL);
@ -3024,9 +3025,9 @@ static boolean P_ThingHeightClip(mobj_t *thing)
{
rover = (thing->eflags & MFE_VERTICALFLIP) ? oldceilingrover : oldfloorrover;
// Match the Thing's old floorz to an FOF and check for FF_EXISTS
// If ~FF_EXISTS, don't set mobj Z.
if (!rover || ((rover->flags & FF_EXISTS) && (rover->flags & FF_SOLID)))
// Match the Thing's old floorz to an FOF and check for FOF_EXISTS
// If ~FOF_EXISTS, don't set mobj Z.
if (!rover || ((rover->fofflags & FOF_EXISTS) && (rover->fofflags & FOF_SOLID)))
{
hitfloor = bouncing;
if (thing->eflags & MFE_VERTICALFLIP)
@ -3287,7 +3288,7 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle)
for (rover = glidesector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_BLOCKPLAYER))
continue;
topheight = P_GetFFloorTopZAt (rover, mo->x, mo->y);
@ -3403,7 +3404,7 @@ static void PTR_GlideClimbTraverse(line_t *li)
{
for (rover = checksector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (slidemo->player->charflags & SF_CANBUSTWALLS)))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (slidemo->player->charflags & SF_CANBUSTWALLS)))
continue;
topheight = P_GetFFloorTopZAt (rover, slidemo->x, slidemo->y);
@ -3631,10 +3632,10 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec)
for (rover = sec->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_SWIMMABLE))
if (!(rover->fofflags & FOF_SWIMMABLE))
continue;
if (rover->master->frontsector->damagetype != SD_LAVA)
@ -4241,8 +4242,8 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush)
for (rover = thing->subsector->sector->ffloors; rover; rover = rover->next)
{
if (!(((rover->flags & FF_BLOCKPLAYER) && thing->player)
|| ((rover->flags & FF_BLOCKOTHERS) && !thing->player)) || !(rover->flags & FF_EXISTS))
if (!(((rover->fofflags & FOF_BLOCKPLAYER) && thing->player)
|| ((rover->fofflags & FOF_BLOCKOTHERS) && !thing->player)) || !(rover->fofflags & FOF_EXISTS))
continue;
topheight = *rover->topheight;
@ -5036,16 +5037,16 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
for (rover = sec->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if ((!(rover->flags & FF_SOLID || rover->flags & FF_QUICKSAND) || (rover->flags & FF_SWIMMABLE)))
if ((!(rover->fofflags & FOF_SOLID || rover->fofflags & FOF_QUICKSAND) || (rover->fofflags & FOF_SWIMMABLE)))
continue;
topheight = P_GetFFloorTopZAt (rover, x, y);
bottomheight = P_GetFFloorBottomZAt(rover, x, y);
if (rover->flags & FF_QUICKSAND)
if (rover->fofflags & FOF_QUICKSAND)
{
if (z < topheight && bottomheight < thingtop)
{
@ -5080,16 +5081,16 @@ fixed_t P_CeilingzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
for (rover = sec->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if ((!(rover->flags & FF_SOLID || rover->flags & FF_QUICKSAND) || (rover->flags & FF_SWIMMABLE)))
if ((!(rover->fofflags & FOF_SOLID || rover->fofflags & FOF_QUICKSAND) || (rover->fofflags & FOF_SWIMMABLE)))
continue;
topheight = P_GetFFloorTopZAt (rover, x, y);
bottomheight = P_GetFFloorBottomZAt(rover, x, y);
if (rover->flags & FF_QUICKSAND)
if (rover->fofflags & FOF_QUICKSAND)
{
if (thingtop > bottomheight && topheight > z)
{

View file

@ -374,7 +374,7 @@ void P_CameraLineOpening(line_t *linedef)
for (rover = front->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_RENDERALL) || !(rover->fofflags & FOF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(mapcampointer, front, rover, tmx, tmy, linedef);
@ -398,7 +398,7 @@ void P_CameraLineOpening(line_t *linedef)
for (rover = back->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_RENDERALL) || !(rover->fofflags & FOF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(mapcampointer, back, rover, tmx, tmy, linedef);
@ -594,13 +594,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
for (rover = front->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (mobj->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mobj->player, rover)))
;
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
else if (!((rover->fofflags & FOF_BLOCKPLAYER && mobj->player)
|| (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player)))
continue;
topheight = P_GetFOFTopZ(mobj, front, rover, tmx, tmy, linedef);
@ -609,7 +609,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2)));
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
if (delta1 >= delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_PLATFORM) // thing is below FOF
if (delta1 >= delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_PLATFORM) // thing is below FOF
{
if (bottomheight < opentop) {
opentop = bottomheight;
@ -620,7 +620,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
highceiling = bottomheight;
}
if (delta1 < delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF
if (delta1 < delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_REVERSEPLATFORM) // thing is above FOF
{
if (topheight > openbottom) {
openbottom = topheight;
@ -636,13 +636,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
for (rover = back->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (mobj->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mobj->player, rover)))
;
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
else if (!((rover->fofflags & FOF_BLOCKPLAYER && mobj->player)
|| (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player)))
continue;
topheight = P_GetFOFTopZ(mobj, back, rover, tmx, tmy, linedef);
@ -651,7 +651,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2)));
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
if (delta1 >= delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_PLATFORM) // thing is below FOF
if (delta1 >= delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_PLATFORM) // thing is below FOF
{
if (bottomheight < opentop) {
opentop = bottomheight;
@ -662,7 +662,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
highceiling = bottomheight;
}
if (delta1 < delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF
if (delta1 < delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_REVERSEPLATFORM) // thing is above FOF
{
if (topheight > openbottom) {
openbottom = topheight;

View file

@ -955,11 +955,11 @@ void P_ExplodeMissile(mobj_t *mo)
boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
return false;
if ((((rover->flags & FF_BLOCKPLAYER) && mobj->player)
|| ((rover->flags & FF_BLOCKOTHERS) && !mobj->player)))
if ((((rover->fofflags & FOF_BLOCKPLAYER) && mobj->player)
|| ((rover->fofflags & FOF_BLOCKOTHERS) && !mobj->player)))
return false;
topheight = P_GetFFloorTopZAt (rover, mobj->x, mobj->y);
@ -1450,10 +1450,10 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
for (rover = mo->subsector->sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !P_InsideANonSolidFFloor(mo, rover)) // P_InsideANonSolidFFloor checks for FF_EXISTS itself, but let's not always call this function
if (!(rover->fofflags & FOF_EXISTS) || !P_InsideANonSolidFFloor(mo, rover)) // P_InsideANonSolidFFloor checks for FOF_EXISTS itself, but let's not always call this function
continue;
if ((rover->flags & (FF_SWIMMABLE|FF_GOOWATER)) == (FF_SWIMMABLE|FF_GOOWATER))
if ((rover->fofflags & (FOF_SWIMMABLE|FOF_GOOWATER)) == (FOF_SWIMMABLE|FOF_GOOWATER))
goopgravity = true;
gravfactor = P_GetSectorGravityFactor(rover->master->frontsector);
@ -1714,10 +1714,10 @@ static void P_PushableCheckBustables(mobj_t *mo)
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_BUSTUP))
if (!(rover->fofflags & FOF_BUSTUP))
continue;
if (!(rover->bustflags & FB_PUSHABLES))
@ -2168,7 +2168,7 @@ void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
topheight = P_GetFOFTopZ(mo, sector, rover, mo->x, mo->y, NULL);
@ -2176,16 +2176,16 @@ void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype)
if (mo->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mo->player, rover))) // only the player should stand on lava or run on water
;
else if (motype != 0 && rover->flags & FF_SWIMMABLE) // "scenery" only
else if (motype != 0 && rover->fofflags & FOF_SWIMMABLE) // "scenery" only
continue;
else if (rover->flags & FF_QUICKSAND) // quicksand
else if (rover->fofflags & FOF_QUICKSAND) // quicksand
;
else if (!( // if it's not either of the following...
(rover->flags & (FF_BLOCKPLAYER|FF_MARIO) && mo->player) // ...solid to players? (mario blocks are always solid from beneath to players)
|| (rover->flags & FF_BLOCKOTHERS && !mo->player) // ...solid to others?
(rover->fofflags & (FOF_BLOCKPLAYER|FOF_MARIO) && mo->player) // ...solid to players? (mario blocks are always solid from beneath to players)
|| (rover->fofflags & FOF_BLOCKOTHERS && !mo->player) // ...solid to others?
)) // ...don't take it into account.
continue;
if (rover->flags & FF_QUICKSAND)
if (rover->fofflags & FOF_QUICKSAND)
{
switch (motype)
{
@ -2210,15 +2210,15 @@ void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype)
delta2 = thingtop - (bottomheight + ((topheight - bottomheight)/2));
if (topheight > mo->floorz && abs(delta1) < abs(delta2)
&& (rover->flags & FF_SOLID) // Non-FF_SOLID Mario blocks are only solid from bottom
&& !(rover->flags & FF_REVERSEPLATFORM)
&& ((P_MobjFlip(mo)*mo->momz >= 0) || (!(rover->flags & FF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference)
&& (rover->fofflags & FOF_SOLID) // Non-FOF_SOLID Mario blocks are only solid from bottom
&& !(rover->fofflags & FOF_REVERSEPLATFORM)
&& ((P_MobjFlip(mo)*mo->momz >= 0) || (!(rover->fofflags & FOF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference)
{
mo->floorz = topheight;
}
if (bottomheight < mo->ceilingz && abs(delta1) >= abs(delta2)
&& !(rover->flags & FF_PLATFORM)
&& ((P_MobjFlip(mo)*mo->momz >= 0) || ((rover->flags & FF_SOLID) && !(rover->flags & FF_REVERSEPLATFORM)))) // In normal gravity, only clip for FOFs that are intangible from the top if you're coming from below
&& !(rover->fofflags & FOF_PLATFORM)
&& ((P_MobjFlip(mo)*mo->momz >= 0) || ((rover->fofflags & FOF_SOLID) && !(rover->fofflags & FOF_REVERSEPLATFORM)))) // In normal gravity, only clip for FOFs that are intangible from the top if you're coming from below
{
mo->ceilingz = bottomheight;
}
@ -2334,7 +2334,7 @@ boolean P_CheckDeathPitCollide(mobj_t *mo)
boolean P_CheckSolidLava(ffloor_t *rover)
{
return (rover->flags & FF_SWIMMABLE) && (rover->master->frontsector->damagetype == SD_LAVA);
return (rover->fofflags & FOF_SWIMMABLE) && (rover->master->frontsector->damagetype == SD_LAVA);
}
//
@ -2828,10 +2828,10 @@ static void P_CheckMarioBlocks(mobj_t *mo)
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_MARIO))
if (!(rover->fofflags & FOF_MARIO))
continue;
if (mo->eflags & MFE_VERTICALFLIP)
@ -2840,7 +2840,7 @@ static void P_CheckMarioBlocks(mobj_t *mo)
if (*rover->bottomheight != mo->ceilingz)
continue;
if (rover->flags & FF_GOOWATER) // Brick block!
if (rover->fofflags & FOF_GOOWATER) // Brick block!
EV_CrumbleChain(node->m_sector, rover);
else // Question block!
EV_MarioBlock(rover, node->m_sector, mo);
@ -3230,7 +3230,7 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
if (!player->powers[pw_carry] && !player->homing
&& ((player->powers[pw_super] || player->charflags & SF_RUNONWATER || player->dashmode >= DASHMODE_THRESHOLD) && doifit)
&& (rover->flags & FF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale)
&& (rover->fofflags & FOF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale)
&& !(player->pflags & PF_SLIDING)
&& abs(playerbottom - surfaceheight) < FixedMul(30*FRACUNIT, player->mo->scale))
return true;
@ -3264,9 +3264,9 @@ void P_MobjCheckWater(mobj_t *mobj)
for (rover = sector->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE)
|| (((rover->flags & FF_BLOCKPLAYER) && mobj->player)
|| ((rover->flags & FF_BLOCKOTHERS) && !mobj->player)))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE)
|| (((rover->fofflags & FOF_BLOCKPLAYER) && mobj->player)
|| ((rover->fofflags & FOF_BLOCKOTHERS) && !mobj->player)))
continue;
topheight = P_GetSpecialTopZ(mobj, sectors + rover->secnum, sector);
@ -3304,7 +3304,7 @@ void P_MobjCheckWater(mobj_t *mobj)
if (rover->master->frontsector->damagetype == SD_FIRE || rover->master->frontsector->damagetype == SD_LAVA)
mobj->eflags |= MFE_TOUCHLAVA;
if (rover->flags & FF_GOOWATER && !(mobj->flags & MF_NOGRAVITY))
if (rover->fofflags & FOF_GOOWATER && !(mobj->flags & MF_NOGRAVITY))
mobj->eflags |= MFE_GOOWATER;
}
}
@ -3512,7 +3512,7 @@ static void P_SceneryCheckWater(mobj_t *mobj)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKOTHERS)
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_BLOCKOTHERS)
continue;
topheight = P_GetFFloorTopZAt (rover, mobj->x, mobj->y);
@ -3558,7 +3558,7 @@ static boolean P_CameraCheckHeat(camera_t *thiscam)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (halfheight >= P_GetFFloorTopZAt(rover, thiscam->x, thiscam->y))
@ -3588,7 +3588,7 @@ static boolean P_CameraCheckWater(camera_t *thiscam)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKOTHERS)
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_BLOCKOTHERS)
continue;
if (halfheight >= P_GetFFloorTopZAt(rover, thiscam->x, thiscam->y))
@ -3782,10 +3782,10 @@ static void P_CheckCrumblingPlatforms(mobj_t *mobj)
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_CRUMBLE))
if (!(rover->fofflags & FOF_CRUMBLE))
continue;
if (mobj->eflags & MFE_VERTICALFLIP)
@ -3799,7 +3799,7 @@ static void P_CheckCrumblingPlatforms(mobj_t *mobj)
continue;
}
EV_StartCrumble(rover->master->frontsector, rover, (rover->flags & FF_FLOATBOB), mobj->player, rover->alpha, !(rover->flags & FF_NORETURN));
EV_StartCrumble(rover->master->frontsector, rover, (rover->fofflags & FOF_FLOATBOB), mobj->player, rover->alpha, !(rover->fofflags & FOF_NORETURN));
}
}
}
@ -3817,10 +3817,10 @@ static boolean P_MobjTouchesSectorWithWater(mobj_t *mobj)
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_SWIMMABLE))
if (!(rover->fofflags & FOF_SWIMMABLE))
continue;
return true;
@ -3851,10 +3851,10 @@ static void P_CheckFloatbobPlatforms(mobj_t *mobj)
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_FLOATBOB))
if (!(rover->fofflags & FOF_FLOATBOB))
continue;
@ -3984,10 +3984,10 @@ static void CalculatePrecipFloor(precipmobj_t *mobj)
for (rover = mobjsecsubsec->ffloors; rover; rover = rover->next)
{
// If it exists, it'll get rained on.
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_BLOCKOTHERS) && !(rover->flags & FF_SWIMMABLE))
if (!(rover->fofflags & FOF_BLOCKOTHERS) && !(rover->fofflags & FOF_SWIMMABLE))
continue;
topheight = P_GetFFloorTopZAt(rover, mobj->x, mobj->y);
@ -4090,9 +4090,9 @@ static void P_KillRingsInLava(mobj_t *mo)
for (rover = node->m_sector->ffloors; rover; rover = rover->next) // go through all fofs in the sector
{
if (!(rover->flags & FF_EXISTS)) continue; // fof must be real
if (!(rover->fofflags & FOF_EXISTS)) continue; // fof must be real
if (!(rover->flags & FF_SWIMMABLE))
if (!(rover->fofflags & FOF_SWIMMABLE))
continue; // fof must be water
if (rover->master->frontsector->damagetype != SD_FIRE && rover->master->frontsector->damagetype != SD_LAVA)
@ -4733,14 +4733,14 @@ static void P_Boss4DestroyCage(mobj_t *mobj)
{
rsec = &sectors[sector->attached[a]];
for (rover = rsec->ffloors; rover; rover = rover->next)
if (rover->flags & FF_EXISTS && rover->secnum == (size_t)snum)
if (rover->fofflags & FOF_EXISTS && rover->secnum == (size_t)snum)
{
if (rover->flags & FF_RENDERALL) // checking for FF_RENDERANY.
if (rover->fofflags & FOF_RENDERALL) // checking for FF_RENDERANY.
EV_CrumbleChain(rsec, rover); // This FOF is visible to some extent? Crumble it.
else // Completely invisible FOF
{
// no longer exists (can't collide with again)
rover->flags &= ~FF_EXISTS;
rover->fofflags &= ~FOF_EXISTS;
sector->moved = true;
rsec->moved = true;
}
@ -6189,8 +6189,9 @@ static void P_MoveHoop(mobj_t *mobj)
{
const fixed_t fuse = (mobj->fuse*mobj->extravalue2);
const angle_t fa = mobj->movedir*(FINEANGLES/mobj->extravalue1);
TVector v;
TVector *res;
matrix_t m;
vector4_t v;
vector4_t res;
fixed_t finalx, finaly, finalz;
fixed_t x, y, z;
@ -6203,19 +6204,20 @@ static void P_MoveHoop(mobj_t *mobj)
z = mobj->target->z+mobj->target->height/2;
// Make the sprite travel towards the center of the hoop
v[0] = FixedMul(FINECOSINE(fa),fuse);
v[1] = 0;
v[2] = FixedMul(FINESINE(fa),fuse);
v[3] = FRACUNIT;
v.x = FixedMul(FINECOSINE(fa),fuse);
v.y = 0;
v.z = FixedMul(FINESINE(fa),fuse);
v.a = FRACUNIT;
res = VectorMatrixMultiply(v, *RotateXMatrix(FixedAngle(mobj->target->movedir*FRACUNIT)));
M_Memcpy(&v, res, sizeof (v));
res = VectorMatrixMultiply(v, *RotateZMatrix(FixedAngle(mobj->target->movecount*FRACUNIT)));
M_Memcpy(&v, res, sizeof (v));
FM_RotateX(&m, FixedAngle(mobj->target->movedir*FRACUNIT));
FV4_Copy(&v, FM_MultMatrixVec4(&m, &v, &res));
finalx = x + v[0];
finaly = y + v[1];
finalz = z + v[2];
FM_RotateZ(&m, FixedAngle(mobj->target->movecount*FRACUNIT));
FV4_Copy(&v, FM_MultMatrixVec4(&m, &v, &res));
finalx = x + v.x;
finaly = y + v.y;
finalz = z + v.z;
P_UnsetThingPosition(mobj);
mobj->x = finalx;
@ -6228,8 +6230,9 @@ void P_SpawnHoopOfSomething(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT
{
mobj_t *mobj;
INT32 i;
TVector v;
TVector *res;
matrix_t m;
vector4_t v;
vector4_t res;
fixed_t finalx, finaly, finalz;
mobj_t hoopcenter;
mobj_t *axis;
@ -6271,19 +6274,20 @@ void P_SpawnHoopOfSomething(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT
for (i = 0; i < number; i++)
{
fa = (i*degrees);
v[0] = FixedMul(FINECOSINE(fa),radius);
v[1] = 0;
v[2] = FixedMul(FINESINE(fa),radius);
v[3] = FRACUNIT;
v.x = FixedMul(FINECOSINE(fa),radius);
v.y = 0;
v.z = FixedMul(FINESINE(fa),radius);
v.a = FRACUNIT;
res = VectorMatrixMultiply(v, *RotateXMatrix(rotangle));
M_Memcpy(&v, res, sizeof (v));
res = VectorMatrixMultiply(v, *RotateZMatrix(closestangle));
M_Memcpy(&v, res, sizeof (v));
FM_RotateX(&m, rotangle);
FV4_Copy(&v, FM_MultMatrixVec4(&m, &v, &res));
finalx = x + v[0];
finaly = y + v[1];
finalz = z + v[2];
FM_RotateZ(&m, closestangle);
FV4_Copy(&v, FM_MultMatrixVec4(&m, &v, &res));
finalx = x + v.x;
finaly = y + v.y;
finalz = z + v.z;
mobj = P_SpawnMobj(finalx, finaly, finalz, type);
mobj->z -= mobj->height/2;
@ -6294,8 +6298,9 @@ void P_SpawnParaloop(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 numb
{
mobj_t *mobj;
INT32 i;
TVector v;
TVector *res;
matrix_t m;
vector4_t v;
vector4_t res;
fixed_t finalx, finaly, finalz, dist;
angle_t degrees, fa, closestangle;
fixed_t mobjx, mobjy, mobjz;
@ -6310,19 +6315,20 @@ void P_SpawnParaloop(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 numb
for (i = 0; i < number; i++)
{
fa = (i*degrees);
v[0] = FixedMul(FINECOSINE(fa),radius);
v[1] = 0;
v[2] = FixedMul(FINESINE(fa),radius);
v[3] = FRACUNIT;
v.x = FixedMul(FINECOSINE(fa),radius);
v.y = 0;
v.z = FixedMul(FINESINE(fa),radius);
v.a = FRACUNIT;
res = VectorMatrixMultiply(v, *RotateXMatrix(rotangle));
M_Memcpy(&v, res, sizeof (v));
res = VectorMatrixMultiply(v, *RotateZMatrix(closestangle));
M_Memcpy(&v, res, sizeof (v));
FM_RotateX(&m, rotangle);
FV4_Copy(&v, FM_MultMatrixVec4(&m, &v, &res));
finalx = x + v[0];
finaly = y + v[1];
finalz = z + v[2];
FM_RotateZ(&m, closestangle);
FV4_Copy(&v, FM_MultMatrixVec4(&m, &v, &res));
finalx = x + v.x;
finaly = y + v.y;
finalz = z + v.z;
mobj = P_SpawnMobj(finalx, finaly, finalz, type);
@ -6489,9 +6495,10 @@ static void P_NightsItemChase(mobj_t *thing)
//
void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot)
{
TVector unit_lengthways, unit_sideways, pos_lengthways, pos_sideways;
TVector *res;
fixed_t radius, dist, zstore;
matrix_t m;
vector4_t unit_lengthways, unit_sideways, pos_lengthways, pos_sideways;
vector4_t res;
fixed_t radius, dist = 0, zstore;
angle_t fa;
boolean dosound = false;
mobj_t *mobj = center->hnext, *hnext = NULL;
@ -6502,8 +6509,9 @@ void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot)
INT32 rot;
INT32 prevrot;
dist = pos_sideways[0] = pos_sideways[1] = pos_sideways[2] = pos_sideways[3] = unit_sideways[3] =\
pos_lengthways[0] = pos_lengthways[1] = pos_lengthways[2] = pos_lengthways[3] = 0;
FV4_Load(&pos_sideways, 0, 0, 0, 0);
FV4_Load(&unit_sideways, 0, 0, 0, 0);
FV4_Load(&pos_lengthways, 0, 0, 0, 0);
while (mobj)
{
@ -6521,15 +6529,15 @@ void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot)
rot = (baserot + mobj->threshold) & FINEMASK;
prevrot = (baseprevrot + mobj->threshold) & FINEMASK;
pos_lengthways[0] = pos_lengthways[1] = pos_lengthways[2] = pos_lengthways[3] = 0;
FV4_Load(&pos_lengthways, 0, 0, 0, 0);
dist = ((mobj->info->speed) ? mobj->info->speed : mobjinfo[MT_SMALLMACECHAIN].speed);
dist = ((center->scale == FRACUNIT) ? dist : FixedMul(dist, center->scale));
fa = (FixedAngle(center->movefactor*FRACUNIT) >> ANGLETOFINESHIFT);
radius = FixedMul(dist, FINECOSINE(fa));
unit_lengthways[1] = -FixedMul(dist, FINESINE(fa));
unit_lengthways[3] = FRACUNIT;
unit_lengthways.y = -FixedMul(dist, FINESINE(fa));
unit_lengthways.a = FRACUNIT;
// Swinging Chain.
if (center->flags2 & MF2_STRONGBOX)
@ -6542,8 +6550,8 @@ void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot)
fa = ((FixedAngle(swingmag) >> ANGLETOFINESHIFT) + mobj->friction) & FINEMASK;
unit_lengthways[0] = FixedMul(FINESINE(fa), -radius);
unit_lengthways[2] = FixedMul(FINECOSINE(fa), -radius);
unit_lengthways.x = FixedMul(FINESINE(fa), -radius);
unit_lengthways.z = FixedMul(FINECOSINE(fa), -radius);
}
// Rotating Chain.
else
@ -6554,15 +6562,16 @@ void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot)
if (!(prevfa > (FINEMASK/2)) && (fa > (FINEMASK/2))) // completed a full swing
dosound = true;
unit_lengthways[0] = FixedMul(FINECOSINE(fa), radius);
unit_lengthways[2] = FixedMul(FINESINE(fa), radius);
unit_lengthways.x = FixedMul(FINECOSINE(fa), radius);
unit_lengthways.z = FixedMul(FINESINE(fa), radius);
}
// Calculate the angle matrixes for the link.
res = VectorMatrixMultiply(unit_lengthways, *RotateXMatrix(center->threshold << ANGLETOFINESHIFT));
M_Memcpy(&unit_lengthways, res, sizeof(unit_lengthways));
res = VectorMatrixMultiply(unit_lengthways, *RotateZMatrix(center->angle));
M_Memcpy(&unit_lengthways, res, sizeof(unit_lengthways));
FM_RotateX(&m, center->threshold << ANGLETOFINESHIFT);
FV4_Copy(&unit_lengthways, FM_MultMatrixVec4(&m, &unit_lengthways, &res));
FM_RotateZ(&m, center->angle);
FV4_Copy(&unit_lengthways, FM_MultMatrixVec4(&m, &unit_lengthways, &res));
lastthreshold = mobj->threshold;
lastfriction = mobj->friction;
@ -6574,63 +6583,64 @@ void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot)
dosound = false;
}
if (pos_sideways[3] != mobj->movefactor)
if (pos_sideways.a != mobj->movefactor)
{
if (!unit_sideways[3])
if (!unit_sideways.a)
{
unit_sideways[1] = dist;
unit_sideways[0] = unit_sideways[2] = 0;
unit_sideways[3] = FRACUNIT;
unit_sideways.y = dist;
unit_sideways.x = unit_sideways.z = 0;
unit_sideways.a = FRACUNIT;
res = VectorMatrixMultiply(unit_sideways, *RotateXMatrix(center->threshold << ANGLETOFINESHIFT));
M_Memcpy(&unit_sideways, res, sizeof(unit_sideways));
res = VectorMatrixMultiply(unit_sideways, *RotateZMatrix(center->angle));
M_Memcpy(&unit_sideways, res, sizeof(unit_sideways));
FM_RotateX(&m, center->threshold << ANGLETOFINESHIFT);
FV4_Copy(&unit_sideways, FM_MultMatrixVec4(&m, &unit_sideways, &res));
FM_RotateZ(&m, center->angle);
FV4_Copy(&unit_sideways, FM_MultMatrixVec4(&m, &unit_sideways, &res));
}
if (pos_sideways[3] > mobj->movefactor)
if (pos_sideways.a > mobj->movefactor)
{
do
{
pos_sideways[0] -= unit_sideways[0];
pos_sideways[1] -= unit_sideways[1];
pos_sideways[2] -= unit_sideways[2];
pos_sideways.x -= unit_sideways.x;
pos_sideways.y -= unit_sideways.y;
pos_sideways.z -= unit_sideways.z;
}
while ((--pos_sideways[3]) != mobj->movefactor);
while ((--pos_sideways.a) != mobj->movefactor);
}
else
{
do
{
pos_sideways[0] += unit_sideways[0];
pos_sideways[1] += unit_sideways[1];
pos_sideways[2] += unit_sideways[2];
pos_sideways.x += unit_sideways.x;
pos_sideways.y += unit_sideways.y;
pos_sideways.z += unit_sideways.z;
}
while ((++pos_sideways[3]) != mobj->movefactor);
while ((++pos_sideways.a) != mobj->movefactor);
}
}
hnext = mobj->hnext; // just in case the mobj is removed
if (pos_lengthways[3] > mobj->movecount)
if (pos_lengthways.a > mobj->movecount)
{
do
{
pos_lengthways[0] -= unit_lengthways[0];
pos_lengthways[1] -= unit_lengthways[1];
pos_lengthways[2] -= unit_lengthways[2];
pos_lengthways.x -= unit_lengthways.x;
pos_lengthways.y -= unit_lengthways.y;
pos_lengthways.z -= unit_lengthways.z;
}
while ((--pos_lengthways[3]) != mobj->movecount);
while ((--pos_lengthways.a) != mobj->movecount);
}
else if (pos_lengthways[3] < mobj->movecount)
else if (pos_lengthways.a < mobj->movecount)
{
do
{
pos_lengthways[0] += unit_lengthways[0];
pos_lengthways[1] += unit_lengthways[1];
pos_lengthways[2] += unit_lengthways[2];
pos_lengthways.x += unit_lengthways.x;
pos_lengthways.y += unit_lengthways.y;
pos_lengthways.z += unit_lengthways.z;
}
while ((++pos_lengthways[3]) != mobj->movecount);
while ((++pos_lengthways.a) != mobj->movecount);
}
P_UnsetThingPosition(mobj);
@ -6640,17 +6650,17 @@ void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot)
mobj->z = center->z;
// Add on the appropriate distances to the center's co-ordinates.
if (pos_lengthways[3])
if (pos_lengthways.a)
{
mobj->x += pos_lengthways[0];
mobj->y += pos_lengthways[1];
zstore = pos_lengthways[2] + pos_sideways[2];
mobj->x += pos_lengthways.x;
mobj->y += pos_lengthways.y;
zstore = pos_lengthways.z + pos_sideways.z;
}
else
zstore = pos_sideways[2];
zstore = pos_sideways.z;
mobj->x += pos_sideways[0];
mobj->y += pos_sideways[1];
mobj->x += pos_sideways.x;
mobj->y += pos_sideways.y;
// Cut the height to align the link with the axis.
if (mobj->type == MT_SMALLMACECHAIN || mobj->type == MT_BIGMACECHAIN || mobj->type == MT_SMALLGRABCHAIN || mobj->type == MT_BIGGRABCHAIN)
@ -6668,7 +6678,7 @@ void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot)
P_SetThingPosition(mobj);
#if 0 // toaster's height-clipping dealie!
if (!pos_lengthways[3] || P_MobjWasRemoved(mobj) || (mobj->flags & MF_NOCLIPHEIGHT))
if (!pos_lengthways.a || P_MobjWasRemoved(mobj) || (mobj->flags & MF_NOCLIPHEIGHT))
goto cont;
if ((fa = ((center->threshold & (FINEMASK/2)) << ANGLETOFINESHIFT)) > ANGLE_45 && fa < ANGLE_135) // only move towards center when the motion is towards/away from the ground, rather than alongside it
@ -6688,8 +6698,8 @@ void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot)
P_UnsetThingPosition(mobj);
mobj->x -= FixedMul(unit_lengthways[0], zstore);
mobj->y -= FixedMul(unit_lengthways[1], zstore);
mobj->x -= FixedMul(unit_lengthways.x, zstore);
mobj->y -= FixedMul(unit_lengthways.y, zstore);
P_SetThingPosition(mobj);
@ -13342,13 +13352,13 @@ void P_SpawnHoop(mapthing_t *mthing)
mobj_t *mobj = NULL;
mobj_t *nextmobj = NULL;
mobj_t *hoopcenter;
TMatrix *pitchmatrix, *yawmatrix;
matrix_t pitchmatrix, yawmatrix;
fixed_t radius = mthing->args[0] << FRACBITS;
fixed_t sizefactor = 4*FRACUNIT;
fixed_t hoopsize = radius/sizefactor;
INT32 i;
angle_t fa;
TVector v, *res;
vector4_t v, res;
fixed_t x = mthing->x << FRACBITS;
fixed_t y = mthing->y << FRACBITS;
fixed_t z = P_GetMobjSpawnHeight(MT_HOOP, x, y, mthing->z << FRACBITS, 0, false, mthing->scale);
@ -13363,9 +13373,9 @@ void P_SpawnHoop(mapthing_t *mthing)
P_SetThingPosition(hoopcenter);
hoopcenter->movedir = mthing->pitch;
pitchmatrix = RotateXMatrix(FixedAngle(hoopcenter->movedir << FRACBITS));
FM_RotateX(&pitchmatrix, FixedAngle(hoopcenter->movedir << FRACBITS));
hoopcenter->movecount = mthing->angle;
yawmatrix = RotateZMatrix(FixedAngle(hoopcenter->movecount << FRACBITS));
FM_RotateZ(&yawmatrix, FixedAngle(hoopcenter->movecount << FRACBITS));
// For the hoop when it flies away
hoopcenter->extravalue1 = hoopsize;
@ -13375,17 +13385,15 @@ void P_SpawnHoop(mapthing_t *mthing)
for (i = 0; i < hoopsize; i++)
{
fa = i*(FINEANGLES/hoopsize);
v[0] = FixedMul(FINECOSINE(fa), radius);
v[1] = 0;
v[2] = FixedMul(FINESINE(fa), radius);
v[3] = FRACUNIT;
v.x = FixedMul(FINECOSINE(fa), radius);
v.y = 0;
v.z = FixedMul(FINESINE(fa), radius);
v.a = FRACUNIT;
res = VectorMatrixMultiply(v, *pitchmatrix);
M_Memcpy(&v, res, sizeof(v));
res = VectorMatrixMultiply(v, *yawmatrix);
M_Memcpy(&v, res, sizeof(v));
FV4_Copy(&v, FM_MultMatrixVec4(&pitchmatrix, &v, &res));
FV4_Copy(&v, FM_MultMatrixVec4(&yawmatrix, &v, &res));
mobj = P_SpawnMobj(x + v[0], y + v[1], z + v[2], MT_HOOP);
mobj = P_SpawnMobj(x + v.x, y + v.y, z + v.z, MT_HOOP);
mobj->z -= mobj->height/2;
if (maptol & TOL_XMAS)
@ -13421,17 +13429,15 @@ void P_SpawnHoop(mapthing_t *mthing)
for (i = 0; i < hoopsize; i++)
{
fa = i*(FINEANGLES/hoopsize);
v[0] = FixedMul(FINECOSINE(fa), radius);
v[1] = 0;
v[2] = FixedMul(FINESINE(fa), radius);
v[3] = FRACUNIT;
v.x = FixedMul(FINECOSINE(fa), radius);
v.y = 0;
v.z = FixedMul(FINESINE(fa), radius);
v.a = FRACUNIT;
res = VectorMatrixMultiply(v, *pitchmatrix);
M_Memcpy(&v, res, sizeof(v));
res = VectorMatrixMultiply(v, *yawmatrix);
M_Memcpy(&v, res, sizeof(v));
FV4_Copy(&v, FM_MultMatrixVec4(&pitchmatrix, &v, &res));
FV4_Copy(&v, FM_MultMatrixVec4(&yawmatrix, &v, &res));
mobj = P_SpawnMobj(x + v[0], y + v[1], z + v[2], MT_HOOPCOLLIDE);
mobj = P_SpawnMobj(x + v.x, y + v.y, z + v.z, MT_HOOPCOLLIDE);
mobj->z -= mobj->height/2;
// Link all the collision sprites together.
@ -13522,7 +13528,8 @@ static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 n
angle_t angle = FixedAngle(mthing->angle << FRACBITS);
angle_t fa;
INT32 i;
TVector v, *res;
matrix_t m;
vector4_t v, res;
for (i = 0; i < numitemtypes; i++)
{
@ -13550,15 +13557,15 @@ static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 n
dummything.type = mobjinfo[itemtype].doomednum;
fa = i*FINEANGLES/numitems;
v[0] = FixedMul(FINECOSINE(fa), size);
v[1] = 0;
v[2] = FixedMul(FINESINE(fa), size);
v[3] = FRACUNIT;
v.x = FixedMul(FINECOSINE(fa), size);
v.y = 0;
v.z = FixedMul(FINESINE(fa), size);
v.a = FRACUNIT;
res = VectorMatrixMultiply(v, *RotateZMatrix(angle));
M_Memcpy(&v, res, sizeof(v));
FM_RotateZ(&m, angle);
FV4_Copy(&v, FM_MultMatrixVec4(&m, &v, &res));
mobj = P_SpawnMobjFromMapThing(&dummything, x + v[0], y + v[1], z + v[2], itemtype);
mobj = P_SpawnMobjFromMapThing(&dummything, x + v.x, y + v.y, z + v.z, itemtype);
if (!mobj)
continue;

View file

@ -915,7 +915,7 @@ static boolean CheckFFloorDiff(const sector_t *ss)
for (rover = ss->ffloors; rover; rover = rover->next)
{
if (rover->flags != rover->spawnflags
if (rover->fofflags != rover->spawnflags
|| rover->alpha != rover->spawnalpha)
{
return true; // we found an FOF that changed!
@ -935,7 +935,7 @@ static void ArchiveFFloors(const sector_t *ss)
for (rover = ss->ffloors; rover; rover = rover->next)
{
fflr_diff = 0; // reset diff flags
if (rover->flags != rover->spawnflags)
if (rover->fofflags != rover->spawnflags)
fflr_diff |= FD_FLAGS;
if (rover->alpha != rover->spawnalpha)
fflr_diff |= FD_ALPHA;
@ -945,7 +945,7 @@ static void ArchiveFFloors(const sector_t *ss)
WRITEUINT16(save_p, j); // save ffloor "number"
WRITEUINT8(save_p, fflr_diff);
if (fflr_diff & FD_FLAGS)
WRITEUINT32(save_p, rover->flags);
WRITEUINT32(save_p, rover->fofflags);
if (fflr_diff & FD_ALPHA)
WRITEINT16(save_p, rover->alpha);
}
@ -983,7 +983,7 @@ static void UnArchiveFFloors(const sector_t *ss)
fflr_diff = READUINT8(save_p);
if (fflr_diff & FD_FLAGS)
rover->flags = READUINT32(save_p);
rover->fofflags = READUINT32(save_p);
if (fflr_diff & FD_ALPHA)
rover->alpha = READINT16(save_p);

View file

@ -2111,31 +2111,31 @@ static void P_WriteTextmap(void)
case 1:
TAG_ITER_SECTORS(Tag_FGet(&wlines[i].tags), s)
{
CONS_Alert(CONS_WARNING, M_GetText("Linedef %d applies custom gravity to sector %d. Changes to this gravity at runtime will not be reflected in the converted map. Use linedef type 469 for this.\n"), i, s);
CONS_Alert(CONS_WARNING, M_GetText("Linedef %s applies custom gravity to sector %d. Changes to this gravity at runtime will not be reflected in the converted map. Use linedef type 469 for this.\n"), sizeu1(i), s);
wsectors[s].gravity = FixedDiv(lines[i].frontsector->floorheight >> FRACBITS, 1000);
}
break;
case 2:
CONS_Alert(CONS_WARNING, M_GetText("Custom exit linedef %d detected. Changes to the next map at runtime will not be reflected in the converted map. Use linedef type 468 for this.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Custom exit linedef %s detected. Changes to the next map at runtime will not be reflected in the converted map. Use linedef type 468 for this.\n"), sizeu1(i));
wlines[i].args[0] = lines[i].frontsector->floorheight >> FRACBITS;
wlines[i].args[2] = lines[i].frontsector->ceilingheight >> FRACBITS;
break;
case 5:
case 50:
case 51:
CONS_Alert(CONS_WARNING, M_GetText("Linedef %d has type %d, which is not supported in UDMF.\n"), i, wlines[i].special);
CONS_Alert(CONS_WARNING, M_GetText("Linedef %s has type %d, which is not supported in UDMF.\n"), sizeu1(i), wlines[i].special);
break;
case 61:
if (wlines[i].flags & ML_MIDSOLID)
continue;
if (!wlines[i].args[1])
continue;
CONS_Alert(CONS_WARNING, M_GetText("Linedef %d with crusher type 61 rises twice as fast on spawn. This behavior is not supported in UDMF.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Linedef %s with crusher type 61 rises twice as fast on spawn. This behavior is not supported in UDMF.\n"), sizeu1(i));
break;
case 76:
if (freetag == (mtag_t)MAXTAGS)
{
CONS_Alert(CONS_WARNING, M_GetText("No unused tag found. Linedef %d with type 76 cannot be converted.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("No unused tag found. Linedef %s with type 76 cannot be converted.\n"), sizeu1(i));
break;
}
TAG_ITER_SECTORS(wlines[i].args[0], s)
@ -2150,10 +2150,10 @@ static void P_WriteTextmap(void)
freetag = Tag_NextUnused(freetag);
break;
case 259:
if (wlines[i].args[3] & FF_QUICKSAND)
CONS_Alert(CONS_WARNING, M_GetText("Quicksand properties of custom FOF on linedef %d cannot be converted. Use linedef type 75 instead.\n"), i);
if (wlines[i].args[3] & FF_BUSTUP)
CONS_Alert(CONS_WARNING, M_GetText("Bustable properties of custom FOF on linedef %d cannot be converted. Use linedef type 74 instead.\n"), i);
if (wlines[i].args[3] & FOF_QUICKSAND)
CONS_Alert(CONS_WARNING, M_GetText("Quicksand properties of custom FOF on linedef %s cannot be converted. Use linedef type 75 instead.\n"), sizeu1(i));
if (wlines[i].args[3] & FOF_BUSTUP)
CONS_Alert(CONS_WARNING, M_GetText("Bustable properties of custom FOF on linedef %s cannot be converted. Use linedef type 74 instead.\n"), sizeu1(i));
break;
case 412:
if ((s = Tag_Iterate_Sectors(wlines[i].args[0], 0)) < 0)
@ -2162,7 +2162,7 @@ static void P_WriteTextmap(void)
break;
if (freetag == (mtag_t)MAXTAGS)
{
CONS_Alert(CONS_WARNING, M_GetText("No unused tag found. Linedef %d with type 412 cannot be converted.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("No unused tag found. Linedef %s with type 412 cannot be converted.\n"), sizeu1(i));
break;
}
Tag_Add(&specialthings[s].teleport->tags, freetag);
@ -2176,7 +2176,7 @@ static void P_WriteTextmap(void)
break;
if (freetag == (mtag_t)MAXTAGS)
{
CONS_Alert(CONS_WARNING, M_GetText("No unused tag found. Linedef %d with type 422 cannot be converted.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("No unused tag found. Linedef %s with type 422 cannot be converted.\n"), sizeu1(i));
break;
}
Tag_Add(&specialthings[s].altview->tags, freetag);
@ -2185,14 +2185,14 @@ static void P_WriteTextmap(void)
freetag = Tag_NextUnused(freetag);
break;
case 447:
CONS_Alert(CONS_WARNING, M_GetText("Linedef %d has change colormap action, which cannot be converted automatically. Tag arg0 to a sector with the desired colormap.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Linedef %s has change colormap action, which cannot be converted automatically. Tag arg0 to a sector with the desired colormap.\n"), sizeu1(i));
if (wlines[i].flags & ML_TFERLINE)
CONS_Alert(CONS_WARNING, M_GetText("Linedef %d mixes front and back colormaps, which is not supported in UDMF. Copy one colormap to the target sector first, then mix in the second one.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Linedef %s mixes front and back colormaps, which is not supported in UDMF. Copy one colormap to the target sector first, then mix in the second one.\n"), sizeu1(i));
break;
case 455:
CONS_Alert(CONS_WARNING, M_GetText("Linedef %d has fade colormap action, which cannot be converted automatically. Tag arg0 to a sector with the desired colormap.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Linedef %s has fade colormap action, which cannot be converted automatically. Tag arg0 to a sector with the desired colormap.\n"), sizeu1(i));
if (wlines[i].flags & ML_TFERLINE)
CONS_Alert(CONS_WARNING, M_GetText("Linedef %d specifies starting colormap for the fade, which is not supported in UDMF. Change the colormap with linedef type 447 instead.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Linedef %s specifies starting colormap for the fade, which is not supported in UDMF. Change the colormap with linedef type 447 instead.\n"), sizeu1(i));
break;
case 457:
if ((s = Tag_Iterate_Sectors(wlines[i].args[0], 0)) < 0)
@ -2201,7 +2201,7 @@ static void P_WriteTextmap(void)
break;
if (freetag == (mtag_t)MAXTAGS)
{
CONS_Alert(CONS_WARNING, M_GetText("No unused tag found. Linedef %d with type 457 cannot be converted.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("No unused tag found. Linedef %s with type 457 cannot be converted.\n"), sizeu1(i));
break;
}
Tag_Add(&specialthings[s].angleanchor->tags, freetag);
@ -2224,7 +2224,7 @@ static void P_WriteTextmap(void)
wsectors[s].extra_colormap = wsides[wlines[i].sidenum[0]].colormap_data;
if (freetag == (mtag_t)MAXTAGS)
{
CONS_Alert(CONS_WARNING, M_GetText("No unused tag found. Linedef %d with type 606 cannot be converted.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("No unused tag found. Linedef %s with type 606 cannot be converted.\n"), sizeu1(i));
break;
}
Tag_Add(&wsectors[s].tags, freetag);
@ -2239,23 +2239,23 @@ static void P_WriteTextmap(void)
}
if (wlines[i].special >= 300 && wlines[i].special < 400 && wlines[i].flags & ML_WRAPMIDTEX)
CONS_Alert(CONS_WARNING, M_GetText("Linedef executor trigger linedef %d has disregard order flag, which is not supported in UDMF.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Linedef executor trigger linedef %s has disregard order flag, which is not supported in UDMF.\n"), sizeu1(i));
}
for (i = 0; i < numsectors; i++)
{
if (Tag_Find(&wsectors[i].tags, LE_CAPSULE0))
CONS_Alert(CONS_WARNING, M_GetText("Sector %d has reserved tag %d, which is not supported in UDMF. Use arg3 of the boss mapthing instead.\n"), i, LE_CAPSULE0);
CONS_Alert(CONS_WARNING, M_GetText("Sector %s has reserved tag %d, which is not supported in UDMF. Use arg3 of the boss mapthing instead.\n"), sizeu1(i), LE_CAPSULE0);
if (Tag_Find(&wsectors[i].tags, LE_CAPSULE1))
CONS_Alert(CONS_WARNING, M_GetText("Sector %d has reserved tag %d, which is not supported in UDMF. Use arg3 of the boss mapthing instead.\n"), i, LE_CAPSULE1);
CONS_Alert(CONS_WARNING, M_GetText("Sector %s has reserved tag %d, which is not supported in UDMF. Use arg3 of the boss mapthing instead.\n"), sizeu1(i), LE_CAPSULE1);
if (Tag_Find(&wsectors[i].tags, LE_CAPSULE2))
CONS_Alert(CONS_WARNING, M_GetText("Sector %d has reserved tag %d, which is not supported in UDMF. Use arg3 of the boss mapthing instead.\n"), i, LE_CAPSULE2);
CONS_Alert(CONS_WARNING, M_GetText("Sector %s has reserved tag %d, which is not supported in UDMF. Use arg3 of the boss mapthing instead.\n"), sizeu1(i), LE_CAPSULE2);
switch (GETSECSPECIAL(wsectors[i].special, 1))
{
case 9:
case 10:
CONS_Alert(CONS_WARNING, M_GetText("Sector %d has ring drainer effect, which is not supported in UDMF. Use linedef type 462 instead.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Sector %s has ring drainer effect, which is not supported in UDMF. Use linedef type 462 instead.\n"), sizeu1(i));
break;
default:
break;
@ -2264,13 +2264,13 @@ static void P_WriteTextmap(void)
switch (GETSECSPECIAL(wsectors[i].special, 2))
{
case 6:
CONS_Alert(CONS_WARNING, M_GetText("Sector %d has emerald check trigger type, which is not supported in UDMF. Use linedef types 337-339 instead.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Sector %s has emerald check trigger type, which is not supported in UDMF. Use linedef types 337-339 instead.\n"), sizeu1(i));
break;
case 7:
CONS_Alert(CONS_WARNING, M_GetText("Sector %d has NiGHTS mare trigger type, which is not supported in UDMF. Use linedef types 340-342 instead.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Sector %s has NiGHTS mare trigger type, which is not supported in UDMF. Use linedef types 340-342 instead.\n"), sizeu1(i));
break;
case 9:
CONS_Alert(CONS_WARNING, M_GetText("Sector %d has Egg Capsule type, which is not supported in UDMF. Use linedef type 464 instead.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Sector %s has Egg Capsule type, which is not supported in UDMF. Use linedef type 464 instead.\n"), sizeu1(i));
break;
default:
break;
@ -2280,7 +2280,7 @@ static void P_WriteTextmap(void)
fprintf(f, "namespace = \"srb2\";\n");
for (i = 0; i < nummapthings; i++)
{
fprintf(f, "thing // %d\n", i);
fprintf(f, "thing // %s\n", sizeu1(i));
fprintf(f, "{\n");
firsttag = Tag_FGet(&wmapthings[i].tags);
if (firsttag != 0)
@ -2313,17 +2313,17 @@ static void P_WriteTextmap(void)
fprintf(f, "flip = true;\n");
for (j = 0; j < NUMMAPTHINGARGS; j++)
if (wmapthings[i].args[j] != 0)
fprintf(f, "arg%d = %d;\n", j, wmapthings[i].args[j]);
fprintf(f, "arg%s = %d;\n", sizeu1(j), wmapthings[i].args[j]);
for (j = 0; j < NUMMAPTHINGSTRINGARGS; j++)
if (mapthings[i].stringargs[j])
fprintf(f, "stringarg%d = \"%s\";\n", j, mapthings[i].stringargs[j]);
fprintf(f, "stringarg%s = \"%s\";\n", sizeu1(j), mapthings[i].stringargs[j]);
fprintf(f, "}\n");
fprintf(f, "\n");
}
for (i = 0; i < numvertexes; i++)
{
fprintf(f, "vertex // %d\n", i);
fprintf(f, "vertex // %s\n", sizeu1(i));
fprintf(f, "{\n");
fprintf(f, "x = %f;\n", FIXED_TO_FLOAT(wvertexes[i].x));
fprintf(f, "y = %f;\n", FIXED_TO_FLOAT(wvertexes[i].y));
@ -2337,10 +2337,10 @@ static void P_WriteTextmap(void)
for (i = 0; i < numlines; i++)
{
fprintf(f, "linedef // %d\n", i);
fprintf(f, "linedef // %s\n", sizeu1(i));
fprintf(f, "{\n");
fprintf(f, "v1 = %d;\n", wlines[i].v1 - vertexes);
fprintf(f, "v2 = %d;\n", wlines[i].v2 - vertexes);
fprintf(f, "v1 = %s;\n", sizeu1(wlines[i].v1 - vertexes));
fprintf(f, "v2 = %s;\n", sizeu1(wlines[i].v2 - vertexes));
fprintf(f, "sidefront = %d;\n", wlines[i].sidenum[0]);
if (wlines[i].sidenum[1] != 0xffff)
fprintf(f, "sideback = %d;\n", wlines[i].sidenum[1]);
@ -2362,10 +2362,10 @@ static void P_WriteTextmap(void)
fprintf(f, "special = %d;\n", wlines[i].special);
for (j = 0; j < NUMLINEARGS; j++)
if (wlines[i].args[j] != 0)
fprintf(f, "arg%d = %d;\n", j, wlines[i].args[j]);
fprintf(f, "arg%s = %d;\n", sizeu1(j), wlines[i].args[j]);
for (j = 0; j < NUMLINESTRINGARGS; j++)
if (lines[i].stringargs[j])
fprintf(f, "stringarg%d = \"%s\";\n", j, lines[i].stringargs[j]);
fprintf(f, "stringarg%s = \"%s\";\n", sizeu1(j), lines[i].stringargs[j]);
if (wlines[i].alpha != FRACUNIT)
fprintf(f, "alpha = %f;\n", FIXED_TO_FLOAT(wlines[i].alpha));
if (wlines[i].blendmode != AST_COPY)
@ -2393,7 +2393,7 @@ static void P_WriteTextmap(void)
}
if (wlines[i].executordelay != 0 && wlines[i].backsector)
{
CONS_Alert(CONS_WARNING, M_GetText("Linedef %d has an executor delay. Changes to the delay at runtime will not be reflected in the converted map. Use linedef type 465 for this.\n"), i);
CONS_Alert(CONS_WARNING, M_GetText("Linedef %s has an executor delay. Changes to the delay at runtime will not be reflected in the converted map. Use linedef type 465 for this.\n"), sizeu1(i));
fprintf(f, "executordelay = %d;\n", (wlines[i].backsector->ceilingheight >> FRACBITS) + (wlines[i].backsector->floorheight >> FRACBITS));
}
if (wlines[i].flags & ML_IMPASSIBLE)
@ -2432,9 +2432,9 @@ static void P_WriteTextmap(void)
for (i = 0; i < numsides; i++)
{
fprintf(f, "sidedef // %d\n", i);
fprintf(f, "sidedef // %s\n", sizeu1(i));
fprintf(f, "{\n");
fprintf(f, "sector = %d;\n", wsides[i].sector - sectors);
fprintf(f, "sector = %s;\n", sizeu1(wsides[i].sector - sectors));
if (wsides[i].textureoffset != 0)
fprintf(f, "offsetx = %d;\n", wsides[i].textureoffset >> FRACBITS);
if (wsides[i].rowoffset != 0)
@ -2453,7 +2453,7 @@ static void P_WriteTextmap(void)
for (i = 0; i < numsectors; i++)
{
fprintf(f, "sector // %d\n", i);
fprintf(f, "sector // %s\n", sizeu1(i));
fprintf(f, "{\n");
fprintf(f, "heightfloor = %d;\n", wsectors[i].floorheight >> FRACBITS);
fprintf(f, "heightceiling = %d;\n", wsectors[i].ceilingheight >> FRACBITS);
@ -3263,7 +3263,7 @@ static boolean P_LoadExtendedSubsectorsAndSegs(UINT8 **data, nodetype_t nodetype
linenum = (nodetype == NT_XGL3) ? READUINT32((*data)) : READUINT16((*data));
if (linenum != 0xFFFF && linenum >= numlines)
I_Error("P_LoadExtendedSubsectorsAndSegs: Seg %s in subsector %d has invalid linedef %d!\n", sizeu1(k), i, linenum);
I_Error("P_LoadExtendedSubsectorsAndSegs: Seg %s in subsector %s has invalid linedef %d!\n", sizeu1(k), sizeu2(i), linenum);
segs[k].glseg = (linenum == 0xFFFF);
segs[k].linedef = (linenum == 0xFFFF) ? NULL : &lines[linenum];
segs[k].side = READUINT8((*data));
@ -3272,7 +3272,7 @@ static boolean P_LoadExtendedSubsectorsAndSegs(UINT8 **data, nodetype_t nodetype
{
subsectors[i].firstline++;
if (subsectors[i].firstline == k)
I_Error("P_LoadExtendedSubsectorsAndSegs: Subsector %d does not have any valid segs!", i);
I_Error("P_LoadExtendedSubsectorsAndSegs: Subsector %s does not have any valid segs!", sizeu1(i));
}
break;
@ -3989,6 +3989,81 @@ static void P_SetBinaryFOFAlpha(line_t *line)
}
}
static INT32 P_GetFOFFlags(INT32 oldflags)
{
INT32 result = 0;
if (oldflags & FF_OLD_EXISTS)
result |= FOF_EXISTS;
if (oldflags & FF_OLD_BLOCKPLAYER)
result |= FOF_BLOCKPLAYER;
if (oldflags & FF_OLD_BLOCKOTHERS)
result |= FOF_BLOCKOTHERS;
if (oldflags & FF_OLD_RENDERSIDES)
result |= FOF_RENDERSIDES;
if (oldflags & FF_OLD_RENDERPLANES)
result |= FOF_RENDERPLANES;
if (oldflags & FF_OLD_SWIMMABLE)
result |= FOF_SWIMMABLE;
if (oldflags & FF_OLD_NOSHADE)
result |= FOF_NOSHADE;
if (oldflags & FF_OLD_CUTSOLIDS)
result |= FOF_CUTSOLIDS;
if (oldflags & FF_OLD_CUTEXTRA)
result |= FOF_CUTEXTRA;
if (oldflags & FF_OLD_CUTSPRITES)
result |= FOF_CUTSPRITES;
if (oldflags & FF_OLD_BOTHPLANES)
result |= FOF_BOTHPLANES;
if (oldflags & FF_OLD_EXTRA)
result |= FOF_EXTRA;
if (oldflags & FF_OLD_TRANSLUCENT)
result |= FOF_TRANSLUCENT;
if (oldflags & FF_OLD_FOG)
result |= FOF_FOG;
if (oldflags & FF_OLD_INVERTPLANES)
result |= FOF_INVERTPLANES;
if (oldflags & FF_OLD_ALLSIDES)
result |= FOF_ALLSIDES;
if (oldflags & FF_OLD_INVERTSIDES)
result |= FOF_INVERTSIDES;
if (oldflags & FF_OLD_DOUBLESHADOW)
result |= FOF_DOUBLESHADOW;
if (oldflags & FF_OLD_FLOATBOB)
result |= FOF_FLOATBOB;
if (oldflags & FF_OLD_NORETURN)
result |= FOF_NORETURN;
if (oldflags & FF_OLD_CRUMBLE)
result |= FOF_CRUMBLE;
if (oldflags & FF_OLD_GOOWATER)
result |= FOF_GOOWATER;
if (oldflags & FF_OLD_MARIO)
result |= FOF_MARIO;
if (oldflags & FF_OLD_BUSTUP)
result |= FOF_BUSTUP;
if (oldflags & FF_OLD_QUICKSAND)
result |= FOF_QUICKSAND;
if (oldflags & FF_OLD_PLATFORM)
result |= FOF_PLATFORM;
if (oldflags & FF_OLD_REVERSEPLATFORM)
result |= FOF_REVERSEPLATFORM;
if (oldflags & FF_OLD_RIPPLE)
result |= FOF_RIPPLE;
if (oldflags & FF_OLD_COLORMAPONLY)
result |= FOF_COLORMAPONLY;
return result;
}
static INT32 P_GetFOFBusttype(INT32 oldflags)
{
if (oldflags & FF_OLD_SHATTER)
return TMFB_TOUCH;
if (oldflags & FF_OLD_SPINBUST)
return TMFB_SPIN;
if (oldflags & FF_OLD_STRONGBUST)
return TMFB_STRONG;
return TMFB_REGULAR;
}
static void P_ConvertBinaryLinedefTypes(void)
{
size_t i;
@ -4637,17 +4712,19 @@ static void P_ConvertBinaryLinedefTypes(void)
I_Error("Custom FOF (tag %d) found without a linedef back side!", tag);
lines[i].args[0] = tag;
lines[i].args[3] = sides[lines[i].sidenum[1]].toptexture;
lines[i].args[3] = P_GetFOFFlags(sides[lines[i].sidenum[1]].toptexture);
if (lines[i].flags & ML_EFFECT6)
lines[i].args[3] |= FF_SPLAT;
lines[i].args[4] = sides[lines[i].sidenum[1]].midtexture;
if (lines[i].args[3] & FF_TRANSLUCENT)
lines[i].args[3] |= FOF_SPLAT;
lines[i].args[4] = P_GetFOFBusttype(sides[lines[i].sidenum[1]].toptexture);
if (sides[lines[i].sidenum[1]].toptexture & FF_OLD_SHATTERBOTTOM)
lines[i].args[4] |= TMFB_ONLYBOTTOM;
if (lines[i].args[3] & FOF_TRANSLUCENT)
{
P_SetBinaryFOFAlpha(&lines[i]);
//Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels
if (lines[i].args[1] == 256)
lines[i].args[3] |= FF_SPLAT;
lines[i].args[3] |= FOF_SPLAT;
}
else
lines[i].args[1] = 255;
@ -5198,6 +5275,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[0] = tag;
lines[i].args[1] = TMSD_FRONTBACK;
lines[i].args[2] = !!(lines[i].flags & ML_NOCLIMB);
lines[i].args[3] = !!(lines[i].flags & ML_EFFECT6);
break;
case 441: //Condition set trigger
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
@ -5359,7 +5437,7 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[0] = tag;
lines[i].args[1] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
lines[i].args[2] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS;
lines[i].args[3] = (lines[i].sidenum[1] != 0xffff) ? sides[lines[i].sidenum[1]].rowoffset >> FRACBITS : 0;
lines[i].args[3] = (lines[i].sidenum[1] != 0xffff) ? sides[lines[i].sidenum[1]].textureoffset >> FRACBITS : 0;
lines[i].args[4] = !!(lines[i].flags & ML_NOSKEW);
break;
case 459: //Control text prompt
@ -5846,7 +5924,7 @@ static void P_ConvertBinarySectorTypes(void)
if (line->flags & ML_BLOCKMONSTERS)
continue;
if (line->special == 120 || (line->special == 259 && (line->args[2] & FF_SWIMMABLE)))
if (line->special == 120 || (line->special == 259 && (line->args[2] & FOF_SWIMMABLE)))
{
isLava = true;
break;
@ -6318,7 +6396,7 @@ static void P_ConvertBinaryThingTypes(void)
if (j == -1)
{
CONS_Debug(DBG_GAMELOGIC, "Particle generator (mapthing #%d) needs to be tagged to a #15 parameter line (trying to find tag %d).\n", i, mapthings[i].angle);
CONS_Debug(DBG_GAMELOGIC, "Particle generator (mapthing #%s) needs to be tagged to a #15 parameter line (trying to find tag %d).\n", sizeu1(i), mapthings[i].angle);
break;
}
mapthings[i].args[0] = mapthings[i].z;

View file

@ -306,8 +306,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
// check front sector's FOFs first
for (rover = front->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS)
|| !(rover->flags & FF_RENDERSIDES) || (rover->flags & (FF_TRANSLUCENT|FF_FOG)))
if (!(rover->fofflags & FOF_EXISTS)
|| !(rover->fofflags & FOF_RENDERSIDES) || (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG)))
{
continue;
}
@ -322,8 +322,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
// check back sector's FOFs as well
for (rover = back->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS)
|| !(rover->flags & FF_RENDERSIDES) || (rover->flags & (FF_TRANSLUCENT|FF_FOG)))
if (!(rover->fofflags & FOF_EXISTS)
|| !(rover->fofflags & FOF_RENDERSIDES) || (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG)))
{
continue;
}
@ -451,8 +451,8 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
// Allow sight through water, fog, etc.
/// \todo Improve by checking fog density/translucency
/// and setting a sight limit.
if (!(rover->flags & FF_EXISTS)
|| !(rover->flags & FF_RENDERPLANES) || (rover->flags & (FF_TRANSLUCENT|FF_FOG)))
if (!(rover->fofflags & FOF_EXISTS)
|| !(rover->fofflags & FOF_RENDERPLANES) || (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG)))
{
continue;
}
@ -470,10 +470,10 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
return false;
}
if (rover->flags & FF_SOLID)
if (rover->fofflags & FOF_SOLID)
continue; // shortcut since neither mobj can be inside the 3dfloor
if (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))
if (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))
{
if (los.sightzstart >= topz1 && t2->z + t2->height < topz2)
return false; // blocked by upper outside plane
@ -482,7 +482,7 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
return false; // blocked by lower outside plane
}
if (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES)
if (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES)
{
if (los.sightzstart < topz1 && t2->z >= topz2)
return false; // blocked by upper inside plane

View file

@ -94,10 +94,14 @@ static void ReconfigureViaVertexes (pslope_t *slope, const vector3_t v1, const v
static void ReconfigureViaConstants (pslope_t *slope, const fixed_t a, const fixed_t b, const fixed_t c, const fixed_t d)
{
fixed_t m;
fixed_t o = 0;
vector3_t *normal = &slope->normal;
if (c)
o = abs(c) <= FRACUNIT ? -FixedMul(d, FixedDiv(FRACUNIT, c)) : -FixedDiv(d, c);
// Set origin.
FV3_Load(&slope->o, 0, 0, c ? -FixedDiv(d, c) : 0);
FV3_Load(&slope->o, 0, 0, o);
// Get slope's normal.
FV3_Load(normal, a, b, c);

File diff suppressed because it is too large Load diff

View file

@ -1029,8 +1029,8 @@ typedef struct
INT16 speed; ///< Speed to fade by
boolean ticbased; ///< Tic-based logic toggle
INT32 timer; ///< Timer for tic-based logic
boolean doexists; ///< Handle FF_EXISTS
boolean dotranslucent; ///< Handle FF_TRANSLUCENT
boolean doexists; ///< Handle FOF_EXISTS
boolean dotranslucent; ///< Handle FOF_TRANSLUCENT
boolean dolighting; ///< Handle shadows and light blocks
boolean docolormap; ///< Handle colormaps
boolean docollision; ///< Handle interactive flags

View file

@ -1966,22 +1966,22 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
ghost->angle = (mobj->player ? mobj->player->drawangle : mobj->angle);
ghost->rollangle = mobj->rollangle;
ghost->sprite = mobj->sprite;
ghost->sprite2 = mobj->sprite2;
ghost->frame = mobj->frame;
ghost->tics = -1;
ghost->frame &= ~FF_TRANSMASK;
ghost->frame |= tr_trans50<<FF_TRANSSHIFT;
ghost->renderflags = mobj->renderflags;
ghost->blendmode = mobj->blendmode;
ghost->spritexscale = mobj->spritexscale;
ghost->spriteyscale = mobj->spriteyscale;
ghost->spritexoffset = mobj->spritexoffset;
ghost->spriteyoffset = mobj->spriteyoffset;
ghost->fuse = ghost->info->damage;
ghost->skin = mobj->skin;
@ -2209,7 +2209,7 @@ boolean P_InSpaceSector(mobj_t *mo) // Returns true if you are in space
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->master->frontsector->specialflags & SSF_OUTERSPACE))
@ -2462,10 +2462,10 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_QUICKSAND))
if (!(rover->fofflags & FOF_QUICKSAND))
continue;
topheight = P_GetFFloorTopZAt (rover, mo->x, mo->y);
@ -2486,10 +2486,10 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand
static boolean P_PlayerCanBust(player_t *player, ffloor_t *rover)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
return false;
if (!(rover->flags & FF_BUSTUP))
if (!(rover->fofflags & FOF_BUSTUP))
return false;
/*if (rover->master->frontsector->crumblestate != CRUMBLE_NONE)
@ -2512,7 +2512,7 @@ static boolean P_PlayerCanBust(player_t *player, ffloor_t *rover)
if ((player->pflags & PF_SPINNING) && !(player->pflags & PF_JUMPED))
return true;
// Strong abilities can break even FF_STRONGBUST.
// Passive wall breaking
if (player->charflags & SF_CANBUSTWALLS)
return true;
@ -2534,7 +2534,7 @@ static boolean P_PlayerCanBust(player_t *player, ffloor_t *rover)
/* FALLTHRU */
case BT_STRONG: // Requires a "strong ability"
if (player->charability == CA_GLIDEANDCLIMB)
if (player->charflags & SF_CANBUSTWALLS)
return true;
if (player->pflags & PF_BOUNCING)
@ -2701,17 +2701,17 @@ static void P_CheckBouncySectors(player_t *player)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue; // FOFs should not be bouncy if they don't even "exist"
// Handle deprecated bouncy FOF sector type
if (!udmf && GETSECSPECIAL(rover->master->frontsector->special, 1) == 15)
{
rover->flags |= FF_BOUNCY;
rover->fofflags |= FOF_BOUNCY;
rover->bouncestrength = P_AproxDistance(rover->master->dx, rover->master->dy)/100;
}
if (!(rover->flags & FF_BOUNCY))
if (!(rover->fofflags & FOF_BOUNCY))
continue;
topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
@ -2784,9 +2784,9 @@ static void P_CheckQuicksand(player_t *player)
for (rover = player->mo->subsector->sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS)) continue;
if (!(rover->fofflags & FOF_EXISTS)) continue;
if (!(rover->flags & FF_QUICKSAND))
if (!(rover->fofflags & FOF_QUICKSAND))
continue;
topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y);
@ -3136,7 +3136,7 @@ static void P_DoClimbing(player_t *player)
for (rover = glidesector->sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS)))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS)))
continue;
floorclimb = true;
@ -3177,7 +3177,7 @@ static void P_DoClimbing(player_t *player)
// Is there a FOF directly below this one that we can move onto?
for (roverbelow = glidesector->sector->ffloors; roverbelow; roverbelow = roverbelow->next)
{
if (!(roverbelow->flags & FF_EXISTS) || !(roverbelow->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS)))
if (!(roverbelow->fofflags & FOF_EXISTS) || !(roverbelow->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS)))
continue;
if (roverbelow == rover)
@ -3222,7 +3222,7 @@ static void P_DoClimbing(player_t *player)
// Is there a FOF directly below this one that we can move onto?
for (roverbelow = glidesector->sector->ffloors; roverbelow; roverbelow = roverbelow->next)
{
if (!(roverbelow->flags & FF_EXISTS) || !(roverbelow->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS)))
if (!(roverbelow->fofflags & FOF_EXISTS) || !(roverbelow->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS)))
continue;
if (roverbelow == rover)
@ -3256,8 +3256,8 @@ static void P_DoClimbing(player_t *player)
if (floorclimb)
{
if (rover->flags & FF_CRUMBLE && !(netgame && player->spectator))
EV_StartCrumble(rover->master->frontsector, rover, (rover->flags & FF_FLOATBOB), player, rover->alpha, !(rover->flags & FF_NORETURN));
if (rover->fofflags & FOF_CRUMBLE && !(netgame && player->spectator))
EV_StartCrumble(rover->master->frontsector, rover, (rover->fofflags & FOF_FLOATBOB), player, rover->alpha, !(rover->fofflags & FOF_NORETURN));
break;
}
}
@ -3279,7 +3279,7 @@ static void P_DoClimbing(player_t *player)
ffloor_t *rover;
for (rover = glidesector->sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS)))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS)))
continue;
bottomheight = P_GetFFloorBottomZAt(rover, player->mo->x, player->mo->y);
@ -3319,7 +3319,7 @@ static void P_DoClimbing(player_t *player)
ffloor_t *rover;
for (rover = glidesector->sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS)))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS)))
continue;
topheight = P_GetFFloorTopZAt(rover, player->mo->x, player->mo->y);
@ -3693,14 +3693,14 @@ static void P_DoTeeter(player_t *player)
for (rover = sec->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS)) continue;
if (!(rover->fofflags & FOF_EXISTS)) continue;
topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y);
bottomheight = P_GetFFloorBottomZAt(rover, player->mo->x, player->mo->y);
if (P_CheckSolidLava(rover))
;
else if (!(rover->flags & FF_BLOCKPLAYER || rover->flags & FF_QUICKSAND))
else if (!(rover->fofflags & FOF_BLOCKPLAYER || rover->fofflags & FOF_QUICKSAND))
continue; // intangible 3d floor
if (player->mo->eflags & MFE_VERTICALFLIP)
@ -10072,7 +10072,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERALL) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
@ -10198,7 +10198,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if ((rover->flags & FF_BLOCKOTHERS) && (rover->flags & FF_RENDERALL) && (rover->flags & FF_EXISTS) && !(rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
if ((rover->fofflags & FOF_BLOCKOTHERS) && (rover->fofflags & FOF_RENDERALL) && (rover->fofflags & FOF_EXISTS) && !(rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
{
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
bottomheight = P_CameraGetFOFBottomZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
@ -10515,7 +10515,7 @@ static void P_CalcPostImg(player_t *player)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_EXISTS))
continue;
topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y);
@ -10541,7 +10541,7 @@ static void P_CalcPostImg(player_t *player)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKPLAYER)
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_BLOCKPLAYER)
continue;
topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y);
@ -10604,7 +10604,7 @@ static sector_t *P_GetMinecartSector(fixed_t x, fixed_t y, fixed_t z, fixed_t *n
ffloor_t *rover;
for (rover = sec->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & (FF_EXISTS|FF_BLOCKOTHERS)))
if (!(rover->fofflags & (FOF_EXISTS|FOF_BLOCKOTHERS)))
continue;
*nz = P_GetFFloorTopZAt(rover, x, y);
@ -12248,7 +12248,7 @@ static boolean P_MobjAboveLava(mobj_t *mobj)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE))
continue;
if (rover->master->frontsector->damagetype != SD_FIRE && rover->master->frontsector->damagetype != SD_LAVA)
@ -12589,6 +12589,29 @@ void P_PlayerAfterThink(player_t *player)
break;
}
case CR_FAN:
{
fixed_t zdist;
mobj_t *mo = player->mo, *fan = player->mo->tracer;
if (!(player->pflags & PF_JUMPSTASIS))
player->pflags |= PF_JUMPSTASIS;
if (fan->eflags & MFE_VERTICALFLIP)
zdist = (mo->z + mo->height) - (fan->z + fan->height);
else
zdist = mo->z - fan->z;
if ((fan->type != MT_FAN && !P_PlayerTouchingSectorSpecialFlag(player, SSF_FAN))
|| (fan->type == MT_FAN && (abs(mo->x - fan->x) > fan->radius || abs(mo->y - fan->y) > fan->radius || zdist > (fan->health << FRACBITS))))
{
P_SetTarget(&player->mo->tracer, NULL);
player->pflags &= ~PF_JUMPSTASIS;
player->powers[pw_carry] = CR_NONE;
break;
}
break;
}
case CR_ROLLOUT:
{
mobj_t *mo = player->mo, *rock = player->mo->tracer;

View file

@ -919,7 +919,7 @@ static void R_Subsector(size_t num)
for (rover = frontsector->ffloors; rover && numffloors < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES))
continue;
if (frontsector->cullheight)
@ -939,8 +939,8 @@ static void R_Subsector(size_t num)
planecenterz = P_GetFFloorBottomZAt(rover, frontsector->soundorg.x, frontsector->soundorg.y);
if (planecenterz <= ceilingcenterz
&& planecenterz >= floorcenterz
&& ((viewz < heightcheck && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES)))
|| (viewz > heightcheck && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
&& ((viewz < heightcheck && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES)))
|| (viewz > heightcheck && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
light = R_GetPlaneLight(frontsector, planecenterz,
viewz < heightcheck);
@ -969,8 +969,8 @@ static void R_Subsector(size_t num)
planecenterz = P_GetFFloorTopZAt(rover, frontsector->soundorg.x, frontsector->soundorg.y);
if (planecenterz >= floorcenterz
&& planecenterz <= ceilingcenterz
&& ((viewz > heightcheck && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES)))
|| (viewz < heightcheck && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
&& ((viewz > heightcheck && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES)))
|| (viewz < heightcheck && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
light = R_GetPlaneLight(frontsector, planecenterz, viewz < heightcheck);
@ -1106,11 +1106,11 @@ void R_Prep3DFloors(sector_t *sector)
count = 1;
for (rover = sector->ffloors; rover; rover = rover->next)
{
if ((rover->flags & FF_EXISTS) && (!(rover->flags & FF_NOSHADE)
|| (rover->flags & FF_CUTLEVEL) || (rover->flags & FF_CUTSPRITES)))
if ((rover->fofflags & FOF_EXISTS) && (!(rover->fofflags & FOF_NOSHADE)
|| (rover->fofflags & FOF_CUTLEVEL) || (rover->fofflags & FOF_CUTSPRITES)))
{
count++;
if (rover->flags & FF_DOUBLESHADOW)
if (rover->fofflags & FOF_DOUBLESHADOW)
count++;
}
}
@ -1141,8 +1141,8 @@ void R_Prep3DFloors(sector_t *sector)
for (rover = sector->ffloors; rover; rover = rover->next)
{
rover->lastlight = 0;
if (!(rover->flags & FF_EXISTS) || (rover->flags & FF_NOSHADE
&& !(rover->flags & FF_CUTLEVEL) && !(rover->flags & FF_CUTSPRITES)))
if (!(rover->fofflags & FOF_EXISTS) || (rover->fofflags & FOF_NOSHADE
&& !(rover->fofflags & FOF_CUTLEVEL) && !(rover->fofflags & FOF_CUTSPRITES)))
continue;
heighttest = P_GetFFloorTopZAt(rover, sector->soundorg.x, sector->soundorg.y);
@ -1154,7 +1154,7 @@ void R_Prep3DFloors(sector_t *sector)
bestslope = *rover->t_slope;
continue;
}
if (rover->flags & FF_DOUBLESHADOW) {
if (rover->fofflags & FOF_DOUBLESHADOW) {
heighttest = P_GetFFloorBottomZAt(rover, sector->soundorg.x, sector->soundorg.y);
if (heighttest > bestheight
@ -1175,16 +1175,16 @@ void R_Prep3DFloors(sector_t *sector)
sector->lightlist[i].height = maxheight = bestheight;
sector->lightlist[i].caster = best;
sector->lightlist[i].flags = best->flags;
sector->lightlist[i].flags = best->fofflags;
sector->lightlist[i].slope = bestslope;
sec = &sectors[best->secnum];
if (best->flags & FF_NOSHADE)
if (best->fofflags & FOF_NOSHADE)
{
sector->lightlist[i].lightlevel = sector->lightlist[i-1].lightlevel;
sector->lightlist[i].extra_colormap = sector->lightlist[i-1].extra_colormap;
}
else if (best->flags & FF_COLORMAPONLY)
else if (best->fofflags & FOF_COLORMAPONLY)
{
sector->lightlist[i].lightlevel = sector->lightlist[i-1].lightlevel;
sector->lightlist[i].extra_colormap = &sec->extra_colormap;
@ -1195,7 +1195,7 @@ void R_Prep3DFloors(sector_t *sector)
sector->lightlist[i].extra_colormap = &sec->extra_colormap;
}
if (best->flags & FF_DOUBLESHADOW)
if (best->fofflags & FOF_DOUBLESHADOW)
{
heighttest = P_GetFFloorBottomZAt(best, sector->soundorg.x, sector->soundorg.y);
if (bestheight == heighttest) ///TODO: do this in a more efficient way -Red

View file

@ -115,43 +115,84 @@ typedef struct
*/
typedef enum
{
FF_EXISTS = 0x1, ///< Always set, to check for validity.
FF_BLOCKPLAYER = 0x2, ///< Solid to player, but nothing else
FF_BLOCKOTHERS = 0x4, ///< Solid to everything but player
FF_SOLID = 0x6, ///< Clips things.
FF_RENDERSIDES = 0x8, ///< Renders the sides.
FF_RENDERPLANES = 0x10, ///< Renders the floor/ceiling.
FF_RENDERALL = 0x18, ///< Renders everything.
FF_SWIMMABLE = 0x20, ///< Is a water block.
FF_NOSHADE = 0x40, ///< Messes with the lighting?
FF_CUTSOLIDS = 0x80, ///< Cuts out hidden solid pixels.
FF_CUTEXTRA = 0x100, ///< Cuts out hidden translucent pixels.
FF_CUTLEVEL = 0x180, ///< Cuts out all hidden pixels.
FF_CUTSPRITES = 0x200, ///< Final step in making 3D water.
FF_BOTHPLANES = 0x400, ///< Render inside and outside planes.
FF_EXTRA = 0x800, ///< Gets cut by ::FF_CUTEXTRA.
FF_TRANSLUCENT = 0x1000, ///< See through!
FF_FOG = 0x2000, ///< Fog "brush."
FF_INVERTPLANES = 0x4000, ///< Only render inside planes.
FF_ALLSIDES = 0x8000, ///< Render inside and outside sides.
FF_INVERTSIDES = 0x10000, ///< Only render inside sides.
FF_DOUBLESHADOW = 0x20000, ///< Make two lightlist entries to reset light?
FF_FLOATBOB = 0x40000, ///< Floats on water and bobs if you step on it.
FF_NORETURN = 0x80000, ///< Used with ::FF_CRUMBLE. Will not return to its original position after falling.
FF_CRUMBLE = 0x100000, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist).
FF_GOOWATER = 0x200000, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop.
FF_MARIO = 0x400000, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector.
FF_BUSTUP = 0x800000, ///< You can spin through/punch this block and it will crumble!
FF_QUICKSAND = 0x1000000, ///< Quicksand!
FF_PLATFORM = 0x2000000, ///< You can jump up through this to the top.
FF_REVERSEPLATFORM = 0x4000000, ///< A fall-through floor in normal gravity, a platform in reverse gravity.
FF_INTANGIBLEFLATS = 0x6000000, ///< Both flats are intangible, but the sides are still solid.
FF_RIPPLE = 0x8000000, ///< Ripple the flats
FF_COLORMAPONLY = 0x10000000, ///< Only copy the colormap, not the lightlevel
FF_BOUNCY = 0x20000000, ///< Bounces players
FF_SPLAT = 0x40000000, ///< Use splat flat renderer (treat cyan pixels as invisible)
FOF_EXISTS = 0x1, ///< Always set, to check for validity.
FOF_BLOCKPLAYER = 0x2, ///< Solid to player, but nothing else
FOF_BLOCKOTHERS = 0x4, ///< Solid to everything but player
FOF_SOLID = 0x6, ///< Clips things.
FOF_RENDERSIDES = 0x8, ///< Renders the sides.
FOF_RENDERPLANES = 0x10, ///< Renders the floor/ceiling.
FOF_RENDERALL = 0x18, ///< Renders everything.
FOF_SWIMMABLE = 0x20, ///< Is a water block.
FOF_NOSHADE = 0x40, ///< Messes with the lighting?
FOF_CUTSOLIDS = 0x80, ///< Cuts out hidden solid pixels.
FOF_CUTEXTRA = 0x100, ///< Cuts out hidden translucent pixels.
FOF_CUTLEVEL = 0x180, ///< Cuts out all hidden pixels.
FOF_CUTSPRITES = 0x200, ///< Final step in making 3D water.
FOF_BOTHPLANES = 0x400, ///< Render inside and outside planes.
FOF_EXTRA = 0x800, ///< Gets cut by ::FOF_CUTEXTRA.
FOF_TRANSLUCENT = 0x1000, ///< See through!
FOF_FOG = 0x2000, ///< Fog "brush."
FOF_INVERTPLANES = 0x4000, ///< Only render inside planes.
FOF_ALLSIDES = 0x8000, ///< Render inside and outside sides.
FOF_INVERTSIDES = 0x10000, ///< Only render inside sides.
FOF_DOUBLESHADOW = 0x20000, ///< Make two lightlist entries to reset light?
FOF_FLOATBOB = 0x40000, ///< Floats on water and bobs if you step on it.
FOF_NORETURN = 0x80000, ///< Used with ::FOF_CRUMBLE. Will not return to its original position after falling.
FOF_CRUMBLE = 0x100000, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist).
FOF_GOOWATER = 0x200000, ///< Used with ::FOF_SWIMMABLE. Makes thick bouncey goop.
FOF_MARIO = 0x400000, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector.
FOF_BUSTUP = 0x800000, ///< You can spin through/punch this block and it will crumble!
FOF_QUICKSAND = 0x1000000, ///< Quicksand!
FOF_PLATFORM = 0x2000000, ///< You can jump up through this to the top.
FOF_REVERSEPLATFORM = 0x4000000, ///< A fall-through floor in normal gravity, a platform in reverse gravity.
FOF_INTANGIBLEFLATS = 0x6000000, ///< Both flats are intangible, but the sides are still solid.
FOF_RIPPLE = 0x8000000, ///< Ripple the flats
FOF_COLORMAPONLY = 0x10000000, ///< Only copy the colormap, not the lightlevel
FOF_BOUNCY = 0x20000000, ///< Bounces players
FOF_SPLAT = 0x40000000, ///< Use splat flat renderer (treat cyan pixels as invisible)
} ffloortype_e;
typedef enum
{
FF_OLD_EXISTS = 0x1,
FF_OLD_BLOCKPLAYER = 0x2,
FF_OLD_BLOCKOTHERS = 0x4,
FF_OLD_SOLID = 0x6,
FF_OLD_RENDERSIDES = 0x8,
FF_OLD_RENDERPLANES = 0x10,
FF_OLD_RENDERALL = 0x18,
FF_OLD_SWIMMABLE = 0x20,
FF_OLD_NOSHADE = 0x40,
FF_OLD_CUTSOLIDS = 0x80,
FF_OLD_CUTEXTRA = 0x100,
FF_OLD_CUTLEVEL = 0x180,
FF_OLD_CUTSPRITES = 0x200,
FF_OLD_BOTHPLANES = 0x400,
FF_OLD_EXTRA = 0x800,
FF_OLD_TRANSLUCENT = 0x1000,
FF_OLD_FOG = 0x2000,
FF_OLD_INVERTPLANES = 0x4000,
FF_OLD_ALLSIDES = 0x8000,
FF_OLD_INVERTSIDES = 0x10000,
FF_OLD_DOUBLESHADOW = 0x20000,
FF_OLD_FLOATBOB = 0x40000,
FF_OLD_NORETURN = 0x80000,
FF_OLD_CRUMBLE = 0x100000,
FF_OLD_SHATTERBOTTOM = 0x200000,
FF_OLD_GOOWATER = 0x200000,
FF_OLD_MARIO = 0x400000,
FF_OLD_BUSTUP = 0x800000,
FF_OLD_QUICKSAND = 0x1000000,
FF_OLD_PLATFORM = 0x2000000,
FF_OLD_REVERSEPLATFORM = 0x4000000,
FF_OLD_INTANGIBLEFLATS = 0x6000000,
FF_OLD_SHATTER = 0x8000000,
FF_OLD_SPINBUST = 0x10000000,
FF_OLD_STRONGBUST = 0x20000000,
FF_OLD_RIPPLE = 0x40000000,
FF_OLD_COLORMAPONLY = 0x80000000,
} oldffloortype_e;
typedef enum
{
FB_PUSHABLES = 0x1, // Bustable by pushables
@ -187,7 +228,7 @@ typedef struct ffloor_s
struct pslope_s **b_slope;
size_t secnum;
ffloortype_e flags;
ffloortype_e fofflags;
struct line_s *master;
struct sector_s *target;
@ -200,16 +241,16 @@ typedef struct ffloor_s
UINT8 blend; // blendmode
tic_t norender; // for culling
// Only relevant for FF_BUSTUP
// Only relevant for FOF_BUSTUP
ffloorbustflags_e bustflags;
UINT8 busttype;
INT16 busttag;
// Only relevant for FF_QUICKSAND
// Only relevant for FOF_QUICKSAND
fixed_t sinkspeed;
fixed_t friction;
// Only relevant for FF_BOUNCY
// Only relevant for FOF_BOUNCY
fixed_t bouncestrength;
// these are saved for netgames, so do not let Lua touch these!
@ -230,7 +271,7 @@ typedef struct lightlist_s
extracolormap_t **extra_colormap; // pointer-to-a-pointer, so we can react to colormap changes
INT32 flags;
ffloor_t *caster;
struct pslope_s *slope; // FF_DOUBLESHADOW makes me have to store this pointer here. Bluh bluh.
struct pslope_s *slope; // FOF_DOUBLESHADOW makes me have to store this pointer here. Bluh bluh.
} lightlist_t;

View file

@ -2128,7 +2128,7 @@ void R_DrawColumnShadowed_8(void)
{
// If the height of the light is above the column, get the colormap
// anyway because the lighting of the top should be affected.
solid = dc_lightlist[i].flags & FF_CUTSOLIDS;
solid = dc_lightlist[i].flags & FOF_CUTSOLIDS;
height = dc_lightlist[i].height >> LIGHTSCALESHIFT;
if (solid)

View file

@ -836,13 +836,13 @@ void R_DrawSinglePlane(visplane_t *pl)
// Don't draw planes that shouldn't be drawn.
for (rover = pl->ffloor->target->ffloors; rover; rover = rover->next)
{
if ((pl->ffloor->flags & FF_CUTEXTRA) && (rover->flags & FF_EXTRA))
if ((pl->ffloor->fofflags & FOF_CUTEXTRA) && (rover->fofflags & FOF_EXTRA))
{
if (pl->ffloor->flags & FF_EXTRA)
if (pl->ffloor->fofflags & FOF_EXTRA)
{
// The plane is from an extra 3D floor... Check the flags so
// there are no undesired cuts.
if (((pl->ffloor->flags & (FF_FOG|FF_SWIMMABLE)) == (rover->flags & (FF_FOG|FF_SWIMMABLE)))
if (((pl->ffloor->fofflags & (FOF_FOG|FOF_SWIMMABLE)) == (rover->fofflags & (FOF_FOG|FOF_SWIMMABLE)))
&& pl->height < *rover->topheight
&& pl->height > *rover->bottomheight)
return;
@ -850,9 +850,9 @@ void R_DrawSinglePlane(visplane_t *pl)
}
}
if (pl->ffloor->flags & FF_TRANSLUCENT)
if (pl->ffloor->fofflags & FOF_TRANSLUCENT)
{
spanfunctype = (pl->ffloor->flags & FF_SPLAT) ? SPANDRAWFUNC_TRANSSPLAT : SPANDRAWFUNC_TRANS;
spanfunctype = (pl->ffloor->fofflags & FOF_SPLAT) ? SPANDRAWFUNC_TRANSSPLAT : SPANDRAWFUNC_TRANS;
// Hacked up support for alpha value in software mode Tails 09-24-2002
// ...unhacked by toaster 04-01-2021, re-hacked a little by sphere 19-11-2021
@ -871,14 +871,14 @@ void R_DrawSinglePlane(visplane_t *pl)
else
light = LIGHTLEVELS-1;
}
else if (pl->ffloor->flags & FF_FOG)
else if (pl->ffloor->fofflags & FOF_FOG)
{
spanfunctype = SPANDRAWFUNC_FOG;
light = (pl->lightlevel >> LIGHTSEGSHIFT);
}
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
if (pl->ffloor->flags & FF_RIPPLE)
if (pl->ffloor->fofflags & FOF_RIPPLE)
{
INT32 top, bottom;

View file

@ -244,7 +244,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
rlight->flags = light->flags;
if ((colfunc != colfuncs[COLDRAWFUNC_FUZZY])
|| (rlight->flags & FF_FOG)
|| (rlight->flags & FOF_FOG)
|| (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG)))
lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
else
@ -387,7 +387,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
{
rlight = &dc_lightlist[i];
if ((rlight->flags & FF_NOSHADE))
if ((rlight->flags & FOF_NOSHADE))
continue;
if (rlight->lightnum < 0)
@ -547,7 +547,7 @@ static boolean R_IsFFloorTranslucent(visffloor_t *pfloor)
// Polyobjects have no ffloors, and they're handled in the conditional above.
if (pfloor->ffloor != NULL)
return (pfloor->ffloor->flags & (FF_TRANSLUCENT|FF_FOG));
return (pfloor->ffloor->fofflags & (FOF_TRANSLUCENT|FOF_FOG));
return false;
}
@ -602,7 +602,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture);
}
if (pfloor->flags & FF_TRANSLUCENT)
if (pfloor->fofflags & FOF_TRANSLUCENT)
{
boolean fuzzy = true;
@ -621,7 +621,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
if (fuzzy)
colfunc = colfuncs[COLDRAWFUNC_FUZZY];
}
else if (pfloor->flags & FF_FOG)
else if (pfloor->fofflags & FOF_FOG)
colfunc = colfuncs[COLDRAWFUNC_FOG];
range = max(ds->x2-ds->x1, 1);
@ -684,7 +684,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
else rlight->heightstep = CLAMPMIN;
rlight->heightstep = (rlight->heightstep-rlight->height)/(range);
rlight->flags = light->flags;
if (light->flags & FF_CUTLEVEL)
if (light->flags & FOF_CUTLEVEL)
{
SLOPEPARAMS(*light->caster->b_slope, leftheight, rightheight, *light->caster->bottomheight)
#undef SLOPEPARAMS
@ -708,12 +708,12 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
rlight->extra_colormap = *light->extra_colormap;
// Check if the current light effects the colormap/lightlevel
if (pfloor->flags & FF_FOG)
if (pfloor->fofflags & FOF_FOG)
rlight->lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT);
else
rlight->lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
if (pfloor->flags & FF_FOG || rlight->flags & FF_FOG || (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG)))
if (pfloor->fofflags & FOF_FOG || rlight->flags & FOF_FOG || (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG)))
;
else if (curline->v1->y == curline->v2->y)
rlight->lightnum--;
@ -730,7 +730,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
// Get correct light level!
if ((frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
else if (pfloor->flags & FF_FOG)
else if (pfloor->fofflags & FOF_FOG)
lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT);
else if (colfunc == colfuncs[COLDRAWFUNC_FUZZY])
lightnum = LIGHTLEVELS-1;
@ -738,7 +738,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
lightnum = R_FakeFlat(frontsector, &tempsec, &templight, &templight, false)
->lightlevel >> LIGHTSEGSHIFT;
if (pfloor->flags & FF_FOG || (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)));
if (pfloor->fofflags & FOF_FOG || (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)));
else if (curline->v1->y == curline->v2->y)
lightnum--;
else if (curline->v1->x == curline->v2->x)
@ -885,7 +885,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
{
rlight = &dc_lightlist[i];
rlight->height += rlight->heightstep;
if (rlight->flags & FF_CUTLEVEL)
if (rlight->flags & FOF_CUTLEVEL)
rlight->botheight += rlight->botheightstep;
}
}
@ -912,7 +912,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
{
// Check if the current light effects the colormap/lightlevel
rlight = &dc_lightlist[i];
lighteffect = !(dc_lightlist[i].flags & FF_NOSHADE);
lighteffect = !(dc_lightlist[i].flags & FOF_NOSHADE);
if (lighteffect)
{
lightnum = rlight->lightnum;
@ -929,7 +929,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
if (pindex >= MAXLIGHTSCALE)
pindex = MAXLIGHTSCALE-1;
if (pfloor->flags & FF_FOG)
if (pfloor->fofflags & FOF_FOG)
{
if (pfloor->master->frontsector->extra_colormap)
rlight->rcolormap = pfloor->master->frontsector->extra_colormap->colormap + (xwalllights[pindex] - colormaps);
@ -948,15 +948,15 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
solid = 0; // don't carry over solid-cutting flag from the previous light
// Check if the current light can cut the current 3D floor.
if (rlight->flags & FF_CUTSOLIDS && !(pfloor->flags & FF_EXTRA))
if (rlight->flags & FOF_CUTSOLIDS && !(pfloor->fofflags & FOF_EXTRA))
solid = 1;
else if (rlight->flags & FF_CUTEXTRA && pfloor->flags & FF_EXTRA)
else if (rlight->flags & FOF_CUTEXTRA && pfloor->fofflags & FOF_EXTRA)
{
if (rlight->flags & FF_EXTRA)
if (rlight->flags & FOF_EXTRA)
{
// The light is from an extra 3D floor... Check the flags so
// there are no undesired cuts.
if ((rlight->flags & (FF_FOG|FF_SWIMMABLE)) == (pfloor->flags & (FF_FOG|FF_SWIMMABLE)))
if ((rlight->flags & (FOF_FOG|FOF_SWIMMABLE)) == (pfloor->fofflags & (FOF_FOG|FOF_SWIMMABLE)))
solid = 1;
}
else
@ -993,7 +993,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
{
rlight = &dc_lightlist[i];
rlight->height += rlight->heightstep;
if (rlight->flags & FF_CUTLEVEL)
if (rlight->flags & FOF_CUTLEVEL)
rlight->botheight += rlight->botheightstep;
}
continue;
@ -1024,7 +1024,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
dc_colormap = walllights[pindex];
if (pfloor->flags & FF_FOG && pfloor->master->frontsector->extra_colormap)
if (pfloor->fofflags & FOF_FOG && pfloor->master->frontsector->extra_colormap)
dc_colormap = pfloor->master->frontsector->extra_colormap->colormap + (dc_colormap - colormaps);
else if (frontsector->extra_colormap)
dc_colormap = frontsector->extra_colormap->colormap + (dc_colormap - colormaps);
@ -1466,7 +1466,7 @@ static void R_RenderSegLoop (void)
for (i = 0; i < dc_numlights; i++)
{
dc_lightlist[i].height += dc_lightlist[i].heightstep;
if (dc_lightlist[i].flags & FF_CUTSOLIDS)
if (dc_lightlist[i].flags & FOF_CUTSOLIDS)
dc_lightlist[i].botheight += dc_lightlist[i].botheightstep;
}
}
@ -2052,9 +2052,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
i = 0;
for (rover = backsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_ALLSIDES) && rover->flags & FF_INVERTSIDES)
if (!(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES)
continue;
if (rover->norender == leveltime)
@ -2071,23 +2071,23 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (r2->master == rover->master) // Skip if same control line.
break;
if (!(r2->flags & FF_EXISTS) || !(r2->flags & FF_RENDERSIDES))
if (!(r2->fofflags & FOF_EXISTS) || !(r2->fofflags & FOF_RENDERSIDES))
continue;
if (r2->norender == leveltime)
continue;
if (rover->flags & FF_EXTRA)
if (rover->fofflags & FOF_EXTRA)
{
if (!(r2->flags & FF_CUTEXTRA))
if (!(r2->fofflags & FOF_CUTEXTRA))
continue;
if (r2->flags & FF_EXTRA && (r2->flags & (FF_TRANSLUCENT|FF_FOG)) != (rover->flags & (FF_TRANSLUCENT|FF_FOG)))
if (r2->fofflags & FOF_EXTRA && (r2->fofflags & (FOF_TRANSLUCENT|FOF_FOG)) != (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG)))
continue;
}
else
{
if (!(r2->flags & FF_CUTSOLIDS))
if (!(r2->fofflags & FOF_CUTSOLIDS))
continue;
}
@ -2110,9 +2110,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
for (rover = frontsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_ALLSIDES || rover->flags & FF_INVERTSIDES))
if (!(rover->fofflags & FOF_ALLSIDES || rover->fofflags & FOF_INVERTSIDES))
continue;
if (rover->norender == leveltime)
@ -2129,23 +2129,23 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if (r2->master == rover->master) // Skip if same control line.
break;
if (!(r2->flags & FF_EXISTS) || !(r2->flags & FF_RENDERSIDES))
if (!(r2->fofflags & FOF_EXISTS) || !(r2->fofflags & FOF_RENDERSIDES))
continue;
if (r2->norender == leveltime)
continue;
if (rover->flags & FF_EXTRA)
if (rover->fofflags & FOF_EXTRA)
{
if (!(r2->flags & FF_CUTEXTRA))
if (!(r2->fofflags & FOF_CUTEXTRA))
continue;
if (r2->flags & FF_EXTRA && (r2->flags & (FF_TRANSLUCENT|FF_FOG)) != (rover->flags & (FF_TRANSLUCENT|FF_FOG)))
if (r2->fofflags & FOF_EXTRA && (r2->fofflags & (FOF_TRANSLUCENT|FOF_FOG)) != (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG)))
continue;
}
else
{
if (!(r2->flags & FF_CUTSOLIDS))
if (!(r2->fofflags & FOF_CUTSOLIDS))
continue;
}
@ -2170,9 +2170,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
{
for (rover = backsector->ffloors, i = 0; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_ALLSIDES) && rover->flags & FF_INVERTSIDES)
if (!(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES)
continue;
if (rover->norender == leveltime)
continue;
@ -2192,9 +2192,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
{
for (rover = frontsector->ffloors, i = 0; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS))
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
continue;
if (!(rover->flags & FF_ALLSIDES || rover->flags & FF_INVERTSIDES))
if (!(rover->fofflags & FOF_ALLSIDES || rover->fofflags & FOF_INVERTSIDES))
continue;
if (rover->norender == leveltime)
continue;
@ -2416,7 +2416,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
rlight->heightstep = (rlight->heightstep-rlight->height)/(range);
rlight->flags = light->flags;
if (light->caster && light->caster->flags & FF_CUTSOLIDS)
if (light->caster && light->caster->fofflags & FOF_CUTSOLIDS)
{
leftheight = P_GetFFloorBottomZAt(light->caster, segleft.x, segleft.y);
rightheight = P_GetFFloorBottomZAt(light->caster, segright.x, segright.y);
@ -2503,7 +2503,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
{
for (rover = backsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES))
continue;
if (rover->norender == leveltime)
continue;
@ -2518,8 +2518,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
((viewz < planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(viewz > planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
//ffloor[i].slope = *rover->b_slope;
ffloor[i].b_pos = roverleft;
@ -2541,8 +2541,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
((viewz > planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(viewz < planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
//ffloor[i].slope = *rover->t_slope;
ffloor[i].b_pos = roverleft;
@ -2560,7 +2560,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
{
for (rover = frontsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES))
continue;
if (rover->norender == leveltime)
continue;
@ -2575,8 +2575,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
((viewz < planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(viewz > planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
//ffloor[i].slope = *rover->b_slope;
ffloor[i].b_pos = roverleft;
@ -2598,8 +2598,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
((viewz > planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) ||
(viewz < planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
((viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
//ffloor[i].slope = *rover->t_slope;
ffloor[i].b_pos = roverleft;

View file

@ -754,13 +754,13 @@ UINT8 *R_GetSpriteTranslation(vissprite_t *vis)
else if (vis->mobj->type == MT_METALSONIC_BATTLE)
return R_GetTranslationColormap(TC_METALSONIC, 0, GTC_CACHE);
else
return R_GetTranslationColormap(TC_BOSS, vis->mobj->color, GTC_CACHE);
return R_GetTranslationColormap(TC_BOSS, vis->color, GTC_CACHE);
}
else if (vis->mobj->color)
else if (vis->color)
{
// New colormap stuff for skins Tails 06-07-2002
if (!(vis->cut & SC_PRECIP) && vis->mobj->colorized)
return R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
return R_GetTranslationColormap(TC_RAINBOW, vis->color, GTC_CACHE);
else if (!(vis->cut & SC_PRECIP)
&& vis->mobj->player && vis->mobj->player->dashmode >= DASHMODE_THRESHOLD
&& (vis->mobj->player->charflags & SF_DASHMODE)
@ -769,15 +769,15 @@ UINT8 *R_GetSpriteTranslation(vissprite_t *vis)
if (vis->mobj->player->charflags & SF_MACHINE)
return R_GetTranslationColormap(TC_DASHMODE, 0, GTC_CACHE);
else
return R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
return R_GetTranslationColormap(TC_RAINBOW, vis->color, GTC_CACHE);
}
else if (!(vis->cut & SC_PRECIP) && vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // This thing is a player!
{
size_t skinnum = (skin_t*)vis->mobj->skin-skins;
return R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE);
return R_GetTranslationColormap((INT32)skinnum, vis->color, GTC_CACHE);
}
else // Use the defaults
return R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE);
return R_GetTranslationColormap(TC_DEFAULT, vis->color, GTC_CACHE);
}
else if (vis->mobj->sprite == SPR_PLAY) // Looks like a player, but doesn't have a color? Get rid of green sonic syndrome.
return R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_BLUE, GTC_CACHE);
@ -822,7 +822,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
if (R_SpriteIsFlashing(vis)) // Bosses "flash"
colfunc = colfuncs[COLDRAWFUNC_TRANS]; // translate certain pixels to white
else if (vis->mobj->color && vis->transmap) // Color mapping
else if (vis->color && vis->transmap) // Color mapping
{
colfunc = colfuncs[COLDRAWFUNC_TRANSTRANS];
dc_transmap = vis->transmap;
@ -832,7 +832,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
colfunc = colfuncs[COLDRAWFUNC_FUZZY];
dc_transmap = vis->transmap; //Fab : 29-04-98: translucency table
}
else if (vis->mobj->color) // translate green skin to another color
else if (vis->color) // translate green skin to another color
colfunc = colfuncs[COLDRAWFUNC_TRANS];
else if (vis->mobj->sprite == SPR_PLAY) // Looks like a player, but doesn't have a color? Get rid of green sonic syndrome.
colfunc = colfuncs[COLDRAWFUNC_TRANS];
@ -1055,7 +1055,7 @@ static void R_SplitSprite(vissprite_t *sprite)
{
fixed_t testheight;
if (!(sector->lightlist[i].caster->flags & FF_CUTSPRITES))
if (!(sector->lightlist[i].caster->fofflags & FOF_CUTSPRITES))
continue;
testheight = P_GetLightZAt(&sector->lightlist[i], sprite->gx, sprite->gy);
@ -1096,7 +1096,7 @@ static void R_SplitSprite(vissprite_t *sprite)
newsprite->szt -= 8;
newsprite->cut |= SC_TOP;
if (!(sector->lightlist[i].caster->flags & FF_NOSHADE))
if (!(sector->lightlist[i].caster->fofflags & FOF_NOSHADE))
{
lightnum = (*sector->lightlist[i].lightlevel >> LIGHTSEGSHIFT);
@ -1162,7 +1162,7 @@ fixed_t R_GetShadowZ(mobj_t *thing, pslope_t **shadowslope)
if (sector->ffloors)
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES) || (rover->alpha < 90 && !(rover->flags & FF_SWIMMABLE)))
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES) || (rover->alpha < 90 && !(rover->fofflags & FOF_SWIMMABLE)))
continue;
z = isflipped ? P_GetFFloorBottomZAt(rover, thing->x, thing->y) : P_GetFFloorTopZAt(rover, thing->x, thing->y);
@ -1356,6 +1356,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
shadow->shear.tan = shadowskew; // repurposed variable
shadow->mobj = thing; // Easy access! Tails 06-07-2002
shadow->color = thing->color;
shadow->x1 = x1 < portalclipstart ? portalclipstart : x1;
shadow->x2 = x2 >= portalclipend ? portalclipend-1 : x2;
@ -2015,6 +2016,10 @@ static void R_ProjectSprite(mobj_t *thing)
vis->viewpoint.angle = viewangle;
vis->mobj = thing; // Easy access! Tails 06-07-2002
if ((oldthing->flags2 & MF2_LINKDRAW) && oldthing->tracer && oldthing->color == SKINCOLOR_NONE)
vis->color = oldthing->tracer->color;
else
vis->color = oldthing->color;
vis->x1 = x1 < portalclipstart ? portalclipstart : x1;
vis->x2 = x2 >= portalclipend ? portalclipend-1 : x2;
@ -2268,6 +2273,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
vis->cut = SC_PRECIP;
vis->extra_colormap = thing->subsector->sector->extra_colormap;
vis->heightsec = thing->subsector->sector->heightsec;
vis->color = SKINCOLOR_NONE;
// Fullbright
vis->colormap = colormaps;

View file

@ -207,6 +207,8 @@ typedef struct vissprite_s
fixed_t shadowscale;
skincolornum_t color;
INT16 clipbot[MAXVIDWIDTH], cliptop[MAXVIDWIDTH];
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing

View file

@ -222,7 +222,7 @@ static INT32 S_getChannel(const void *origin, sfxinfo_t *sfxinfo)
}
else if (origin && channels[cnum].origin == origin
&& channels[cnum].sfxinfo->name != sfxinfo->name
&& channels[cnum].sfxinfo->pitch == SF_TOTALLYSINGLE && sfxinfo->pitch == SF_TOTALLYSINGLE)
&& channels[cnum].sfxinfo->pitch & SF_TOTALLYSINGLE && sfxinfo->pitch & SF_TOTALLYSINGLE)
{
S_StopChannel(cnum);
break;

View file

@ -143,21 +143,32 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#define UNIXBACKTRACE
#endif
// Locations for searching the srb2.pk3
// Locations to directly check for srb2.pk3 in
const char *wadDefaultPaths[] = {
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
#define DEFAULTWADLOCATION1 "/usr/local/share/games/SRB2"
#define DEFAULTWADLOCATION2 "/usr/local/games/SRB2"
#define DEFAULTWADLOCATION3 "/usr/share/games/SRB2"
#define DEFAULTWADLOCATION4 "/usr/games/SRB2"
#define DEFAULTSEARCHPATH1 "/usr/local/games"
#define DEFAULTSEARCHPATH2 "/usr/games"
#define DEFAULTSEARCHPATH3 "/usr/local"
"/usr/local/share/games/SRB2",
"/usr/local/games/SRB2",
"/usr/share/games/SRB2",
"/usr/games/SRB2",
#elif defined (_WIN32)
#define DEFAULTWADLOCATION1 "c:\\games\\srb2"
#define DEFAULTWADLOCATION2 "\\games\\srb2"
#define DEFAULTSEARCHPATH1 "c:\\games"
#define DEFAULTSEARCHPATH2 "\\games"
"c:\\games\\srb2",
"\\games\\srb2",
#endif
NULL
};
// Folders to recurse through looking for srb2.pk3
const char *wadSearchPaths[] = {
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
"/usr/local/games",
"/usr/games",
"/usr/local",
#elif defined (_WIN32)
"c:\\games",
"\\games",
#endif
NULL
};
/** \brief WAD file to look for
*/
@ -2808,6 +2819,20 @@ static const char *searchWad(const char *searchDir)
return NULL;
}
#define CHECKWADPATH(ret) \
do { \
I_OutputMsg(",%s", returnWadPath); \
if (isWadPathOk(returnWadPath)) \
return ret; \
} while (0)
#define SEARCHWAD(str) \
do { \
WadPath = searchWad(str); \
if (WadPath) \
return WadPath; \
} while (0)
/** \brief go through all possible paths and look for srb2.pk3
\return path to srb2.pk3 if any
@ -2816,6 +2841,7 @@ static const char *locateWad(void)
{
const char *envstr;
const char *WadPath;
int i;
I_OutputMsg("SRB2WADDIR");
// does SRB2WADDIR exist?
@ -2823,108 +2849,44 @@ static const char *locateWad(void)
return envstr;
#ifndef NOCWD
I_OutputMsg(",.");
// examine current dir
strcpy(returnWadPath, ".");
if (isWadPathOk(returnWadPath))
return NULL;
CHECKWADPATH(NULL);
#endif
#ifdef CMAKECONFIG
#ifndef NDEBUG
I_OutputMsg(","CMAKE_ASSETS_DIR);
strcpy(returnWadPath, CMAKE_ASSETS_DIR);
if (isWadPathOk(returnWadPath))
{
return returnWadPath;
}
CHECKWADPATH(returnWadPath);
#endif
#endif
#ifdef __APPLE__
OSX_GetResourcesPath(returnWadPath);
I_OutputMsg(",%s", returnWadPath);
if (isWadPathOk(returnWadPath))
{
return returnWadPath;
}
CHECKWADPATH(returnWadPath);
#endif
// examine default dirs
#ifdef DEFAULTWADLOCATION1
I_OutputMsg(","DEFAULTWADLOCATION1);
strcpy(returnWadPath, DEFAULTWADLOCATION1);
if (isWadPathOk(returnWadPath))
return returnWadPath;
#endif
#ifdef DEFAULTWADLOCATION2
I_OutputMsg(","DEFAULTWADLOCATION2);
strcpy(returnWadPath, DEFAULTWADLOCATION2);
if (isWadPathOk(returnWadPath))
return returnWadPath;
#endif
#ifdef DEFAULTWADLOCATION3
I_OutputMsg(","DEFAULTWADLOCATION3);
strcpy(returnWadPath, DEFAULTWADLOCATION3);
if (isWadPathOk(returnWadPath))
return returnWadPath;
#endif
#ifdef DEFAULTWADLOCATION4
I_OutputMsg(","DEFAULTWADLOCATION4);
strcpy(returnWadPath, DEFAULTWADLOCATION4);
if (isWadPathOk(returnWadPath))
return returnWadPath;
#endif
#ifdef DEFAULTWADLOCATION5
I_OutputMsg(","DEFAULTWADLOCATION5);
strcpy(returnWadPath, DEFAULTWADLOCATION5);
if (isWadPathOk(returnWadPath))
return returnWadPath;
#endif
#ifdef DEFAULTWADLOCATION6
I_OutputMsg(","DEFAULTWADLOCATION6);
strcpy(returnWadPath, DEFAULTWADLOCATION6);
if (isWadPathOk(returnWadPath))
return returnWadPath;
#endif
#ifdef DEFAULTWADLOCATION7
I_OutputMsg(","DEFAULTWADLOCATION7);
strcpy(returnWadPath, DEFAULTWADLOCATION7);
if (isWadPathOk(returnWadPath))
return returnWadPath;
#endif
for (i = 0; wadDefaultPaths[i]; i++)
{
strcpy(returnWadPath, wadDefaultPaths[i]);
CHECKWADPATH(returnWadPath);
}
#ifndef NOHOME
// find in $HOME
I_OutputMsg(",HOME");
if ((envstr = I_GetEnv("HOME")) != NULL)
SEARCHWAD(envstr);
#endif
// search paths
for (i = 0; wadSearchPaths[i]; i++)
{
WadPath = searchWad(envstr);
if (WadPath)
return WadPath;
I_OutputMsg(", in:%s", wadSearchPaths[i]);
SEARCHWAD(wadSearchPaths[i]);
}
#endif
#ifdef DEFAULTSEARCHPATH1
// find in /usr/local
I_OutputMsg(", in:"DEFAULTSEARCHPATH1);
WadPath = searchWad(DEFAULTSEARCHPATH1);
if (WadPath)
return WadPath;
#endif
#ifdef DEFAULTSEARCHPATH2
// find in /usr/games
I_OutputMsg(", in:"DEFAULTSEARCHPATH2);
WadPath = searchWad(DEFAULTSEARCHPATH2);
if (WadPath)
return WadPath;
#endif
#ifdef DEFAULTSEARCHPATH3
// find in ???
I_OutputMsg(", in:"DEFAULTSEARCHPATH3);
WadPath = searchWad(DEFAULTSEARCHPATH3);
if (WadPath)
return WadPath;
#endif
// if nothing was found
return NULL;
}

View file

@ -1633,6 +1633,11 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
#ifdef HWRENDER
if (vid.glstate == VID_GL_LIBRARY_LOADED)
flags |= SDL_WINDOW_OPENGL;
// Without a 24-bit depth buffer many visuals are ruined by z-fighting.
// Some GPU drivers may give us a 16-bit depth buffer since the
// default value for SDL_GL_DEPTH_SIZE is 16.
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
#endif
// Create a window

File diff suppressed because it is too large Load diff

View file

@ -407,9 +407,9 @@ void FV3_Rotate(vector3_t *rotVec, const vector3_t *axisVec, const angle_t angle
rotVec->z = az+dz+ez;
}
void FM_Rotate(matrix_t *dest, angle_t angle, fixed_t x, fixed_t y, fixed_t z)
{
#define M(row,col) dest->m[row * 4 + col]
matrix_t *FM_Rotate(matrix_t *dest, angle_t angle, fixed_t x, fixed_t y, fixed_t z)
{
const fixed_t sinA = FINESINE(angle>>ANGLETOFINESHIFT);
const fixed_t cosA = FINECOSINE(angle>>ANGLETOFINESHIFT);
const fixed_t invCosA = FRACUNIT - cosA;
@ -459,5 +459,84 @@ void FM_Rotate(matrix_t *dest, angle_t angle, fixed_t x, fixed_t y, fixed_t z)
M(1, 3) = 0;
M(2, 3) = 0;
M(3, 3) = FRACUNIT;
#undef M
return dest;
}
matrix_t *FM_RotateX(matrix_t *dest, angle_t rad)
{
const angle_t fa = rad>>ANGLETOFINESHIFT;
const fixed_t cosrad = FINECOSINE(fa), sinrad = FINESINE(fa);
M(0, 0) = FRACUNIT;
M(0, 1) = 0;
M(0, 2) = 0;
M(0, 3) = 0;
M(1, 0) = 0;
M(1, 1) = cosrad;
M(1, 2) = sinrad;
M(1, 3) = 0;
M(2, 0) = 0;
M(2, 1) = -sinrad;
M(2, 2) = cosrad;
M(2, 3) = 0;
M(3, 0) = 0;
M(3, 1) = 0;
M(3, 2) = 0;
M(3, 3) = FRACUNIT;
return dest;
}
matrix_t *FM_RotateY(matrix_t *dest, angle_t rad)
{
const angle_t fa = rad>>ANGLETOFINESHIFT;
const fixed_t cosrad = FINECOSINE(fa), sinrad = FINESINE(fa);
M(0, 0) = cosrad;
M(0, 1) = 0;
M(0, 2) = -sinrad;
M(0, 3) = 0;
M(1, 0) = 0;
M(1, 1) = FRACUNIT;
M(1, 2) = 0;
M(1, 3) = 0;
M(2, 0) = sinrad;
M(2, 1) = 0;
M(2, 2) = cosrad;
M(2, 3) = 0;
M(3, 0) = 0;
M(3, 1) = 0;
M(3, 2) = 0;
M(3, 3) = FRACUNIT;
return dest;
}
matrix_t *FM_RotateZ(matrix_t *dest, angle_t rad)
{
const angle_t fa = rad>>ANGLETOFINESHIFT;
const fixed_t cosrad = FINECOSINE(fa), sinrad = FINESINE(fa);
M(0, 0) = cosrad;
M(0, 1) = sinrad;
M(0, 2) = 0;
M(0, 3) = 0;
M(1, 0) = -sinrad;
M(1, 1) = cosrad;
M(1, 2) = 0;
M(1, 3) = 0;
M(2, 0) = 0;
M(2, 1) = 0;
M(2, 2) = FRACUNIT;
M(2, 3) = 0;
M(3, 0) = 0;
M(3, 1) = 0;
M(3, 2) = 0;
M(3, 3) = FRACUNIT;
return dest;
}
#undef M

View file

@ -107,7 +107,10 @@ boolean FV3_InsidePolygon(const vector3_t *vIntersection, const vector3_t *Poly,
boolean FV3_IntersectedPolygon(const vector3_t *vPoly, const vector3_t *vLine, const INT32 vertexCount, vector3_t *collisionPoint);
void FV3_Rotate(vector3_t *rotVec, const vector3_t *axisVec, const angle_t angle);
/// Fixed Point Matrix functions
void FM_Rotate(matrix_t *dest, angle_t angle, fixed_t x, fixed_t y, fixed_t z);
matrix_t *FM_Rotate(matrix_t *dest, angle_t angle, fixed_t x, fixed_t y, fixed_t z);
matrix_t *FM_RotateX(matrix_t *dest, angle_t rad);
matrix_t *FM_RotateY(matrix_t *dest, angle_t rad);
matrix_t *FM_RotateZ(matrix_t *dest, angle_t rad);
// The table values in tables.c are calculated with this many fractional bits.
#define FINE_FRACBITS 16

View file

@ -644,8 +644,6 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
lump_p->fullname = Z_Calloc(zentry.namelen + 1, PU_STATIC, NULL);
strncpy(lump_p->fullname, fullname, zentry.namelen);
free(fullname);
switch(zentry.compression)
{
case 0:
@ -665,6 +663,8 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
break;
}
free(fullname);
// skip and ignore comments/extra fields
if (fseek(handle, zentry.xtralen + zentry.commlen, SEEK_CUR) != 0)
{
@ -2483,6 +2483,10 @@ int W_VerifyNMUSlumps(const char *filename, boolean exit_on_error)
{"STNONEX", 7}, // "X" graphic
{"ULTIMATE", 8}, // Ultimate no-save
{"SLCT", 4}, // Level select "cursor"
{"LSSTATIC", 8}, // Level select static
{"BLANKLV", 7}, // "?" level images
{"CRFNT", 5}, // Sonic 1 font changes
{"NTFNT", 5}, // Character Select font changes
{"NTFNO", 5}, // Character Select font (outline)
@ -2494,12 +2498,23 @@ int W_VerifyNMUSlumps(const char *filename, boolean exit_on_error)
{"STLIVE", 6}, // Life graphics, background and the "X" that shows under skin's HUDNAME
{"CROSHAI", 7}, // First person crosshairs
{"INTERSC", 7}, // Default intermission backgrounds (co-op)
{"SPECTILE", 8}, // Special stage intermission background
{"STT", 3}, // Acceptable HUD changes (Score Time Rings)
{"YB_", 3}, // Intermission graphics, goes with the above
{"RESULT", 6}, // Used in intermission for competitive modes, above too :3
{"RACE", 4}, // Race mode graphics, 321go
{"SRB2BACK", 8}, // MP intermission background
{"M_", 2}, // Menu stuff
{"LT", 2}, // Titlecard changes
{"HOMING", 6}, // Emerald hunt radar
{"HOMITM", 6}, // Emblem radar
{"CHARFG", 6}, // Character select menu
{"CHARBG", 6},
{"RECATK", 6}, // Record Attack menu
{"RECCLOCK", 8},
{"NTSATK", 6}, // NiGHTS Mode menu
{"NTSSONC", 7},
{"SLID", 4}, // Continue
{"CONT", 4},
@ -2523,6 +2538,7 @@ int W_VerifyNMUSlumps(const char *filename, boolean exit_on_error)
{"DRILL", 5},
{"GRADE", 5},
{"MINUS5", 6},
{"NGRTIMER", 8}, // NiGHTS Mode timer
{"MUSICDEF", 8}, // Song definitions (thanks kart)
{"SHADERS", 7}, // OpenGL shader definitions

View file

@ -2,6 +2,7 @@
//
#include "resource.h"
#include "winver.h"
#include "winuser.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////

View file

@ -1,5 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</windowsSettings>
</application>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>