mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-13 05:11:01 +00:00
Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2.git into sonicitems
# Conflicts: # src/f_finale.c # src/hardware/hw_md2.c
This commit is contained in:
commit
c52a4de933
11 changed files with 115 additions and 67 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
# GNU Make makefile for SRB2
|
# GNU Make makefile for SRB2
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# Copyright (C) 1998-2000 by DooM Legacy Team.
|
# Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||||
|
@ -426,7 +427,8 @@ endif
|
||||||
|
|
||||||
ifdef PROFILEMODE
|
ifdef PROFILEMODE
|
||||||
# build with profiling information
|
# build with profiling information
|
||||||
CFLAGS:=-pg $(CFLAGS)
|
CFLAGS+=-pg
|
||||||
|
LDFLAGS+=-pg
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef ZDEBUG
|
ifdef ZDEBUG
|
||||||
|
|
|
@ -443,8 +443,7 @@ static void ExtraDataTicker(void)
|
||||||
DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic));
|
DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic));
|
||||||
}
|
}
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]);
|
CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]);
|
||||||
D_FreeTextcmd(gametic);
|
break;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3428,7 +3427,7 @@ void SV_StopServer(void)
|
||||||
localtextcmd3[0] = 0;
|
localtextcmd3[0] = 0;
|
||||||
localtextcmd4[0] = 0;
|
localtextcmd4[0] = 0;
|
||||||
|
|
||||||
for (i = 0; i < BACKUPTICS; i++)
|
for (i = firstticstosend; i < firstticstosend + BACKUPTICS; i++)
|
||||||
D_Clearticcmd(i);
|
D_Clearticcmd(i);
|
||||||
|
|
||||||
consoleplayer = 0;
|
consoleplayer = 0;
|
||||||
|
|
|
@ -1170,15 +1170,6 @@ void D_SRB2Main(void)
|
||||||
|
|
||||||
if (M_CheckParm("-password") && M_IsNextParm())
|
if (M_CheckParm("-password") && M_IsNextParm())
|
||||||
D_SetPassword(M_GetNextParm());
|
D_SetPassword(M_GetNextParm());
|
||||||
else
|
|
||||||
{
|
|
||||||
size_t z;
|
|
||||||
char junkpw[25];
|
|
||||||
for (z = 0; z < 24; z++)
|
|
||||||
junkpw[z] = (char)(rand() & 64)+32;
|
|
||||||
junkpw[24] = '\0';
|
|
||||||
D_SetPassword(junkpw);
|
|
||||||
}
|
|
||||||
|
|
||||||
// add any files specified on the command line with -file wadfile
|
// add any files specified on the command line with -file wadfile
|
||||||
// to the wad list
|
// to the wad list
|
||||||
|
|
|
@ -3282,10 +3282,12 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt,
|
||||||
|
|
||||||
#define BASESALT "basepasswordstorage"
|
#define BASESALT "basepasswordstorage"
|
||||||
static UINT8 adminpassmd5[16];
|
static UINT8 adminpassmd5[16];
|
||||||
|
static boolean adminpasswordset = false;
|
||||||
|
|
||||||
void D_SetPassword(const char *pw)
|
void D_SetPassword(const char *pw)
|
||||||
{
|
{
|
||||||
D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &adminpassmd5);
|
D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &adminpassmd5);
|
||||||
|
adminpasswordset = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remote Administration
|
// Remote Administration
|
||||||
|
@ -3357,6 +3359,12 @@ static void Got_Login(UINT8 **cp, INT32 playernum)
|
||||||
if (client)
|
if (client)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!adminpasswordset)
|
||||||
|
{
|
||||||
|
CONS_Printf(M_GetText("Password from %s failed (no password set).\n"), player_names[playernum]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Do the final pass to compare with the sent md5
|
// Do the final pass to compare with the sent md5
|
||||||
D_MD5PasswordPass(adminpassmd5, 16, va("PNUM%02d", playernum), &finalmd5);
|
D_MD5PasswordPass(adminpassmd5, 16, va("PNUM%02d", playernum), &finalmd5);
|
||||||
|
|
||||||
|
|
|
@ -2186,27 +2186,34 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
||||||
}
|
}
|
||||||
else if (drawtextured)
|
else if (drawtextured)
|
||||||
{
|
{
|
||||||
#ifdef ESLOPE // P.S. this is better-organized than the old version
|
fixed_t texturevpeg;
|
||||||
fixed_t offs = sides[(newline ? newline : rover->master)->sidenum[0]].rowoffset;
|
|
||||||
grTex = HWR_GetTexture(texnum);
|
|
||||||
|
|
||||||
wallVerts[3].t = (*rover->topheight - h + offs) * grTex->scaleY;
|
|
||||||
wallVerts[2].t = (*rover->topheight - hS + offs) * grTex->scaleY;
|
|
||||||
wallVerts[0].t = (*rover->topheight - l + offs) * grTex->scaleY;
|
|
||||||
wallVerts[1].t = (*rover->topheight - lS + offs) * grTex->scaleY;
|
|
||||||
#else
|
|
||||||
grTex = HWR_GetTexture(texnum);
|
|
||||||
|
|
||||||
|
// Wow, how was this missing from OpenGL for so long?
|
||||||
|
// ...Oh well, anyway, Lower Unpegged now changes pegging of FOFs like in software
|
||||||
|
// -- Monster Iestyn 26/06/18
|
||||||
if (newline)
|
if (newline)
|
||||||
{
|
{
|
||||||
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset) * grTex->scaleY;
|
texturevpeg = sides[newline->sidenum[0]].rowoffset;
|
||||||
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset)) * grTex->scaleY;
|
if (newline->flags & ML_DONTPEGBOTTOM)
|
||||||
|
texturevpeg -= *rover->topheight - *rover->bottomheight;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset) * grTex->scaleY;
|
texturevpeg = sides[rover->master->sidenum[0]].rowoffset;
|
||||||
wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset)) * grTex->scaleY;
|
if (gr_linedef->flags & ML_DONTPEGBOTTOM)
|
||||||
|
texturevpeg -= *rover->topheight - *rover->bottomheight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grTex = HWR_GetTexture(texnum);
|
||||||
|
|
||||||
|
#ifdef ESLOPE
|
||||||
|
wallVerts[3].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY;
|
||||||
|
wallVerts[2].t = (*rover->topheight - hS + texturevpeg) * grTex->scaleY;
|
||||||
|
wallVerts[0].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY;
|
||||||
|
wallVerts[1].t = (*rover->topheight - lS + texturevpeg) * grTex->scaleY;
|
||||||
|
#else
|
||||||
|
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY;
|
||||||
|
wallVerts[0].t = wallVerts[1].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
|
wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
|
||||||
|
@ -5389,7 +5396,10 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
}
|
}
|
||||||
|
|
||||||
heightsec = thing->subsector->sector->heightsec;
|
heightsec = thing->subsector->sector->heightsec;
|
||||||
phs = players[displayplayer].mo->subsector->sector->heightsec;
|
if (viewplayer->mo && viewplayer->mo->subsector)
|
||||||
|
phs = viewplayer->mo->subsector->sector->heightsec;
|
||||||
|
else
|
||||||
|
phs = -1;
|
||||||
|
|
||||||
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
|
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "hw_drv.h"
|
#include "hw_drv.h"
|
||||||
#include "hw_light.h"
|
#include "hw_light.h"
|
||||||
#include "hw_md2.h"
|
#include "hw_md2.h"
|
||||||
|
#include "../d_main.h"
|
||||||
#include "../r_bsp.h"
|
#include "../r_bsp.h"
|
||||||
#include "../r_main.h"
|
#include "../r_main.h"
|
||||||
#include "../m_misc.h"
|
#include "../m_misc.h"
|
||||||
|
@ -70,6 +71,10 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef errno
|
||||||
|
#include "errno.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NUMVERTEXNORMALS 162
|
#define NUMVERTEXNORMALS 162
|
||||||
float avertexnormals[NUMVERTEXNORMALS][3] = {
|
float avertexnormals[NUMVERTEXNORMALS][3] = {
|
||||||
{-0.525731f, 0.000000f, 0.850651f},
|
{-0.525731f, 0.000000f, 0.850651f},
|
||||||
|
@ -291,7 +296,8 @@ static md2_model_t *md2_readModel(const char *filename)
|
||||||
if (model == NULL)
|
if (model == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
file = fopen(filename, "rb");
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
file = fopen(va("%s"PATHSEP"%s", srb2home, filename), "rb");
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
free(model);
|
free(model);
|
||||||
|
@ -480,7 +486,8 @@ static GrTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
png_FILE_p png_FILE;
|
png_FILE_p png_FILE;
|
||||||
char *pngfilename = va("md2/%s", filename);
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
char *pngfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2home, filename);
|
||||||
|
|
||||||
FIL_ForceExtension(pngfilename, ".png");
|
FIL_ForceExtension(pngfilename, ".png");
|
||||||
png_FILE = fopen(pngfilename, "rb");
|
png_FILE = fopen(pngfilename, "rb");
|
||||||
|
@ -608,7 +615,8 @@ static GrTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
|
||||||
size_t pw, ph, size, ptr = 0;
|
size_t pw, ph, size, ptr = 0;
|
||||||
INT32 ch, rep;
|
INT32 ch, rep;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
char *pcxfilename = va("md2/%s", filename);
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
char *pcxfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2home, filename);
|
||||||
|
|
||||||
FIL_ForceExtension(pcxfilename, ".pcx");
|
FIL_ForceExtension(pcxfilename, ".pcx");
|
||||||
file = fopen(pcxfilename, "rb");
|
file = fopen(pcxfilename, "rb");
|
||||||
|
@ -797,12 +805,13 @@ void HWR_InitMD2(void)
|
||||||
md2_models[i].error = false;
|
md2_models[i].error = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// read the kmd2.dat file
|
// read the md2.dat file
|
||||||
f = fopen("kmd2.dat", "rt");
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
f = fopen(va("%s"PATHSEP"%s", srb2home, "kmd2.dat"), "rt");
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
CONS_Printf("%s", M_GetText("Error while loading kmd2.dat\n"));
|
CONS_Printf("%s %s\n", M_GetText("Error while loading kmd2.dat:"), strerror(errno));
|
||||||
nomd2s = true;
|
nomd2s = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -863,8 +872,9 @@ void HWR_AddPlayerMD2(int skin) // For MD2's that were added after startup
|
||||||
|
|
||||||
CONS_Printf("AddPlayerMD2()...\n");
|
CONS_Printf("AddPlayerMD2()...\n");
|
||||||
|
|
||||||
// read the kmd2.dat file
|
// read the md2.dat file
|
||||||
f = fopen("kmd2.dat", "rt");
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
f = fopen(va("%s"PATHSEP"%s", srb2home, "kmd2.dat"), "rt");
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
|
@ -908,8 +918,9 @@ void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startu
|
||||||
if (spritenum == SPR_PLAY) // Handled already NEWMD2: Per sprite, per-skin check
|
if (spritenum == SPR_PLAY) // Handled already NEWMD2: Per sprite, per-skin check
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Read the kmd2.dat file
|
// Read the md2.dat file
|
||||||
f = fopen("kmd2.dat", "rt");
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
f = fopen(va("%s"PATHSEP"%s", srb2home, "kmd2.dat"), "rt");
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
|
@ -1320,7 +1331,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
frame = (spr->mobj->frame & FF_FRAMEMASK) % md2->model->header.numFrames;
|
frame = (spr->mobj->frame & FF_FRAMEMASK) % md2->model->header.numFrames;
|
||||||
buff = md2->model->glCommandBuffer;
|
buff = md2->model->glCommandBuffer;
|
||||||
curr = &md2->model->frames[frame];
|
curr = &md2->model->frames[frame];
|
||||||
if (cv_grmd2.value == 1)
|
if (cv_grmd2.value == 1 && tics <= durs)
|
||||||
{
|
{
|
||||||
// frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation
|
// frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation
|
||||||
if (spr->mobj->frame & FF_ANIMATE)
|
if (spr->mobj->frame & FF_ANIMATE)
|
||||||
|
|
|
@ -77,7 +77,9 @@ void Got_Luacmd(UINT8 **cp, INT32 playernum)
|
||||||
|
|
||||||
deny:
|
deny:
|
||||||
//must be hacked/buggy client
|
//must be hacked/buggy client
|
||||||
|
if (gL) // check if Lua is actually turned on first, you dummmy -- Monster Iestyn 04/07/18
|
||||||
lua_settop(gL, 0); // clear stack
|
lua_settop(gL, 0); // clear stack
|
||||||
|
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal lua command received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal lua command received from %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
{
|
||||||
|
|
|
@ -527,9 +527,23 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LUA_TSTRING:
|
case LUA_TSTRING:
|
||||||
|
{
|
||||||
|
UINT16 len = (UINT16)lua_objlen(gL, myindex); // get length of string, including embedded zeros
|
||||||
|
const char *s = lua_tostring(gL, myindex);
|
||||||
|
UINT16 i = 0;
|
||||||
WRITEUINT8(save_p, ARCH_STRING);
|
WRITEUINT8(save_p, ARCH_STRING);
|
||||||
WRITESTRING(save_p, lua_tostring(gL, myindex));
|
// if you're wondering why we're writing a string to save_p this way,
|
||||||
|
// it turns out that Lua can have embedded zeros ('\0') in the strings,
|
||||||
|
// so we can't use WRITESTRING as that cuts off when it finds a '\0'.
|
||||||
|
// Saving the size of the string also allows us to get the size of the string on the other end,
|
||||||
|
// fixing the awful crashes previously encountered for reading strings longer than 1024
|
||||||
|
// (yes I know that's kind of a stupid thing to care about, but it'd be evil to trim or ignore them?)
|
||||||
|
// -- Monster Iestyn 05/08/18
|
||||||
|
WRITEUINT16(save_p, len); // save size of string
|
||||||
|
while (i < len)
|
||||||
|
WRITECHAR(save_p, s[i++]); // write chars individually, including the embedded zeros
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case LUA_TTABLE:
|
case LUA_TTABLE:
|
||||||
{
|
{
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
|
@ -810,9 +824,19 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
|
||||||
break;
|
break;
|
||||||
case ARCH_STRING:
|
case ARCH_STRING:
|
||||||
{
|
{
|
||||||
char value[1024];
|
UINT16 len = READUINT16(save_p); // length of string, including embedded zeros
|
||||||
READSTRING(save_p, value);
|
char *value;
|
||||||
lua_pushstring(gL, value);
|
UINT16 i = 0;
|
||||||
|
// See my comments in the ArchiveValue function;
|
||||||
|
// it's much the same for reading strings as writing them!
|
||||||
|
// (i.e. we can't use READSTRING either)
|
||||||
|
// -- Monster Iestyn 05/08/18
|
||||||
|
value = malloc(len); // make temp buffer of size len
|
||||||
|
// now read the actual string
|
||||||
|
while (i < len)
|
||||||
|
value[i++] = READCHAR(save_p); // read chars individually, including the embedded zeros
|
||||||
|
lua_pushlstring(gL, value, len); // push the string (note: this function supports embedded zeros)
|
||||||
|
free(value); // free the buffer
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ARCH_TABLE:
|
case ARCH_TABLE:
|
||||||
|
|
|
@ -7387,7 +7387,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice)
|
||||||
if (choice < 32 || choice > 127 || itemOn != 0)
|
if (choice < 32 || choice > 127 || itemOn != 0)
|
||||||
break;
|
break;
|
||||||
l = strlen(setupm_name);
|
l = strlen(setupm_name);
|
||||||
if (l < MAXPLAYERNAME-1)
|
if (l < MAXPLAYERNAME)
|
||||||
{
|
{
|
||||||
S_StartSound(NULL,sfx_menu1); // Tails
|
S_StartSound(NULL,sfx_menu1); // Tails
|
||||||
setupm_name[l] =(char)choice;
|
setupm_name[l] =(char)choice;
|
||||||
|
|
|
@ -297,7 +297,7 @@ void R_DrawTranslucentColumn_8(void)
|
||||||
// Re-map color indices from wall texture column
|
// Re-map color indices from wall texture column
|
||||||
// using a lighting/special effects LUT.
|
// using a lighting/special effects LUT.
|
||||||
// heightmask is the Tutti-Frutti fix
|
// heightmask is the Tutti-Frutti fix
|
||||||
*dest = colormap[*(transmap + (source[frac>>FRACBITS]<<8) + (*dest))];
|
*dest = *(transmap + (colormap[source[frac>>FRACBITS]]<<8) + (*dest));
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
if ((frac += fracstep) >= heightmask)
|
if ((frac += fracstep) >= heightmask)
|
||||||
frac -= heightmask;
|
frac -= heightmask;
|
||||||
|
@ -308,15 +308,15 @@ void R_DrawTranslucentColumn_8(void)
|
||||||
{
|
{
|
||||||
while ((count -= 2) >= 0) // texture height is a power of 2
|
while ((count -= 2) >= 0) // texture height is a power of 2
|
||||||
{
|
{
|
||||||
*dest = colormap[*(transmap + ((source[(frac>>FRACBITS)&heightmask]<<8)) + (*dest))];
|
*dest = *(transmap + (colormap[source[(frac>>FRACBITS)&heightmask]]<<8) + (*dest));
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
*dest = colormap[*(transmap + ((source[(frac>>FRACBITS)&heightmask]<<8)) + (*dest))];
|
*dest = *(transmap + (colormap[source[(frac>>FRACBITS)&heightmask]]<<8) + (*dest));
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
}
|
}
|
||||||
if (count & 1)
|
if (count & 1)
|
||||||
*dest = colormap[*(transmap + ((source[(frac>>FRACBITS)&heightmask]<<8)) + (*dest))];
|
*dest = *(transmap + (colormap[source[(frac>>FRACBITS)&heightmask]]<<8) + (*dest));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -367,8 +367,7 @@ void R_DrawTranslatedTranslucentColumn_8(void)
|
||||||
// using a lighting/special effects LUT.
|
// using a lighting/special effects LUT.
|
||||||
// heightmask is the Tutti-Frutti fix
|
// heightmask is the Tutti-Frutti fix
|
||||||
|
|
||||||
*dest = dc_colormap[*(dc_transmap
|
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest));
|
||||||
+ (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest))];
|
|
||||||
|
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
if ((frac += fracstep) >= heightmask)
|
if ((frac += fracstep) >= heightmask)
|
||||||
|
@ -380,17 +379,15 @@ void R_DrawTranslatedTranslucentColumn_8(void)
|
||||||
{
|
{
|
||||||
while ((count -= 2) >= 0) // texture height is a power of 2
|
while ((count -= 2) >= 0) // texture height is a power of 2
|
||||||
{
|
{
|
||||||
*dest = dc_colormap[*(dc_transmap
|
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[(frac>>FRACBITS)&heightmask]]]<<8) + (*dest));
|
||||||
+ (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest))];
|
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
*dest = dc_colormap[*(dc_transmap
|
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[(frac>>FRACBITS)&heightmask]]]<<8) + (*dest));
|
||||||
+ (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]]<<8) + (*dest))];
|
|
||||||
dest += vid.width;
|
dest += vid.width;
|
||||||
frac += fracstep;
|
frac += fracstep;
|
||||||
}
|
}
|
||||||
if (count & 1)
|
if (count & 1)
|
||||||
*dest = dc_colormap[*(dc_transmap + (dc_colormap[dc_translation[dc_source[frac>>FRACBITS]]] <<8) + (*dest))];
|
*dest = *(dc_transmap + (dc_colormap[dc_translation[dc_source[(frac>>FRACBITS)&heightmask]]]<<8) + (*dest));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1220,35 +1217,35 @@ void R_DrawTranslucentSpan_8 (void)
|
||||||
// SoM: Why didn't I see this earlier? the spot variable is a waste now because we don't
|
// SoM: Why didn't I see this earlier? the spot variable is a waste now because we don't
|
||||||
// have the uber complicated math to calculate it now, so that was a memory write we didn't
|
// have the uber complicated math to calculate it now, so that was a memory write we didn't
|
||||||
// need!
|
// need!
|
||||||
dest[0] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[0])];
|
dest[0] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[0]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[1] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[1])];
|
dest[1] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[1]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[2] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[2])];
|
dest[2] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[2]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[3] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[3])];
|
dest[3] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[3]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[4] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[4])];
|
dest[4] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[4]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[5] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[5])];
|
dest[5] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[5]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[6] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[6])];
|
dest[6] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[6]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
dest[7] = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + dest[7])];
|
dest[7] = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + dest[7]);
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
||||||
|
@ -1257,7 +1254,7 @@ void R_DrawTranslucentSpan_8 (void)
|
||||||
}
|
}
|
||||||
while (count--)
|
while (count--)
|
||||||
{
|
{
|
||||||
*dest = colormap[*(ds_transmap + (source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)] << 8) + *dest)];
|
*dest = *(ds_transmap + (colormap[source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]] << 8) + *dest);
|
||||||
dest++;
|
dest++;
|
||||||
xposition += xstep;
|
xposition += xstep;
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
|
|
|
@ -66,6 +66,7 @@ static boolean midimode;
|
||||||
static Mix_Music *music;
|
static Mix_Music *music;
|
||||||
static UINT8 music_volume, midi_volume, sfx_volume;
|
static UINT8 music_volume, midi_volume, sfx_volume;
|
||||||
static float loop_point;
|
static float loop_point;
|
||||||
|
static boolean songpaused;
|
||||||
|
|
||||||
#ifdef HAVE_LIBGME
|
#ifdef HAVE_LIBGME
|
||||||
static Music_Emu *gme;
|
static Music_Emu *gme;
|
||||||
|
@ -102,6 +103,7 @@ void I_StartupSound(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
sound_started = true;
|
sound_started = true;
|
||||||
|
songpaused = false;
|
||||||
Mix_AllocateChannels(256);
|
Mix_AllocateChannels(256);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -450,7 +452,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
|
||||||
(void)udata;
|
(void)udata;
|
||||||
|
|
||||||
// no gme? no music.
|
// no gme? no music.
|
||||||
if (!gme || gme_track_ended(gme))
|
if (!gme || gme_track_ended(gme) || songpaused)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// play gme into stream
|
// play gme into stream
|
||||||
|
@ -458,7 +460,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
|
||||||
|
|
||||||
// apply volume to stream
|
// apply volume to stream
|
||||||
for (i = 0, p = (short *)stream; i < len/2; i++, p++)
|
for (i = 0, p = (short *)stream; i < len/2; i++, p++)
|
||||||
*p = ((INT32)*p) * music_volume / 31;
|
*p = ((INT32)*p) * music_volume*2 / 42;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -476,12 +478,14 @@ void I_PauseSong(INT32 handle)
|
||||||
{
|
{
|
||||||
(void)handle;
|
(void)handle;
|
||||||
Mix_PauseMusic();
|
Mix_PauseMusic();
|
||||||
|
songpaused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_ResumeSong(INT32 handle)
|
void I_ResumeSong(INT32 handle)
|
||||||
{
|
{
|
||||||
(void)handle;
|
(void)handle;
|
||||||
Mix_ResumeMusic();
|
Mix_ResumeMusic();
|
||||||
|
songpaused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue