Merge branch 'next' into thokker_next

This commit is contained in:
Alam Ed Arias 2016-02-24 12:01:08 -05:00
commit b64f45c846
40 changed files with 1126 additions and 893 deletions

View file

@ -100,7 +100,8 @@ set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary")
include(GitUtilities)
git_describe(SRB2_GIT_DESCRIBE "${CMAKE_SOURCE_DIR}")
git_current_branch(SRB2_GIT_BRANCH "${CMAKE_SOURCE_DIR}")
set(SRB2_COMP_REVISION "${SRB2_GIT_DESCRIBE}-<${SRB2_GIT_BRANCH}>")
set(SRB2_COMP_BRANCH "${SRB2_GIT_BRANCH}")
set(SRB2_COMP_REVISION "${SRB2_GIT_DESCRIBE}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
##### PACKAGE CONFIGURATION #####

View file

@ -1,10 +1,32 @@
@ECHO OFF
set REV=Unknown
set BRA=Unknown
set REV=illegal
copy nul: /b +%1\comptime.c tmp.$$$ > nul
move tmp.$$$ %1\comptime.c > nul
SET REV=illegal
FOR /F "usebackq" %%s IN (`svnversion %1`) DO @SET REV=%%s
if exist .git goto gitrev
if exist ..\.git goto gitrev
if exist .svn goto svnrev
goto filwri
:gitrev
set GIT=%2
if "%GIT%"=="" set GIT=git
FOR /F "usebackq" %%s IN (`%GIT% rev-parse --abbrev-ref HEAD`) DO @SET BRA=%%s
FOR /F "usebackq" %%s IN (`%GIT% rev-parse HEAD`) DO @SET REV=%%s
set REV=%REV:~0,8%
goto filwri
:svnrev
set BRA=Subversion
FOR /F "usebackq" %%s IN (`svnversion .`) DO @SET REV=%%s
set REV=r%REV%
goto filwri
:filwri
ECHO // Do not edit! This file was autogenerated > %1\comptime.h
ECHO // by the %0 batch file >> %1\comptime.h
ECHO // >> %1\comptime.h
ECHO const char* comprevision = "r%REV%"; >> %1\comptime.h
ECHO const char* compbranch = "%BRA%"; >> %1\comptime.h
ECHO const char* comprevision = "%REV%"; >> %1\comptime.h

View file

@ -5,13 +5,15 @@ if [ x"$1" != x ]; then
fi
versiongit() {
gitversion=`git describe`
gitbranch=`git rev-parse --abbrev-ref HEAD`
gitversion=`git rev-parse HEAD`
cat <<EOF > $path/comptime.h
// Do not edit! This file was autogenerated
// by the $0 script with git svn
// by the $0 script with git
//
const char* comprevision = "$gitversion";
const char* compbranch = "$gitbranch";
const char* comprevision = "${gitversion:0:8}";
EOF
exit 0
}
@ -23,6 +25,7 @@ versionsvn() {
// Do not edit! This file was autogenerated
// by the $0 script with subversion
//
const char* compbranch = "Subversion";
const char* comprevision = "r$svnrevision";
EOF
exit 0
@ -34,6 +37,7 @@ versionfake() {
// Do not edit! This file was autogenerated
// by the $0 script with an unknown or nonexist SCM
//
const char* compbranch = "Unknown";
const char* comprevision = "illegal";
EOF
}

View file

@ -9,12 +9,14 @@
#if (defined(CMAKECONFIG))
#include "config.h"
const char *compbranch = SRB2_COMP_BRANCH;
const char *comprevision = SRB2_COMP_REVISION;
#elif (defined(COMPVERSION))
#include "comptime.h"
#else
const char *compbranch = "Unknown";
const char *comprevision = "illegal";
#endif

View file

@ -18,6 +18,7 @@
#define ASSET_HASH_PATCH_DTA "${SRB2_ASSET_patch.dta_HASH}"
#define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}"
#define SRB2_COMP_BRANCH "${SRB2_COMP_BRANCH}"
#define SRB2_GIT_DESCRIBE "${SRB2_GIT_DESCRIBE}"
#define SRB2_GIT_BRANCH "${SRB2_GIT_BRANCH}"

View file

@ -202,7 +202,7 @@ static void CONS_Bind_f(void)
}
key = G_KeyStringtoNum(COM_Argv(1));
if (!key)
if (key <= 0 || key >= NUMINPUTS)
{
CONS_Alert(CONS_NOTICE, M_GetText("Invalid key name\n"));
return;

View file

@ -3183,7 +3183,11 @@ static void Command_ListWADS_f(void)
*/
static void Command_Version_f(void)
{
#ifdef DEVELOP
CONS_Printf("Sonic Robo Blast 2 %s-%s (%s %s)\n", compbranch, comprevision, compdate, comptime);
#else
CONS_Printf("Sonic Robo Blast 2 %s (%s %s %s)\n", VERSIONSTRING, compdate, comptime, comprevision);
#endif
}
#ifdef UPDATE_ALERT

View file

@ -1132,6 +1132,10 @@ static void readlevelheader(MYFILE *f, INT32 num)
}
else if (fastcmp(word, "NEXTLEVEL"))
{
if (fastcmp(word2, "TITLE")) i = 1100;
else if (fastcmp(word2, "EVALUATION")) i = 1101;
else if (fastcmp(word2, "CREDITS")) i = 1102;
else
// Support using the actual map name,
// i.e., Nextlevel = AB, Nextlevel = FZ, etc.

View file

@ -142,8 +142,10 @@ extern FILE *logstream;
#ifdef DEVELOP
#define VERSION 0 // Game version
#define SUBVERSION 0 // more precise version number
#define VERSIONSTRING "Trunk"
#define VERSIONSTRINGW L"Trunk"
#define VERSIONSTRING "Development EXE"
#define VERSIONSTRINGW L"Development EXE"
// most interface strings are ignored in development mode.
// we use comprevision and compbranch instead.
#else
#define VERSION 165 // Game version
#define SUBVERSION 1
@ -426,7 +428,7 @@ INT32 I_GetKey(void);
#endif
// Compile date and time and revision.
extern const char *compdate, *comptime, *comprevision;
extern const char *compdate, *comptime, *comprevision, *compbranch;
// Disabled code and code under testing
// None of these that are disabled in the normal build are guaranteed to work perfectly

View file

@ -231,34 +231,52 @@ static void F_DoWipe(fademask_t *fademask)
maskx = masky = 0;
do
{
// pointer to transtable that this mask would use
transtbl = transtables + ((9 - *mask)<<FF_TRANSSHIFT);
// (ignore that it goes out of bounds if *mask is 0 or 10 --
// it wouldn't be used in those cases anyway)
draw_rowstart = scrxpos[maskx];
draw_rowend = scrxpos[maskx + 1];
draw_linestart = scrypos[masky];
draw_lineend = scrypos[masky + 1];
// DRAWING LOOP
relativepos = (draw_linestart * vid.width) + draw_rowstart;
draw_linestogo = draw_lineend - draw_linestart;
while (draw_linestogo--)
if (*mask == 0)
{
w = w_base + relativepos;
s = s_base + relativepos;
e = e_base + relativepos;
draw_rowstogo = draw_rowend - draw_rowstart;
while (draw_rowstogo--)
// shortcut - memcpy source to work
while (draw_linestogo--)
{
if (*s != *e)
*w = ((*mask == 0) ? *s : (*mask == 10) ? *e : transtbl[(*e<<8) + *s]);
++w, ++s, ++e;
M_Memcpy(w_base+relativepos, s_base+relativepos, draw_rowend-draw_rowstart);
relativepos += vid.width;
}
relativepos += vid.width;
}
// END DRAWING LOOP
else if (*mask == 10)
{
// shortcut - memcpy target to work
while (draw_linestogo--)
{
M_Memcpy(w_base+relativepos, e_base+relativepos, draw_rowend-draw_rowstart);
relativepos += vid.width;
}
}
else
{
// pointer to transtable that this mask would use
transtbl = transtables + ((9 - *mask)<<FF_TRANSSHIFT);
// DRAWING LOOP
while (draw_linestogo--)
{
w = w_base + relativepos;
s = s_base + relativepos;
e = e_base + relativepos;
draw_rowstogo = draw_rowend - draw_rowstart;
while (draw_rowstogo--)
*w++ = transtbl[ ( *e++ << 8 ) + *s++ ];
relativepos += vid.width;
}
// END DRAWING LOOP
}
if (++maskx >= fademask->width)
++masky, maskx = 0;

View file

@ -297,9 +297,6 @@ static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
#if JOYAXISSET > 3
{7, "Pitch"}, {8, "Roll"}, {-7, "Pitch-"}, {-8, "Roll-"},
#endif
#if JOYAXISSET > 3
{7, "Pitch"}, {8, "Roll"}, {-7, "Pitch-"}, {-8, "Roll-"},
#endif
#if JOYAXISSET > 4
{7, "Yaw"}, {8, "Dummy"}, {-7, "Yaw-"}, {-8, "Dummy-"},
#endif

View file

@ -1041,13 +1041,13 @@ INT32 G_KeyStringtoNum(const char *keystr)
if (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z')
return keystr[0];
if (!strncmp(keystr, "KEY", 3) && keystr[3] >= '0' && keystr[3] <= '9')
return atoi(&keystr[3]);
for (j = 0; j < NUMKEYNAMES; j++)
if (!stricmp(keynames[j].name, keystr))
return keynames[j].keynum;
if (strlen(keystr) > 3)
return atoi(&keystr[3]);
return 0;
}

View file

@ -79,6 +79,7 @@ typedef struct gr_vissprite_s
boolean vflip;
//Hurdler: 25/04/2000: now support colormap in hardware mode
UINT8 *colormap;
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
} gr_vissprite_t;
// --------

View file

@ -4471,6 +4471,7 @@ static void HWR_SortVisSprites(void)
gr_vissprite_t *best = NULL;
gr_vissprite_t unsorted;
float bestdist;
INT32 bestdispoffset;
if (!gr_visspritecount)
return;
@ -4498,11 +4499,19 @@ static void HWR_SortVisSprites(void)
for (i = 0; i < gr_visspritecount; i++)
{
best = NULL;
bestdispoffset = INT32_MAX;
for (ds = unsorted.next; ds != &unsorted; ds = ds->next)
{
if (!best || ds->tz > bestdist)
{
bestdist = ds->tz;
bestdispoffset = ds->dispoffset;
best = ds;
}
// order visprites of same scale by dispoffset, smallest first
else if (ds->tz == bestdist && ds->dispoffset < bestdispoffset)
{
bestdispoffset = ds->dispoffset;
best = ds;
}
}
@ -5126,6 +5135,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
#endif
vis->x2 = tx;
vis->tz = tz;
vis->dispoffset = thing->info->dispoffset; // Monster Iestyn: 23/11/15: HARDWARE SUPPORT AT LAST
vis->patchlumpnum = sprframe->lumppat[rot];
vis->flip = flip;
vis->mobj = thing;
@ -5242,6 +5252,7 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
vis->x1 = x1;
vis->x2 = tx;
vis->tz = tz;
vis->dispoffset = 0; // Monster Iestyn: 23/11/15: HARDWARE SUPPORT AT LAST
vis->patchlumpnum = sprframe->lumppat[rot];
vis->flip = flip;
vis->mobj = (mobj_t *)thing;

View file

@ -1346,6 +1346,248 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, con
Z_ChangeTag(newmip->grInfo.data, PU_HWRCACHE_UNLOCKED);
}
static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, GLMipmap_t *grmip, skincolors_t color)
{
UINT16 w = gpatch->width, h = gpatch->height;
UINT32 size = w*h;
RGBA_t *image, *blendimage, *cur, blendcolor;
if (grmip->width == 0)
{
grmip->width = gpatch->width;
grmip->height = gpatch->height;
// no wrap around, no chroma key
grmip->flags = 0;
// setup the texture info
grmip->grInfo.format = GR_RGBA;
}
Z_Free(grmip->grInfo.data);
grmip->grInfo.data = NULL;
cur = Z_Malloc(size*4, PU_HWRCACHE, &grmip->grInfo.data);
memset(cur, 0x00, size*4);
image = gpatch->mipmap.grInfo.data;
blendimage = blendgpatch->mipmap.grInfo.data;
switch (color)
{
case SKINCOLOR_WHITE:
blendcolor = V_GetColor(3);
break;
case SKINCOLOR_SILVER:
blendcolor = V_GetColor(10);
break;
case SKINCOLOR_GREY:
blendcolor = V_GetColor(15);
break;
case SKINCOLOR_BLACK:
blendcolor = V_GetColor(27);
break;
case SKINCOLOR_CYAN:
blendcolor = V_GetColor(215);
break;
case SKINCOLOR_TEAL:
blendcolor = V_GetColor(221);
break;
case SKINCOLOR_STEELBLUE:
blendcolor = V_GetColor(203);
break;
case SKINCOLOR_BLUE:
blendcolor = V_GetColor(232);
break;
case SKINCOLOR_PEACH:
blendcolor = V_GetColor(71);
break;
case SKINCOLOR_TAN:
blendcolor = V_GetColor(79);
break;
case SKINCOLOR_PINK:
blendcolor = V_GetColor(147);
break;
case SKINCOLOR_LAVENDER:
blendcolor = V_GetColor(251);
break;
case SKINCOLOR_PURPLE:
blendcolor = V_GetColor(195);
break;
case SKINCOLOR_ORANGE:
blendcolor = V_GetColor(87);
break;
case SKINCOLOR_ROSEWOOD:
blendcolor = V_GetColor(94);
break;
case SKINCOLOR_BEIGE:
blendcolor = V_GetColor(40);
break;
case SKINCOLOR_BROWN:
blendcolor = V_GetColor(57);
break;
case SKINCOLOR_RED:
blendcolor = V_GetColor(130);
break;
case SKINCOLOR_DARKRED:
blendcolor = V_GetColor(139);
break;
case SKINCOLOR_NEONGREEN:
blendcolor = V_GetColor(184);
break;
case SKINCOLOR_GREEN:
blendcolor = V_GetColor(166);
break;
case SKINCOLOR_ZIM:
blendcolor = V_GetColor(180);
break;
case SKINCOLOR_OLIVE:
blendcolor = V_GetColor(108);
break;
case SKINCOLOR_YELLOW:
blendcolor = V_GetColor(104);
break;
case SKINCOLOR_GOLD:
blendcolor = V_GetColor(115);
break;
case SKINCOLOR_SUPER1:
blendcolor = V_GetColor(97);
break;
case SKINCOLOR_SUPER2:
blendcolor = V_GetColor(100);
break;
case SKINCOLOR_SUPER3:
blendcolor = V_GetColor(103);
break;
case SKINCOLOR_SUPER4:
blendcolor = V_GetColor(113);
break;
case SKINCOLOR_SUPER5:
blendcolor = V_GetColor(116);
break;
case SKINCOLOR_TSUPER1:
blendcolor = V_GetColor(81);
break;
case SKINCOLOR_TSUPER2:
blendcolor = V_GetColor(82);
break;
case SKINCOLOR_TSUPER3:
blendcolor = V_GetColor(84);
break;
case SKINCOLOR_TSUPER4:
blendcolor = V_GetColor(85);
break;
case SKINCOLOR_TSUPER5:
blendcolor = V_GetColor(87);
break;
case SKINCOLOR_KSUPER1:
blendcolor = V_GetColor(122);
break;
case SKINCOLOR_KSUPER2:
blendcolor = V_GetColor(123);
break;
case SKINCOLOR_KSUPER3:
blendcolor = V_GetColor(124);
break;
case SKINCOLOR_KSUPER4:
blendcolor = V_GetColor(125);
break;
case SKINCOLOR_KSUPER5:
blendcolor = V_GetColor(126);
break;
default:
blendcolor = V_GetColor(247);
break;
}
while (size--)
{
if (blendimage->s.alpha == 0)
{
// Don't bother with blending the pixel if the alpha of the blend pixel is 0
cur->rgba = image->rgba;
}
else
{
INT32 tempcolor;
INT16 tempmult, tempalpha;
tempalpha = -(abs(blendimage->s.red-127)-127)*2;
if (tempalpha > 255)
tempalpha = 255;
else if (tempalpha < 0)
tempalpha = 0;
tempmult = (blendimage->s.red-127)*2;
if (tempmult > 255)
tempmult = 255;
else if (tempmult < 0)
tempmult = 0;
tempcolor = (image->s.red*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.red)/255)) * blendimage->s.alpha)/255;
cur->s.red = (UINT8)tempcolor;
tempcolor = (image->s.green*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.green)/255)) * blendimage->s.alpha)/255;
cur->s.green = (UINT8)tempcolor;
tempcolor = (image->s.blue*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.blue)/255)) * blendimage->s.alpha)/255;
cur->s.blue = (UINT8)tempcolor;
cur->s.alpha = image->s.alpha;
}
cur++; image++; blendimage++;
}
return;
}
static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, const UINT8 *colormap, skincolors_t color)
{
// mostly copied from HWR_GetMappedPatch, hence the similarities and comment
GLMipmap_t *grmip, *newmip;
if (colormap == colormaps || colormap == NULL)
{
// Don't do any blending
HWD.pfnSetTexture(&gpatch->mipmap);
return;
}
// search for the mimmap
// skip the first (no colormap translated)
for (grmip = &gpatch->mipmap; grmip->nextcolormap; )
{
grmip = grmip->nextcolormap;
if (grmip->colormap == colormap)
{
if (grmip->downloaded && grmip->grInfo.data)
{
HWD.pfnSetTexture(grmip); // found the colormap, set it to the correct texture
Z_ChangeTag(grmip->grInfo.data, PU_HWRCACHE_UNLOCKED);
return;
}
}
}
// If here, the blended texture has not been created
// So we create it
//BP: WARNING: don't free it manually without clearing the cache of harware renderer
// (it have a liste of mipmap)
// this malloc is cleared in HWR_FreeTextureCache
// (...) unfortunately z_malloc fragment alot the memory :(so malloc is better
newmip = calloc(1, sizeof (*newmip));
if (newmip == NULL)
I_Error("%s: Out of memory", "HWR_GetMappedPatch");
grmip->nextcolormap = newmip;
newmip->colormap = colormap;
HWR_CreateBlendedTexture(gpatch, blendgpatch, newmip, color);
HWD.pfnSetTexture(newmip);
Z_ChangeTag(newmip->grInfo.data, PU_HWRCACHE_UNLOCKED);
}
// -----------------+
// HWR_DrawMD2 : Draw MD2

View file

@ -1157,14 +1157,11 @@ static int mapheaderinfo_get(lua_State *L)
{
mapheader_t *header = *((mapheader_t **)luaL_checkudata(L, 1, META_MAPHEADER));
const char *field = luaL_checkstring(L, 2);
//INT16 i;
if (fastcmp(field,"lvlttl")) {
//for (i = 0; i < 21; i++)
// if (!header->lvlttl[i])
// break;
lua_pushlstring(L, header->lvlttl, 21);
} else if (fastcmp(field,"subttl"))
lua_pushlstring(L, header->subttl, 32);
INT16 i;
if (fastcmp(field,"lvlttl"))
lua_pushstring(L, header->lvlttl);
else if (fastcmp(field,"subttl"))
lua_pushstring(L, header->subttl);
else if (fastcmp(field,"actnum"))
lua_pushinteger(L, header->actnum);
else if (fastcmp(field,"typeoflevel"))
@ -1176,7 +1173,7 @@ static int mapheaderinfo_get(lua_State *L)
else if (fastcmp(field,"musicslottrack"))
lua_pushinteger(L, header->musicslottrack);
else if (fastcmp(field,"forcecharacter"))
lua_pushlstring(L, header->forcecharacter, 16);
lua_pushstring(L, header->forcecharacter);
else if (fastcmp(field,"weather"))
lua_pushinteger(L, header->weather);
else if (fastcmp(field,"skynum"))
@ -1187,12 +1184,15 @@ static int mapheaderinfo_get(lua_State *L)
lua_pushinteger(L, header->skybox_scaley);
else if (fastcmp(field,"skybox_scalez"))
lua_pushinteger(L, header->skybox_scalez);
else if (fastcmp(field,"interscreen"))
lua_pushlstring(L, header->interscreen, 8);
else if (fastcmp(field,"runsoc"))
lua_pushlstring(L, header->runsoc, 32);
else if (fastcmp(field,"interscreen")) {
for (i = 0; i < 8; i++)
if (!header->interscreen[i])
break;
lua_pushlstring(L, header->interscreen, i);
} else if (fastcmp(field,"runsoc"))
lua_pushstring(L, header->runsoc);
else if (fastcmp(field,"scriptname"))
lua_pushlstring(L, header->scriptname, 32);
lua_pushstring(L, header->scriptname);
else if (fastcmp(field,"precutscenenum"))
lua_pushinteger(L, header->precutscenenum);
else if (fastcmp(field,"cutscenenum"))
@ -1217,11 +1217,11 @@ static int mapheaderinfo_get(lua_State *L)
else {
// Read custom vars now
// (note: don't include the "LUA." in your lua scripts!)
UINT8 i = 0;
for (;i < header->numCustomOptions && !fastcmp(field, header->customopts[i].option); ++i);
UINT8 j = 0;
for (;j < header->numCustomOptions && !fastcmp(field, header->customopts[j].option); ++j);
if(i < header->numCustomOptions)
lua_pushlstring(L, header->customopts[i].value, 255);
if(j < header->numCustomOptions)
lua_pushstring(L, header->customopts[j].value);
else
lua_pushnil(L);
}

View file

@ -77,7 +77,9 @@ static int lib_finecosine(lua_State *L)
static int lib_finetangent(lua_State *L)
{
lua_pushfixed(L, FINETANGENT((luaL_checkangle(L, 1)>>ANGLETOFINESHIFT) & FINEMASK));
// HACK: add ANGLE_90 to make tan() in Lua start at 0 like it should
// use & 4095 instead of & FINEMASK (8191), so it doesn't go out of the array's bounds
lua_pushfixed(L, FINETANGENT(((luaL_checkangle(L, 1)+ANGLE_90)>>ANGLETOFINESHIFT) & 4095));
return 1;
}
@ -164,7 +166,7 @@ static int lib_all7emeralds(lua_State *L)
// Returns both color and frame numbers!
static int lib_coloropposite(lua_State *L)
{
int colornum = ((int)luaL_checkinteger(L, 1)) & MAXSKINCOLORS;
int colornum = ((int)luaL_checkinteger(L, 1)) % MAXSKINCOLORS;
lua_pushinteger(L, Color_Opposite[colornum*2]); // push color
lua_pushinteger(L, Color_Opposite[colornum*2+1]); // push frame
return 2;

View file

@ -737,7 +737,7 @@ static int NetArchive(lua_State *L)
{
int TABLESINDEX = lua_upvalueindex(1);
int i, n = lua_gettop(L);
for (i = 0; i < n; i++)
for (i = 1; i <= n; i++)
ArchiveValue(TABLESINDEX, i);
return n;
}
@ -884,7 +884,7 @@ static int NetUnArchive(lua_State *L)
{
int TABLESINDEX = lua_upvalueindex(1);
int i, n = lua_gettop(L);
for (i = 0; i < n; i++)
for (i = 1; i <= n; i++)
UnArchiveValue(TABLESINDEX);
return n;
}

View file

@ -880,12 +880,33 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling)
static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean ceiling)
{
mapthing_t *mt;
mapthing_t *mt = mapthings;
#ifdef HAVE_BLUA
LUA_InvalidateMapthings();
#endif
mapthings = Z_Realloc(mapthings, ++nummapthings * sizeof (*mapthings), PU_LEVEL, NULL);
// as Z_Realloc can relocate mapthings, quickly go through thinker list and correct
// the spawnpoints of any objects that have them to the new location
if (mt != mapthings)
{
thinker_t *th;
mobj_t *mo;
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo = (mobj_t *)th;
// get offset from mt, which points to old mapthings, then add new location
if (mo->spawnpoint)
mo->spawnpoint = (mo->spawnpoint - mt) + mapthings;
}
}
mt = (mapthings+nummapthings-1);
mt->type = type;

View file

@ -2464,11 +2464,14 @@ void M_Drawer(void)
V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, customversionstring);
}
else
#if VERSION > 0 || SUBVERSION > 0
{
#ifdef DEVELOP // Development -- show revision / branch info
V_DrawThinString(vid.dupx, vid.height - 17*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, compbranch);
V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, comprevision);
#else // Regular build
V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING));
#else // Trunk build, show revision info
V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s (%s)", VERSIONSTRING, comprevision));
#endif
}
}
}

View file

@ -1800,16 +1800,14 @@ UINT8 M_HighestBit(UINT32 num)
const char *GetRevisionString(void)
{
INT32 vinfo;
static char rev[8] = {0};
static char rev[9] = {0};
if (rev[0])
return rev;
vinfo = atoi(&comprevision[1]);
if (vinfo)
snprintf(rev, 7, "r%d", vinfo);
if (comprevision[0] == 'r')
strncpy(rev, comprevision, 7);
else
strcpy(rev, "rNULL");
snprintf(rev, 7, "r%s", comprevision);
rev[7] = '\0';
return rev;

View file

@ -7597,48 +7597,35 @@ void A_SetTargetsTarget(mobj_t *actor)
{
INT32 locvar1 = var1;
INT32 locvar2 = var2;
mobj_t *targetedmobj = NULL;
thinker_t *th;
mobj_t *mo2;
mobj_t *oldtarg = NULL, *newtarg = NULL;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_SetTargetsTarget", actor))
return;
#endif
if ((!locvar1 && (!actor->target)) || (locvar1 && (!actor->tracer)))
// actor's target
if (locvar1) // or tracer
oldtarg = actor->tracer;
else
oldtarg = actor->target;
if (P_MobjWasRemoved(oldtarg))
return;
if ((!locvar1 && !locvar2 && (!actor->target->target))
|| (!locvar1 && locvar2 && (!actor->target->tracer))
|| (locvar1 && !locvar2 && (!actor->tracer->target))
|| (locvar1 && locvar2 && (!actor->tracer->tracer)))
return; // Don't search for nothing.
// scan the thinkers
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
if ((!locvar1 && !locvar2 && (mo2 == actor->target->target))
|| (!locvar1 && locvar2 && (mo2 == actor->target->tracer))
|| (locvar1 && !locvar2 && (mo2 == actor->tracer->target))
|| (locvar1 && locvar2 && (mo2 == actor->tracer->tracer)))
{
targetedmobj = mo2;
break;
}
}
if (!targetedmobj)
return; // Oops, nothing found..
if (!locvar1)
P_SetTarget(&actor->target, targetedmobj);
// actor's target's target!
if (locvar2) // or tracer
newtarg = oldtarg->tracer;
else
P_SetTarget(&actor->tracer, targetedmobj);
newtarg = oldtarg->target;
if (P_MobjWasRemoved(newtarg))
return;
// set actor's new target
if (locvar1) // or tracer
P_SetTarget(&actor->tracer, newtarg);
else
P_SetTarget(&actor->target, newtarg);
}
// Function: A_SetObjectFlags

View file

@ -1641,11 +1641,126 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour
CONS_Printf(str, targetname, deadtarget ? M_GetText("killed") : M_GetText("hit"));
}
/** Checks if the level timer is over the timelimit and the round should end,
* unless you are in overtime. In which case leveltime may stretch out beyond
* timelimitintics and overtime's status will be checked here each tick.
* Verify that the value of ::cv_timelimit is greater than zero before
* calling this function.
*
* \sa cv_timelimit, P_CheckPointLimit, P_UpdateSpecials
*/
void P_CheckTimeLimit(void)
{
INT32 i, k;
if (!cv_timelimit.value)
return;
if (!(multiplayer || netgame))
return;
if (G_PlatformGametype())
return;
if (leveltime < timelimitintics)
return;
if (gameaction == ga_completed)
return;
//Tagmode round end but only on the tic before the
//XD_EXITLEVEL packet is recieved by all players.
if (G_TagGametype())
{
if (leveltime == (timelimitintics + 1))
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator
|| (players[i].pflags & PF_TAGGED) || (players[i].pflags & PF_TAGIT))
continue;
CONS_Printf(M_GetText("%s recieved double points for surviving the round.\n"), player_names[i]);
P_AddPlayerScore(&players[i], players[i].score);
}
}
if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
}
//Optional tie-breaker for Match/CTF
else if (cv_overtime.value)
{
INT32 playerarray[MAXPLAYERS];
INT32 tempplayer = 0;
INT32 spectators = 0;
INT32 playercount = 0;
//Figure out if we have enough participating players to care.
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && players[i].spectator)
spectators++;
}
if ((D_NumPlayers() - spectators) > 1)
{
// Play the starpost sfx after the first second of overtime.
if (gamestate == GS_LEVEL && (leveltime == (timelimitintics + TICRATE)))
S_StartSound(NULL, sfx_strpst);
// Normal Match
if (!G_GametypeHasTeams())
{
//Store the nodes of participating players in an array.
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !players[i].spectator)
{
playerarray[playercount] = i;
playercount++;
}
}
//Sort 'em.
for (i = 1; i < playercount; i++)
{
for (k = i; k < playercount; k++)
{
if (players[playerarray[i-1]].score < players[playerarray[k]].score)
{
tempplayer = playerarray[i-1];
playerarray[i-1] = playerarray[k];
playerarray[k] = tempplayer;
}
}
}
//End the round if the top players aren't tied.
if (players[playerarray[0]].score == players[playerarray[1]].score)
return;
}
else
{
//In team match and CTF, determining a tie is much simpler. =P
if (redscore == bluescore)
return;
}
}
if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
}
if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
}
/** Checks if a player's score is over the pointlimit and the round should end.
* Verify that the value of ::cv_pointlimit is greater than zero before
* calling this function.
*
* \sa cv_pointlimit, P_UpdateSpecials
* \sa cv_pointlimit, P_CheckTimeLimit, P_UpdateSpecials
*/
void P_CheckPointLimit(void)
{

View file

@ -380,6 +380,7 @@ void P_PlayerEmeraldBurst(player_t *player, boolean toss);
void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck);
void P_PlayerFlagBurst(player_t *player, boolean toss);
void P_CheckTimeLimit(void);
void P_CheckPointLimit(void);
void P_CheckSurvivors(void);
boolean P_CheckRacers(void);

View file

@ -5761,8 +5761,6 @@ static void P_NightsItemChase(mobj_t *thing)
static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield)
{
fixed_t destx, desty;
if (!thing->target || thing->target->health <= 0 || !thing->target->player
|| (thing->target->player->powers[pw_shield] & SH_NOSTACK) == SH_NONE || thing->target->player->powers[pw_super]
|| thing->target->player->powers[pw_invulnerability] > 1)
@ -5787,26 +5785,6 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield)
return false;
}
if (!splitscreen && rendermode != render_soft)
{
angle_t viewingangle;
if (players[displayplayer].awayviewtics)
viewingangle = R_PointToAngle2(thing->target->x, thing->target->y, players[displayplayer].awayviewmobj->x, players[displayplayer].awayviewmobj->y);
else if (!camera.chase && players[displayplayer].mo)
viewingangle = R_PointToAngle2(thing->target->x, thing->target->y, players[displayplayer].mo->x, players[displayplayer].mo->y);
else
viewingangle = R_PointToAngle2(thing->target->x, thing->target->y, camera.x, camera.y);
destx = thing->target->x + P_ReturnThrustX(thing->target, viewingangle, FixedMul(FRACUNIT, thing->scale));
desty = thing->target->y + P_ReturnThrustY(thing->target, viewingangle, FixedMul(FRACUNIT, thing->scale));
}
else
{
destx = thing->target->x;
desty = thing->target->y;
}
if (shield == SH_FORCE && thing->movecount != (thing->target->player->powers[pw_shield] & 0xFF))
{
thing->movecount = (thing->target->player->powers[pw_shield] & 0xFF);
@ -5831,8 +5809,8 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield)
P_SetScale(thing, thing->target->scale);
P_UnsetThingPosition(thing);
thing->x = destx;
thing->y = desty;
thing->x = thing->target->x;
thing->y = thing->target->y;
if (thing->eflags & MFE_VERTICALFLIP)
thing->z = thing->target->z + thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT) - FixedMul(2*FRACUNIT, thing->target->scale);
else
@ -9718,7 +9696,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
// Diagonal rings (handles both types)
else if (mthing->type == 602 || mthing->type == 603) // Diagonal rings (5)
{
angle_t angle = ANGLE_45 * (mthing->angle/45);
angle_t angle = FixedAngle(mthing->angle*FRACUNIT);
mobjtype_t ringthing = MT_RING;
INT32 iterations = 5;
if (mthing->type == 603)

View file

@ -427,6 +427,8 @@ newseg:
// seg's ending vertex.
for (i = 0; i < numsegs; ++i)
{
if (segs[i].side != 0) // needs to be frontfacing
continue;
if (segs[i].v1->x == seg->v2->x && segs[i].v1->y == seg->v2->y)
{
// Make sure you didn't already add this seg...
@ -593,6 +595,9 @@ static void Polyobj_spawnPolyObj(INT32 num, mobj_t *spawnSpot, INT32 id)
seg_t *seg = &segs[i];
INT32 polyID, parentID;
if (seg->side != 0) // needs to be frontfacing
continue;
if (seg->linedef->special != POLYOBJ_START_LINE)
continue;

View file

@ -636,7 +636,7 @@ static void P_NetArchiveWorld(void)
if (li->special != SHORT(mld->special))
diff |= LD_SPECIAL;
if (mld->special == 321 || mld->special == 322) // only reason li->callcount would be non-zero is if either of these are involved
if (SHORT(mld->special) == 321 || SHORT(mld->special) == 322) // only reason li->callcount would be non-zero is if either of these are involved
diff |= LD_CLLCOUNT;
if (li->sidenum[0] != 0xffff)

View file

@ -46,14 +46,14 @@ static pslope_t *slopelist = NULL;
static UINT16 slopecount = 0;
// Calculate line normal
void P_CalculateSlopeNormal(pslope_t *slope) {
static void P_CalculateSlopeNormal(pslope_t *slope) {
slope->normal.z = FINECOSINE(slope->zangle>>ANGLETOFINESHIFT);
slope->normal.x = -FixedMul(FINESINE(slope->zangle>>ANGLETOFINESHIFT), slope->d.x);
slope->normal.y = -FixedMul(FINESINE(slope->zangle>>ANGLETOFINESHIFT), slope->d.y);
}
// With a vertex slope that has its vertices set, configure relevant slope info
void P_ReconfigureVertexSlope(pslope_t *slope)
static void P_ReconfigureVertexSlope(pslope_t *slope)
{
vector3_t vec1, vec2;
@ -543,7 +543,7 @@ void P_SpawnSlope_Line(int linenum)
//
// Creates a new slope from three vertices with the specified IDs
//
pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flags)
static pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flags)
{
size_t i;
mapthing_t *mt = mapthings;

View file

@ -4648,114 +4648,19 @@ void P_PlayerInSpecialSector(player_t *player)
/** Animate planes, scroll walls, etc. and keeps track of level timelimit and exits if time is up.
*
* \sa cv_timelimit, P_CheckPointLimit
* \sa P_CheckTimeLimit, P_CheckPointLimit
*/
void P_UpdateSpecials(void)
{
anim_t *anim;
INT32 i, k;
INT32 i;
INT32 pic;
size_t j;
levelflat_t *foundflats; // for flat animation
// LEVEL TIMER
// Exit if the timer is equal to or greater the timelimit, unless you are
// in overtime. In which case leveltime may stretch out beyond timelimitintics
// and overtime's status will be checked here each tick.
if (cv_timelimit.value && timelimitintics <= leveltime && (multiplayer || netgame)
&& G_RingSlingerGametype() && (gameaction != ga_completed))
{
boolean pexit = false;
//Tagmode round end but only on the tic before the
//XD_EXITLEVEL packet is recieved by all players.
if (G_TagGametype())
{
if (leveltime == (timelimitintics + 1))
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator
|| (players[i].pflags & PF_TAGGED) || (players[i].pflags & PF_TAGIT))
continue;
CONS_Printf(M_GetText("%s recieved double points for surviving the round.\n"), player_names[i]);
P_AddPlayerScore(&players[i], players[i].score);
}
}
pexit = true;
}
//Optional tie-breaker for Match/CTF
else if (G_RingSlingerGametype() && cv_overtime.value)
{
INT32 playerarray[MAXPLAYERS];
INT32 tempplayer = 0;
INT32 spectators = 0;
INT32 playercount = 0;
//Figure out if we have enough participating players to care.
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && players[i].spectator)
spectators++;
}
if ((D_NumPlayers() - spectators) > 1)
{
// Play the starpost sfx after the first second of overtime.
if (gamestate == GS_LEVEL && (leveltime == (timelimitintics + TICRATE)))
S_StartSound(NULL, sfx_strpst);
// Normal Match
if (!G_GametypeHasTeams())
{
//Store the nodes of participating players in an array.
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !players[i].spectator)
{
playerarray[playercount] = i;
playercount++;
}
}
//Sort 'em.
for (i = 1; i < playercount; i++)
{
for (k = i; k < playercount; k++)
{
if (players[playerarray[i-1]].score < players[playerarray[k]].score)
{
tempplayer = playerarray[i-1];
playerarray[i-1] = playerarray[k];
playerarray[k] = tempplayer;
}
}
}
//End the round if the top players aren't tied.
if (!(players[playerarray[0]].score == players[playerarray[1]].score))
pexit = true;
}
else
{
//In team match and CTF, determining a tie is much simpler. =P
if (!(redscore == bluescore))
pexit = true;
}
}
else
pexit = true;
}
else
pexit = true;
if (server && pexit)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
}
P_CheckTimeLimit();
// POINT LIMIT
P_CheckPointLimit();
@ -4766,11 +4671,11 @@ void P_UpdateSpecials(void)
// ANIMATE TEXTURES
for (anim = anims; anim < lastanim; anim++)
{
for (i = anim->basepic; i < anim->basepic + anim->numpics; i++)
for (i = 0; i < anim->numpics; i++)
{
pic = anim->basepic + ((leveltime/anim->speed + i) % anim->numpics);
if (anim->istexture)
texturetranslation[i] = pic;
texturetranslation[anim->basepic+i] = pic;
}
}

View file

@ -2117,30 +2117,7 @@ static void P_CheckInvincibilityTimer(player_t *player)
player->mo->color = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
else if (leveltime % (TICRATE/7) == 0)
{
fixed_t destx, desty;
mobj_t *sparkle;
if (!splitscreen && rendermode != render_soft)
{
angle_t viewingangle;
if (players[displayplayer].awayviewtics)
viewingangle = R_PointToAngle2(player->mo->x, player->mo->y, players[displayplayer].awayviewmobj->x, players[displayplayer].awayviewmobj->y);
else if (!camera.chase && players[displayplayer].mo)
viewingangle = R_PointToAngle2(player->mo->x, player->mo->y, players[displayplayer].mo->x, players[displayplayer].mo->y);
else
viewingangle = R_PointToAngle2(player->mo->x, player->mo->y, camera.x, camera.y);
destx = player->mo->x + P_ReturnThrustX(player->mo, viewingangle, FixedMul(FRACUNIT, player->mo->scale));
desty = player->mo->y + P_ReturnThrustY(player->mo, viewingangle, FixedMul(FRACUNIT, player->mo->scale));
}
else
{
destx = player->mo->x;
desty = player->mo->y;
}
sparkle = P_SpawnMobj(destx, desty, player->mo->z, MT_IVSP);
mobj_t *sparkle = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_IVSP);
sparkle->destscale = player->mo->scale;
P_SetScale(sparkle, player->mo->scale);
}

View file

@ -934,14 +934,14 @@ static void R_Subsector(size_t num)
ffloor[numffloors].plane = NULL;
ffloor[numffloors].polyobj = NULL;
floorcenterz =
floorcenterz =
#ifdef ESLOPE
frontsector->f_slope ? P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
#endif
frontsector->floorheight;
ceilingcenterz =
ceilingcenterz =
#ifdef ESLOPE
frontsector->c_slope ? P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
#endif
@ -952,8 +952,8 @@ static void R_Subsector(size_t num)
*rover->b_slope ? P_GetZAt(*rover->b_slope, viewx, viewy) :
#endif
*rover->bottomheight;
planecenterz =
planecenterz =
#ifdef ESLOPE
*rover->b_slope ? P_GetZAt(*rover->b_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
#endif
@ -965,7 +965,7 @@ static void R_Subsector(size_t num)
{
light = R_GetPlaneLight(frontsector, planecenterz,
viewz < *rover->bottomheight);
ffloor[numffloors].plane = R_FindPlane(*rover->bottomheight, *rover->bottompic,
*frontsector->lightlist[light].lightlevel, *rover->bottomxoffs,
*rover->bottomyoffs, *rover->bottomangle, frontsector->lightlist[light].extra_colormap, rover
@ -1001,8 +1001,8 @@ static void R_Subsector(size_t num)
*rover->t_slope ? P_GetZAt(*rover->t_slope, viewx, viewy) :
#endif
*rover->topheight;
planecenterz =
planecenterz =
#ifdef ESLOPE
*rover->t_slope ? P_GetZAt(*rover->t_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
#endif
@ -1013,7 +1013,7 @@ static void R_Subsector(size_t num)
|| (viewz < heightcheck && (rover->flags & FF_BOTHPLANES))))
{
light = R_GetPlaneLight(frontsector, planecenterz, viewz < *rover->topheight);
ffloor[numffloors].plane = R_FindPlane(*rover->topheight, *rover->toppic,
*frontsector->lightlist[light].lightlevel, *rover->topxoffs, *rover->topyoffs, *rover->topangle,
frontsector->lightlist[light].extra_colormap, rover

View file

@ -114,15 +114,6 @@ INT32 viewangletox[FINEANGLES/2];
// from clipangle to -clipangle.
angle_t xtoviewangle[MAXVIDWIDTH+1];
// UNUSED.
// The finetangentgent[angle+FINEANGLES/4] table
// holds the fixed_t tangent values for view angles,
// ranging from INT32_MIN to 0 to INT32_MAX.
#if !(defined _NDS) || !(defined NONET)
fixed_t *finecosine = &finesine[FINEANGLES/4];
#endif
lighttable_t *scalelight[LIGHTLEVELS][MAXLIGHTSCALE];
lighttable_t *scalelightfixed[MAXLIGHTSCALE];
lighttable_t *zlight[LIGHTLEVELS][MAXLIGHTZ];

View file

@ -750,31 +750,15 @@ void R_DrawSinglePlane(visplane_t *pl)
// Hacked up support for alpha value in software mode Tails 09-24-2002 (sidenote: ported to polys 10-15-2014, there was no time travel involved -Red)
if (pl->polyobj->translucency >= 10)
return; // Don't even draw it
else if (pl->polyobj->translucency == 9)
ds_transmap = ((tr_trans90)<<FF_TRANSSHIFT) - 0x10000 + transtables;
else if (pl->polyobj->translucency == 8)
ds_transmap = ((tr_trans80)<<FF_TRANSSHIFT) - 0x10000 + transtables;
else if (pl->polyobj->translucency == 7)
ds_transmap = ((tr_trans70)<<FF_TRANSSHIFT) - 0x10000 + transtables;
else if (pl->polyobj->translucency == 6)
ds_transmap = ((tr_trans60)<<FF_TRANSSHIFT) - 0x10000 + transtables;
else if (pl->polyobj->translucency == 5)
ds_transmap = ((tr_trans50)<<FF_TRANSSHIFT) - 0x10000 + transtables;
else if (pl->polyobj->translucency == 4)
ds_transmap = ((tr_trans40)<<FF_TRANSSHIFT) - 0x10000 + transtables;
else if (pl->polyobj->translucency == 3)
ds_transmap = ((tr_trans30)<<FF_TRANSSHIFT) - 0x10000 + transtables;
else if (pl->polyobj->translucency == 2)
ds_transmap = ((tr_trans20)<<FF_TRANSSHIFT) - 0x10000 + transtables;
else if (pl->polyobj->translucency == 1)
ds_transmap = ((tr_trans10)<<FF_TRANSSHIFT) - 0x10000 + transtables;
else if (pl->polyobj->translucency > 0)
ds_transmap = transtables + ((pl->polyobj->translucency-1)<<FF_TRANSSHIFT);
else // Opaque, but allow transparent flat pixels
spanfunc = splatfunc;
if (pl->extra_colormap && pl->extra_colormap->fog)
light = (pl->lightlevel >> LIGHTSEGSHIFT);
else
light = LIGHTLEVELS-1;
light = LIGHTLEVELS-1;
} else
#endif
@ -805,23 +789,23 @@ void R_DrawSinglePlane(visplane_t *pl)
if (pl->ffloor->alpha < 12)
return; // Don't even draw it
else if (pl->ffloor->alpha < 38)
ds_transmap = ((tr_trans90)<<FF_TRANSSHIFT) - 0x10000 + transtables;
ds_transmap = transtables + ((tr_trans90-1)<<FF_TRANSSHIFT);
else if (pl->ffloor->alpha < 64)
ds_transmap = ((tr_trans80)<<FF_TRANSSHIFT) - 0x10000 + transtables;
ds_transmap = transtables + ((tr_trans80-1)<<FF_TRANSSHIFT);
else if (pl->ffloor->alpha < 89)
ds_transmap = ((tr_trans70)<<FF_TRANSSHIFT) - 0x10000 + transtables;
ds_transmap = transtables + ((tr_trans70-1)<<FF_TRANSSHIFT);
else if (pl->ffloor->alpha < 115)
ds_transmap = ((tr_trans60)<<FF_TRANSSHIFT) - 0x10000 + transtables;
ds_transmap = transtables + ((tr_trans60-1)<<FF_TRANSSHIFT);
else if (pl->ffloor->alpha < 140)
ds_transmap = ((tr_trans50)<<FF_TRANSSHIFT) - 0x10000 + transtables;
ds_transmap = transtables + ((tr_trans50-1)<<FF_TRANSSHIFT);
else if (pl->ffloor->alpha < 166)
ds_transmap = ((tr_trans40)<<FF_TRANSSHIFT) - 0x10000 + transtables;
ds_transmap = transtables + ((tr_trans40-1)<<FF_TRANSSHIFT);
else if (pl->ffloor->alpha < 192)
ds_transmap = ((tr_trans30)<<FF_TRANSSHIFT) - 0x10000 + transtables;
ds_transmap = transtables + ((tr_trans30-1)<<FF_TRANSSHIFT);
else if (pl->ffloor->alpha < 217)
ds_transmap = ((tr_trans20)<<FF_TRANSSHIFT) - 0x10000 + transtables;
ds_transmap = transtables + ((tr_trans20-1)<<FF_TRANSSHIFT);
else if (pl->ffloor->alpha < 243)
ds_transmap = ((tr_trans10)<<FF_TRANSSHIFT) - 0x10000 + transtables;
ds_transmap = transtables + ((tr_trans10-1)<<FF_TRANSSHIFT);
else // Opaque, but allow transparent flat pixels
spanfunc = splatfunc;
@ -1082,7 +1066,7 @@ using the palette colors.
if (spanfunc == R_DrawSpan_8)
{
INT32 i;
ds_transmap = ((tr_trans50)<<FF_TRANSSHIFT) - 0x10000 + transtables;
ds_transmap = transtables + ((tr_trans50-1)<<FF_TRANSSHIFT);
spanfunc = R_DrawTranslucentSpan_8;
for (i=0; i<4; i++)
{

View file

@ -183,7 +183,7 @@ static void R_DrawWallSplats(void)
colfunc = basecolfunc;
else
{
dc_transmap = ((tr_trans50 - 1)<<FF_TRANSSHIFT) + transtables;
dc_transmap = transtables + ((tr_trans50 - 1)<<FF_TRANSSHIFT);
colfunc = fuzzcolfunc;
}
@ -304,39 +304,15 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
switch (ldef->special)
{
case 900:
dc_transmap = ((tr_trans10)<<FF_TRANSSHIFT) - 0x10000 + transtables;
colfunc = fuzzcolfunc;
break;
case 901:
dc_transmap = ((tr_trans20)<<FF_TRANSSHIFT) - 0x10000 + transtables;
colfunc = fuzzcolfunc;
break;
case 902:
dc_transmap = ((tr_trans30)<<FF_TRANSSHIFT) - 0x10000 + transtables;
colfunc = fuzzcolfunc;
break;
case 903:
dc_transmap = ((tr_trans40)<<FF_TRANSSHIFT) - 0x10000 + transtables;
colfunc = fuzzcolfunc;
break;
case 904:
dc_transmap = ((tr_trans50)<<FF_TRANSSHIFT) - 0x10000 + transtables;
colfunc = fuzzcolfunc;
break;
case 905:
dc_transmap = ((tr_trans60)<<FF_TRANSSHIFT) - 0x10000 + transtables;
colfunc = fuzzcolfunc;
break;
case 906:
dc_transmap = ((tr_trans70)<<FF_TRANSSHIFT) - 0x10000 + transtables;
colfunc = fuzzcolfunc;
break;
case 907:
dc_transmap = ((tr_trans80)<<FF_TRANSSHIFT) - 0x10000 + transtables;
colfunc = fuzzcolfunc;
break;
case 908:
dc_transmap = ((tr_trans90)<<FF_TRANSSHIFT) - 0x10000 + transtables;
dc_transmap = transtables + ((ldef->special-900)<<FF_TRANSSHIFT);
colfunc = fuzzcolfunc;
break;
case 909:
@ -354,7 +330,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
if (curline->polyseg->translucency >= NUMTRANSMAPS)
return;
dc_transmap = ((curline->polyseg->translucency)<<FF_TRANSSHIFT) - 0x10000 + transtables;
dc_transmap = transtables + ((curline->polyseg->translucency-1)<<FF_TRANSSHIFT);
colfunc = fuzzcolfunc;
}
@ -733,23 +709,23 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
if (pfloor->alpha < 12)
return; // Don't even draw it
else if (pfloor->alpha < 38)
dc_transmap = ((tr_trans90)<<FF_TRANSSHIFT) - 0x10000 + transtables;
dc_transmap = transtables + ((tr_trans90-1)<<FF_TRANSSHIFT);
else if (pfloor->alpha < 64)
dc_transmap = ((tr_trans80)<<FF_TRANSSHIFT) - 0x10000 + transtables;
dc_transmap = transtables + ((tr_trans80-1)<<FF_TRANSSHIFT);
else if (pfloor->alpha < 89)
dc_transmap = ((tr_trans70)<<FF_TRANSSHIFT) - 0x10000 + transtables;
dc_transmap = transtables + ((tr_trans70-1)<<FF_TRANSSHIFT);
else if (pfloor->alpha < 115)
dc_transmap = ((tr_trans60)<<FF_TRANSSHIFT) - 0x10000 + transtables;
dc_transmap = transtables + ((tr_trans60-1)<<FF_TRANSSHIFT);
else if (pfloor->alpha < 140)
dc_transmap = ((tr_trans50)<<FF_TRANSSHIFT) - 0x10000 + transtables;
dc_transmap = transtables + ((tr_trans50-1)<<FF_TRANSSHIFT);
else if (pfloor->alpha < 166)
dc_transmap = ((tr_trans40)<<FF_TRANSSHIFT) - 0x10000 + transtables;
dc_transmap = transtables + ((tr_trans40-1)<<FF_TRANSSHIFT);
else if (pfloor->alpha < 192)
dc_transmap = ((tr_trans30)<<FF_TRANSSHIFT) - 0x10000 + transtables;
dc_transmap = transtables + ((tr_trans30-1)<<FF_TRANSSHIFT);
else if (pfloor->alpha < 217)
dc_transmap = ((tr_trans20)<<FF_TRANSSHIFT) - 0x10000 + transtables;
dc_transmap = transtables + ((tr_trans20-1)<<FF_TRANSSHIFT);
else if (pfloor->alpha < 243)
dc_transmap = ((tr_trans10)<<FF_TRANSSHIFT) - 0x10000 + transtables;
dc_transmap = transtables + ((tr_trans10-1)<<FF_TRANSSHIFT);
else
fuzzy = false; // Opaque

View file

@ -503,7 +503,7 @@ static void R_RenderFloorSplat(floorsplat_t *pSplat, vertex_t *verts, UINT8 *pTe
{
ds_x1 = x1;
ds_x2 = x2;
ds_transmap = ((tr_trans50)<<FF_TRANSSHIFT) - 0x10000 + transtables;
ds_transmap = transtables + ((tr_trans50-1)<<FF_TRANSSHIFT);
splatfunc();
}

View file

@ -1257,7 +1257,8 @@ static void R_ProjectSprite(mobj_t *thing)
vis = R_NewVisSprite();
vis->heightsec = heightsec; //SoM: 3/17/2000
vis->mobjflags = thing->flags;
vis->scale = yscale + thing->info->dispoffset; //<<detailshift;
vis->scale = yscale; //<<detailshift;
vis->dispoffset = thing->info->dispoffset; // Monster Iestyn: 23/11/15
vis->gx = thing->x;
vis->gy = thing->y;
vis->gz = gz;
@ -1320,9 +1321,9 @@ static void R_ProjectSprite(mobj_t *thing)
if (!cv_translucency.value)
; // no translucency
else if (thing->flags2 & MF2_SHADOW) // actually only the player should use this (temporary invisibility)
vis->transmap = ((tr_trans80-1)<<FF_TRANSSHIFT) + transtables; // because now the translucency is set through FF_TRANSMASK
vis->transmap = transtables + ((tr_trans80-1)<<FF_TRANSSHIFT); // because now the translucency is set through FF_TRANSMASK
else if (thing->frame & FF_TRANSMASK)
vis->transmap = (thing->frame & FF_TRANSMASK) - 0x10000 + transtables;
vis->transmap = transtables + (thing->frame & FF_TRANSMASK) - 0x10000;
if (((thing->frame & FF_FULLBRIGHT) || (thing->flags2 & MF2_SHADOW))
&& (!vis->extra_colormap || !vis->extra_colormap->fog))
@ -1473,6 +1474,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
// store information in a vissprite
vis = R_NewVisSprite();
vis->scale = yscale; //<<detailshift;
vis->dispoffset = 0; // Monster Iestyn: 23/11/15
vis->gx = thing->x;
vis->gy = thing->y;
vis->gz = gz;
@ -1624,6 +1626,7 @@ void R_SortVisSprites(void)
vissprite_t *best = NULL;
vissprite_t unsorted;
fixed_t bestscale;
INT32 bestdispoffset;
if (!visspritecount)
return;
@ -1654,12 +1657,19 @@ void R_SortVisSprites(void)
vsprsortedhead.next = vsprsortedhead.prev = &vsprsortedhead;
for (i = 0; i < visspritecount; i++)
{
bestscale = INT32_MAX;
bestscale = bestdispoffset = INT32_MAX;
for (ds = unsorted.next; ds != &unsorted; ds = ds->next)
{
if (ds->scale < bestscale)
{
bestscale = ds->scale;
bestdispoffset = ds->dispoffset;
best = ds;
}
// order visprites of same scale by dispoffset, smallest first
else if (ds->scale == bestscale && ds->dispoffset < bestdispoffset)
{
bestdispoffset = ds->dispoffset;
best = ds;
}
}
@ -1911,7 +1921,8 @@ static void R_CreateDrawNodes(void)
if (r2->sprite->szt > rover->sz || r2->sprite->sz < rover->szt)
continue;
if (r2->sprite->scale > rover->scale)
if (r2->sprite->scale > rover->scale
|| (r2->sprite->scale == rover->scale && r2->sprite->dispoffset > rover->dispoffset))
{
entry = R_CreateDrawNode(NULL);
(entry->prev = r2->prev)->next = entry;

View file

@ -162,6 +162,7 @@ typedef struct vissprite_s
boolean precip;
boolean vflip; // Flip vertically
boolean isScaled;
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
} vissprite_t;
// A drawnode is something that points to a 3D floor, 3D side, or masked

View file

@ -1842,37 +1842,6 @@ static void ST_overlayDrawer(void)
LUAh_GameHUD(stplyr);
#endif
#if 0 // Pope XVI
if (!(netgame || multiplayer) && !modifiedgame && gamemap == 11 && ALL7EMERALDS(emeralds)
&& stplyr->mo && stplyr->mo->subsector && stplyr->mo->subsector->sector-sectors == 1361)
{
if (grade & 2048) // NAGZ
{
V_DrawCenteredString(BASEVIDWIDTH/2, 70, 0, M_GetText("I, Pope Rededict XVI proclaim"));
V_DrawCenteredString(BASEVIDWIDTH/2, 80, 0, M_GetText("AJ & Amy"));
V_DrawCenteredString(BASEVIDWIDTH/2, 90, 0, M_GetText("Husband & Wife"));
V_DrawCenteredString(BASEVIDWIDTH/2, 100, 0, M_GetText("on this day"));
V_DrawCenteredString(BASEVIDWIDTH/2, 110, 0, M_GetText("May 16, 2009"));
P_GivePlayerRings(stplyr, 9999);
}
else
{
V_DrawCenteredString(BASEVIDWIDTH/2, 60, 0, M_GetText("Oh... it's you again..."));
V_DrawCenteredString(BASEVIDWIDTH/2, 80, 0, M_GetText("Look, I wanted to apologize for the way"));
V_DrawCenteredString(BASEVIDWIDTH/2, 90, 0, M_GetText("I've acted in the past."));
V_DrawCenteredString(BASEVIDWIDTH/2, 110, 0, M_GetText("I've seen the error of my ways"));
V_DrawCenteredString(BASEVIDWIDTH/2, 120, 0, M_GetText("and turned over a new leaf."));
V_DrawCenteredString(BASEVIDWIDTH/2, 140, 0, M_GetText("Instead of sending people to hell,"));
V_DrawCenteredString(BASEVIDWIDTH/2, 150, 0, M_GetText("I now send them to heaven!"));
P_LinedefExecute(4200, stplyr->mo, stplyr->mo->subsector->sector);
P_LinedefExecute(4201, stplyr->mo, stplyr->mo->subsector->sector);
stplyr->mo->momx = stplyr->mo->momy = 0;
}
}
#endif
// draw level title Tails
if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))
#ifdef HAVE_BLUA

File diff suppressed because it is too large Load diff

View file

@ -366,7 +366,7 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
}
if (alphalevel)
{
v_translevel = ((alphalevel)<<FF_TRANSSHIFT) - 0x10000 + transtables;
v_translevel = transtables + ((alphalevel-1)<<FF_TRANSSHIFT);
patchdrawfunc = translucentpdraw;
}
@ -1869,7 +1869,7 @@ void V_DoPostProcessor(INT32 view, postimg_t type, INT32 param)
angle_t disStart = (leveltime * 128) & FINEMASK; // in 0 to FINEANGLE
INT32 newpix;
INT32 sine;
//UINT8 *transme = ((tr_trans50)<<FF_TRANSSHIFT) + transtables;
//UINT8 *transme = transtables + ((tr_trans50-1)<<FF_TRANSSHIFT);
for (y = yoffset; y < yoffset+height; y++)
{
@ -1926,7 +1926,7 @@ Unoptimized version
INT32 x, y;
// TODO: Add a postimg_param so that we can pick the translucency level...
UINT8 *transme = ((param)<<FF_TRANSSHIFT) - 0x10000 + transtables;
UINT8 *transme = transtables + ((param-1)<<FF_TRANSSHIFT);
for (y = yoffset; y < yoffset+height; y++)
{