mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
fix building with MSVC after Helixhorned's commit
fix FastLZ mipmap corruption issue fix Polymer MSVC warnings rewrote qsprintf to take up to 32 parameters, either quotes or gamevars added qstrncat to concatenate n characters of one quote to another exposed internal sectorofwall() function to CON changed CON parser to count ( ) ; and , as whitespace so people can make their code more readable added ACTIVATOR and ACTIVATORLOCKED support to SE49 and SE50 added SPRITE_USEACTIVATOR flag to allow actor execution based on whether a sector is "locked" or not rearranged a few structures for faster array lookups fixed EVENT_HOLSTER git-svn-id: https://svn.eduke32.com/eduke32@1457 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a3c0bee4a3
commit
1538f39289
29 changed files with 990 additions and 890 deletions
|
@ -351,7 +351,7 @@ static inline void dtol(double d, int32_t *a)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define BMAX_PATH 260
|
#define BMAX_PATH 256
|
||||||
|
|
||||||
|
|
||||||
struct Bdirent {
|
struct Bdirent {
|
||||||
|
|
|
@ -80,9 +80,11 @@ ACQUIRE_LOCK, RELEASE_LOCK, TRY_LOCK, IS_LOCKED and NULL_LOCK_INITIALIZER.
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _MSC_VER
|
||||||
#ifndef UNREFERENCED_PARAMETER
|
#ifndef UNREFERENCED_PARAMETER
|
||||||
#define UNREFERENCED_PARAMETER(x) x=x
|
#define UNREFERENCED_PARAMETER(x) x=x
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef NO_MALLINFO
|
#ifndef NO_MALLINFO
|
||||||
#define NO_MALLINFO 0
|
#define NO_MALLINFO 0
|
||||||
|
|
|
@ -163,6 +163,7 @@ typedef struct s_prplanelist {
|
||||||
struct s_prplanelist* n;
|
struct s_prplanelist* n;
|
||||||
} _prplanelist;
|
} _prplanelist;
|
||||||
|
|
||||||
|
#pragma pack(push,1)
|
||||||
typedef struct s_prlight {
|
typedef struct s_prlight {
|
||||||
int32_t x, y, z, horiz, range;
|
int32_t x, y, z, horiz, range;
|
||||||
int16_t angle, faderadius, radius, sector;
|
int16_t angle, faderadius, radius, sector;
|
||||||
|
@ -189,6 +190,7 @@ extern int32_t lightcount;
|
||||||
|
|
||||||
extern _prlight gamelights[PR_MAXLIGHTS];
|
extern _prlight gamelights[PR_MAXLIGHTS];
|
||||||
extern int32_t gamelightcount;
|
extern int32_t gamelightcount;
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
// RENDER TARGETS
|
// RENDER TARGETS
|
||||||
typedef struct s_prrt {
|
typedef struct s_prrt {
|
||||||
|
|
|
@ -380,7 +380,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
}
|
}
|
||||||
if (!boardfilename[0])
|
if (!boardfilename[0])
|
||||||
{
|
{
|
||||||
Bstrncpy(boardfilename, argv[i], BMAX_PATH-4-1);
|
Bstrncpy(boardfilename, argv[i], BMAX_PATH);
|
||||||
boardfilename[i-BMAX_PATH] = 0;
|
boardfilename[i-BMAX_PATH] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
static intptr_t kzipopen(char *filnam)
|
static intptr_t kzipopen(char *filnam)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
char newst[BMAX_PATH+4];
|
char newst[BMAX_PATH];
|
||||||
|
|
||||||
newst[0] = '|';
|
newst[0] = '|';
|
||||||
for (i=0; filnam[i] && (i < sizeof(newst)-2); i++) newst[i+1] = filnam[i];
|
for (i=0; filnam[i] && (i < sizeof(newst)-2); i++) newst[i+1] = filnam[i];
|
||||||
|
|
|
@ -7419,8 +7419,9 @@ int32_t loadmaphack(char *filename)
|
||||||
case T_LIGHT: // light sector x y z range r g b radius faderadius angle horiz minshade maxshade priority tilenum
|
case T_LIGHT: // light sector x y z range r g b radius faderadius angle horiz minshade maxshade priority tilenum
|
||||||
{
|
{
|
||||||
int32_t value;
|
int32_t value;
|
||||||
|
#pragma pack(push,1)
|
||||||
_prlight light;
|
_prlight light;
|
||||||
|
#pragma pack(pop)
|
||||||
scriptfile_getnumber(script, &value);
|
scriptfile_getnumber(script, &value);
|
||||||
light.sector = value;
|
light.sector = value;
|
||||||
scriptfile_getnumber(script, &value);
|
scriptfile_getnumber(script, &value);
|
||||||
|
|
|
@ -653,7 +653,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf)
|
||||||
{
|
{
|
||||||
int32_t i,j, bpl, xsiz=0, ysiz=0, osizx, osizy, texfmt = GL_RGBA, intexfmt = GL_RGBA;
|
int32_t i,j, bpl, xsiz=0, ysiz=0, osizx, osizy, texfmt = GL_RGBA, intexfmt = GL_RGBA;
|
||||||
intptr_t fptr=0;
|
intptr_t fptr=0;
|
||||||
char *skinfile, hasalpha, fn[BMAX_PATH+65];
|
char *skinfile, hasalpha, fn[BMAX_PATH];
|
||||||
GLuint *texidx = NULL;
|
GLuint *texidx = NULL;
|
||||||
mdskinmap_t *sk, *skzero = NULL;
|
mdskinmap_t *sk, *skzero = NULL;
|
||||||
int32_t doalloc = 1, filh;
|
int32_t doalloc = 1, filh;
|
||||||
|
@ -672,7 +672,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf)
|
||||||
{
|
{
|
||||||
skinfile = sk->fn;
|
skinfile = sk->fn;
|
||||||
texidx = &sk->texid[(globalnoeffect)?0:(hictinting[pal].f&HICEFFECTMASK)];
|
texidx = &sk->texid[(globalnoeffect)?0:(hictinting[pal].f&HICEFFECTMASK)];
|
||||||
strcpy(fn,skinfile);
|
strncpy(fn,skinfile,BMAX_PATH);
|
||||||
//OSD_Printf("Using exact match skin (pal=%d,skinnum=%d,surfnum=%d) %s\n",pal,number,surf,skinfile);
|
//OSD_Printf("Using exact match skin (pal=%d,skinnum=%d,surfnum=%d) %s\n",pal,number,surf,skinfile);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -692,7 +692,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf)
|
||||||
{
|
{
|
||||||
skinfile = skzero->fn;
|
skinfile = skzero->fn;
|
||||||
texidx = &skzero->texid[(globalnoeffect)?0:(hictinting[pal].f&HICEFFECTMASK)];
|
texidx = &skzero->texid[(globalnoeffect)?0:(hictinting[pal].f&HICEFFECTMASK)];
|
||||||
strcpy(fn,skinfile);
|
strncpy(fn,skinfile,BMAX_PATH);
|
||||||
//OSD_Printf("Using def skin 0,0 as fallback, pal=%d\n", pal);
|
//OSD_Printf("Using def skin 0,0 as fallback, pal=%d\n", pal);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -700,7 +700,9 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf)
|
||||||
if ((unsigned)number >= (unsigned)m->numskins) number = 0;
|
if ((unsigned)number >= (unsigned)m->numskins) number = 0;
|
||||||
skinfile = m->skinfn + number*64;
|
skinfile = m->skinfn + number*64;
|
||||||
texidx = &m->texid[ number * (HICEFFECTMASK+1) + (globalnoeffect)?0:(hictinting[pal].f&HICEFFECTMASK)];
|
texidx = &m->texid[ number * (HICEFFECTMASK+1) + (globalnoeffect)?0:(hictinting[pal].f&HICEFFECTMASK)];
|
||||||
strcpy(fn,m->basepath); strcat(fn,skinfile);
|
strncpy(fn,m->basepath,BMAX_PATH);
|
||||||
|
if ((Bstrlen(fn) + Bstrlen(skinfile)) < BMAX_PATH)
|
||||||
|
strcat(fn,skinfile);
|
||||||
//OSD_Printf("Using MD2/MD3 skin (%d) %s, pal=%d\n",number,skinfile,pal);
|
//OSD_Printf("Using MD2/MD3 skin (%d) %s, pal=%d\n",number,skinfile,pal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#define POLYMER_C
|
#define POLYMER_C
|
||||||
#include "polymer.h"
|
#include "polymer.h"
|
||||||
#include "engine_priv.h"
|
#include "engine_priv.h"
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
// CVARS
|
// CVARS
|
||||||
int32_t pr_lighting = 1;
|
int32_t pr_lighting = 1;
|
||||||
|
@ -134,12 +135,14 @@ GLuint skyboxdatavbo;
|
||||||
GLfloat artskydata[16];
|
GLfloat artskydata[16];
|
||||||
|
|
||||||
// LIGHTS
|
// LIGHTS
|
||||||
|
#pragma pack(push,1)
|
||||||
_prlight prlights[PR_MAXLIGHTS];
|
_prlight prlights[PR_MAXLIGHTS];
|
||||||
int32_t lightcount;
|
int32_t lightcount;
|
||||||
int32_t curlight;
|
int32_t curlight;
|
||||||
|
|
||||||
_prlight gamelights[PR_MAXLIGHTS];
|
_prlight gamelights[PR_MAXLIGHTS];
|
||||||
int32_t gamelightcount;
|
int32_t gamelightcount;
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
static GLfloat shadowBias[] =
|
static GLfloat shadowBias[] =
|
||||||
{
|
{
|
||||||
|
@ -728,11 +731,11 @@ void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t da
|
||||||
horizang = (float)(-getangle(128, dahoriz-100)) / (2048.0f / 360.0f);
|
horizang = (float)(-getangle(128, dahoriz-100)) / (2048.0f / 360.0f);
|
||||||
tiltang = (gtang * 90.0f);
|
tiltang = (gtang * 90.0f);
|
||||||
|
|
||||||
if (searchit == 2) polymer_editorselect();
|
// if (searchit == 2) polymer_editorselect();
|
||||||
|
|
||||||
pos[0] = daposy;
|
pos[0] = (float)daposy;
|
||||||
pos[1] = -(float)(daposz) / 16.0f;
|
pos[1] = -(float)(daposz) / 16.0f;
|
||||||
pos[2] = -daposx;
|
pos[2] = -(float)daposx;
|
||||||
|
|
||||||
polymer_updatelights();
|
polymer_updatelights();
|
||||||
|
|
||||||
|
@ -758,7 +761,7 @@ void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t da
|
||||||
// the angle factor is computed from eyeballed values
|
// the angle factor is computed from eyeballed values
|
||||||
// need to recompute it if we ever change the max horiz amplitude
|
// need to recompute it if we ever change the max horiz amplitude
|
||||||
if (!pth || !(pth->flags & 4))
|
if (!pth || !(pth->flags & 4))
|
||||||
skyhoriz /= 4.3027;
|
skyhoriz /= 4.3027f;
|
||||||
|
|
||||||
bglMatrixMode(GL_MODELVIEW);
|
bglMatrixMode(GL_MODELVIEW);
|
||||||
bglLoadIdentity();
|
bglLoadIdentity();
|
||||||
|
@ -840,10 +843,10 @@ void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t da
|
||||||
|
|
||||||
curmodelviewmatrix = rootmodelviewmatrix;
|
curmodelviewmatrix = rootmodelviewmatrix;
|
||||||
|
|
||||||
#ifdef M32_ALTAIMING
|
// #ifdef M32_ALTAIMING
|
||||||
// only showcase for now...
|
// only showcase for now...
|
||||||
polymer_alt_editorselect();
|
if (searchit == 2) polymer_alt_editorselect();
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
// build globals used by rotatesprite
|
// build globals used by rotatesprite
|
||||||
viewangle = daang;
|
viewangle = daang;
|
||||||
|
@ -981,23 +984,23 @@ void polymer_drawsprite(int32_t snum)
|
||||||
ysize = h_ysize[curpicnum];
|
ysize = h_ysize[curpicnum];
|
||||||
}
|
}
|
||||||
|
|
||||||
xsize *= xratio;
|
xsize = (int32_t)(xsize * xratio);
|
||||||
ysize *= yratio;
|
ysize = (int32_t)(ysize * yratio);
|
||||||
|
|
||||||
tilexoff = (int32_t)tspr->xoffset;
|
tilexoff = (int32_t)tspr->xoffset;
|
||||||
tileyoff = (int32_t)tspr->yoffset;
|
tileyoff = (int32_t)tspr->yoffset;
|
||||||
tilexoff += (int8_t)((usehightile&&h_xsize[curpicnum])?(h_xoffs[curpicnum]):((picanm[curpicnum]>>8)&255));
|
tilexoff += (int8_t)((usehightile&&h_xsize[curpicnum])?(h_xoffs[curpicnum]):((picanm[curpicnum]>>8)&255));
|
||||||
tileyoff += (int8_t)((usehightile&&h_xsize[curpicnum])?(h_yoffs[curpicnum]):((picanm[curpicnum]>>16)&255));
|
tileyoff += (int8_t)((usehightile&&h_xsize[curpicnum])?(h_yoffs[curpicnum]):((picanm[curpicnum]>>16)&255));
|
||||||
|
|
||||||
xoff = tilexoff * xratio;
|
xoff = (int32_t)(tilexoff * xratio);
|
||||||
yoff = tileyoff * yratio;
|
yoff = (int32_t)(tileyoff * yratio);
|
||||||
|
|
||||||
if ((tspr->cstat & 128) && (((tspr->cstat>>4) & 3) != 2))
|
if ((tspr->cstat & 128) && (((tspr->cstat>>4) & 3) != 2))
|
||||||
yoff -= ysize / 2;
|
yoff -= ysize / 2;
|
||||||
|
|
||||||
spos[0] = tspr->y;
|
spos[0] = (float)tspr->y;
|
||||||
spos[1] = -(float)(tspr->z) / 16.0f;
|
spos[1] = -(float)(tspr->z) / 16.0f;
|
||||||
spos[2] = -tspr->x;
|
spos[2] = -(float)tspr->x;
|
||||||
|
|
||||||
bglMatrixMode(GL_MODELVIEW);
|
bglMatrixMode(GL_MODELVIEW);
|
||||||
bglPushMatrix();
|
bglPushMatrix();
|
||||||
|
@ -1137,7 +1140,7 @@ void polymer_setanimatesprites(animatespritesptr animatesprites,
|
||||||
|
|
||||||
int16_t polymer_addlight(_prlight* light)
|
int16_t polymer_addlight(_prlight* light)
|
||||||
{
|
{
|
||||||
int16_t lighti;
|
int32_t lighti;
|
||||||
|
|
||||||
if (lightcount >= PR_MAXLIGHTS || light->priority > pr_maxlightpriority || !pr_lighting)
|
if (lightcount >= PR_MAXLIGHTS || light->priority > pr_maxlightpriority || !pr_lighting)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
@ -1335,9 +1338,9 @@ static void polymer_displayrooms(int16_t dacursectnum)
|
||||||
float pos[3], sqdist;
|
float pos[3], sqdist;
|
||||||
int32_t oldoverridematerial;
|
int32_t oldoverridematerial;
|
||||||
|
|
||||||
pos[0] = globalposy;
|
pos[0] = (float)globalposy;
|
||||||
pos[1] = -(float)(globalposz) / 16.0f;
|
pos[1] = -(float)(globalposz) / 16.0f;
|
||||||
pos[2] = -globalposx;
|
pos[2] = -(float)globalposx;
|
||||||
|
|
||||||
sqdist = prwalls[sec->wallptr + i]->mask.plane[0] * pos[0] +
|
sqdist = prwalls[sec->wallptr + i]->mask.plane[0] * pos[0] +
|
||||||
prwalls[sec->wallptr + i]->mask.plane[1] * pos[1] +
|
prwalls[sec->wallptr + i]->mask.plane[1] * pos[1] +
|
||||||
|
@ -1487,9 +1490,9 @@ static void polymer_displayrooms(int16_t dacursectnum)
|
||||||
mirrorlist[i].plane->plane[1] * mirrorlist[i].plane->plane[1] +
|
mirrorlist[i].plane->plane[1] * mirrorlist[i].plane->plane[1] +
|
||||||
mirrorlist[i].plane->plane[2] * mirrorlist[i].plane->plane[2]);
|
mirrorlist[i].plane->plane[2] * mirrorlist[i].plane->plane[2]);
|
||||||
|
|
||||||
px = -coeff*mirrorlist[i].plane->plane[0]*2 + px;
|
px = (int32_t)(-coeff*mirrorlist[i].plane->plane[0]*2 + px);
|
||||||
py = -coeff*mirrorlist[i].plane->plane[1]*2 + py;
|
py = (int32_t)(-coeff*mirrorlist[i].plane->plane[1]*2 + py);
|
||||||
pz = -coeff*mirrorlist[i].plane->plane[2]*2 + pz;
|
pz = (int32_t)(-coeff*mirrorlist[i].plane->plane[2]*2 + pz);
|
||||||
|
|
||||||
// map back from polymer to build
|
// map back from polymer to build
|
||||||
globalposx = -pz;
|
globalposx = -pz;
|
||||||
|
@ -1899,17 +1902,9 @@ void polymer_alt_editorselect(void)
|
||||||
GLdouble proj[16];
|
GLdouble proj[16];
|
||||||
GLint view[4];
|
GLint view[4];
|
||||||
|
|
||||||
bglGetDoublev(GL_MODELVIEW_MATRIX, model);
|
|
||||||
bglGetDoublev(GL_PROJECTION_MATRIX, proj);
|
|
||||||
bglGetIntegerv(GL_VIEWPORT, view);
|
|
||||||
|
|
||||||
GLdouble x,y,z, viewx,viewy,viewz;
|
GLdouble x,y,z, viewx,viewy,viewz;
|
||||||
GLfloat dadepth;
|
GLfloat dadepth;
|
||||||
|
|
||||||
bglReadPixels(searchx, ydimen-searchy, 1,1, GL_DEPTH_COMPONENT, GL_FLOAT, &dadepth);
|
|
||||||
bgluUnProject(searchx, ydimen-searchy, dadepth, model, proj, view, &x, &y, &z);
|
|
||||||
bgluUnProject(searchx, ydimen-searchy, 0.0, model, proj, view, &viewx, &viewy, &viewz);
|
|
||||||
|
|
||||||
int8_t bestwhat = -1;
|
int8_t bestwhat = -1;
|
||||||
int16_t bestsec = -1;
|
int16_t bestsec = -1;
|
||||||
int16_t bestwall = -1;
|
int16_t bestwall = -1;
|
||||||
|
@ -1924,6 +1919,14 @@ void polymer_alt_editorselect(void)
|
||||||
qvertcount=0;
|
qvertcount=0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bglGetDoublev(GL_MODELVIEW_MATRIX, model);
|
||||||
|
bglGetDoublev(GL_PROJECTION_MATRIX, proj);
|
||||||
|
bglGetIntegerv(GL_VIEWPORT, view);
|
||||||
|
|
||||||
|
bglReadPixels(searchx, ydimen-searchy, 1,1, GL_DEPTH_COMPONENT, GL_FLOAT, &dadepth);
|
||||||
|
bgluUnProject(searchx, ydimen-searchy, dadepth, model, proj, view, &x, &y, &z);
|
||||||
|
bgluUnProject(searchx, ydimen-searchy, 0.0, model, proj, view, &viewx, &viewy, &viewz);
|
||||||
|
|
||||||
for (i=0; i<numwalls; i++)
|
for (i=0; i<numwalls; i++)
|
||||||
{
|
{
|
||||||
_prwall *w = prwalls[i];
|
_prwall *w = prwalls[i];
|
||||||
|
@ -1932,31 +1935,40 @@ void polymer_alt_editorselect(void)
|
||||||
if (!w->flags.uptodate)
|
if (!w->flags.uptodate)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
{
|
||||||
_prplane *wp = &w->wall;
|
_prplane *wp = &w->wall;
|
||||||
int8_t what;
|
int8_t what;
|
||||||
|
|
||||||
GLfloat *pl = wp->plane;
|
GLfloat *pl = wp->plane;
|
||||||
GLdouble a=pl[0], b=pl[1], c=pl[2], d=pl[3];
|
GLdouble a=pl[0], b=pl[1], c=pl[2], d=pl[3];
|
||||||
GLdouble nnormsq, nnorm, dist;
|
GLdouble nnormsq = a*a + b*b + c*c;
|
||||||
|
GLdouble nnorm = sqrt(nnormsq);
|
||||||
|
GLdouble dist;
|
||||||
|
|
||||||
nnormsq = a*a + b*b + c*c;
|
|
||||||
nnorm = sqrt(nnormsq);
|
|
||||||
GLfloat npl[3] = {a/nnorm, b/nnorm, c/nnorm};
|
GLfloat npl[3] = {a/nnorm, b/nnorm, c/nnorm};
|
||||||
GLfloat scrv[3] = {x-viewx, y-viewy, z-viewz};
|
GLfloat scrv[3] = {x-viewx, y-viewy, z-viewz};
|
||||||
|
|
||||||
if (-dot3f(scrv,pl)<0)
|
if (-dot3f(scrv,pl)<0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
{
|
||||||
GLfloat coeff = -d/nnormsq;
|
GLfloat coeff = -d/nnormsq;
|
||||||
GLfloat pointonplane[3] = {coeff*a, coeff*b, coeff*c};
|
GLfloat pointonplane[3] = {coeff*a, coeff*b, coeff*c};
|
||||||
GLfloat vec[3] = {x-pointonplane[0], y-pointonplane[1], z-pointonplane[2]};
|
GLfloat vec[3] = {x-pointonplane[0], y-pointonplane[1], z-pointonplane[2]};
|
||||||
|
_prplane *pp;
|
||||||
|
|
||||||
dist = fabs((a*vec[0] + b*vec[1] + c*vec[2])/nnorm);
|
dist = fabs((a*vec[0] + b*vec[1] + c*vec[2])/nnorm);
|
||||||
|
|
||||||
if (dist > bestdist)
|
if (dist > bestdist)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
_prplane *pp;
|
|
||||||
// TODO: the parallax cases...
|
// TODO: the parallax cases...
|
||||||
for (what=0; what < (wal->nextsector>=0?2:1); what++)
|
for (what=0; what < (wal->nextsector>=0?2:1); what++)
|
||||||
{
|
{
|
||||||
|
GLfloat v1[3], v2[3], v3[3], v4[3], v12[3], v34[3], v1p_r[3], v3p_r[3];
|
||||||
|
GLfloat v23[3], v41[3], v2p_r[3], v4p_r[3];
|
||||||
|
GLfloat tp[3]={x,y,z};
|
||||||
|
|
||||||
pp=wp;
|
pp=wp;
|
||||||
if (what==0)
|
if (what==0)
|
||||||
{
|
{
|
||||||
|
@ -1969,17 +1981,14 @@ void polymer_alt_editorselect(void)
|
||||||
continue;
|
continue;
|
||||||
pp=&w->over;
|
pp=&w->over;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
else if (what==2)
|
else if (what==2)
|
||||||
{
|
{
|
||||||
if (!(wal->cstat&16) && !(wal->cstat&32))
|
if (!(wal->cstat&16) && !(wal->cstat&32))
|
||||||
continue;
|
continue;
|
||||||
pp=&w->mask;
|
pp=&w->mask;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
GLfloat v1[3], v2[3], v3[3], v4[3], v12[3], v34[3], v1p_r[3], v3p_r[3];
|
|
||||||
GLfloat v23[3], v41[3], v2p_r[3], v4p_r[3];
|
|
||||||
GLfloat tp[3]={x,y,z};
|
|
||||||
Bmemcpy(v1, &pp->buffer[0], 3*sizeof(GLfloat));
|
Bmemcpy(v1, &pp->buffer[0], 3*sizeof(GLfloat));
|
||||||
Bmemcpy(v2, &pp->buffer[5], 3*sizeof(GLfloat));
|
Bmemcpy(v2, &pp->buffer[5], 3*sizeof(GLfloat));
|
||||||
Bmemcpy(v3, &pp->buffer[10], 3*sizeof(GLfloat));
|
Bmemcpy(v3, &pp->buffer[10], 3*sizeof(GLfloat));
|
||||||
|
@ -2031,42 +2040,50 @@ void polymer_alt_editorselect(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i=0; i<numsectors; i++)
|
for (i=0; i<numsectors; i++)
|
||||||
{
|
{
|
||||||
_prsector *s = prsectors[i];
|
_prsector *s = prsectors[i];
|
||||||
sectortype *sec = §or[i];
|
sectortype *sec = §or[i];
|
||||||
|
_prplane *cfp;
|
||||||
|
int8_t what = 1;
|
||||||
|
|
||||||
if (!s->flags.uptodate)
|
if (!s->flags.uptodate)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
_prplane *cfp;
|
|
||||||
int8_t what = 1;
|
|
||||||
|
|
||||||
for (what=1; what<=2; what++)
|
for (what=1; what<=2; what++)
|
||||||
{
|
{
|
||||||
|
GLfloat *pl;
|
||||||
|
GLdouble a, b, c, d;
|
||||||
|
GLfloat scrv[3] = {x-viewx, y-viewy, z-viewz};
|
||||||
|
|
||||||
if (what==1)
|
if (what==1)
|
||||||
cfp = &s->ceil;
|
cfp = &s->ceil;
|
||||||
else
|
else
|
||||||
cfp = &s->floor;
|
cfp = &s->floor;
|
||||||
|
|
||||||
GLfloat *pl = cfp->plane;
|
pl = cfp->plane;
|
||||||
GLdouble a=pl[0], b=pl[1], c=pl[2], d=pl[3];
|
|
||||||
GLfloat scrv[3] = {x-viewx, y-viewy, z-viewz};
|
|
||||||
if (-dot3f(scrv,pl)<0)
|
if (-dot3f(scrv,pl)<0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
GLdouble nnormsq, nnorm, dist;
|
a=pl[0], b=pl[1], c=pl[2], d=pl[3];
|
||||||
nnormsq = a*a + b*b + c*c;
|
|
||||||
nnorm = sqrt(nnormsq);
|
|
||||||
|
|
||||||
|
{
|
||||||
|
GLdouble nnormsq = a*a + b*b + c*c;
|
||||||
|
GLdouble nnorm = sqrt(nnormsq);
|
||||||
GLfloat coeff = -d/nnormsq;
|
GLfloat coeff = -d/nnormsq;
|
||||||
GLfloat pointonplane[3] = {coeff*a, coeff*b, coeff*c};
|
GLfloat pointonplane[3] = {coeff*a, coeff*b, coeff*c};
|
||||||
GLfloat vec[3] = {x-pointonplane[0], y-pointonplane[1], z-pointonplane[2]};
|
GLfloat vec[3] = {x-pointonplane[0], y-pointonplane[1], z-pointonplane[2]};
|
||||||
dist = fabs((a*vec[0] + b*vec[1] + c*vec[2])/nnorm);
|
GLdouble dist = fabs((a*vec[0] + b*vec[1] + c*vec[2])/nnorm);
|
||||||
|
|
||||||
if (dist > bestdist)
|
if (dist > bestdist)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
{
|
||||||
// projected point
|
// projected point
|
||||||
GLfloat p[2] =
|
GLfloat p[2] =
|
||||||
{
|
{
|
||||||
|
@ -2128,7 +2145,7 @@ void polymer_alt_editorselect(void)
|
||||||
goto nextsector;
|
goto nextsector;
|
||||||
}
|
}
|
||||||
} // loop over triangles
|
} // loop over triangles
|
||||||
/*
|
/*
|
||||||
// implementation using inside() (less precise)
|
// implementation using inside() (less precise)
|
||||||
if (inside(-p[1],p[0],i))
|
if (inside(-p[1],p[0],i))
|
||||||
{
|
{
|
||||||
|
@ -2136,12 +2153,12 @@ void polymer_alt_editorselect(void)
|
||||||
bestsec = i;
|
bestsec = i;
|
||||||
bestdist = dist;
|
bestdist = dist;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
nextsector:
|
nextsector:
|
||||||
if (bestsec==i)
|
if (bestsec==i)
|
||||||
{
|
{
|
||||||
int16_t k, bestk=0;
|
int16_t k, bestk=0;
|
||||||
GLfloat bestwdistsq = 1e60, wdistsq, wnorm;
|
GLfloat bestwdistsq = FLT_MAX, wdistsq, wnorm;
|
||||||
GLfloat w1[2], w2[2], w21[2], pw1[2], pw2[2];
|
GLfloat w1[2], w2[2], w21[2], pw1[2], pw2[2];
|
||||||
GLfloat ptonline[2];
|
GLfloat ptonline[2];
|
||||||
GLfloat scrvxz[2]={scrv[0],scrv[2]};
|
GLfloat scrvxz[2]={scrv[0],scrv[2]};
|
||||||
|
@ -2150,10 +2167,10 @@ nextsector:
|
||||||
walltype *wal = &wall[sec->wallptr];
|
walltype *wal = &wall[sec->wallptr];
|
||||||
for (k=0; k<sec->wallnum; k++)
|
for (k=0; k<sec->wallnum; k++)
|
||||||
{
|
{
|
||||||
w1[1] = -wal[k].x;
|
w1[1] = -(float)wal[k].x;
|
||||||
w1[0] = wal[k].y;
|
w1[0] = (float)wal[k].y;
|
||||||
w2[1] = -wall[wal[k].point2].x;
|
w2[1] = -(float)wall[wal[k].point2].x;
|
||||||
w2[0] = wall[wal[k].point2].y;
|
w2[0] = (float)wall[wal[k].point2].y;
|
||||||
|
|
||||||
scrvxznorm = sqrt(dot2f(scrvxz,scrvxz));
|
scrvxznorm = sqrt(dot2f(scrvxz,scrvxz));
|
||||||
scrvxzn[0] = scrvxz[1]/scrvxznorm;
|
scrvxzn[0] = scrvxz[1]/scrvxznorm;
|
||||||
|
@ -2186,6 +2203,9 @@ nextsector:
|
||||||
} // determine searchwall
|
} // determine searchwall
|
||||||
} // ceiling or floor
|
} // ceiling or floor
|
||||||
} // loop over sectors
|
} // loop over sectors
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SECTORS
|
// SECTORS
|
||||||
|
@ -2270,12 +2290,12 @@ static int32_t polymer_updatesector(int16_t sectnum)
|
||||||
{
|
{
|
||||||
if ((-wal->x != s->verts[(i*3)+2]))
|
if ((-wal->x != s->verts[(i*3)+2]))
|
||||||
{
|
{
|
||||||
s->verts[(i*3)+2] = s->floor.buffer[(i*5)+2] = s->ceil.buffer[(i*5)+2] = -wal->x;
|
s->verts[(i*3)+2] = s->floor.buffer[(i*5)+2] = s->ceil.buffer[(i*5)+2] = -(float)wal->x;
|
||||||
needfloor = wallinvalidate = 1;
|
needfloor = wallinvalidate = 1;
|
||||||
}
|
}
|
||||||
if ((wal->y != s->verts[i*3]))
|
if ((wal->y != s->verts[i*3]))
|
||||||
{
|
{
|
||||||
s->verts[i*3] = s->floor.buffer[i*5] = s->ceil.buffer[i*5] = wal->y;
|
s->verts[i*3] = s->floor.buffer[i*5] = s->ceil.buffer[i*5] = (float)wal->y;
|
||||||
needfloor = wallinvalidate = 1;
|
needfloor = wallinvalidate = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2362,11 +2382,11 @@ static int32_t polymer_updatesector(int16_t sectnum)
|
||||||
// relative texturing
|
// relative texturing
|
||||||
if (curstat & 64)
|
if (curstat & 64)
|
||||||
{
|
{
|
||||||
xpancoef = wal->x - wall[sec->wallptr].x;
|
xpancoef = (float)(wal->x - wall[sec->wallptr].x);
|
||||||
ypancoef = wall[sec->wallptr].y - wal->y;
|
ypancoef = (float)(wall[sec->wallptr].y - wal->y);
|
||||||
|
|
||||||
tex = xpancoef * secangsin + ypancoef * secangcos;
|
tex = (int32_t)(xpancoef * secangsin + ypancoef * secangcos);
|
||||||
tey = xpancoef * secangcos - ypancoef * secangsin;
|
tey = (int32_t)(xpancoef * secangcos - ypancoef * secangsin);
|
||||||
} else {
|
} else {
|
||||||
tex = wal->x;
|
tex = wal->x;
|
||||||
tey = -wal->y;
|
tey = -wal->y;
|
||||||
|
@ -2374,12 +2394,12 @@ static int32_t polymer_updatesector(int16_t sectnum)
|
||||||
|
|
||||||
if ((curstat & (2+64)) == (2+64))
|
if ((curstat & (2+64)) == (2+64))
|
||||||
{
|
{
|
||||||
heidiff = curbuffer[(i*5)+1] - curbuffer[1];
|
heidiff = (int32_t)(curbuffer[(i*5)+1] - curbuffer[1]);
|
||||||
// don't forget the sign, tey could be negative with concave sectors
|
// don't forget the sign, tey could be negative with concave sectors
|
||||||
if (tey >= 0)
|
if (tey >= 0)
|
||||||
tey = sqrt((tey * tey) + (heidiff * heidiff));
|
tey = (int32_t)sqrt((tey * tey) + (heidiff * heidiff));
|
||||||
else
|
else
|
||||||
tey = -sqrt((tey * tey) + (heidiff * heidiff));
|
tey = -(int32_t)sqrt((tey * tey) + (heidiff * heidiff));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curstat & 4)
|
if (curstat & 4)
|
||||||
|
@ -2807,9 +2827,9 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
while (i < 4)
|
while (i < 4)
|
||||||
{
|
{
|
||||||
if ((i == 0) || (i == 3))
|
if ((i == 0) || (i == 3))
|
||||||
dist = xref;
|
dist = (float)xref;
|
||||||
else
|
else
|
||||||
dist = (xref == 0);
|
dist = (float)(xref == 0);
|
||||||
|
|
||||||
w->wall.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
w->wall.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
||||||
w->wall.buffer[(i * 5) + 4] = (-(float)(yref + (w->wall.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
w->wall.buffer[(i * 5) + 4] = (-(float)(yref + (w->wall.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
||||||
|
@ -2877,9 +2897,9 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
while (i < 4)
|
while (i < 4)
|
||||||
{
|
{
|
||||||
if ((i == 0) || (i == 3))
|
if ((i == 0) || (i == 3))
|
||||||
dist = xref;
|
dist = (float)xref;
|
||||||
else
|
else
|
||||||
dist = (xref == 0);
|
dist = (float)(xref == 0);
|
||||||
|
|
||||||
w->wall.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + curxpanning) / (float)(tilesizx[curpicnum]);
|
w->wall.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + curxpanning) / (float)(tilesizx[curpicnum]);
|
||||||
w->wall.buffer[(i * 5) + 4] = (-(float)(yref + (w->wall.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
w->wall.buffer[(i * 5) + 4] = (-(float)(yref + (w->wall.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
||||||
|
@ -2964,9 +2984,9 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
while (i < 4)
|
while (i < 4)
|
||||||
{
|
{
|
||||||
if ((i == 0) || (i == 3))
|
if ((i == 0) || (i == 3))
|
||||||
dist = xref;
|
dist = (float)xref;
|
||||||
else
|
else
|
||||||
dist = (xref == 0);
|
dist = (float)(xref == 0);
|
||||||
|
|
||||||
w->over.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
w->over.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
||||||
w->over.buffer[(i * 5) + 4] = (-(float)(yref + (w->over.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
w->over.buffer[(i * 5) + 4] = (-(float)(yref + (w->over.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
||||||
|
@ -3017,9 +3037,9 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
while (i < 4)
|
while (i < 4)
|
||||||
{
|
{
|
||||||
if ((i == 0) || (i == 3))
|
if ((i == 0) || (i == 3))
|
||||||
dist = xref;
|
dist = (float)xref;
|
||||||
else
|
else
|
||||||
dist = (xref == 0);
|
dist = (float)(xref == 0);
|
||||||
|
|
||||||
w->mask.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
w->mask.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
||||||
w->mask.buffer[(i * 5) + 4] = (-(float)(yref + (w->mask.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
w->mask.buffer[(i * 5) + 4] = (-(float)(yref + (w->mask.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
||||||
|
@ -3391,9 +3411,9 @@ static void polymer_drawsky(int16_t tilenum, char palnum, int8_t shade)
|
||||||
float pos[3];
|
float pos[3];
|
||||||
pthtyp* pth;
|
pthtyp* pth;
|
||||||
|
|
||||||
pos[0] = globalposy;
|
pos[0] = (float)globalposy;
|
||||||
pos[1] = -(float)(globalposz) / 16.0f;
|
pos[1] = -(float)(globalposz) / 16.0f;
|
||||||
pos[2] = -globalposx;
|
pos[2] = -(float)globalposx;
|
||||||
|
|
||||||
bglPushMatrix();
|
bglPushMatrix();
|
||||||
bglLoadIdentity();
|
bglLoadIdentity();
|
||||||
|
@ -3599,9 +3619,9 @@ static void polymer_drawmdsprite(spritetype *tspr)
|
||||||
if ((pr_vbos > 1) && (m->indices == NULL))
|
if ((pr_vbos > 1) && (m->indices == NULL))
|
||||||
polymer_loadmodelvbos(m);
|
polymer_loadmodelvbos(m);
|
||||||
|
|
||||||
spos[0] = tspr->y;
|
spos[0] = (float)tspr->y;
|
||||||
spos[1] = -(float)(tspr->z) / 16.0f;
|
spos[1] = -(float)(tspr->z) / 16.0f;
|
||||||
spos[2] = -tspr->x;
|
spos[2] = -(float)tspr->x;
|
||||||
ang = (float)((tspr->ang+spriteext[tspr->owner].angoff) & 2047) / (2048.0f / 360.0f);
|
ang = (float)((tspr->ang+spriteext[tspr->owner].angoff) & 2047) / (2048.0f / 360.0f);
|
||||||
ang -= 90.0f;
|
ang -= 90.0f;
|
||||||
if (((tspr->cstat>>4) & 3) == 2)
|
if (((tspr->cstat>>4) & 3) == 2)
|
||||||
|
@ -3723,11 +3743,11 @@ static void polymer_drawmdsprite(spritetype *tspr)
|
||||||
if (tspr->cstat & 2)
|
if (tspr->cstat & 2)
|
||||||
{
|
{
|
||||||
if (!(tspr->cstat&512))
|
if (!(tspr->cstat&512))
|
||||||
color[3] = 0.66;
|
color[3] = 0.66f;
|
||||||
else
|
else
|
||||||
color[3] = 0.33;
|
color[3] = 0.33f;
|
||||||
} else
|
} else
|
||||||
color[3] = 1.0;
|
color[3] = 1.0f;
|
||||||
|
|
||||||
color[3] *= (1.0f - spriteext[tspr->owner].alpha);
|
color[3] *= (1.0f - spriteext[tspr->owner].alpha);
|
||||||
|
|
||||||
|
@ -3777,9 +3797,9 @@ static void polymer_drawmdsprite(spritetype *tspr)
|
||||||
|
|
||||||
lradius = prlights[i].range / 1000.0f;
|
lradius = prlights[i].range / 1000.0f;
|
||||||
|
|
||||||
lpos[0] = prlights[i].y;
|
lpos[0] = (float)prlights[i].y;
|
||||||
lpos[1] = -prlights[i].z / 16.0f;
|
lpos[1] = -(float)prlights[i].z / 16.0f;
|
||||||
lpos[2] = -prlights[i].x;
|
lpos[2] = -(float)prlights[i].x;
|
||||||
|
|
||||||
polymer_transformpoint(lpos, tlpos, rootmodelviewmatrix);
|
polymer_transformpoint(lpos, tlpos, rootmodelviewmatrix);
|
||||||
|
|
||||||
|
@ -4218,9 +4238,9 @@ static int32_t polymer_bindmaterial(_prmaterial material, int16_t* lights,
|
||||||
{
|
{
|
||||||
float pos[3], bias[2];
|
float pos[3], bias[2];
|
||||||
|
|
||||||
pos[0] = globalposy;
|
pos[0] = (float)globalposy;
|
||||||
pos[1] = -(float)(globalposz) / 16.0f;
|
pos[1] = -(float)(globalposz) / 16.0f;
|
||||||
pos[2] = -globalposx;
|
pos[2] = -(float)globalposx;
|
||||||
|
|
||||||
bglActiveTextureARB(texunit + GL_TEXTURE0_ARB);
|
bglActiveTextureARB(texunit + GL_TEXTURE0_ARB);
|
||||||
bglBindTexture(GL_TEXTURE_2D, material.normalmap);
|
bglBindTexture(GL_TEXTURE_2D, material.normalmap);
|
||||||
|
@ -4335,9 +4355,9 @@ static int32_t polymer_bindmaterial(_prmaterial material, int16_t* lights,
|
||||||
float range[2];
|
float range[2];
|
||||||
float color[4];
|
float color[4];
|
||||||
|
|
||||||
inpos[0] = prlights[lights[curlight]].y;
|
inpos[0] = (float)prlights[lights[curlight]].y;
|
||||||
inpos[1] = -prlights[lights[curlight]].z / 16.0f;
|
inpos[1] = -(float)prlights[lights[curlight]].z / 16.0f;
|
||||||
inpos[2] = -prlights[lights[curlight]].x;
|
inpos[2] = -(float)prlights[lights[curlight]].x;
|
||||||
|
|
||||||
polymer_transformpoint(inpos, pos, curmodelviewmatrix);
|
polymer_transformpoint(inpos, pos, curmodelviewmatrix);
|
||||||
|
|
||||||
|
@ -4738,9 +4758,9 @@ static int32_t polymer_planeinlight(_prplane* plane, _prlight* light)
|
||||||
if (light->radius)
|
if (light->radius)
|
||||||
return polymer_planeinfrustum(plane, light->frustum);
|
return polymer_planeinfrustum(plane, light->frustum);
|
||||||
|
|
||||||
lightpos[0] = light->y;
|
lightpos[0] = (float)light->y;
|
||||||
lightpos[1] = -light->z / 16.0f;
|
lightpos[1] = -(float)light->z / 16.0f;
|
||||||
lightpos[2] = -light->x;
|
lightpos[2] = -(float)light->x;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
|
@ -4821,9 +4841,9 @@ static void polymer_processspotlight(_prlight* light)
|
||||||
if ((light->horiz > 100) && (light->horiz < 110))
|
if ((light->horiz > 100) && (light->horiz < 110))
|
||||||
light->horiz = 110;
|
light->horiz = 110;
|
||||||
|
|
||||||
lightpos[0] = light->y;
|
lightpos[0] = (float)light->y;
|
||||||
lightpos[1] = -light->z / 16.0f;
|
lightpos[1] = -(float)light->z / 16.0f;
|
||||||
lightpos[2] = -light->x;
|
lightpos[2] = -(float)light->x;
|
||||||
|
|
||||||
// calculate the spot light transformations and matrices
|
// calculate the spot light transformations and matrices
|
||||||
radius = (float)(light->radius) / (2048.0f / 360.0f);
|
radius = (float)(light->radius) / (2048.0f / 360.0f);
|
||||||
|
|
|
@ -6060,7 +6060,7 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
||||||
{
|
{
|
||||||
#ifdef USELZF
|
#ifdef USELZF
|
||||||
cleng = fastlz_compress(pic, miplen, packbuf/*, miplen-1*/);
|
cleng = fastlz_compress(pic, miplen, packbuf/*, miplen-1*/);
|
||||||
if (cleng == 0)
|
if (cleng == 0 || cleng > j-1)
|
||||||
{
|
{
|
||||||
// failed to compress
|
// failed to compress
|
||||||
cleng = miplen;
|
cleng = miplen;
|
||||||
|
@ -6100,9 +6100,9 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
||||||
if (glusetexcachecompression)
|
if (glusetexcachecompression)
|
||||||
{
|
{
|
||||||
#ifdef USELZF
|
#ifdef USELZF
|
||||||
j = (miplen/stride)*8;
|
j = (miplen/stride)<<3;
|
||||||
cleng = fastlz_compress(midbuf,j,packbuf/*,j-1*/);
|
cleng = fastlz_compress(midbuf,j,packbuf/*,j-1*/);
|
||||||
if (cleng == 0)
|
if (cleng == 0 || cleng > j-1)
|
||||||
{
|
{
|
||||||
cleng = j;
|
cleng = j;
|
||||||
writebuf = midbuf;
|
writebuf = midbuf;
|
||||||
|
@ -6115,11 +6115,11 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cleng = (miplen/stride)*8;
|
cleng = (miplen/stride)<<3;
|
||||||
writebuf = midbuf;
|
writebuf = midbuf;
|
||||||
}
|
}
|
||||||
j = B_LITTLE32(cleng);
|
j = B_LITTLE32(cleng);
|
||||||
Bwrite(fil,&j,4);
|
Bwrite(fil,&j,sizeof(j));
|
||||||
Bwrite(fil,writebuf,cleng);
|
Bwrite(fil,writebuf,cleng);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6131,9 +6131,9 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
||||||
if (glusetexcachecompression)
|
if (glusetexcachecompression)
|
||||||
{
|
{
|
||||||
#ifdef USELZF
|
#ifdef USELZF
|
||||||
j = (miplen/stride)*4;
|
j = (miplen/stride)<<2;
|
||||||
cleng = fastlz_compress(midbuf,j,packbuf/*,j-1*/);
|
cleng = fastlz_compress(midbuf,j,packbuf/*,j-1*/);
|
||||||
if (cleng == 0)
|
if (cleng == 0 || cleng > j-1)
|
||||||
{
|
{
|
||||||
cleng = j;
|
cleng = j;
|
||||||
writebuf = midbuf;
|
writebuf = midbuf;
|
||||||
|
@ -6146,11 +6146,11 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cleng = (miplen/stride)*4;
|
cleng = (miplen/stride)<<2;
|
||||||
writebuf = midbuf;
|
writebuf = midbuf;
|
||||||
}
|
}
|
||||||
j = B_LITTLE32(cleng);
|
j = B_LITTLE32(cleng);
|
||||||
Bwrite(fil,&j,4);
|
Bwrite(fil,&j,sizeof(j));
|
||||||
Bwrite(fil,writebuf,cleng);
|
Bwrite(fil,writebuf,cleng);
|
||||||
|
|
||||||
//index_4x4
|
//index_4x4
|
||||||
|
@ -6167,9 +6167,9 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
||||||
if (glusetexcachecompression)
|
if (glusetexcachecompression)
|
||||||
{
|
{
|
||||||
#ifdef USELZF
|
#ifdef USELZF
|
||||||
j = (miplen/stride)*4;
|
j = (miplen/stride)<<2;
|
||||||
cleng = fastlz_compress(midbuf,j,packbuf/*,j-1*/);
|
cleng = fastlz_compress(midbuf,j,packbuf/*,j-1*/);
|
||||||
if (cleng == 0)
|
if (cleng == 0 || cleng > j-1)
|
||||||
{
|
{
|
||||||
cleng = j;
|
cleng = j;
|
||||||
writebuf = midbuf;
|
writebuf = midbuf;
|
||||||
|
@ -6182,11 +6182,11 @@ int32_t dxtfilter(int32_t fil, texcachepicture *pict, char *pic, void *midbuf, c
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cleng = (miplen/stride)*4;
|
cleng = (miplen/stride)<<2;
|
||||||
writebuf = midbuf;
|
writebuf = midbuf;
|
||||||
}
|
}
|
||||||
j = B_LITTLE32(cleng);
|
j = B_LITTLE32(cleng);
|
||||||
Bwrite(fil,&j,4);
|
Bwrite(fil,&j,sizeof(j));
|
||||||
Bwrite(fil,writebuf,cleng);
|
Bwrite(fil,writebuf,cleng);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -204,7 +204,7 @@ SKIPWALLCHECK:
|
||||||
|
|
||||||
if (s->picnum == RPG && sj->extra > 0)
|
if (s->picnum == RPG && sj->extra > 0)
|
||||||
ActorExtra[j].picnum = RPG;
|
ActorExtra[j].picnum = RPG;
|
||||||
else if (A_CheckSpriteFlags(i,SPRITE_PROJECTILE) && ActorExtra[i].projectile.workslike & PROJECTILE_RADIUS_PICNUM && sj->extra > 0)
|
else if (A_CheckSpriteFlags(i,SPRITE_PROJECTILE) && SpriteProjectile[i].workslike & PROJECTILE_RADIUS_PICNUM && sj->extra > 0)
|
||||||
ActorExtra[j].picnum = s->picnum;
|
ActorExtra[j].picnum = s->picnum;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -648,7 +648,9 @@ inline void G_AddGameLight(int32_t radius, int32_t srcsprite, int32_t zoffset, i
|
||||||
|
|
||||||
if (ActorExtra[srcsprite].lightptr == NULL)
|
if (ActorExtra[srcsprite].lightptr == NULL)
|
||||||
{
|
{
|
||||||
|
#pragma pack(push,1)
|
||||||
_prlight mylight;
|
_prlight mylight;
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
mylight.sector = s->sectnum;
|
mylight.sector = s->sectnum;
|
||||||
mylight.x = s->x;
|
mylight.x = s->x;
|
||||||
|
@ -780,6 +782,8 @@ static void G_MoveZombieActors(void)
|
||||||
case RECON__STATIC:
|
case RECON__STATIC:
|
||||||
CS |= 257;
|
CS |= 257;
|
||||||
default:
|
default:
|
||||||
|
if (A_CheckSpriteFlags(i, SPRITE_USEACTIVATOR) && sector[sprite[i].sectnum].lotag & 16384)
|
||||||
|
break;
|
||||||
ActorExtra[i].timetosleep = 0;
|
ActorExtra[i].timetosleep = 0;
|
||||||
A_PlayAlertSound(i);
|
A_PlayAlertSound(i);
|
||||||
changespritestat(i, STAT_ACTOR);
|
changespritestat(i, STAT_ACTOR);
|
||||||
|
@ -861,7 +865,7 @@ int32_t A_IncurDamage(int32_t sn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (A_CheckSpriteTileFlags(ActorExtra[sn].picnum,SPRITE_PROJECTILE) && (ActorExtra[sn].projectile.workslike & PROJECTILE_RPG))
|
if (A_CheckSpriteTileFlags(ActorExtra[sn].picnum,SPRITE_PROJECTILE) && (ActorExtra[sn].projectile->workslike & PROJECTILE_RPG))
|
||||||
{
|
{
|
||||||
g_player[p].ps->posxv +=
|
g_player[p].ps->posxv +=
|
||||||
ActorExtra[sn].extra*(sintable[(ActorExtra[sn].ang+512)&2047])<<2;
|
ActorExtra[sn].extra*(sintable[(ActorExtra[sn].ang+512)&2047])<<2;
|
||||||
|
@ -2360,33 +2364,33 @@ static void G_MoveWeapons(void)
|
||||||
{
|
{
|
||||||
/* Custom projectiles. This is a big hack. */
|
/* Custom projectiles. This is a big hack. */
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.pal >= 0)
|
if (SpriteProjectile[i].pal >= 0)
|
||||||
s->pal=ActorExtra[i].projectile.pal;
|
s->pal=SpriteProjectile[i].pal;
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_KNEE)
|
if (SpriteProjectile[i].workslike & PROJECTILE_KNEE)
|
||||||
KILLIT(i);
|
KILLIT(i);
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_RPG)
|
if (SpriteProjectile[i].workslike & PROJECTILE_RPG)
|
||||||
{
|
{
|
||||||
// if (ActorExtra[i].projectile.workslike & COOLEXPLOSION1)
|
// if (SpriteProjectile[i].workslike & COOLEXPLOSION1)
|
||||||
// if( g_sounds[WIERDSHOT_FLY].num == 0 )
|
// if( g_sounds[WIERDSHOT_FLY].num == 0 )
|
||||||
// A_PlaySound(WIERDSHOT_FLY,i);
|
// A_PlaySound(WIERDSHOT_FLY,i);
|
||||||
|
|
||||||
Bmemcpy(&davect,s,sizeof(vec3_t));
|
Bmemcpy(&davect,s,sizeof(vec3_t));
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.flashcolor)
|
if (SpriteProjectile[i].flashcolor)
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), 2048, ActorExtra[i].projectile.flashcolor,PR_LIGHT_PRIO_LOW_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), 2048, SpriteProjectile[i].flashcolor,PR_LIGHT_PRIO_LOW_GAME);
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_BOUNCESOFFWALLS)
|
if (SpriteProjectile[i].workslike & PROJECTILE_BOUNCESOFFWALLS)
|
||||||
{
|
{
|
||||||
/* if(s->yvel < 1 || s->extra < 2 || (s->xvel|s->zvel) == 0)
|
/* if(s->yvel < 1 || s->extra < 2 || (s->xvel|s->zvel) == 0)
|
||||||
Did this cause the bug with prematurely exploding projectiles? */
|
Did this cause the bug with prematurely exploding projectiles? */
|
||||||
if (s->yvel < 1)
|
if (s->yvel < 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.spawns >= 0)
|
if (SpriteProjectile[i].spawns >= 0)
|
||||||
{
|
{
|
||||||
k = A_Spawn(i,ActorExtra[i].projectile.spawns);
|
k = A_Spawn(i,SpriteProjectile[i].spawns);
|
||||||
|
|
||||||
// Bmemcpy(&sprite[k],&davect,sizeof(vec3_t));
|
// Bmemcpy(&sprite[k],&davect,sizeof(vec3_t));
|
||||||
/*
|
/*
|
||||||
|
@ -2395,21 +2399,21 @@ static void G_MoveWeapons(void)
|
||||||
sprite[k].z = daz;
|
sprite[k].z = daz;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.sxrepeat > 4)
|
if (SpriteProjectile[i].sxrepeat > 4)
|
||||||
sprite[k].xrepeat=ActorExtra[i].projectile.sxrepeat;
|
sprite[k].xrepeat=SpriteProjectile[i].sxrepeat;
|
||||||
if (ActorExtra[i].projectile.syrepeat > 4)
|
if (SpriteProjectile[i].syrepeat > 4)
|
||||||
sprite[k].yrepeat=ActorExtra[i].projectile.syrepeat;
|
sprite[k].yrepeat=SpriteProjectile[i].syrepeat;
|
||||||
}
|
}
|
||||||
if (ActorExtra[i].projectile.isound >= 0)
|
if (SpriteProjectile[i].isound >= 0)
|
||||||
A_PlaySound(ActorExtra[i].projectile.isound,i);
|
A_PlaySound(SpriteProjectile[i].isound,i);
|
||||||
|
|
||||||
s->extra=ActorExtra[i].projectile.extra;
|
s->extra=SpriteProjectile[i].extra;
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.extra_rand > 0)
|
if (SpriteProjectile[i].extra_rand > 0)
|
||||||
s->extra += (krand()&ActorExtra[i].projectile.extra_rand);
|
s->extra += (krand()&SpriteProjectile[i].extra_rand);
|
||||||
|
|
||||||
x = s->extra;
|
x = s->extra;
|
||||||
A_RadiusDamage(i,ActorExtra[i].projectile.hitradius, x>>2,x>>1,x-(x>>2),x);
|
A_RadiusDamage(i,SpriteProjectile[i].hitradius, x>>2,x>>1,x-(x>>2),x);
|
||||||
|
|
||||||
KILLIT(i);
|
KILLIT(i);
|
||||||
}
|
}
|
||||||
|
@ -2417,16 +2421,16 @@ static void G_MoveWeapons(void)
|
||||||
|
|
||||||
p = -1;
|
p = -1;
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_COOLEXPLOSION1)
|
if (SpriteProjectile[i].workslike & PROJECTILE_COOLEXPLOSION1)
|
||||||
{
|
{
|
||||||
s->shade++;
|
s->shade++;
|
||||||
if (s->shade >= 40) KILLIT(i);
|
if (s->shade >= 40) KILLIT(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.drop)
|
if (SpriteProjectile[i].drop)
|
||||||
s->zvel -= ActorExtra[i].projectile.drop;
|
s->zvel -= SpriteProjectile[i].drop;
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_SPIT)
|
if (SpriteProjectile[i].workslike & PROJECTILE_SPIT)
|
||||||
if (s->zvel < 6144)
|
if (s->zvel < 6144)
|
||||||
s->zvel += g_spriteGravity-112;
|
s->zvel += g_spriteGravity-112;
|
||||||
|
|
||||||
|
@ -2442,21 +2446,21 @@ static void G_MoveWeapons(void)
|
||||||
A_GetZLimits(i);
|
A_GetZLimits(i);
|
||||||
qq = CLIPMASK1;
|
qq = CLIPMASK1;
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.trail >= 0)
|
if (SpriteProjectile[i].trail >= 0)
|
||||||
{
|
{
|
||||||
for (f=0; f<=ActorExtra[i].projectile.tnum; f++)
|
for (f=0; f<=SpriteProjectile[i].tnum; f++)
|
||||||
{
|
{
|
||||||
j = A_Spawn(i,ActorExtra[i].projectile.trail);
|
j = A_Spawn(i,SpriteProjectile[i].trail);
|
||||||
if (ActorExtra[i].projectile.toffset != 0)
|
if (SpriteProjectile[i].toffset != 0)
|
||||||
sprite[j].z += (ActorExtra[i].projectile.toffset<<8);
|
sprite[j].z += (SpriteProjectile[i].toffset<<8);
|
||||||
if (ActorExtra[i].projectile.txrepeat >= 0)
|
if (SpriteProjectile[i].txrepeat >= 0)
|
||||||
sprite[j].xrepeat=ActorExtra[i].projectile.txrepeat;
|
sprite[j].xrepeat=SpriteProjectile[i].txrepeat;
|
||||||
if (ActorExtra[i].projectile.tyrepeat >= 0)
|
if (SpriteProjectile[i].tyrepeat >= 0)
|
||||||
sprite[j].yrepeat=ActorExtra[i].projectile.tyrepeat;
|
sprite[j].yrepeat=SpriteProjectile[i].tyrepeat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (f=1; f<=ActorExtra[i].projectile.velmult; f++)
|
for (f=1; f<=SpriteProjectile[i].velmult; f++)
|
||||||
{
|
{
|
||||||
vec3_t tmpvect;
|
vec3_t tmpvect;
|
||||||
Bmemcpy(&davect,s,sizeof(vec3_t));
|
Bmemcpy(&davect,s,sizeof(vec3_t));
|
||||||
|
@ -2470,7 +2474,7 @@ static void G_MoveWeapons(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(ActorExtra[i].projectile.workslike & PROJECTILE_BOUNCESOFFWALLS) &&
|
if (!(SpriteProjectile[i].workslike & PROJECTILE_BOUNCESOFFWALLS) &&
|
||||||
s->yvel >= 0 && sprite[s->yvel].sectnum < MAXSECTORS)
|
s->yvel >= 0 && sprite[s->yvel].sectnum < MAXSECTORS)
|
||||||
if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256)
|
if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256)
|
||||||
j = 49152|s->yvel;
|
j = 49152|s->yvel;
|
||||||
|
@ -2482,45 +2486,45 @@ static void G_MoveWeapons(void)
|
||||||
KILLIT(i);
|
KILLIT(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_TIMED && ActorExtra[i].projectile.range > 0)
|
if (SpriteProjectile[i].workslike & PROJECTILE_TIMED && SpriteProjectile[i].range > 0)
|
||||||
{
|
{
|
||||||
if (!(ActorExtra[i].temp_data[8]))
|
if (!(ActorExtra[i].temp_data[8]))
|
||||||
ActorExtra[i].temp_data[8] = 1;
|
ActorExtra[i].temp_data[8] = 1;
|
||||||
else
|
else
|
||||||
ActorExtra[i].temp_data[8]++;
|
ActorExtra[i].temp_data[8]++;
|
||||||
|
|
||||||
if (ActorExtra[i].temp_data[8] > ActorExtra[i].projectile.range)
|
if (ActorExtra[i].temp_data[8] > SpriteProjectile[i].range)
|
||||||
{
|
{
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_EXPLODEONTIMER)
|
if (SpriteProjectile[i].workslike & PROJECTILE_EXPLODEONTIMER)
|
||||||
{
|
{
|
||||||
if (ActorExtra[i].projectile.spawns >= 0)
|
if (SpriteProjectile[i].spawns >= 0)
|
||||||
{
|
{
|
||||||
k = A_Spawn(i,ActorExtra[i].projectile.spawns);
|
k = A_Spawn(i,SpriteProjectile[i].spawns);
|
||||||
|
|
||||||
Bmemcpy(&sprite[k],&davect,sizeof(vec3_t));
|
Bmemcpy(&sprite[k],&davect,sizeof(vec3_t));
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.sxrepeat > 4)
|
if (SpriteProjectile[i].sxrepeat > 4)
|
||||||
sprite[k].xrepeat=ActorExtra[i].projectile.sxrepeat;
|
sprite[k].xrepeat=SpriteProjectile[i].sxrepeat;
|
||||||
if (ActorExtra[i].projectile.syrepeat > 4)
|
if (SpriteProjectile[i].syrepeat > 4)
|
||||||
sprite[k].yrepeat=ActorExtra[i].projectile.syrepeat;
|
sprite[k].yrepeat=SpriteProjectile[i].syrepeat;
|
||||||
}
|
}
|
||||||
if (ActorExtra[i].projectile.isound >= 0)
|
if (SpriteProjectile[i].isound >= 0)
|
||||||
A_PlaySound(ActorExtra[i].projectile.isound,i);
|
A_PlaySound(SpriteProjectile[i].isound,i);
|
||||||
|
|
||||||
s->extra=ActorExtra[i].projectile.extra;
|
s->extra=SpriteProjectile[i].extra;
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.extra_rand > 0)
|
if (SpriteProjectile[i].extra_rand > 0)
|
||||||
s->extra += (krand()&ActorExtra[i].projectile.extra_rand);
|
s->extra += (krand()&SpriteProjectile[i].extra_rand);
|
||||||
|
|
||||||
x = s->extra;
|
x = s->extra;
|
||||||
A_RadiusDamage(i,ActorExtra[i].projectile.hitradius, x>>2,x>>1,x-(x>>2),x);
|
A_RadiusDamage(i,SpriteProjectile[i].hitradius, x>>2,x>>1,x-(x>>2),x);
|
||||||
}
|
}
|
||||||
KILLIT(i);
|
KILLIT(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((j&49152) != 49152)
|
if ((j&49152) != 49152)
|
||||||
if (!(ActorExtra[i].projectile.workslike & PROJECTILE_BOUNCESOFFWALLS))
|
if (!(SpriteProjectile[i].workslike & PROJECTILE_BOUNCESOFFWALLS))
|
||||||
{
|
{
|
||||||
if (s->z < ActorExtra[i].ceilingz)
|
if (s->z < ActorExtra[i].ceilingz)
|
||||||
{
|
{
|
||||||
|
@ -2536,13 +2540,13 @@ static void G_MoveWeapons(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_WATERBUBBLES &&
|
if (SpriteProjectile[i].workslike & PROJECTILE_WATERBUBBLES &&
|
||||||
sector[s->sectnum].lotag == 2 && rnd(140))
|
sector[s->sectnum].lotag == 2 && rnd(140))
|
||||||
A_Spawn(i,WATERBUBBLE);
|
A_Spawn(i,WATERBUBBLE);
|
||||||
|
|
||||||
if (j != 0)
|
if (j != 0)
|
||||||
{
|
{
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_COOLEXPLOSION1)
|
if (SpriteProjectile[i].workslike & PROJECTILE_COOLEXPLOSION1)
|
||||||
{
|
{
|
||||||
s->xvel = 0;
|
s->xvel = 0;
|
||||||
s->zvel = 0;
|
s->zvel = 0;
|
||||||
|
@ -2552,22 +2556,22 @@ static void G_MoveWeapons(void)
|
||||||
{
|
{
|
||||||
j &= (MAXSPRITES-1);
|
j &= (MAXSPRITES-1);
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_BOUNCESOFFSPRITES)
|
if (SpriteProjectile[i].workslike & PROJECTILE_BOUNCESOFFSPRITES)
|
||||||
{
|
{
|
||||||
s->yvel--;
|
s->yvel--;
|
||||||
|
|
||||||
k = getangle(sprite[j].x-s->x,sprite[j].y-s->y)+(sprite[j].cstat&16?0:512);
|
k = getangle(sprite[j].x-s->x,sprite[j].y-s->y)+(sprite[j].cstat&16?0:512);
|
||||||
s->ang = ((k<<1) - s->ang)&2047;
|
s->ang = ((k<<1) - s->ang)&2047;
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.bsound >= 0)
|
if (SpriteProjectile[i].bsound >= 0)
|
||||||
A_PlaySound(ActorExtra[i].projectile.bsound,i);
|
A_PlaySound(SpriteProjectile[i].bsound,i);
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_LOSESVELOCITY)
|
if (SpriteProjectile[i].workslike & PROJECTILE_LOSESVELOCITY)
|
||||||
{
|
{
|
||||||
s->xvel=s->xvel>>1;
|
s->xvel=s->xvel>>1;
|
||||||
s->zvel=s->zvel>>1;
|
s->zvel=s->zvel>>1;
|
||||||
}
|
}
|
||||||
if (!(ActorExtra[i].projectile.workslike & PROJECTILE_FORCEIMPACT))goto BOLT;
|
if (!(SpriteProjectile[i].workslike & PROJECTILE_FORCEIMPACT))goto BOLT;
|
||||||
}
|
}
|
||||||
|
|
||||||
A_DamageObject(j,i);
|
A_DamageObject(j,i);
|
||||||
|
@ -2577,7 +2581,7 @@ static void G_MoveWeapons(void)
|
||||||
p = sprite[j].yvel;
|
p = sprite[j].yvel;
|
||||||
A_PlaySound(PISTOL_BODYHIT,j);
|
A_PlaySound(PISTOL_BODYHIT,j);
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_SPIT)
|
if (SpriteProjectile[i].workslike & PROJECTILE_SPIT)
|
||||||
{
|
{
|
||||||
g_player[p].ps->horiz += 32;
|
g_player[p].ps->horiz += 32;
|
||||||
g_player[p].ps->return_to_center = 8;
|
g_player[p].ps->return_to_center = 8;
|
||||||
|
@ -2599,32 +2603,32 @@ static void G_MoveWeapons(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_RPG_IMPACT)
|
if (SpriteProjectile[i].workslike & PROJECTILE_RPG_IMPACT)
|
||||||
{
|
{
|
||||||
|
|
||||||
ActorExtra[j].owner = s->owner;
|
ActorExtra[j].owner = s->owner;
|
||||||
ActorExtra[j].picnum = s->picnum;
|
ActorExtra[j].picnum = s->picnum;
|
||||||
ActorExtra[j].extra += ActorExtra[i].projectile.extra;
|
ActorExtra[j].extra += SpriteProjectile[i].extra;
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.spawns >= 0)
|
if (SpriteProjectile[i].spawns >= 0)
|
||||||
{
|
{
|
||||||
k = A_Spawn(i,ActorExtra[i].projectile.spawns);
|
k = A_Spawn(i,SpriteProjectile[i].spawns);
|
||||||
Bmemcpy(&sprite[k],&davect,sizeof(vec3_t));
|
Bmemcpy(&sprite[k],&davect,sizeof(vec3_t));
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.sxrepeat > 4)
|
if (SpriteProjectile[i].sxrepeat > 4)
|
||||||
sprite[k].xrepeat=ActorExtra[i].projectile.sxrepeat;
|
sprite[k].xrepeat=SpriteProjectile[i].sxrepeat;
|
||||||
if (ActorExtra[i].projectile.syrepeat > 4)
|
if (SpriteProjectile[i].syrepeat > 4)
|
||||||
sprite[k].yrepeat=ActorExtra[i].projectile.syrepeat;
|
sprite[k].yrepeat=SpriteProjectile[i].syrepeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.isound >= 0)
|
if (SpriteProjectile[i].isound >= 0)
|
||||||
A_PlaySound(ActorExtra[i].projectile.isound,i);
|
A_PlaySound(SpriteProjectile[i].isound,i);
|
||||||
|
|
||||||
if (!(ActorExtra[i].projectile.workslike & PROJECTILE_FORCEIMPACT))
|
if (!(SpriteProjectile[i].workslike & PROJECTILE_FORCEIMPACT))
|
||||||
KILLIT(i);
|
KILLIT(i);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_FORCEIMPACT)
|
if (SpriteProjectile[i].workslike & PROJECTILE_FORCEIMPACT)
|
||||||
goto BOLT;
|
goto BOLT;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2632,7 +2636,7 @@ static void G_MoveWeapons(void)
|
||||||
{
|
{
|
||||||
j &= (MAXWALLS-1);
|
j &= (MAXWALLS-1);
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_BOUNCESOFFMIRRORS &&
|
if (SpriteProjectile[i].workslike & PROJECTILE_BOUNCESOFFMIRRORS &&
|
||||||
(wall[j].overpicnum == MIRROR || wall[j].picnum == MIRROR))
|
(wall[j].overpicnum == MIRROR || wall[j].picnum == MIRROR))
|
||||||
{
|
{
|
||||||
k = getangle(
|
k = getangle(
|
||||||
|
@ -2648,7 +2652,7 @@ static void G_MoveWeapons(void)
|
||||||
setsprite(i,&davect);
|
setsprite(i,&davect);
|
||||||
A_DamageWall(i,j,(vec3_t *)s,s->picnum);
|
A_DamageWall(i,j,(vec3_t *)s,s->picnum);
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_BOUNCESOFFWALLS)
|
if (SpriteProjectile[i].workslike & PROJECTILE_BOUNCESOFFWALLS)
|
||||||
{
|
{
|
||||||
if (wall[j].overpicnum != MIRROR && wall[j].picnum != MIRROR)
|
if (wall[j].overpicnum != MIRROR && wall[j].picnum != MIRROR)
|
||||||
s->yvel--;
|
s->yvel--;
|
||||||
|
@ -2658,10 +2662,10 @@ static void G_MoveWeapons(void)
|
||||||
wall[wall[j].point2].y-wall[j].y);
|
wall[wall[j].point2].y-wall[j].y);
|
||||||
s->ang = ((k<<1) - s->ang)&2047;
|
s->ang = ((k<<1) - s->ang)&2047;
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.bsound >= 0)
|
if (SpriteProjectile[i].bsound >= 0)
|
||||||
A_PlaySound(ActorExtra[i].projectile.bsound,i);
|
A_PlaySound(SpriteProjectile[i].bsound,i);
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_LOSESVELOCITY)
|
if (SpriteProjectile[i].workslike & PROJECTILE_LOSESVELOCITY)
|
||||||
{
|
{
|
||||||
s->xvel=s->xvel>>1;
|
s->xvel=s->xvel>>1;
|
||||||
s->zvel=s->zvel>>1;
|
s->zvel=s->zvel>>1;
|
||||||
|
@ -2682,17 +2686,17 @@ static void G_MoveWeapons(void)
|
||||||
Sect_DamageCeiling(s->sectnum);
|
Sect_DamageCeiling(s->sectnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_BOUNCESOFFWALLS)
|
if (SpriteProjectile[i].workslike & PROJECTILE_BOUNCESOFFWALLS)
|
||||||
{
|
{
|
||||||
A_DoProjectileBounce(i);
|
A_DoProjectileBounce(i);
|
||||||
A_SetSprite(i,qq);
|
A_SetSprite(i,qq);
|
||||||
|
|
||||||
s->yvel--;
|
s->yvel--;
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.bsound >= 0)
|
if (SpriteProjectile[i].bsound >= 0)
|
||||||
A_PlaySound(ActorExtra[i].projectile.bsound,i);
|
A_PlaySound(SpriteProjectile[i].bsound,i);
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_LOSESVELOCITY)
|
if (SpriteProjectile[i].workslike & PROJECTILE_LOSESVELOCITY)
|
||||||
{
|
{
|
||||||
s->xvel=s->xvel>>1;
|
s->xvel=s->xvel>>1;
|
||||||
s->zvel=s->zvel>>1;
|
s->zvel=s->zvel>>1;
|
||||||
|
@ -2702,7 +2706,7 @@ static void G_MoveWeapons(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_HITSCAN)
|
if (SpriteProjectile[i].workslike & PROJECTILE_HITSCAN)
|
||||||
{
|
{
|
||||||
if (!actorscrptr[sprite[i].picnum])
|
if (!actorscrptr[sprite[i].picnum])
|
||||||
goto BOLT;
|
goto BOLT;
|
||||||
|
@ -2711,27 +2715,27 @@ static void G_MoveWeapons(void)
|
||||||
goto BOLT;
|
goto BOLT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_RPG)
|
if (SpriteProjectile[i].workslike & PROJECTILE_RPG)
|
||||||
{
|
{
|
||||||
if (ActorExtra[i].projectile.spawns > 0)
|
if (SpriteProjectile[i].spawns > 0)
|
||||||
{
|
{
|
||||||
k = A_Spawn(i,ActorExtra[i].projectile.spawns);
|
k = A_Spawn(i,SpriteProjectile[i].spawns);
|
||||||
Bmemcpy(&sprite[k],&davect,sizeof(vec3_t));
|
Bmemcpy(&sprite[k],&davect,sizeof(vec3_t));
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.sxrepeat > 4)
|
if (SpriteProjectile[i].sxrepeat > 4)
|
||||||
sprite[k].xrepeat=ActorExtra[i].projectile.sxrepeat;
|
sprite[k].xrepeat=SpriteProjectile[i].sxrepeat;
|
||||||
if (ActorExtra[i].projectile.syrepeat > 4)
|
if (SpriteProjectile[i].syrepeat > 4)
|
||||||
sprite[k].yrepeat=ActorExtra[i].projectile.syrepeat;
|
sprite[k].yrepeat=SpriteProjectile[i].syrepeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.isound >= 0)
|
if (SpriteProjectile[i].isound >= 0)
|
||||||
A_PlaySound(ActorExtra[i].projectile.isound,i);
|
A_PlaySound(SpriteProjectile[i].isound,i);
|
||||||
|
|
||||||
s->extra=ActorExtra[i].projectile.extra;
|
s->extra=SpriteProjectile[i].extra;
|
||||||
if (ActorExtra[i].projectile.extra_rand > 0)
|
if (SpriteProjectile[i].extra_rand > 0)
|
||||||
s->extra += (krand()&ActorExtra[i].projectile.extra_rand);
|
s->extra += (krand()&SpriteProjectile[i].extra_rand);
|
||||||
|
|
||||||
A_RadiusDamage(i,ActorExtra[i].projectile.hitradius,
|
A_RadiusDamage(i,SpriteProjectile[i].hitradius,
|
||||||
s->extra>>2,s->extra>>1,s->extra-(s->extra>>2),s->extra);
|
s->extra>>2,s->extra>>1,s->extra-(s->extra>>2),s->extra);
|
||||||
KILLIT(i);
|
KILLIT(i);
|
||||||
}
|
}
|
||||||
|
@ -6583,7 +6587,7 @@ static void G_MoveEffectors(void) //STATNUM 3
|
||||||
j = nextspritesect[j];
|
j = nextspritesect[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t[0]) if (t[0]) //If in motion
|
if (t[0]) //If in motion
|
||||||
{
|
{
|
||||||
if (klabs(sc->floorz-t[2]) <= SP)
|
if (klabs(sc->floorz-t[2]) <= SP)
|
||||||
{
|
{
|
||||||
|
@ -7570,29 +7574,20 @@ static void G_MoveEffectors(void) //STATNUM 3
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
case 49:
|
case 49:
|
||||||
{
|
{
|
||||||
if (getrendermode() == 4)
|
if (!A_CheckSpriteFlags(i, SPRITE_NOLIGHT) && getrendermode() == 4 &&
|
||||||
|
!(A_CheckSpriteFlags(i, SPRITE_USEACTIVATOR) && sector[sprite[i].sectnum].lotag & 16384))
|
||||||
{
|
{
|
||||||
if (ActorExtra[i].lightptr == NULL)
|
if (ActorExtra[i].lightptr == NULL)
|
||||||
{
|
{
|
||||||
|
#pragma pack(push,1)
|
||||||
_prlight mylight;
|
_prlight mylight;
|
||||||
|
#pragma pack(pop)
|
||||||
mylight.sector = SECT;
|
mylight.sector = SECT;
|
||||||
mylight.x = SX;
|
Bmemcpy(&mylight, &sprite[i], sizeof(int32_t) * 3);
|
||||||
mylight.y = SY;
|
|
||||||
mylight.z = SZ;
|
|
||||||
mylight.range = SHT;
|
mylight.range = SHT;
|
||||||
if ((sprite[i].xvel | sprite[i].yvel | sprite[i].zvel) != 0)
|
|
||||||
{
|
|
||||||
mylight.color[0] = sprite[i].xvel;
|
mylight.color[0] = sprite[i].xvel;
|
||||||
mylight.color[1] = sprite[i].yvel;
|
mylight.color[1] = sprite[i].yvel;
|
||||||
mylight.color[2] = sprite[i].zvel;
|
mylight.color[2] = sprite[i].zvel;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mylight.color[0] = hictinting[PL].r;
|
|
||||||
mylight.color[1] = hictinting[PL].g;
|
|
||||||
mylight.color[2] = hictinting[PL].b;
|
|
||||||
}
|
|
||||||
mylight.radius = 0;
|
mylight.radius = 0;
|
||||||
mylight.angle = SA;
|
mylight.angle = SA;
|
||||||
mylight.horiz = SH;
|
mylight.horiz = SH;
|
||||||
|
@ -7626,31 +7621,23 @@ static void G_MoveEffectors(void) //STATNUM 3
|
||||||
}
|
}
|
||||||
case 50:
|
case 50:
|
||||||
{
|
{
|
||||||
if (getrendermode() == 4)
|
if (!A_CheckSpriteFlags(i, SPRITE_NOLIGHT) && getrendermode() == 4 &&
|
||||||
|
!(A_CheckSpriteFlags(i, SPRITE_USEACTIVATOR) && sector[sprite[i].sectnum].lotag & 16384))
|
||||||
{
|
{
|
||||||
if (ActorExtra[i].lightptr == NULL)
|
if (ActorExtra[i].lightptr == NULL)
|
||||||
{
|
{
|
||||||
|
#pragma pack(push,1)
|
||||||
_prlight mylight;
|
_prlight mylight;
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
mylight.sector = SECT;
|
mylight.sector = SECT;
|
||||||
mylight.x = SX;
|
Bmemcpy(&mylight, &sprite[i], sizeof(int32_t) * 3);
|
||||||
mylight.y = SY;
|
|
||||||
mylight.z = SZ;
|
|
||||||
mylight.range = SHT;
|
mylight.range = SHT;
|
||||||
if ((sprite[i].xvel | sprite[i].yvel | sprite[i].zvel) != 0)
|
|
||||||
{
|
|
||||||
mylight.color[0] = sprite[i].xvel;
|
mylight.color[0] = sprite[i].xvel;
|
||||||
mylight.color[1] = sprite[i].yvel;
|
mylight.color[1] = sprite[i].yvel;
|
||||||
mylight.color[2] = sprite[i].zvel;
|
mylight.color[2] = sprite[i].zvel;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mylight.color[0] = hictinting[PL].r;
|
|
||||||
mylight.color[1] = hictinting[PL].g;
|
|
||||||
mylight.color[2] = hictinting[PL].b;
|
|
||||||
}
|
|
||||||
mylight.radius = (256-(SS+128))<<1;
|
mylight.radius = (256-(SS+128))<<1;
|
||||||
mylight.faderadius = (int16_t)(mylight.radius * 0.75);
|
mylight.faderadius = (int16_t)(mylight.radius * 0.75f);
|
||||||
mylight.angle = SA;
|
mylight.angle = SA;
|
||||||
mylight.horiz = SH;
|
mylight.horiz = SH;
|
||||||
mylight.minshade = sprite[i].xoffset;
|
mylight.minshade = sprite[i].xoffset;
|
||||||
|
@ -7913,7 +7900,8 @@ void G_MoveWorld(void)
|
||||||
{
|
{
|
||||||
spritetype *s = &sprite[i];
|
spritetype *s = &sprite[i];
|
||||||
|
|
||||||
if ((s->cstat & 32768) || A_CheckSpriteFlags(i, SPRITE_NOLIGHT))
|
if ((sprite[i].picnum != SECTOREFFECTOR && (s->cstat & 32768)) || A_CheckSpriteFlags(i, SPRITE_NOLIGHT) ||
|
||||||
|
(A_CheckSpriteFlags(i, SPRITE_USEACTIVATOR) && sector[sprite[i].sectnum].lotag & 16384))
|
||||||
{
|
{
|
||||||
if (ActorExtra[i].lightptr != NULL)
|
if (ActorExtra[i].lightptr != NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -261,10 +261,10 @@ void A_DeleteSprite(int32_t s);
|
||||||
#pragma pack(push,1)
|
#pragma pack(push,1)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t bits;
|
uint32_t bits; // 4b
|
||||||
int16_t fvel, svel;
|
int16_t fvel, svel; // 4b
|
||||||
int8_t avel, horz;
|
int8_t avel, horz; // 2b
|
||||||
char extbits;
|
int8_t extbits, filler; // 2b
|
||||||
} input_t;
|
} input_t;
|
||||||
|
|
||||||
#define sync dsync // JBF 20040604: sync is a function on some platforms
|
#define sync dsync // JBF 20040604: sync is a function on some platforms
|
||||||
|
@ -278,14 +278,14 @@ typedef struct {
|
||||||
} SOUNDOWNER;
|
} SOUNDOWNER;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int32_t length, num, soundsiz;
|
int32_t length, num, soundsiz; // 12b
|
||||||
char *filename, *ptr, *filename1;
|
char *filename, *ptr, *filename1; // 12b/24b
|
||||||
SOUNDOWNER SoundOwner[4];
|
SOUNDOWNER SoundOwner[4]; // 32b
|
||||||
int16_t ps,pe,vo;
|
int16_t ps,pe,vo; // 6b
|
||||||
char pr,m;
|
char pr,m; // 2b
|
||||||
volatile char lock;
|
|
||||||
} sound_t;
|
} sound_t;
|
||||||
|
|
||||||
|
extern volatile char g_soundlocks[MAXSOUNDS];
|
||||||
extern sound_t g_sounds[MAXSOUNDS];
|
extern sound_t g_sounds[MAXSOUNDS];
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -310,8 +310,47 @@ struct savehead {
|
||||||
int32_t numplr,volnum,levnum,plrskl;
|
int32_t numplr,volnum,levnum,plrskl;
|
||||||
char boardfn[BMAX_PATH];
|
char boardfn[BMAX_PATH];
|
||||||
};
|
};
|
||||||
|
#pragma pack(pop)
|
||||||
|
// the following struct is never saved off anywhere
|
||||||
|
// so we don't need to fuck with its packing
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
int32_t camerax,cameray,cameraz;
|
||||||
|
int32_t const_visibility,uw_framerate;
|
||||||
|
int32_t camera_time,folfvel,folavel,folx,foly,fola;
|
||||||
|
int32_t reccnt,crosshairscale;
|
||||||
|
|
||||||
|
int32_t runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125
|
||||||
|
int32_t democams,color,msgdisptime,statusbarmode;
|
||||||
|
int32_t m_noexits,noexits,autovote,automsg,idplayers;
|
||||||
|
int32_t team, viewbob, weaponsway, althud, weaponscale, textscale;
|
||||||
|
|
||||||
|
int32_t entered_name,screen_tilting,shadows,fta_on,executions,auto_run;
|
||||||
|
int32_t coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair;
|
||||||
|
int32_t playerai,angleinterpolation,obituaries;
|
||||||
|
|
||||||
|
int32_t respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness;
|
||||||
|
int32_t m_respawn_items,m_respawn_monsters,m_respawn_inventory,m_recstat,m_monsters_off,detail;
|
||||||
|
int32_t m_ffire,ffire,m_player_skill,m_level_number,m_volume_number,multimode;
|
||||||
|
int32_t player_skill,level_number,volume_number,m_marker,marker,mouseflip;
|
||||||
|
|
||||||
|
int32_t configversion;
|
||||||
|
|
||||||
|
int16_t cameraang, camerasect, camerahoriz;
|
||||||
|
int16_t pause_on,from_bonus;
|
||||||
|
int16_t camerasprite,last_camsprite;
|
||||||
|
int16_t last_level,secretlevel;
|
||||||
|
|
||||||
|
char overhead_on,last_overhead,showweapons;
|
||||||
|
char god,warp_on,cashman,eog,showallmap;
|
||||||
|
char show_help,scrollmode,clipping;
|
||||||
|
char ridecule[10][40];
|
||||||
|
char savegame[10][22];
|
||||||
|
char pwlockout[128],rtsname[128];
|
||||||
|
char display_bonus_screen;
|
||||||
|
char show_level_text;
|
||||||
|
|
||||||
|
struct {
|
||||||
int32_t UseJoystick;
|
int32_t UseJoystick;
|
||||||
int32_t UseMouse;
|
int32_t UseMouse;
|
||||||
int32_t RunMode;
|
int32_t RunMode;
|
||||||
|
@ -372,47 +411,11 @@ typedef struct {
|
||||||
int32_t CheckForUpdates;
|
int32_t CheckForUpdates;
|
||||||
int32_t LastUpdateCheck;
|
int32_t LastUpdateCheck;
|
||||||
int32_t useprecache;
|
int32_t useprecache;
|
||||||
} config_t;
|
} config;
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int32_t camerax,cameray,cameraz;
|
|
||||||
int32_t const_visibility,uw_framerate;
|
|
||||||
int32_t camera_time,folfvel,folavel,folx,foly,fola;
|
|
||||||
int32_t reccnt,crosshairscale;
|
|
||||||
|
|
||||||
int32_t runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125
|
|
||||||
int32_t democams,color,msgdisptime,statusbarmode;
|
|
||||||
int32_t m_noexits,noexits,autovote,automsg,idplayers;
|
|
||||||
int32_t team, viewbob, weaponsway, althud, weaponscale, textscale;
|
|
||||||
|
|
||||||
int32_t entered_name,screen_tilting,shadows,fta_on,executions,auto_run;
|
|
||||||
int32_t coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair;
|
|
||||||
int32_t playerai,angleinterpolation,obituaries;
|
|
||||||
|
|
||||||
int32_t respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness;
|
|
||||||
int32_t m_respawn_items,m_respawn_monsters,m_respawn_inventory,m_recstat,m_monsters_off,detail;
|
|
||||||
int32_t m_ffire,ffire,m_player_skill,m_level_number,m_volume_number,multimode;
|
|
||||||
int32_t player_skill,level_number,volume_number,m_marker,marker,mouseflip;
|
|
||||||
|
|
||||||
int32_t configversion;
|
|
||||||
|
|
||||||
int16_t cameraang, camerasect, camerahoriz;
|
|
||||||
int16_t pause_on,from_bonus;
|
|
||||||
int16_t camerasprite,last_camsprite;
|
|
||||||
int16_t last_level,secretlevel;
|
|
||||||
|
|
||||||
char overhead_on,last_overhead,showweapons;
|
|
||||||
char god,warp_on,cashman,eog,showallmap;
|
|
||||||
char show_help,scrollmode,clipping;
|
|
||||||
char ridecule[10][40];
|
|
||||||
char savegame[10][22];
|
|
||||||
char pwlockout[128],rtsname[128];
|
|
||||||
char display_bonus_screen;
|
|
||||||
char show_level_text;
|
|
||||||
|
|
||||||
config_t config;
|
|
||||||
} user_defs;
|
} user_defs;
|
||||||
|
|
||||||
|
#pragma pack(push,1)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int32_t ox,oy,oz;
|
int32_t ox,oy,oz;
|
||||||
int16_t oa,os;
|
int16_t oa,os;
|
||||||
|
@ -523,9 +526,15 @@ extern char EnvMusicFilename[MAXVOLUMES+1][BMAX_PATH];
|
||||||
extern int16_t camsprite;
|
extern int16_t camsprite;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int32_t workslike, extra, cstat, extra_rand, hitradius, range, flashcolor;
|
int32_t workslike, extra, cstat, extra_rand; // 16b
|
||||||
int16_t spawns, sound, isound, vel, decal, trail, tnum, drop, clipdist, offset, bounces, bsound, toffset;
|
int32_t hitradius, range, flashcolor; // 12b
|
||||||
int8_t sxrepeat, syrepeat, txrepeat, tyrepeat, shade, xrepeat, yrepeat, pal, velmult;
|
int16_t spawns, sound, isound, vel; // 8b
|
||||||
|
int16_t decal, trail, tnum, drop; // 8b
|
||||||
|
int16_t clipdist, offset, bounces, bsound; // 8b
|
||||||
|
int16_t toffset; // 2b
|
||||||
|
int8_t sxrepeat, syrepeat, txrepeat, tyrepeat; // 4b
|
||||||
|
int8_t shade, xrepeat, yrepeat, pal; // 4b
|
||||||
|
int8_t velmult, filler; // 2b
|
||||||
} projectile_t;
|
} projectile_t;
|
||||||
|
|
||||||
// extern char gotz;
|
// extern char gotz;
|
||||||
|
@ -540,24 +549,27 @@ typedef struct {
|
||||||
// spriteinterpolate sprpos[MAXSPRITES];
|
// spriteinterpolate sprpos[MAXSPRITES];
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int32_t bposx,bposy,bposz;
|
int32_t bposx,bposy,bposz,flags; //16b
|
||||||
int32_t floorz,ceilingz,lastvx,lastvy;
|
int32_t floorz,ceilingz,lastvx,lastvy; //16b
|
||||||
int32_t flags,lasttransport,shootzvel;
|
int32_t lasttransport; //4b
|
||||||
intptr_t temp_data[10]; // sometimes used to hold pointers to con code
|
|
||||||
int16_t picnum,ang,extra,owner,movflag;
|
int16_t timetosleep, shootzvel; //4b
|
||||||
int16_t tempang,actorstayput,dispicnum;
|
|
||||||
int16_t timetosleep;
|
intptr_t temp_data[10]; // 40b/80b sometimes used to hold pointers to con code
|
||||||
char cgg;
|
|
||||||
char filler;
|
int16_t picnum,ang,extra,owner; //8b
|
||||||
projectile_t projectile;
|
int16_t movflag,tempang,actorstayput,dispicnum; //8b
|
||||||
int16_t lightId;
|
int16_t lightId, lightcount, lightmaxrange, cgg; //8b
|
||||||
int16_t lightcount; // how many tics until light is killed
|
|
||||||
int16_t lightmaxrange;
|
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
_prlight *lightptr;
|
_prlight *lightptr; //4b/8b
|
||||||
#else
|
#else
|
||||||
void *lightptr;
|
void *lightptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int8_t filler[16]; // pad struct to 128 bytes
|
||||||
|
|
||||||
|
projectile_t *projectile; //4b/8b
|
||||||
} ActorData_t;
|
} ActorData_t;
|
||||||
|
|
||||||
extern ActorData_t ActorExtra[MAXSPRITES];
|
extern ActorData_t ActorExtra[MAXSPRITES];
|
||||||
|
@ -655,6 +667,8 @@ extern int16_t myangbak[MOVEFIFOSIZ];
|
||||||
extern int16_t BlimpSpawnSprites[15];
|
extern int16_t BlimpSpawnSprites[15];
|
||||||
|
|
||||||
//DUKE3D.H:
|
//DUKE3D.H:
|
||||||
|
|
||||||
|
#pragma pack(pop)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int16_t got_access, last_extra, shield_amount, curr_weapon, holoduke_on;
|
int16_t got_access, last_extra, shield_amount, curr_weapon, holoduke_on;
|
||||||
int16_t firstaid_amount, steroids_amount, holoduke_amount, jetpack_amount;
|
int16_t firstaid_amount, steroids_amount, holoduke_amount, jetpack_amount;
|
||||||
|
@ -662,9 +676,10 @@ typedef struct {
|
||||||
int16_t last_weapon, weapon_pos, kickback_pic;
|
int16_t last_weapon, weapon_pos, kickback_pic;
|
||||||
int16_t ammo_amount[MAX_WEAPONS], frag[MAXPLAYERS];
|
int16_t ammo_amount[MAX_WEAPONS], frag[MAXPLAYERS];
|
||||||
char inven_icon, jetpack_on, heat_on, gotweapon[MAX_WEAPONS];
|
char inven_icon, jetpack_on, heat_on, gotweapon[MAX_WEAPONS];
|
||||||
} STATUSBARTYPE;
|
} DukeStatus_t;
|
||||||
|
#pragma pack(push,1)
|
||||||
|
|
||||||
extern STATUSBARTYPE sbar;
|
extern DukeStatus_t sbar;
|
||||||
extern int32_t g_cameraDistance, g_cameraClock, g_playerFriction,g_showShareware;
|
extern int32_t g_cameraDistance, g_cameraClock, g_playerFriction,g_showShareware;
|
||||||
extern int32_t g_networkBroadcastMode, g_movesPerPacket;
|
extern int32_t g_networkBroadcastMode, g_movesPerPacket;
|
||||||
extern int32_t g_gameQuit;
|
extern int32_t g_gameQuit;
|
||||||
|
@ -839,15 +854,15 @@ typedef struct {
|
||||||
intptr_t *plValues; // array of values when 'per-player', or 'per-actor'
|
intptr_t *plValues; // array of values when 'per-player', or 'per-actor'
|
||||||
} val;
|
} val;
|
||||||
intptr_t lDefault;
|
intptr_t lDefault;
|
||||||
uint32_t dwFlags;
|
uintptr_t dwFlags;
|
||||||
char *szLabel;
|
char *szLabel;
|
||||||
} gamevar_t;
|
} gamevar_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *szLabel;
|
char *szLabel;
|
||||||
int32_t *plValues; // array of values
|
int32_t *plValues; // array of values
|
||||||
int32_t size;
|
intptr_t size;
|
||||||
char bReset;
|
intptr_t bReset;
|
||||||
} gamearray_t;
|
} gamearray_t;
|
||||||
|
|
||||||
extern gamevar_t aGameVars[MAXGAMEVARS];
|
extern gamevar_t aGameVars[MAXGAMEVARS];
|
||||||
|
@ -867,6 +882,7 @@ enum SpriteFlags_t {
|
||||||
SPRITE_NOPAL = 64,
|
SPRITE_NOPAL = 64,
|
||||||
SPRITE_NOEVENTCODE = 128,
|
SPRITE_NOEVENTCODE = 128,
|
||||||
SPRITE_NOLIGHT = 256,
|
SPRITE_NOLIGHT = 256,
|
||||||
|
SPRITE_USEACTIVATOR = 512,
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int16_t SpriteCacheList[MAXTILES][3];
|
extern int16_t SpriteCacheList[MAXTILES][3];
|
||||||
|
@ -961,7 +977,7 @@ enum ProjectileFlags_t {
|
||||||
PROJECTILE_FORCEIMPACT = 262144
|
PROJECTILE_FORCEIMPACT = 262144
|
||||||
};
|
};
|
||||||
|
|
||||||
extern projectile_t ProjectileData[MAXTILES], DefaultProjectileData[MAXTILES];
|
extern projectile_t ProjectileData[MAXTILES], DefaultProjectileData[MAXTILES], SpriteProjectile[MAXSPRITES];
|
||||||
|
|
||||||
// logo control
|
// logo control
|
||||||
|
|
||||||
|
@ -996,39 +1012,42 @@ extern char setupfilename[BMAX_PATH];
|
||||||
typedef struct {
|
typedef struct {
|
||||||
// this needs to have a copy of everything related to the map/actor state
|
// this needs to have a copy of everything related to the map/actor state
|
||||||
// see savegame.c
|
// see savegame.c
|
||||||
int16_t numwalls;
|
|
||||||
walltype wall[MAXWALLS];
|
|
||||||
int16_t numsectors;
|
|
||||||
sectortype sector[MAXSECTORS];
|
|
||||||
spritetype sprite[MAXSPRITES];
|
|
||||||
spriteext_t spriteext[MAXSPRITES];
|
|
||||||
int16_t headspritesect[MAXSECTORS+1];
|
|
||||||
int16_t prevspritesect[MAXSPRITES];
|
|
||||||
int16_t nextspritesect[MAXSPRITES];
|
|
||||||
int16_t headspritestat[MAXSTATUS+1];
|
|
||||||
int16_t prevspritestat[MAXSPRITES];
|
|
||||||
int16_t nextspritestat[MAXSPRITES];
|
|
||||||
int16_t g_numCyclers;
|
|
||||||
int16_t cyclers[MAXCYCLERS][6];
|
|
||||||
PlayerSpawn_t g_playerSpawnPoints[MAXPLAYERS];
|
|
||||||
int16_t g_numAnimWalls;
|
|
||||||
int16_t SpriteDeletionQueue[1024],g_spriteDeleteQueuePos;
|
|
||||||
animwalltype animwall[MAXANIMWALLS];
|
|
||||||
int32_t msx[2048], msy[2048];
|
|
||||||
int16_t g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount;
|
|
||||||
uint8_t show2dsector[(MAXSECTORS+7)>>3];
|
|
||||||
int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128];
|
|
||||||
ActorData_t ActorExtra[MAXSPRITES];
|
|
||||||
int16_t pskyoff[MAXPSKYTILES], pskybits;
|
|
||||||
int32_t animategoal[MAXANIMATES], animatevel[MAXANIMATES], g_animateCount;
|
int32_t animategoal[MAXANIMATES], animatevel[MAXANIMATES], g_animateCount;
|
||||||
int16_t animatesect[MAXANIMATES];
|
|
||||||
int32_t animateptr[MAXANIMATES];
|
int32_t animateptr[MAXANIMATES];
|
||||||
uint8_t g_numPlayerSprites;
|
|
||||||
uint8_t g_earthquakeTime;
|
|
||||||
int32_t lockclock;
|
int32_t lockclock;
|
||||||
|
int32_t msx[2048], msy[2048];
|
||||||
int32_t randomseed, g_globalRandom;
|
int32_t randomseed, g_globalRandom;
|
||||||
uint8_t scriptptrs[MAXSPRITES];
|
|
||||||
intptr_t *vars[MAXGAMEVARS];
|
intptr_t *vars[MAXGAMEVARS];
|
||||||
|
|
||||||
|
int16_t SpriteDeletionQueue[1024],g_spriteDeleteQueuePos;
|
||||||
|
int16_t animatesect[MAXANIMATES];
|
||||||
|
int16_t cyclers[MAXCYCLERS][6];
|
||||||
|
int16_t g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount;
|
||||||
|
int16_t g_numAnimWalls;
|
||||||
|
int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128];
|
||||||
|
int16_t g_numCyclers;
|
||||||
|
int16_t headspritesect[MAXSECTORS+1];
|
||||||
|
int16_t headspritestat[MAXSTATUS+1];
|
||||||
|
int16_t nextspritesect[MAXSPRITES];
|
||||||
|
int16_t nextspritestat[MAXSPRITES];
|
||||||
|
int16_t numsectors;
|
||||||
|
int16_t numwalls;
|
||||||
|
int16_t prevspritesect[MAXSPRITES];
|
||||||
|
int16_t prevspritestat[MAXSPRITES];
|
||||||
|
int16_t pskyoff[MAXPSKYTILES], pskybits;
|
||||||
|
|
||||||
|
uint8_t g_earthquakeTime;
|
||||||
|
uint8_t g_numPlayerSprites;
|
||||||
|
uint8_t scriptptrs[MAXSPRITES];
|
||||||
|
uint8_t show2dsector[(MAXSECTORS+7)>>3];
|
||||||
|
|
||||||
|
ActorData_t ActorExtra[MAXSPRITES];
|
||||||
|
PlayerSpawn_t g_playerSpawnPoints[MAXPLAYERS];
|
||||||
|
animwalltype animwall[MAXANIMWALLS];
|
||||||
|
sectortype sector[MAXSECTORS];
|
||||||
|
spriteext_t spriteext[MAXSPRITES];
|
||||||
|
spritetype sprite[MAXSPRITES];
|
||||||
|
walltype wall[MAXWALLS];
|
||||||
} mapstate_t;
|
} mapstate_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -4594,6 +4594,8 @@ int32_t A_InsertSprite(int32_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int3
|
||||||
G_GameExit("Too many sprites spawned.");
|
G_GameExit("Too many sprites spawned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ActorExtra[i].projectile = &SpriteProjectile[i];
|
||||||
|
|
||||||
ActorExtra[i].bposx = s_x;
|
ActorExtra[i].bposx = s_x;
|
||||||
ActorExtra[i].bposy = s_y;
|
ActorExtra[i].bposy = s_y;
|
||||||
ActorExtra[i].bposz = s_z;
|
ActorExtra[i].bposz = s_z;
|
||||||
|
@ -4709,6 +4711,8 @@ int32_t A_Spawn(int32_t j, int32_t pn)
|
||||||
ActorExtra[i].timetosleep = 0;
|
ActorExtra[i].timetosleep = 0;
|
||||||
ActorExtra[i].extra = -1;
|
ActorExtra[i].extra = -1;
|
||||||
|
|
||||||
|
ActorExtra[i].projectile = &SpriteProjectile[i];
|
||||||
|
|
||||||
ActorExtra[i].bposx = SX;
|
ActorExtra[i].bposx = SX;
|
||||||
ActorExtra[i].bposy = SY;
|
ActorExtra[i].bposy = SY;
|
||||||
ActorExtra[i].bposz = SZ;
|
ActorExtra[i].bposz = SZ;
|
||||||
|
@ -6050,6 +6054,13 @@ int32_t A_Spawn(int32_t j, int32_t pn)
|
||||||
ror_protectedsectors[sp->sectnum] = 1;
|
ror_protectedsectors[sp->sectnum] = 1;
|
||||||
case 49:
|
case 49:
|
||||||
case 50:
|
case 50:
|
||||||
|
{
|
||||||
|
int32_t j, nextj;
|
||||||
|
|
||||||
|
TRAVERSE_SPRITE_SECT(headspritesect[sp->sectnum], j, nextj)
|
||||||
|
if (sprite[j].picnum == ACTIVATOR || sprite[j].picnum == ACTIVATORLOCKED)
|
||||||
|
ActorExtra[i].flags |= SPRITE_USEACTIVATOR;
|
||||||
|
}
|
||||||
changespritestat(i, STAT_EFFECTOR);
|
changespritestat(i, STAT_EFFECTOR);
|
||||||
goto SPAWN_END;
|
goto SPAWN_END;
|
||||||
break;
|
break;
|
||||||
|
@ -11779,7 +11790,7 @@ void G_OpenDemoWrite(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((frecfilep = fopen(d,"wb")) == NULL) return;
|
if ((frecfilep = fopen(d,"wb")) == NULL) return;
|
||||||
fwrite(&dummylong,4,1,frecfilep);
|
fwrite(&dummylong,sizeof(dummylong),1,frecfilep);
|
||||||
fwrite(&ver,sizeof(uint8_t),1,frecfilep);
|
fwrite(&ver,sizeof(uint8_t),1,frecfilep);
|
||||||
fwrite((char *)&ud.volume_number,sizeof(uint8_t),1,frecfilep);
|
fwrite((char *)&ud.volume_number,sizeof(uint8_t),1,frecfilep);
|
||||||
fwrite((char *)&ud.level_number,sizeof(uint8_t),1,frecfilep);
|
fwrite((char *)&ud.level_number,sizeof(uint8_t),1,frecfilep);
|
||||||
|
|
|
@ -490,6 +490,8 @@ const char *keyw[] =
|
||||||
"savenn", // 344
|
"savenn", // 344
|
||||||
"copy", // 345
|
"copy", // 345
|
||||||
"<null>", // 346 internal inversion function
|
"<null>", // 346 internal inversion function
|
||||||
|
"sectorofwall", // 347
|
||||||
|
"qstrncat", // 348
|
||||||
"<null>"
|
"<null>"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1404,7 +1406,8 @@ static inline int32_t ispecial(const char c)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == ' ' || c == 0x0d)
|
if (c == ' ' || c == 0x0d || c == '(' || c == ')' ||
|
||||||
|
c == ',' || c == ';')
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2970,20 +2973,13 @@ static int32_t C_ParseCommand(void)
|
||||||
case CON_QSPRINTF:
|
case CON_QSPRINTF:
|
||||||
C_GetNextValue(LABEL_DEFINE);
|
C_GetNextValue(LABEL_DEFINE);
|
||||||
C_GetNextValue(LABEL_DEFINE);
|
C_GetNextValue(LABEL_DEFINE);
|
||||||
for (j=3; j>=0; j--)
|
|
||||||
{
|
|
||||||
if (C_GetKeyword() == -1)
|
|
||||||
C_GetNextVar();
|
|
||||||
else break;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (j > -1)
|
j = 0;
|
||||||
{
|
|
||||||
bitptr[(g_scriptPtr-script)>>3] &= ~(BITPTR_POINTER<<((g_scriptPtr-script)&7));
|
while (C_GetKeyword() == -1 && j < 32)
|
||||||
*g_scriptPtr = 0;
|
C_GetNextVar(), j++;
|
||||||
g_scriptPtr++;
|
|
||||||
j--;
|
*g_scriptPtr++ = CON_NULLOP + (g_lineNumber<<12);
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case CON_ESPAWN:
|
case CON_ESPAWN:
|
||||||
|
@ -3810,6 +3806,11 @@ static int32_t C_ParseCommand(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case CON_SECTOROFWALL:
|
||||||
|
C_GetNextVarType(GAMEVAR_READONLY);
|
||||||
|
C_GetNextVar();
|
||||||
|
return 0;
|
||||||
|
|
||||||
case CON_GETTICKS:
|
case CON_GETTICKS:
|
||||||
if (C_CheckEventSync(g_currentEvent))
|
if (C_CheckEventSync(g_currentEvent))
|
||||||
{
|
{
|
||||||
|
@ -4737,6 +4738,9 @@ repeatcase:
|
||||||
return 1; // end of block
|
return 1; // end of block
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CON_QSTRNCAT:
|
||||||
|
C_GetManyVars(3);
|
||||||
|
return 0;
|
||||||
case CON_CHANGESPRITESTAT:
|
case CON_CHANGESPRITESTAT:
|
||||||
case CON_CHANGESPRITESECT:
|
case CON_CHANGESPRITESECT:
|
||||||
case CON_ZSHOOTVAR:
|
case CON_ZSHOOTVAR:
|
||||||
|
@ -5449,6 +5453,7 @@ repeatcase:
|
||||||
|
|
||||||
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0)
|
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
if (*textptr == '%' && *(textptr+1) == 's')
|
if (*textptr == '%' && *(textptr+1) == 's')
|
||||||
{
|
{
|
||||||
initprintf("%s:%d: error: quote text contains string identifier.\n",g_szScriptFileName,g_lineNumber);
|
initprintf("%s:%d: error: quote text contains string identifier.\n",g_szScriptFileName,g_lineNumber);
|
||||||
|
@ -5456,6 +5461,7 @@ repeatcase:
|
||||||
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++;
|
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if (tw == CON_DEFINEQUOTE)
|
if (tw == CON_DEFINEQUOTE)
|
||||||
*(ScriptQuotes[k]+i) = *textptr;
|
*(ScriptQuotes[k]+i) = *textptr;
|
||||||
else
|
else
|
||||||
|
@ -5931,14 +5937,20 @@ static void C_InitProjectiles(void)
|
||||||
int32_t i;
|
int32_t i;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int32_t workslike, extra, cstat, extra_rand, hitradius, range, flashcolor;
|
int32_t workslike, extra, cstat, extra_rand; // 16b
|
||||||
int16_t spawns, sound, isound, vel, decal, trail, tnum, drop, clipdist, offset, bounces, bsound, toffset;
|
int32_t hitradius, range, flashcolor; // 12b
|
||||||
int8_t sxrepeat, syrepeat, txrepeat, tyrepeat, shade, xrepeat, yrepeat, pal, velmult;
|
int16_t spawns, sound, isound, vel; // 8b
|
||||||
|
int16_t decal, trail, tnum, drop; // 8b
|
||||||
|
int16_t clipdist, offset, bounces, bsound; // 8b
|
||||||
|
int16_t toffset; // 2b
|
||||||
|
int8_t sxrepeat, syrepeat, txrepeat, tyrepeat; // 4b
|
||||||
|
int8_t shade, xrepeat, yrepeat, pal; // 4b
|
||||||
|
int8_t velmult, filler; // 2b
|
||||||
} DefaultProjectile =
|
} DefaultProjectile =
|
||||||
{
|
{
|
||||||
1, 100, -1, -1, 2048, 0, 0,
|
1, 100, -1, -1, 2048, 0, 0,
|
||||||
SMALLSMOKE, -1, -1, 600, BULLETHOLE, -1, 0, 0, 32, 448, g_numFreezeBounces, PIPEBOMB_BOUNCE, 1,
|
SMALLSMOKE, -1, -1, 600, BULLETHOLE, -1, 0, 0, 32, 448, g_numFreezeBounces, PIPEBOMB_BOUNCE, 1,
|
||||||
-1, -1, -1, -1, -96, 18, 18, 0, 1
|
-1, -1, -1, -1, -96, 18, 18, 0, 1, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
// this will only happen if I forget to update this function...
|
// this will only happen if I forget to update this function...
|
||||||
|
|
|
@ -904,6 +904,8 @@ enum ScriptKeywords_t
|
||||||
CON_SAVENN, // 344
|
CON_SAVENN, // 344
|
||||||
CON_COPY, // 345
|
CON_COPY, // 345
|
||||||
CON_INV, // 346
|
CON_INV, // 346
|
||||||
|
CON_SECTOROFWALL, // 347
|
||||||
|
CON_QSTRNCAT, // 348
|
||||||
CON_END
|
CON_END
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1632,6 +1632,7 @@ static int32_t X_DoExecute(register int32_t once)
|
||||||
}
|
}
|
||||||
|
|
||||||
case CON_GETPNAME:
|
case CON_GETPNAME:
|
||||||
|
case CON_QSTRNCAT:
|
||||||
case CON_QSTRCAT:
|
case CON_QSTRCAT:
|
||||||
case CON_QSTRCPY:
|
case CON_QSTRCPY:
|
||||||
case CON_QGETSYSSTR:
|
case CON_QGETSYSSTR:
|
||||||
|
@ -1690,19 +1691,15 @@ static int32_t X_DoExecute(register int32_t once)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CON_QSTRCAT:
|
case CON_QSTRCAT:
|
||||||
if ((ScriptQuotes[i] == NULL || ScriptQuotes[j] == NULL) /* && g_scriptSanityChecks */)
|
if ((ScriptQuotes[i] == NULL || ScriptQuotes[j] == NULL) /* && g_scriptSanityChecks */) goto nullquote;
|
||||||
{
|
|
||||||
OSD_Printf(CON_ERROR "null quote %d\n",g_errorLineNum,keyw[g_tw],ScriptQuotes[i] ? j : i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Bstrncat(ScriptQuotes[i],ScriptQuotes[j],(MAXQUOTELEN-1)-Bstrlen(ScriptQuotes[i]));
|
Bstrncat(ScriptQuotes[i],ScriptQuotes[j],(MAXQUOTELEN-1)-Bstrlen(ScriptQuotes[i]));
|
||||||
break;
|
break;
|
||||||
case CON_QSTRCPY:
|
case CON_QSTRNCAT:
|
||||||
if ((ScriptQuotes[i] == NULL || ScriptQuotes[j] == NULL) /* && g_scriptSanityChecks */)
|
if ((ScriptQuotes[i] == NULL || ScriptQuotes[j] == NULL) /* && g_scriptSanityChecks */) goto nullquote;
|
||||||
{
|
Bstrncat(ScriptQuotes[i],ScriptQuotes[j],Gv_GetVarX(*insptr++));
|
||||||
OSD_Printf(CON_ERROR "null quote %d\n",g_errorLineNum,keyw[g_tw],ScriptQuotes[i] ? j : i);
|
|
||||||
break;
|
break;
|
||||||
}
|
case CON_QSTRCPY:
|
||||||
|
if ((ScriptQuotes[i] == NULL || ScriptQuotes[j] == NULL) /* && g_scriptSanityChecks */) goto nullquote;
|
||||||
Bstrcpy(ScriptQuotes[i],ScriptQuotes[j]);
|
Bstrcpy(ScriptQuotes[i],ScriptQuotes[j]);
|
||||||
break;
|
break;
|
||||||
case CON_CHANGESPRITESECT:
|
case CON_CHANGESPRITESECT:
|
||||||
|
@ -1710,6 +1707,10 @@ static int32_t X_DoExecute(register int32_t once)
|
||||||
if ((j<0 || j>=numsectors) /* && g_scriptSanityChecks */) {OSD_Printf(CON_ERROR "Invalid sector %d\n",g_errorLineNum,keyw[g_tw],j); break;}
|
if ((j<0 || j>=numsectors) /* && g_scriptSanityChecks */) {OSD_Printf(CON_ERROR "Invalid sector %d\n",g_errorLineNum,keyw[g_tw],j); break;}
|
||||||
changespritesect(i,j);
|
changespritesect(i,j);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
nullquote:
|
||||||
|
OSD_Printf(CON_ERROR "null quote %d\n",g_errorLineNum,keyw[g_tw],ScriptQuotes[i] ? j : i);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3104,6 +3105,15 @@ static int32_t X_DoExecute(register int32_t once)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CON_SECTOROFWALL:
|
||||||
|
insptr++;
|
||||||
|
{
|
||||||
|
int32_t j = *insptr++;
|
||||||
|
|
||||||
|
Gv_SetVarX(j, sectorofwall(Gv_GetVarX(*insptr++)));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case CON_QSPRINTF:
|
case CON_QSPRINTF:
|
||||||
insptr++;
|
insptr++;
|
||||||
{
|
{
|
||||||
|
@ -3116,10 +3126,55 @@ static int32_t X_DoExecute(register int32_t once)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
int32_t var1 = Gv_GetVarX(*insptr++), var2 = Gv_GetVarX(*insptr++);
|
int32_t arg[32], i = 0, j = 0, k = 0;
|
||||||
int32_t var3 = Gv_GetVarX(*insptr++), var4 = Gv_GetVarX(*insptr++);
|
int32_t len = Bstrlen(ScriptQuotes[sq]);
|
||||||
Bstrcpy(tempbuf,ScriptQuotes[sq]);
|
char tempbuf[MAXQUOTELEN];
|
||||||
Bsprintf(ScriptQuotes[dq],tempbuf,var1,var2,var3,var4);
|
|
||||||
|
while ((*insptr & 0xFFF) != CON_NULLOP)
|
||||||
|
arg[i++] = Gv_GetVarX(*insptr++);
|
||||||
|
|
||||||
|
insptr++; // skip the NOP
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
while (k < len && j < MAXQUOTELEN && ScriptQuotes[sq][k] != '%')
|
||||||
|
tempbuf[j++] = ScriptQuotes[sq][k++];
|
||||||
|
|
||||||
|
if (ScriptQuotes[sq][k] == '%')
|
||||||
|
{
|
||||||
|
k++;
|
||||||
|
switch (ScriptQuotes[sq][k])
|
||||||
|
{
|
||||||
|
case 'l':
|
||||||
|
k++;
|
||||||
|
case 'd':
|
||||||
|
{
|
||||||
|
char buf[16];
|
||||||
|
|
||||||
|
Bstrcat(tempbuf, itoa(arg[i++], buf, 10));
|
||||||
|
j += Bstrlen(buf);
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 's':
|
||||||
|
Bstrcat(tempbuf, ScriptQuotes[arg[i]]);
|
||||||
|
j += Bstrlen(ScriptQuotes[arg[i++]]);
|
||||||
|
k++;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
tempbuf[j++] = ScriptQuotes[sq][k++];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (k < len && j < MAXQUOTELEN);
|
||||||
|
|
||||||
|
tempbuf[j] = '\0';
|
||||||
|
Bstrcpy(ScriptQuotes[dq], tempbuf);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3441,6 +3496,7 @@ static int32_t X_DoExecute(register int32_t once)
|
||||||
j = nextspritestat[j];
|
j = nextspritestat[j];
|
||||||
}
|
}
|
||||||
while (j>=0);
|
while (j>=0);
|
||||||
|
|
||||||
if (tw==CON_FINDNEARACTORZ || j == MAXSPRITES)
|
if (tw==CON_FINDNEARACTORZ || j == MAXSPRITES)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4664,7 +4720,7 @@ void A_Execute(int32_t iActor,int32_t iPlayer,int32_t lDist)
|
||||||
if (ActorExtra[vm.g_i].timetosleep > 1)
|
if (ActorExtra[vm.g_i].timetosleep > 1)
|
||||||
ActorExtra[vm.g_i].timetosleep--;
|
ActorExtra[vm.g_i].timetosleep--;
|
||||||
else if (ActorExtra[vm.g_i].timetosleep == 1)
|
else if (ActorExtra[vm.g_i].timetosleep == 1)
|
||||||
changespritestat(vm.g_i,2);
|
changespritestat(vm.g_i,STAT_ZOMBIEACTOR);
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4679,10 +4735,12 @@ void A_Execute(int32_t iActor,int32_t iPlayer,int32_t lDist)
|
||||||
}
|
}
|
||||||
else if (ud.respawn_items == 1 && (vm.g_sp->cstat&32768)) return;
|
else if (ud.respawn_items == 1 && (vm.g_sp->cstat&32768)) return;
|
||||||
|
|
||||||
if (ActorExtra[vm.g_i].timetosleep > 1)
|
if (A_CheckSpriteFlags(vm.g_i, SPRITE_USEACTIVATOR) && sector[vm.g_sp->sectnum].lotag & 16384)
|
||||||
|
changespritestat(vm.g_i,STAT_ZOMBIEACTOR);
|
||||||
|
else if (ActorExtra[vm.g_i].timetosleep > 1)
|
||||||
ActorExtra[vm.g_i].timetosleep--;
|
ActorExtra[vm.g_i].timetosleep--;
|
||||||
else if (ActorExtra[vm.g_i].timetosleep == 1)
|
else if (ActorExtra[vm.g_i].timetosleep == 1)
|
||||||
changespritestat(vm.g_i,2);
|
changespritestat(vm.g_i,STAT_ZOMBIEACTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void G_SaveMapState(mapstate_t *save)
|
void G_SaveMapState(mapstate_t *save)
|
||||||
|
|
|
@ -936,262 +936,262 @@ static void __fastcall X_AccessActiveProjectile(int32_t iSet, int32_t lVar1, int
|
||||||
case PROJ_WORKSLIKE:
|
case PROJ_WORKSLIKE:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.workslike=lValue;
|
SpriteProjectile[proj].workslike=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.workslike, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].workslike, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_SPAWNS:
|
case PROJ_SPAWNS:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.spawns=lValue;
|
SpriteProjectile[proj].spawns=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.spawns, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].spawns, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_SXREPEAT:
|
case PROJ_SXREPEAT:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.sxrepeat=lValue;
|
SpriteProjectile[proj].sxrepeat=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.sxrepeat, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].sxrepeat, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_SYREPEAT:
|
case PROJ_SYREPEAT:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.syrepeat=lValue;
|
SpriteProjectile[proj].syrepeat=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.syrepeat, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].syrepeat, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_SOUND:
|
case PROJ_SOUND:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.sound=lValue;
|
SpriteProjectile[proj].sound=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.sound, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].sound, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_ISOUND:
|
case PROJ_ISOUND:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.isound=lValue;
|
SpriteProjectile[proj].isound=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.isound, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].isound, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_VEL:
|
case PROJ_VEL:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.vel=lValue;
|
SpriteProjectile[proj].vel=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.vel, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].vel, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_EXTRA:
|
case PROJ_EXTRA:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.extra=lValue;
|
SpriteProjectile[proj].extra=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.extra, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].extra, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_DECAL:
|
case PROJ_DECAL:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.decal=lValue;
|
SpriteProjectile[proj].decal=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.decal, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].decal, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_TRAIL:
|
case PROJ_TRAIL:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.trail=lValue;
|
SpriteProjectile[proj].trail=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.trail, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].trail, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_TXREPEAT:
|
case PROJ_TXREPEAT:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.txrepeat=lValue;
|
SpriteProjectile[proj].txrepeat=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.txrepeat, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].txrepeat, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_TYREPEAT:
|
case PROJ_TYREPEAT:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.tyrepeat=lValue;
|
SpriteProjectile[proj].tyrepeat=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.tyrepeat, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].tyrepeat, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_TOFFSET:
|
case PROJ_TOFFSET:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.toffset=lValue;
|
SpriteProjectile[proj].toffset=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.toffset, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].toffset, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_TNUM:
|
case PROJ_TNUM:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.tnum=lValue;
|
SpriteProjectile[proj].tnum=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.tnum, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].tnum, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_DROP:
|
case PROJ_DROP:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.drop=lValue;
|
SpriteProjectile[proj].drop=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.drop, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].drop, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_CSTAT:
|
case PROJ_CSTAT:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.cstat=lValue;
|
SpriteProjectile[proj].cstat=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.cstat, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].cstat, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_CLIPDIST:
|
case PROJ_CLIPDIST:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.clipdist=lValue;
|
SpriteProjectile[proj].clipdist=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.clipdist, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].clipdist, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_SHADE:
|
case PROJ_SHADE:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.shade=lValue;
|
SpriteProjectile[proj].shade=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.shade, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].shade, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_XREPEAT:
|
case PROJ_XREPEAT:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.xrepeat=lValue;
|
SpriteProjectile[proj].xrepeat=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.xrepeat, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].xrepeat, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_YREPEAT:
|
case PROJ_YREPEAT:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.yrepeat=lValue;
|
SpriteProjectile[proj].yrepeat=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.yrepeat, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].yrepeat, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_PAL:
|
case PROJ_PAL:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.pal=lValue;
|
SpriteProjectile[proj].pal=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.pal, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].pal, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_EXTRA_RAND:
|
case PROJ_EXTRA_RAND:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.extra_rand=lValue;
|
SpriteProjectile[proj].extra_rand=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.extra_rand, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].extra_rand, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_HITRADIUS:
|
case PROJ_HITRADIUS:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.hitradius=lValue;
|
SpriteProjectile[proj].hitradius=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.hitradius, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].hitradius, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_VEL_MULT:
|
case PROJ_VEL_MULT:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.velmult=lValue;
|
SpriteProjectile[proj].velmult=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.velmult, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].velmult, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_OFFSET:
|
case PROJ_OFFSET:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.offset=lValue;
|
SpriteProjectile[proj].offset=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.offset, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].offset, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_BOUNCES:
|
case PROJ_BOUNCES:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.bounces=lValue;
|
SpriteProjectile[proj].bounces=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.bounces, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].bounces, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_BSOUND:
|
case PROJ_BSOUND:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.bsound=lValue;
|
SpriteProjectile[proj].bsound=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.bsound, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].bsound, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_RANGE:
|
case PROJ_RANGE:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.range=lValue;
|
SpriteProjectile[proj].range=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.range, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].range, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case PROJ_FLASH_COLOR:
|
case PROJ_FLASH_COLOR:
|
||||||
if (iSet)
|
if (iSet)
|
||||||
{
|
{
|
||||||
ActorExtra[proj].projectile.flashcolor=lValue;
|
SpriteProjectile[proj].flashcolor=lValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Gv_SetVar(lVar2, ActorExtra[proj].projectile.flashcolor, vm.g_i, vm.g_p);
|
Gv_SetVar(lVar2, SpriteProjectile[proj].flashcolor, vm.g_i, vm.g_p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -56,12 +56,9 @@ int16_t g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount;
|
||||||
|
|
||||||
int32_t g_currentMenu;
|
int32_t g_currentMenu;
|
||||||
|
|
||||||
|
|
||||||
#pragma pack(push,1)
|
|
||||||
|
|
||||||
map_t MapInfo[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" music
|
map_t MapInfo[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" music
|
||||||
sound_t g_sounds[ MAXSOUNDS ];
|
sound_t g_sounds[ MAXSOUNDS ];
|
||||||
#pragma pack(pop)
|
volatile char g_soundlocks[MAXSOUNDS];
|
||||||
|
|
||||||
char EpisodeNames[MAXVOLUMES][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY" };
|
char EpisodeNames[MAXVOLUMES][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY" };
|
||||||
char SkillNames[5][33] = { "PIECE OF CAKE", "LET'S ROCK", "COME GET SOME", "DAMN I'M GOOD" };
|
char SkillNames[5][33] = { "PIECE OF CAKE", "LET'S ROCK", "COME GET SOME", "DAMN I'M GOOD" };
|
||||||
|
@ -169,7 +166,7 @@ int32_t g_damageCameras,g_freezerSelfDamage=0,g_tripbombLaserMode=0;
|
||||||
int32_t g_networkBroadcastMode = 255, g_movesPerPacket = 1,g_gameQuit = 0,everyothertime;
|
int32_t g_networkBroadcastMode = 255, g_movesPerPacket = 1,g_gameQuit = 0,everyothertime;
|
||||||
int32_t g_numFreezeBounces=3,g_rpgBlastRadius,g_pipebombBlastRadius,g_tripbombBlastRadius,
|
int32_t g_numFreezeBounces=3,g_rpgBlastRadius,g_pipebombBlastRadius,g_tripbombBlastRadius,
|
||||||
g_shrinkerBlastRadius,g_morterBlastRadius,g_bouncemineBlastRadius,g_seenineBlastRadius;
|
g_shrinkerBlastRadius,g_morterBlastRadius,g_bouncemineBlastRadius,g_seenineBlastRadius;
|
||||||
STATUSBARTYPE sbar;
|
DukeStatus_t sbar;
|
||||||
|
|
||||||
int32_t mymaxlag, otherminlag, bufferjitter = 1;
|
int32_t mymaxlag, otherminlag, bufferjitter = 1;
|
||||||
int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128];
|
int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128];
|
||||||
|
@ -183,7 +180,7 @@ int32_t nextvoxid = 0;
|
||||||
|
|
||||||
int32_t SpriteFlags[MAXTILES];
|
int32_t SpriteFlags[MAXTILES];
|
||||||
|
|
||||||
projectile_t ProjectileData[MAXTILES], DefaultProjectileData[MAXTILES];
|
projectile_t ProjectileData[MAXTILES], DefaultProjectileData[MAXTILES], SpriteProjectile[MAXSPRITES];
|
||||||
|
|
||||||
char CheatKeys[2] = { sc_D, sc_N };
|
char CheatKeys[2] = { sc_D, sc_N };
|
||||||
char setupfilename[BMAX_PATH]= SETUPFILENAME;
|
char setupfilename[BMAX_PATH]= SETUPFILENAME;
|
||||||
|
|
|
@ -26,10 +26,10 @@ struct grpfile *foundgrps = NULL;
|
||||||
static struct grpcache
|
static struct grpcache
|
||||||
{
|
{
|
||||||
struct grpcache *next;
|
struct grpcache *next;
|
||||||
char name[BMAX_PATH+1];
|
|
||||||
int32_t size;
|
int32_t size;
|
||||||
int32_t mtime;
|
int32_t mtime;
|
||||||
int32_t crcval;
|
int32_t crcval;
|
||||||
|
char name[BMAX_PATH];
|
||||||
}
|
}
|
||||||
*grpcache = NULL, *usedgrpcache = NULL;
|
*grpcache = NULL, *usedgrpcache = NULL;
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,6 @@ BEGIN
|
||||||
CONTROL "&Polymer", IDCPOLYMER, "BUTTON", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 203, 6, 40, 10
|
CONTROL "&Polymer", IDCPOLYMER, "BUTTON", BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 203, 6, 40, 10
|
||||||
|
|
||||||
CONTROL "Input devices:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 20, 50, 8
|
CONTROL "Input devices:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 20, 50, 8
|
||||||
#if 0
|
|
||||||
CONTROL "Mo&use", IDCINPUTMOUSE, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 60, 22, 49, 8
|
|
||||||
CONTROL "&Joystick", IDCINPUTJOY, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 110, 22, 49, 8
|
|
||||||
#endif
|
|
||||||
CONTROL "", IDCINPUT, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 60, 19, 86, 56
|
CONTROL "", IDCINPUT, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 60, 19, 86, 56
|
||||||
CONTROL "&Game:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 35, 100, 8
|
CONTROL "&Game:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 35, 100, 8
|
||||||
CONTROL "", IDCDATA, "LISTBOX", LBS_NOINTEGRALHEIGHT | LBS_USETABSTOPS | LBS_STANDARD | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 45, 226, 43
|
CONTROL "", IDCDATA, "LISTBOX", LBS_NOINTEGRALHEIGHT | LBS_USETABSTOPS | LBS_STANDARD | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 45, 226, 43
|
||||||
|
|
|
@ -585,7 +585,7 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
|
||||||
if (hitinfo.hitwall >= 0 || hitinfo.hitsprite >= 0)
|
if (hitinfo.hitwall >= 0 || hitinfo.hitsprite >= 0)
|
||||||
{
|
{
|
||||||
j = A_InsertSprite(hitinfo.hitsect,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,atwith,-15,0,0,sa,32,0,i,4);
|
j = A_InsertSprite(hitinfo.hitsect,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,atwith,-15,0,0,sa,32,0,i,4);
|
||||||
ActorExtra[j].projectile.workslike = ProjectileData[sprite[j].picnum].workslike;
|
ActorExtra[j].projectile->workslike = ProjectileData[sprite[j].picnum].workslike;
|
||||||
sprite[j].extra = ProjectileData[atwith].extra;
|
sprite[j].extra = ProjectileData[atwith].extra;
|
||||||
if (ProjectileData[atwith].extra_rand > 0)
|
if (ProjectileData[atwith].extra_rand > 0)
|
||||||
sprite[j].extra += (krand()&ProjectileData[atwith].extra_rand);
|
sprite[j].extra += (krand()&ProjectileData[atwith].extra_rand);
|
||||||
|
@ -5168,6 +5168,22 @@ SHOOTINCODE:
|
||||||
X_OnEvent(EVENT_HOLSTER, pi, snum, -1);
|
X_OnEvent(EVENT_HOLSTER, pi, snum, -1);
|
||||||
if (aGameVars[g_iReturnVarID].val.lValue == 0)
|
if (aGameVars[g_iReturnVarID].val.lValue == 0)
|
||||||
{
|
{
|
||||||
|
if (p->curr_weapon > KNEE_WEAPON)
|
||||||
|
{
|
||||||
|
if (p->holster_weapon == 0 && p->weapon_pos == 0)
|
||||||
|
{
|
||||||
|
p->holster_weapon = 1;
|
||||||
|
p->weapon_pos = -1;
|
||||||
|
P_DoQuote(73,p);
|
||||||
|
}
|
||||||
|
else if (p->holster_weapon == 1 && p->weapon_pos == -9)
|
||||||
|
{
|
||||||
|
p->holster_weapon = 0;
|
||||||
|
p->weapon_pos = 10;
|
||||||
|
P_DoQuote(74,p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_HOLSTER_CLEARS_CLIP)
|
if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_HOLSTER_CLEARS_CLIP)
|
||||||
{
|
{
|
||||||
if (p->ammo_amount[p->curr_weapon] > aplWeaponClip[p->curr_weapon][snum]
|
if (p->ammo_amount[p->curr_weapon] > aplWeaponClip[p->curr_weapon][snum]
|
||||||
|
|
|
@ -301,8 +301,8 @@ static int32_t G_CacheSound(uint32_t num)
|
||||||
if ((ud.level_number == 0 && ud.volume_number == 0 && (num == 189 || num == 232 || num == 99 || num == 233 || num == 17)) ||
|
if ((ud.level_number == 0 && ud.volume_number == 0 && (num == 189 || num == 232 || num == 99 || num == 233 || num == 17)) ||
|
||||||
(l < 12288))
|
(l < 12288))
|
||||||
{
|
{
|
||||||
g_sounds[num].lock = 199;
|
g_soundlocks[num] = 199;
|
||||||
allocache((intptr_t *)&g_sounds[num].ptr,l,(char *)&g_sounds[num].lock);
|
allocache((intptr_t *)&g_sounds[num].ptr,l,(char *)&g_soundlocks[num]);
|
||||||
if (g_sounds[num].ptr != NULL)
|
if (g_sounds[num].ptr != NULL)
|
||||||
kread(fp, g_sounds[num].ptr , l);
|
kread(fp, g_sounds[num].ptr , l);
|
||||||
}
|
}
|
||||||
|
@ -1318,13 +1318,14 @@ static void resetpspritevars(char g)
|
||||||
int16_t i, j, nexti,circ;
|
int16_t i, j, nexti,circ;
|
||||||
// int32_t firstx,firsty;
|
// int32_t firstx,firsty;
|
||||||
spritetype *s;
|
spritetype *s;
|
||||||
char aimmode[MAXPLAYERS],autoaim[MAXPLAYERS],weaponswitch[MAXPLAYERS];
|
uint8_t aimmode[MAXPLAYERS],autoaim[MAXPLAYERS],weaponswitch[MAXPLAYERS];
|
||||||
STATUSBARTYPE tsbar[MAXPLAYERS];
|
DukeStatus_t tsbar[MAXPLAYERS];
|
||||||
|
|
||||||
A_InsertSprite(g_player[0].ps->cursectnum,g_player[0].ps->posx,g_player[0].ps->posy,g_player[0].ps->posz,
|
A_InsertSprite(g_player[0].ps->cursectnum,g_player[0].ps->posx,g_player[0].ps->posy,g_player[0].ps->posz,
|
||||||
APLAYER,0,0,0,g_player[0].ps->ang,0,0,0,10);
|
APLAYER,0,0,0,g_player[0].ps->ang,0,0,0,10);
|
||||||
|
|
||||||
if (ud.recstat != 2) for (i=0; i<ud.multimode; i++)
|
if (ud.recstat != 2)
|
||||||
|
for (i=0; i<ud.multimode; i++)
|
||||||
{
|
{
|
||||||
aimmode[i] = g_player[i].ps->aim_mode;
|
aimmode[i] = g_player[i].ps->aim_mode;
|
||||||
autoaim[i] = g_player[i].ps->auto_aim;
|
autoaim[i] = g_player[i].ps->auto_aim;
|
||||||
|
|
|
@ -51,7 +51,7 @@ void ReadSaveGameHeaders(void)
|
||||||
kclose(fil);
|
kclose(fil);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (kdfread(&dummy,4,1,fil) != 1)
|
if (kdfread(&dummy,sizeof(dummy),1,fil) != 1)
|
||||||
{
|
{
|
||||||
kclose(fil);
|
kclose(fil);
|
||||||
continue;
|
continue;
|
||||||
|
@ -61,7 +61,7 @@ void ReadSaveGameHeaders(void)
|
||||||
kclose(fil);
|
kclose(fil);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (kdfread(&dummy,4,1,fil) != 1)
|
if (kdfread(&dummy,sizeof(dummy),1,fil) != 1)
|
||||||
{
|
{
|
||||||
kclose(fil);
|
kclose(fil);
|
||||||
continue;
|
continue;
|
||||||
|
@ -92,7 +92,7 @@ int32_t G_LoadSaveHeader(char spot,struct savehead *saveh)
|
||||||
g_szBuf[bv]=0;
|
g_szBuf[bv]=0;
|
||||||
// AddLog(g_szBuf);
|
// AddLog(g_szBuf);
|
||||||
|
|
||||||
if (kdfread(&bv,4,1,fil) != 1) goto corrupt;
|
if (kdfread(&bv,sizeof(bv),1,fil) != 1) goto corrupt;
|
||||||
/* if (bv != BYTEVERSION)
|
/* if (bv != BYTEVERSION)
|
||||||
{
|
{
|
||||||
P_DoQuote(114,g_player[myconnectindex].ps);
|
P_DoQuote(114,g_player[myconnectindex].ps);
|
||||||
|
@ -170,7 +170,7 @@ int32_t G_LoadPlayer(int32_t spot)
|
||||||
g_szBuf[bv]=0;
|
g_szBuf[bv]=0;
|
||||||
// AddLog(g_szBuf);
|
// AddLog(g_szBuf);
|
||||||
|
|
||||||
if (kdfread(&bv,4,1,fil) != 1) return -1;
|
if (kdfread(&bv,sizeof(bv),1,fil) != 1) return -1;
|
||||||
if (bv != BYTEVERSION)
|
if (bv != BYTEVERSION)
|
||||||
{
|
{
|
||||||
P_DoQuote(114,g_player[myconnectindex].ps);
|
P_DoQuote(114,g_player[myconnectindex].ps);
|
||||||
|
@ -325,6 +325,7 @@ int32_t G_LoadPlayer(int32_t spot)
|
||||||
if (scriptptrs[i]&1) T2 += j;
|
if (scriptptrs[i]&1) T2 += j;
|
||||||
if (scriptptrs[i]&2) T5 += j;
|
if (scriptptrs[i]&2) T5 += j;
|
||||||
if (scriptptrs[i]&4) T6 += j;
|
if (scriptptrs[i]&4) T6 += j;
|
||||||
|
ActorExtra[i].projectile = &SpriteProjectile[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kdfread(&lockclock,sizeof(lockclock),1,fil) != 1) goto corrupt;
|
if (kdfread(&lockclock,sizeof(lockclock),1,fil) != 1) goto corrupt;
|
||||||
|
@ -374,6 +375,7 @@ int32_t G_LoadPlayer(int32_t spot)
|
||||||
if (kdfread(&g_globalRandom,sizeof(g_globalRandom),1,fil) != 1) goto corrupt;
|
if (kdfread(&g_globalRandom,sizeof(g_globalRandom),1,fil) != 1) goto corrupt;
|
||||||
if (kdfread(¶llaxyscale,sizeof(parallaxyscale),1,fil) != 1) goto corrupt;
|
if (kdfread(¶llaxyscale,sizeof(parallaxyscale),1,fil) != 1) goto corrupt;
|
||||||
|
|
||||||
|
if (kdfread(&SpriteProjectile[0],sizeof(projectile_t),MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
|
||||||
if (kdfread(&ProjectileData[0],sizeof(projectile_t),MAXTILES,fil) != MAXTILES) goto corrupt;
|
if (kdfread(&ProjectileData[0],sizeof(projectile_t),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||||
if (kdfread(&DefaultProjectileData[0],sizeof(projectile_t),MAXTILES,fil) != MAXTILES) goto corrupt;
|
if (kdfread(&DefaultProjectileData[0],sizeof(projectile_t),MAXTILES,fil) != MAXTILES) goto corrupt;
|
||||||
|
|
||||||
|
@ -668,7 +670,7 @@ int32_t G_SavePlayer(int32_t spot)
|
||||||
dfwrite(&i,sizeof(i),1,fil);
|
dfwrite(&i,sizeof(i),1,fil);
|
||||||
dfwrite(g_szBuf,i,1,fil);
|
dfwrite(g_szBuf,i,1,fil);
|
||||||
|
|
||||||
dfwrite(&bv,4,1,fil);
|
dfwrite(&bv,sizeof(bv),1,fil);
|
||||||
dfwrite(&ud.multimode,sizeof(ud.multimode),1,fil);
|
dfwrite(&ud.multimode,sizeof(ud.multimode),1,fil);
|
||||||
|
|
||||||
dfwrite(&ud.savegame[spot][0],19,1,fil);
|
dfwrite(&ud.savegame[spot][0],19,1,fil);
|
||||||
|
@ -715,9 +717,9 @@ int32_t G_SavePlayer(int32_t spot)
|
||||||
dfwrite(&headspritesect[0],sizeof(headspritesect[0]),MAXSECTORS+1,fil);
|
dfwrite(&headspritesect[0],sizeof(headspritesect[0]),MAXSECTORS+1,fil);
|
||||||
dfwrite(&prevspritesect[0],sizeof(prevspritesect[0]),MAXSPRITES,fil);
|
dfwrite(&prevspritesect[0],sizeof(prevspritesect[0]),MAXSPRITES,fil);
|
||||||
dfwrite(&nextspritesect[0],sizeof(nextspritesect[0]),MAXSPRITES,fil);
|
dfwrite(&nextspritesect[0],sizeof(nextspritesect[0]),MAXSPRITES,fil);
|
||||||
dfwrite(&headspritestat[STAT_DEFAULT],2,MAXSTATUS+1,fil);
|
dfwrite(&headspritestat[STAT_DEFAULT],sizeof(headspritestat[0]),MAXSTATUS+1,fil);
|
||||||
dfwrite(&prevspritestat[STAT_DEFAULT],2,MAXSPRITES,fil);
|
dfwrite(&prevspritestat[STAT_DEFAULT],sizeof(prevspritestat[0]),MAXSPRITES,fil);
|
||||||
dfwrite(&nextspritestat[STAT_DEFAULT],2,MAXSPRITES,fil);
|
dfwrite(&nextspritestat[STAT_DEFAULT],sizeof(nextspritestat[0]),MAXSPRITES,fil);
|
||||||
dfwrite(&g_numCyclers,sizeof(g_numCyclers),1,fil);
|
dfwrite(&g_numCyclers,sizeof(g_numCyclers),1,fil);
|
||||||
dfwrite(&cyclers[0][0],sizeof(cyclers[0][0])*6,MAXCYCLERS,fil);
|
dfwrite(&cyclers[0][0],sizeof(cyclers[0][0])*6,MAXCYCLERS,fil);
|
||||||
for (i=0; i<ud.multimode; i++)
|
for (i=0; i<ud.multimode; i++)
|
||||||
|
@ -755,8 +757,8 @@ int32_t G_SavePlayer(int32_t spot)
|
||||||
}
|
}
|
||||||
|
|
||||||
// dfwrite(&scriptptrs[0],sizeof(scriptptrs),g_scriptSize,fil);
|
// dfwrite(&scriptptrs[0],sizeof(scriptptrs),g_scriptSize,fil);
|
||||||
dfwrite(&bitptr[0],sizeof(uint8_t),(g_scriptSize+7)>>3,fil);
|
dfwrite(&bitptr[0],sizeof(bitptr[0]),(g_scriptSize+7)>>3,fil);
|
||||||
dfwrite(&script[0],sizeof(script),g_scriptSize,fil);
|
dfwrite(&script[0],sizeof(script[0]),g_scriptSize,fil);
|
||||||
|
|
||||||
for (i=0; i<g_scriptSize; i++)
|
for (i=0; i<g_scriptSize; i++)
|
||||||
if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)))
|
if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)))
|
||||||
|
@ -874,6 +876,7 @@ int32_t G_SavePlayer(int32_t spot)
|
||||||
dfwrite(&g_globalRandom,sizeof(g_globalRandom),1,fil);
|
dfwrite(&g_globalRandom,sizeof(g_globalRandom),1,fil);
|
||||||
dfwrite(¶llaxyscale,sizeof(parallaxyscale),1,fil);
|
dfwrite(¶llaxyscale,sizeof(parallaxyscale),1,fil);
|
||||||
|
|
||||||
|
dfwrite(&SpriteProjectile[0],sizeof(projectile_t),MAXSPRITES,fil);
|
||||||
dfwrite(&ProjectileData[0],sizeof(projectile_t),MAXTILES,fil);
|
dfwrite(&ProjectileData[0],sizeof(projectile_t),MAXTILES,fil);
|
||||||
dfwrite(&DefaultProjectileData[0],sizeof(projectile_t),MAXTILES,fil);
|
dfwrite(&DefaultProjectileData[0],sizeof(projectile_t),MAXTILES,fil);
|
||||||
|
|
||||||
|
|
|
@ -1015,7 +1015,7 @@ void G_OperateActivators(int32_t low,int32_t snum)
|
||||||
if (sprite[i].picnum == ACTIVATORLOCKED)
|
if (sprite[i].picnum == ACTIVATORLOCKED)
|
||||||
{
|
{
|
||||||
if (sector[SECT].lotag&16384)
|
if (sector[SECT].lotag&16384)
|
||||||
sector[SECT].lotag &= 65535-16384;
|
sector[SECT].lotag &= ~16384;
|
||||||
else
|
else
|
||||||
sector[SECT].lotag |= 16384;
|
sector[SECT].lotag |= 16384;
|
||||||
|
|
||||||
|
@ -1611,7 +1611,7 @@ void A_DamageWall(int32_t spr,int32_t dawallnum,const vec3_t *pos,int32_t atwith
|
||||||
int32_t j, i, darkestwall;
|
int32_t j, i, darkestwall;
|
||||||
walltype *wal = &wall[dawallnum];
|
walltype *wal = &wall[dawallnum];
|
||||||
|
|
||||||
if (wal->overpicnum == MIRROR && wal->pal != 4 && A_CheckSpriteTileFlags(atwith,SPRITE_PROJECTILE) && (ActorExtra[spr].projectile.workslike & PROJECTILE_RPG))
|
if (wal->overpicnum == MIRROR && wal->pal != 4 && A_CheckSpriteTileFlags(atwith,SPRITE_PROJECTILE) && (ActorExtra[spr].projectile->workslike & PROJECTILE_RPG))
|
||||||
{
|
{
|
||||||
if (wal->nextwall == -1 || wall[wal->nextwall].pal != 4)
|
if (wal->nextwall == -1 || wall[wal->nextwall].pal != 4)
|
||||||
{
|
{
|
||||||
|
@ -1950,7 +1950,7 @@ void A_DamageObject(int32_t i,int32_t sn)
|
||||||
i &= (MAXSPRITES-1);
|
i &= (MAXSPRITES-1);
|
||||||
|
|
||||||
if (A_CheckSpriteFlags(sn,SPRITE_PROJECTILE))
|
if (A_CheckSpriteFlags(sn,SPRITE_PROJECTILE))
|
||||||
if (ActorExtra[sn].projectile.workslike & PROJECTILE_RPG)
|
if (ActorExtra[sn].projectile->workslike & PROJECTILE_RPG)
|
||||||
rpg = 1;
|
rpg = 1;
|
||||||
switchpicnum = PN;
|
switchpicnum = PN;
|
||||||
if ((PN > WATERFOUNTAIN)&&(PN < WATERFOUNTAIN+3))
|
if ((PN > WATERFOUNTAIN)&&(PN < WATERFOUNTAIN+3))
|
||||||
|
@ -2445,7 +2445,7 @@ void allignwarpelevators(void)
|
||||||
|
|
||||||
void G_HandleSharedKeys(int32_t snum)
|
void G_HandleSharedKeys(int32_t snum)
|
||||||
{
|
{
|
||||||
int32_t i, k, dainv;
|
int32_t i, k = 0, dainv;
|
||||||
uint32_t sb_snum = g_player[snum].sync->bits, j;
|
uint32_t sb_snum = g_player[snum].sync->bits, j;
|
||||||
DukePlayer_t *p = g_player[snum].ps;
|
DukePlayer_t *p = g_player[snum].ps;
|
||||||
|
|
||||||
|
@ -2822,8 +2822,6 @@ CHECKINV1:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
k = -1;
|
|
||||||
|
|
||||||
Gv_SetVar(g_iWorksLikeVarID,aplWeaponWorksLike[p->curr_weapon][snum],p->i,snum);
|
Gv_SetVar(g_iWorksLikeVarID,aplWeaponWorksLike[p->curr_weapon][snum],p->i,snum);
|
||||||
Gv_SetVar(g_iWeaponVarID,j, p->i, snum);
|
Gv_SetVar(g_iWeaponVarID,j, p->i, snum);
|
||||||
aGameVars[g_iReturnVarID].val.lValue = 0;
|
aGameVars[g_iReturnVarID].val.lValue = 0;
|
||||||
|
@ -2965,24 +2963,6 @@ CHECKINV1:
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (TEST_SYNC_KEY(sb_snum, SK_HOLSTER))
|
|
||||||
{
|
|
||||||
if (p->curr_weapon > KNEE_WEAPON)
|
|
||||||
{
|
|
||||||
if (p->holster_weapon == 0 && p->weapon_pos == 0)
|
|
||||||
{
|
|
||||||
p->holster_weapon = 1;
|
|
||||||
p->weapon_pos = -1;
|
|
||||||
P_DoQuote(73,p);
|
|
||||||
}
|
|
||||||
else if (p->holster_weapon == 1 && p->weapon_pos == -9)
|
|
||||||
{
|
|
||||||
p->holster_weapon = 0;
|
|
||||||
p->weapon_pos = 10;
|
|
||||||
P_DoQuote(74,p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TEST_SYNC_KEY(sb_snum, SK_HOLODUKE) && p->newowner == -1)
|
if (TEST_SYNC_KEY(sb_snum, SK_HOLODUKE) && p->newowner == -1)
|
||||||
|
|
|
@ -292,9 +292,9 @@ int32_t S_LoadSound(uint32_t num)
|
||||||
l = kfilelength(fp);
|
l = kfilelength(fp);
|
||||||
g_sounds[num].soundsiz = l;
|
g_sounds[num].soundsiz = l;
|
||||||
|
|
||||||
g_sounds[num].lock = 200;
|
g_soundlocks[num] = 200;
|
||||||
|
|
||||||
allocache((intptr_t *)&g_sounds[num].ptr,l,(char *)&g_sounds[num].lock);
|
allocache((intptr_t *)&g_sounds[num].ptr,l,(char *)&g_soundlocks[num]);
|
||||||
kread(fp, g_sounds[num].ptr , l);
|
kread(fp, g_sounds[num].ptr , l);
|
||||||
kclose(fp);
|
kclose(fp);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -410,9 +410,9 @@ int32_t S_PlaySoundXYZ(int32_t num, int32_t i, const vec3_t *pos)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (g_sounds[num].lock < 200)
|
if (g_soundlocks[num] < 200)
|
||||||
g_sounds[num].lock = 200;
|
g_soundlocks[num] = 200;
|
||||||
else g_sounds[num].lock++;
|
else g_soundlocks[num]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_sounds[num].m&16) sndist = 0;
|
if (g_sounds[num].m&16) sndist = 0;
|
||||||
|
@ -454,7 +454,7 @@ int32_t S_PlaySoundXYZ(int32_t num, int32_t i, const vec3_t *pos)
|
||||||
g_sounds[num].SoundOwner[g_sounds[num].num].voice = voice;
|
g_sounds[num].SoundOwner[g_sounds[num].num].voice = voice;
|
||||||
g_sounds[num].num++;
|
g_sounds[num].num++;
|
||||||
}
|
}
|
||||||
else g_sounds[num].lock--;
|
else g_soundlocks[num]--;
|
||||||
return (voice);
|
return (voice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,9 +493,9 @@ void S_PlaySound(int32_t num)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (g_sounds[num].lock < 200)
|
if (g_soundlocks[num] < 200)
|
||||||
g_sounds[num].lock = 200;
|
g_soundlocks[num] = 200;
|
||||||
else g_sounds[num].lock++;
|
else g_soundlocks[num]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_sounds[num].m&1)
|
if (g_sounds[num].m&1)
|
||||||
|
@ -530,7 +530,7 @@ void S_PlaySound(int32_t num)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (voice > FX_Ok) return;
|
if (voice > FX_Ok) return;
|
||||||
g_sounds[num].lock--;
|
g_soundlocks[num]--;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t A_PlaySound(uint32_t num, int32_t i)
|
int32_t A_PlaySound(uint32_t num, int32_t i)
|
||||||
|
@ -698,7 +698,7 @@ void S_TestSoundCallback(uint32_t num)
|
||||||
g_sounds[num].SoundOwner[tempk-1].i = -1;
|
g_sounds[num].SoundOwner[tempk-1].i = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_sounds[num].lock--;
|
g_soundlocks[num]--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void S_ClearSoundLocks(void)
|
void S_ClearSoundLocks(void)
|
||||||
|
@ -706,8 +706,8 @@ void S_ClearSoundLocks(void)
|
||||||
int32_t i;
|
int32_t i;
|
||||||
|
|
||||||
for (i=0; i<MAXSOUNDS; i++)
|
for (i=0; i<MAXSOUNDS; i++)
|
||||||
if (g_sounds[i].lock >= 200)
|
if (g_soundlocks[i] >= 200)
|
||||||
g_sounds[i].lock = 199;
|
g_soundlocks[i] = 199;
|
||||||
|
|
||||||
for (i=0; i<11; i++)
|
for (i=0; i<11; i++)
|
||||||
if (lumplockbyte[i] >= 200)
|
if (lumplockbyte[i] >= 200)
|
||||||
|
@ -725,7 +725,7 @@ int32_t S_CheckSoundPlaying(int32_t i, int32_t num)
|
||||||
{
|
{
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
{
|
{
|
||||||
if (g_sounds[num].lock == 200)
|
if (g_soundlocks[num] == 200)
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,9 +29,9 @@ static struct
|
||||||
int32_t xdim3d, ydim3d, bpp3d;
|
int32_t xdim3d, ydim3d, bpp3d;
|
||||||
int32_t forcesetup;
|
int32_t forcesetup;
|
||||||
int32_t usemouse, usejoy;
|
int32_t usemouse, usejoy;
|
||||||
char selectedgrp[BMAX_PATH+1];
|
|
||||||
int32_t game;
|
int32_t game;
|
||||||
int32_t crcval;
|
int32_t crcval;
|
||||||
|
char selectedgrp[BMAX_PATH];
|
||||||
} settings;
|
} settings;
|
||||||
|
|
||||||
extern int32_t gtkenabled;
|
extern int32_t gtkenabled;
|
||||||
|
|
|
@ -34,10 +34,10 @@ static struct
|
||||||
int32_t xdim, ydim, bpp;
|
int32_t xdim, ydim, bpp;
|
||||||
int32_t forcesetup;
|
int32_t forcesetup;
|
||||||
int32_t usemouse, usejoy;
|
int32_t usemouse, usejoy;
|
||||||
char selectedgrp[BMAX_PATH+1];
|
|
||||||
int32_t game;
|
int32_t game;
|
||||||
int32_t crcval; // for finding the grp in the list again
|
int32_t crcval; // for finding the grp in the list again
|
||||||
char *gamedir;
|
char *gamedir;
|
||||||
|
char selectedgrp[BMAX_PATH];
|
||||||
}
|
}
|
||||||
settings;
|
settings;
|
||||||
|
|
||||||
|
@ -51,14 +51,14 @@ static int32_t done = -1, mode = TAB_CONFIG;
|
||||||
static CACHE1D_FIND_REC *finddirs=NULL;
|
static CACHE1D_FIND_REC *finddirs=NULL;
|
||||||
static int32_t numdirs=0;
|
static int32_t numdirs=0;
|
||||||
|
|
||||||
static void clearfilenames(void)
|
static inline void clearfilenames(void)
|
||||||
{
|
{
|
||||||
klistfree(finddirs);
|
klistfree(finddirs);
|
||||||
finddirs = NULL;
|
finddirs = NULL;
|
||||||
numdirs = 0;
|
numdirs = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t getfilenames(char *path)
|
static inline int32_t getfilenames(char *path)
|
||||||
{
|
{
|
||||||
CACHE1D_FIND_REC *r;
|
CACHE1D_FIND_REC *r;
|
||||||
|
|
||||||
|
@ -88,12 +88,34 @@ extern int32_t g_noSetup;
|
||||||
#define INPUT_JOYSTICK 2
|
#define INPUT_JOYSTICK 2
|
||||||
#define INPUT_ALL 3
|
#define INPUT_ALL 3
|
||||||
|
|
||||||
|
const char *controlstrings[] = { "Keyboard only", "Keyboard and mouse", "Keyboard and joystick", "All supported devices" };
|
||||||
|
|
||||||
static void PopulateForm(int32_t pgs)
|
static void PopulateForm(int32_t pgs)
|
||||||
{
|
{
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
char buf[256];
|
char buf[512];
|
||||||
int32_t i,j;
|
int32_t i,j;
|
||||||
|
|
||||||
|
if (pgs & POPULATE_GAMEDIRS)
|
||||||
|
{
|
||||||
|
CACHE1D_FIND_REC *dirs = NULL;
|
||||||
|
|
||||||
|
hwnd = GetDlgItem(pages[TAB_CONFIG], IDCGAMEDIR);
|
||||||
|
|
||||||
|
getfilenames("/");
|
||||||
|
(void)ComboBox_ResetContent(hwnd);
|
||||||
|
j = ComboBox_AddString(hwnd, "None");
|
||||||
|
(void)ComboBox_SetItemData(hwnd, j, 0);
|
||||||
|
(void)ComboBox_SetCurSel(hwnd, j);
|
||||||
|
for (dirs=finddirs,i=1; dirs != NULL; dirs=dirs->next,i++)
|
||||||
|
{
|
||||||
|
(void)ComboBox_AddString(hwnd, dirs->name);
|
||||||
|
(void)ComboBox_SetItemData(hwnd, i, i);
|
||||||
|
if (Bstrcasecmp(dirs->name,settings.gamedir) == 0)
|
||||||
|
(void)ComboBox_SetCurSel(hwnd, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pgs & POPULATE_VIDEO)
|
if (pgs & POPULATE_VIDEO)
|
||||||
{
|
{
|
||||||
int32_t mode;
|
int32_t mode;
|
||||||
|
@ -120,7 +142,9 @@ static void PopulateForm(int32_t pgs)
|
||||||
|
|
||||||
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCFULLSCREEN), ((settings.flags&1) ? BST_CHECKED : BST_UNCHECKED));
|
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCFULLSCREEN), ((settings.flags&1) ? BST_CHECKED : BST_UNCHECKED));
|
||||||
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCPOLYMER), ((settings.flags&2) ? BST_CHECKED : BST_UNCHECKED));
|
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCPOLYMER), ((settings.flags&2) ? BST_CHECKED : BST_UNCHECKED));
|
||||||
|
|
||||||
(void)ComboBox_ResetContent(hwnd);
|
(void)ComboBox_ResetContent(hwnd);
|
||||||
|
|
||||||
for (i=0; i<validmodecnt; i++)
|
for (i=0; i<validmodecnt; i++)
|
||||||
{
|
{
|
||||||
if (validmode[i].fs != (settings.flags & 1)) continue;
|
if (validmode[i].fs != (settings.flags & 1)) continue;
|
||||||
|
@ -136,7 +160,7 @@ static void PopulateForm(int32_t pgs)
|
||||||
|
|
||||||
if (pgs & POPULATE_CONFIG)
|
if (pgs & POPULATE_CONFIG)
|
||||||
{
|
{
|
||||||
/*
|
#if 0
|
||||||
struct audioenumdev *d;
|
struct audioenumdev *d;
|
||||||
char *n;
|
char *n;
|
||||||
|
|
||||||
|
@ -165,31 +189,34 @@ static void PopulateForm(int32_t pgs)
|
||||||
d = d->next;
|
d = d->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
#endif
|
||||||
|
|
||||||
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCALWAYSSHOW), (settings.forcesetup ? BST_CHECKED : BST_UNCHECKED));
|
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCALWAYSSHOW), (settings.forcesetup ? BST_CHECKED : BST_UNCHECKED));
|
||||||
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCAUTOLOAD), (!(settings.flags & 4) ? BST_CHECKED : BST_UNCHECKED));
|
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCAUTOLOAD), (!(settings.flags & 4) ? BST_CHECKED : BST_UNCHECKED));
|
||||||
|
|
||||||
{
|
|
||||||
static const char *s[] = { "Keyboard only", "Keyboard and mouse", "Keyboard and joystick", "All supported devices" };
|
|
||||||
|
|
||||||
hwnd = GetDlgItem(pages[TAB_CONFIG], IDCINPUT);
|
hwnd = GetDlgItem(pages[TAB_CONFIG], IDCINPUT);
|
||||||
|
|
||||||
(void)ComboBox_ResetContent(hwnd);
|
(void)ComboBox_ResetContent(hwnd);
|
||||||
j = ComboBox_AddString(hwnd, s[INPUT_KB]);
|
(void)ComboBox_SetCurSel(hwnd, 0);
|
||||||
(void)ComboBox_SetItemData(hwnd, j, INPUT_KB);
|
|
||||||
(void)ComboBox_SetCurSel(hwnd, j);
|
|
||||||
for (i=1; i<4; i++)
|
|
||||||
{
|
|
||||||
j = ComboBox_AddString(hwnd, s[i]);
|
|
||||||
(void)ComboBox_SetItemData(hwnd, j, i);
|
|
||||||
if ((settings.usemouse && !settings.usejoy && i == INPUT_MOUSE) ||
|
|
||||||
(!settings.usemouse && settings.usejoy && i == INPUT_JOYSTICK) ||
|
|
||||||
(settings.usemouse && settings.usejoy && i == INPUT_ALL))
|
|
||||||
(void)ComboBox_SetCurSel(hwnd, j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
for (i=0; i<4; i++)
|
||||||
|
{
|
||||||
|
(void)ComboBox_InsertString(hwnd, i, controlstrings[i]);
|
||||||
|
(void)ComboBox_SetItemData(hwnd, i, i);
|
||||||
|
|
||||||
|
switch (i)
|
||||||
|
{
|
||||||
|
case INPUT_MOUSE:
|
||||||
|
if (settings.usemouse && !settings.usejoy)(void)ComboBox_SetCurSel(hwnd, i);
|
||||||
|
break;
|
||||||
|
case INPUT_JOYSTICK:
|
||||||
|
if (!settings.usemouse && settings.usejoy)(void)ComboBox_SetCurSel(hwnd, i);
|
||||||
|
break;
|
||||||
|
case INPUT_ALL:
|
||||||
|
if (settings.usemouse && settings.usejoy)(void)ComboBox_SetCurSel(hwnd, i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pgs & POPULATE_GAME)
|
if (pgs & POPULATE_GAME)
|
||||||
|
@ -210,29 +237,6 @@ static void PopulateForm(int32_t pgs)
|
||||||
if (!Bstrcasecmp(fg->name, settings.selectedgrp))(void)ListBox_SetCurSel(hwnd, j);
|
if (!Bstrcasecmp(fg->name, settings.selectedgrp))(void)ListBox_SetCurSel(hwnd, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pgs & POPULATE_GAMEDIRS)
|
|
||||||
{
|
|
||||||
CACHE1D_FIND_REC *dirs = NULL;
|
|
||||||
|
|
||||||
hwnd = GetDlgItem(pages[TAB_CONFIG], IDCGAMEDIR);
|
|
||||||
|
|
||||||
getfilenames("/");
|
|
||||||
(void)ComboBox_ResetContent(hwnd);
|
|
||||||
j = ComboBox_AddString(hwnd, "None");
|
|
||||||
(void)ComboBox_SetItemData(hwnd, j, 0);
|
|
||||||
(void)ComboBox_SetCurSel(hwnd, j);
|
|
||||||
for (dirs=finddirs,i=1; dirs != NULL; dirs=dirs->next,i++)
|
|
||||||
{
|
|
||||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
|
||||||
if (Bstrcasecmp(TEXCACHEFILE,dirs->name) == 0) continue;
|
|
||||||
#endif
|
|
||||||
j = ComboBox_AddString(hwnd, dirs->name);
|
|
||||||
(void)ComboBox_SetItemData(hwnd, j, i);
|
|
||||||
if (Bstrcasecmp(dirs->name,settings.gamedir) == 0)
|
|
||||||
(void)ComboBox_SetCurSel(hwnd, j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
@ -275,14 +279,6 @@ static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
|
||||||
settings.flags &= ~4;
|
settings.flags &= ~4;
|
||||||
else settings.flags |= 4;
|
else settings.flags |= 4;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
/*
|
|
||||||
case IDCINPUTMOUSE:
|
|
||||||
settings.usemouse = IsDlgButtonChecked(hwndDlg, IDCINPUTMOUSE) == BST_CHECKED;
|
|
||||||
return TRUE;
|
|
||||||
case IDCINPUTJOY:
|
|
||||||
settings.usejoy = IsDlgButtonChecked(hwndDlg, IDCINPUTJOY) == BST_CHECKED;
|
|
||||||
return TRUE;
|
|
||||||
*/
|
|
||||||
case IDCINPUT:
|
case IDCINPUT:
|
||||||
if (HIWORD(wParam) == CBN_SELCHANGE)
|
if (HIWORD(wParam) == CBN_SELCHANGE)
|
||||||
{
|
{
|
||||||
|
@ -381,10 +377,6 @@ static void EnableConfig(int32_t n)
|
||||||
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCFULLSCREEN), n);
|
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCFULLSCREEN), n);
|
||||||
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCPOLYMER), n);
|
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCPOLYMER), n);
|
||||||
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCVMODE), n);
|
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCVMODE), n);
|
||||||
/*
|
|
||||||
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCINPUTMOUSE), n);
|
|
||||||
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCINPUTJOY), n);
|
|
||||||
*/
|
|
||||||
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCINPUT), n);
|
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCINPUT), n);
|
||||||
|
|
||||||
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCDATA), n);
|
EnableWindow(GetDlgItem(pages[TAB_CONFIG], IDCDATA), n);
|
||||||
|
|
|
@ -17,11 +17,9 @@
|
||||||
#define IDCSOUNDDRV 102
|
#define IDCSOUNDDRV 102
|
||||||
#define IDCMIDIDEV 103
|
#define IDCMIDIDEV 103
|
||||||
#define IDCCDADEV 104
|
#define IDCCDADEV 104
|
||||||
// #define IDCINPUTMOUSE 105
|
#define IDCALWAYSSHOW 105
|
||||||
// #define IDCINPUTJOY 106
|
#define IDCDATA 106
|
||||||
#define IDCALWAYSSHOW 107
|
#define IDCGAMEDIR 107
|
||||||
#define IDCDATA 108
|
#define IDCPOLYMER 108
|
||||||
#define IDCGAMEDIR 109
|
#define IDCAUTOLOAD 109
|
||||||
#define IDCPOLYMER 110
|
#define IDCINPUT 110
|
||||||
#define IDCAUTOLOAD 111
|
|
||||||
#define IDCINPUT 112
|
|
||||||
|
|
Loading…
Reference in a new issue