Formatting change

git-svn-id: https://svn.eduke32.com/eduke32@331 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-11-13 23:12:47 +00:00
parent 757da2432b
commit 37dea75dc6
44 changed files with 13087 additions and 12209 deletions

View file

@ -229,7 +229,8 @@ static int osdcmd_vidmode(const osdfuncparm_t *parm)
newx = Batol(parm->parms[0]);
newy = Batol(parm->parms[1]);
break;
default: return OSDCMD_SHOWHELP;
default:
return OSDCMD_SHOWHELP;
}
if (setgamemode(newfullscreen,newx,newy,newbpp))
@ -1494,7 +1495,9 @@ void editinput(void)
if (i >= 0)
switch (searchstat)
{
case 0: case 1: case 4:
case 0:
case 1:
case 4:
alignceilslope(searchsector,wall[searchwall].x,wall[searchwall].y,getceilzofslope(i,wall[searchwall].x,wall[searchwall].y));
break;
case 2:
@ -1545,7 +1548,9 @@ void editinput(void)
case 1:
alignceilslope(searchsector,wall[searchwall].x,wall[searchwall].y,getceilzofslope(i,wall[searchwall].x,wall[searchwall].y));
break;
case 0: case 2: case 4:
case 0:
case 2:
case 4:
alignflorslope(searchsector,wall[searchwall].x,wall[searchwall].y,getflorzofslope(i,wall[searchwall].x,wall[searchwall].y));
break;
}
@ -1822,7 +1827,8 @@ void editinput(void)
{
switch (searchstat)
{
case 0: case 4:
case 0:
case 4:
Bstrcpy(buffer,"Wall pal: ");
wall[searchwall].pal = getnumber256(buffer,wall[searchwall].pal,256L,0);
break;
@ -2122,10 +2128,14 @@ void editinput(void)
i = ((i>>3)&1)+((i>>7)&2); //3-x,8-y
switch (i)
{
case 0: i = 1; break;
case 1: i = 3; break;
case 2: i = 0; break;
case 3: i = 2; break;
case 0:
i = 1; break;
case 1:
i = 3; break;
case 2:
i = 0; break;
case 3:
i = 2; break;
}
i = ((i&1)<<3)+((i&2)<<7);
wall[searchwall].cstat &= ~0x0108;
@ -2138,14 +2148,22 @@ void editinput(void)
i = (i&0x4)+((i>>4)&3);
switch (i)
{
case 0: i = 6; break;
case 6: i = 3; break;
case 3: i = 5; break;
case 5: i = 1; break;
case 1: i = 7; break;
case 7: i = 2; break;
case 2: i = 4; break;
case 4: i = 0; break;
case 0:
i = 6; break;
case 6:
i = 3; break;
case 3:
i = 5; break;
case 5:
i = 1; break;
case 1:
i = 7; break;
case 7:
i = 2; break;
case 2:
i = 4; break;
case 4:
i = 0; break;
}
i = (i&0x4)+((i&3)<<4);
sector[searchsector].ceilingstat &= ~0x34;
@ -2158,14 +2176,22 @@ void editinput(void)
i = (i&0x4)+((i>>4)&3);
switch (i)
{
case 0: i = 6; break;
case 6: i = 3; break;
case 3: i = 5; break;
case 5: i = 1; break;
case 1: i = 7; break;
case 7: i = 2; break;
case 2: i = 4; break;
case 4: i = 0; break;
case 0:
i = 6; break;
case 6:
i = 3; break;
case 3:
i = 5; break;
case 5:
i = 1; break;
case 1:
i = 7; break;
case 7:
i = 2; break;
case 2:
i = 4; break;
case 4:
i = 0; break;
}
i = (i&0x4)+((i&3)<<4);
sector[searchsector].floorstat &= ~0x34;
@ -2185,10 +2211,14 @@ void editinput(void)
i = ((i>>2)&3);
switch (i)
{
case 0: i = 1; break;
case 1: i = 3; break;
case 2: i = 0; break;
case 3: i = 2; break;
case 0:
i = 1; break;
case 1:
i = 3; break;
case 2:
i = 0; break;
case 3:
i = 2; break;
}
i <<= 2;
sprite[searchwall].cstat &= ~0xc;
@ -2323,9 +2353,14 @@ void editinput(void)
{
switch (searchstat)
{
case 1: case 2: ExtShowSectorData(searchsector); break;
case 0: case 4: ExtShowWallData(searchwall); break;
case 3: ExtShowSpriteData(searchwall); break;
case 1:
case 2:
ExtShowSectorData(searchsector); break;
case 0:
case 4:
ExtShowWallData(searchwall); break;
case 3:
ExtShowSpriteData(searchwall); break;
}
keystatus[0x3f] = 0, keystatus[0x40] = 0;
}
@ -2333,9 +2368,14 @@ void editinput(void)
{
switch (searchstat)
{
case 1: case 2: ExtEditSectorData(searchsector); break;
case 0: case 4: ExtEditWallData(searchwall); break;
case 3: ExtEditSpriteData(searchwall); break;
case 1:
case 2:
ExtEditSectorData(searchsector); break;
case 0:
case 4:
ExtEditWallData(searchwall); break;
case 3:
ExtEditSpriteData(searchwall); break;
}
keystatus[0x41] = 0, keystatus[0x42] = 0;
}

View file

@ -690,11 +690,14 @@ long klseek(long handle, long offset, long whence)
{
switch (whence)
{
case BSEEK_SET: filepos[handle] = offset; break;
case BSEEK_END: i = filehan[handle];
case BSEEK_SET:
filepos[handle] = offset; break;
case BSEEK_END:
i = filehan[handle];
filepos[handle] = (gfileoffs[groupnum][i+1]-gfileoffs[groupnum][i])+offset;
break;
case BSEEK_CUR: filepos[handle] += offset; break;
case BSEEK_CUR:
filepos[handle] += offset; break;
}
return(filepos[handle]);
}
@ -902,7 +905,8 @@ CACHE1D_FIND_REC *klistpath(const char *_path, const char *mask, int type)
case -1: goto failure;
//case 1: initprintf("%s:%s dropped for lower priority\n", d,dirent->name); break;
//case 0: initprintf("%s:%s accepted\n", d,dirent->name); break;
default: break;
default:
break;
}
}
Bclosedir(dir);
@ -970,10 +974,12 @@ CACHE1D_FIND_REC *klistpath(const char *_path, const char *mask, int type)
// the entry is in the clear
switch (klistaddentry(&rec, buf, ftype, CACHE1D_SOURCE_ZIP)) {
case -1: goto failure;
case -1:
goto failure;
//case 1: initprintf("<ZIP>:%s dropped for lower priority\n", buf); break;
//case 0: initprintf("<ZIP>:%s accepted\n", buf); break;
default: break;
default:
break;
}
}
}
@ -990,10 +996,12 @@ CACHE1D_FIND_REC *klistpath(const char *_path, const char *mask, int type)
Bmemcpy(buf,&gfilelist[i][j<<4],12);
if (!Bwildmatch(buf,mask)) continue;
switch (klistaddentry(&rec, buf, CACHE1D_FIND_FILE, CACHE1D_SOURCE_GRP)) {
case -1: goto failure;
case -1:
goto failure;
//case 1: initprintf("<GRP>:%s dropped for lower priority\n", workspace); break;
//case 0: initprintf("<GRP>:%s accepted\n", workspace); break;
default: break;
default:
break;
}
}
}

View file

@ -95,9 +95,12 @@ bssize_t Bread(int fd, void *buf, bsize_t count)
int Blseek(int fildes, int offset, int whence)
{
switch (whence) {
case BSEEK_SET: whence=SEEK_SET; break;
case BSEEK_CUR: whence=SEEK_CUR; break;
case BSEEK_END: whence=SEEK_END; break;
case BSEEK_SET:
whence=SEEK_SET; break;
case BSEEK_CUR:
whence=SEEK_CUR; break;
case BSEEK_END:
whence=SEEK_END; break;
}
return lseek(fildes,offset,whence);
}

View file

@ -13,7 +13,8 @@
static long vesares[13][2] = {{320,200},{360,200},{320,240},{360,240},{320,400},
{360,400},{640,350},{640,400},{640,480},{800,600},
{1024,768},{1280,1024},{1600,1200}};
{1024,768},{1280,1024},{1600,1200}
};
static int readconfig(BFILE *fp, const char *key, char *value, unsigned len)
{

View file

@ -563,13 +563,17 @@ static int defsparser(scriptfile *script)
#if defined(POLYMOST) && defined(USE_OPENGL)
for (tilex = ftilenume; tilex <= ltilenume && happy; tilex++) {
switch (md_defineframe(lastmodelid, framename, tilex, max(0,modelskin))) {
case 0: break;
case -1: happy = 0; break; // invalid model id!?
case -2: initprintf("Invalid tile number on line %s:%d\n",
case 0:
break;
case -1:
happy = 0; break; // invalid model id!?
case -2:
initprintf("Invalid tile number on line %s:%d\n",
script->filename, scriptfile_getlinum(script,cmdtokptr));
happy = 0;
break;
case -3: initprintf("Invalid frame name on line %s:%d\n",
case -3:
initprintf("Invalid frame name on line %s:%d\n",
script->filename, scriptfile_getlinum(script,cmdtokptr));
happy = 0;
break;
@ -596,15 +600,20 @@ static int defsparser(scriptfile *script)
}
#if defined(POLYMOST) && defined(USE_OPENGL)
switch (md_defineanimation(lastmodelid, startframe, endframe, (int)(dfps*(65536.0*.001)), flags)) {
case 0: break;
case -1: break; // invalid model id!?
case -2: initprintf("Invalid starting frame name on line %s:%d\n",
case 0:
break;
case -1:
break; // invalid model id!?
case -2:
initprintf("Invalid starting frame name on line %s:%d\n",
script->filename, scriptfile_getlinum(script,cmdtokptr));
break;
case -3: initprintf("Invalid ending frame name on line %s:%d\n",
case -3:
initprintf("Invalid ending frame name on line %s:%d\n",
script->filename, scriptfile_getlinum(script,cmdtokptr));
break;
case -4: initprintf("Out of memory on line %s:%d\n",
case -4:
initprintf("Out of memory on line %s:%d\n",
script->filename, scriptfile_getlinum(script,cmdtokptr));
break;
}
@ -636,15 +645,20 @@ static int defsparser(scriptfile *script)
#if defined(POLYMOST) && defined(USE_OPENGL)
switch (md_defineskin(lastmodelid, skinfn, palnum, max(0,modelskin), 0)) {
case 0: break;
case -1: break; // invalid model id!?
case -2: initprintf("Invalid skin filename on line %s:%d\n",
case 0:
break;
case -1:
break; // invalid model id!?
case -2:
initprintf("Invalid skin filename on line %s:%d\n",
script->filename, scriptfile_getlinum(script,cmdtokptr));
break;
case -3: initprintf("Invalid palette number on line %s:%d\n",
case -3:
initprintf("Invalid palette number on line %s:%d\n",
script->filename, scriptfile_getlinum(script,cmdtokptr));
break;
case -4: initprintf("Out of memory on line %s:%d\n",
case -4:
initprintf("Out of memory on line %s:%d\n",
script->filename, scriptfile_getlinum(script,cmdtokptr));
break;
}
@ -732,9 +746,12 @@ static int defsparser(scriptfile *script)
while (script->textptr < modelend) {
switch (getatoken(script,modeltokens,sizeof(modeltokens)/sizeof(tokenlist))) {
//case T_ERROR: initprintf("Error on line %s:%d in model tokens\n", script->filename,script->linenum); break;
case T_SCALE: scriptfile_getdouble(script,&scale); break;
case T_SHADE: scriptfile_getnumber(script,&shadeoffs); break;
case T_ZADD: scriptfile_getdouble(script,&mzadd); break;
case T_SCALE:
scriptfile_getdouble(script,&scale); break;
case T_SHADE:
scriptfile_getnumber(script,&shadeoffs); break;
case T_ZADD:
scriptfile_getdouble(script,&mzadd); break;
case T_FRAME:
{
char *frametokptr = script->ltextptr;
@ -744,10 +761,14 @@ static int defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&frameend)) break;
while (script->textptr < frameend) {
switch (getatoken(script,modelframetokens,sizeof(modelframetokens)/sizeof(tokenlist))) {
case T_FRAME: scriptfile_getstring(script,&framename); break;
case T_TILE: scriptfile_getsymbol(script,&ftilenume); ltilenume = ftilenume; break;
case T_TILE0: scriptfile_getsymbol(script,&ftilenume); break; //first tile number
case T_TILE1: scriptfile_getsymbol(script,&ltilenume); break; //last tile number (inclusive)
case T_FRAME:
scriptfile_getstring(script,&framename); break;
case T_TILE:
scriptfile_getsymbol(script,&ftilenume); ltilenume = ftilenume; break;
case T_TILE0:
scriptfile_getsymbol(script,&ftilenume); break; //first tile number
case T_TILE1:
scriptfile_getsymbol(script,&ltilenume); break; //last tile number (inclusive)
}
}
@ -769,13 +790,17 @@ static int defsparser(scriptfile *script)
#if defined(POLYMOST) && defined(USE_OPENGL)
for (tilex = ftilenume; tilex <= ltilenume && happy; tilex++) {
switch (md_defineframe(lastmodelid, framename, tilex, max(0,modelskin))) {
case 0: break;
case -1: happy = 0; break; // invalid model id!?
case -2: initprintf("Invalid tile number on line %s:%d\n",
case 0:
break;
case -1:
happy = 0; break; // invalid model id!?
case -2:
initprintf("Invalid tile number on line %s:%d\n",
script->filename, scriptfile_getlinum(script,frametokptr));
happy = 0;
break;
case -3: initprintf("Invalid frame name on line %s:%d\n",
case -3:
initprintf("Invalid frame name on line %s:%d\n",
script->filename, scriptfile_getlinum(script,frametokptr));
happy = 0;
break;
@ -795,10 +820,14 @@ static int defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&animend)) break;
while (script->textptr < animend) {
switch (getatoken(script,modelanimtokens,sizeof(modelanimtokens)/sizeof(tokenlist))) {
case T_FRAME0: scriptfile_getstring(script,&startframe); break;
case T_FRAME1: scriptfile_getstring(script,&endframe); break;
case T_FPS: scriptfile_getdouble(script,&dfps); break; //animation frame rate
case T_FLAGS: scriptfile_getsymbol(script,&flags); break;
case T_FRAME0:
scriptfile_getstring(script,&startframe); break;
case T_FRAME1:
scriptfile_getstring(script,&endframe); break;
case T_FPS:
scriptfile_getdouble(script,&dfps); break; //animation frame rate
case T_FLAGS:
scriptfile_getsymbol(script,&flags); break;
}
}
@ -812,15 +841,20 @@ static int defsparser(scriptfile *script)
}
#if defined(POLYMOST) && defined(USE_OPENGL)
switch (md_defineanimation(lastmodelid, startframe, endframe, (int)(dfps*(65536.0*.001)), flags)) {
case 0: break;
case -1: break; // invalid model id!?
case -2: initprintf("Invalid starting frame name on line %s:%d\n",
case 0:
break;
case -1:
break; // invalid model id!?
case -2:
initprintf("Invalid starting frame name on line %s:%d\n",
script->filename, scriptfile_getlinum(script,animtokptr));
break;
case -3: initprintf("Invalid ending frame name on line %s:%d\n",
case -3:
initprintf("Invalid ending frame name on line %s:%d\n",
script->filename, scriptfile_getlinum(script,animtokptr));
break;
case -4: initprintf("Out of memory on line %s:%d\n",
case -4:
initprintf("Out of memory on line %s:%d\n",
script->filename, scriptfile_getlinum(script,animtokptr));
break;
}
@ -835,9 +869,12 @@ static int defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&skinend)) break;
while (script->textptr < skinend) {
switch (getatoken(script,modelskintokens,sizeof(modelskintokens)/sizeof(tokenlist))) {
case T_PAL: scriptfile_getsymbol(script,&palnum); break;
case T_FILE: scriptfile_getstring(script,&skinfn); break; //skin filename
case T_SURF: scriptfile_getnumber(script,&surfnum); break;
case T_PAL:
scriptfile_getsymbol(script,&palnum); break;
case T_FILE:
scriptfile_getstring(script,&skinfn); break; //skin filename
case T_SURF:
scriptfile_getnumber(script,&surfnum); break;
}
}
@ -851,15 +888,20 @@ static int defsparser(scriptfile *script)
#if defined(POLYMOST) && defined(USE_OPENGL)
switch (md_defineskin(lastmodelid, skinfn, palnum, max(0,modelskin), surfnum)) {
case 0: break;
case -1: break; // invalid model id!?
case -2: initprintf("Invalid skin filename on line %s:%d\n",
case 0:
break;
case -1:
break; // invalid model id!?
case -2:
initprintf("Invalid skin filename on line %s:%d\n",
script->filename, scriptfile_getlinum(script,skintokptr));
break;
case -3: initprintf("Invalid palette number on line %s:%d\n",
case -3:
initprintf("Invalid palette number on line %s:%d\n",
script->filename, scriptfile_getlinum(script,skintokptr));
break;
case -4: initprintf("Out of memory on line %s:%d\n",
case -4:
initprintf("Out of memory on line %s:%d\n",
script->filename, scriptfile_getlinum(script,skintokptr));
break;
}
@ -875,17 +917,28 @@ static int defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&frameend)) break;
while (script->textptr < frameend) {
switch (getatoken(script,modelhudtokens,sizeof(modelhudtokens)/sizeof(tokenlist))) {
case T_TILE: scriptfile_getsymbol(script,&ftilenume); ltilenume = ftilenume; break;
case T_TILE0: scriptfile_getsymbol(script,&ftilenume); break; //first tile number
case T_TILE1: scriptfile_getsymbol(script,&ltilenume); break; //last tile number (inclusive)
case T_XADD: scriptfile_getdouble(script,&xadd); break;
case T_YADD: scriptfile_getdouble(script,&yadd); break;
case T_ZADD: scriptfile_getdouble(script,&zadd); break;
case T_ANGADD:scriptfile_getdouble(script,&angadd); break;
case T_HIDE: flags |= 1; break;
case T_NOBOB: flags |= 2; break;
case T_FLIPPED: flags |= 4; break;
case T_NODEPTH: flags |= 8; break;
case T_TILE:
scriptfile_getsymbol(script,&ftilenume); ltilenume = ftilenume; break;
case T_TILE0:
scriptfile_getsymbol(script,&ftilenume); break; //first tile number
case T_TILE1:
scriptfile_getsymbol(script,&ltilenume); break; //last tile number (inclusive)
case T_XADD:
scriptfile_getdouble(script,&xadd); break;
case T_YADD:
scriptfile_getdouble(script,&yadd); break;
case T_ZADD:
scriptfile_getdouble(script,&zadd); break;
case T_ANGADD:
scriptfile_getdouble(script,&angadd); break;
case T_HIDE:
flags |= 1; break;
case T_NOBOB:
flags |= 2; break;
case T_FLIPPED:
flags |= 4; break;
case T_NODEPTH:
flags |= 8; break;
}
}
@ -907,13 +960,17 @@ static int defsparser(scriptfile *script)
#if defined(POLYMOST) && defined(USE_OPENGL)
for (tilex = ftilenume; tilex <= ltilenume && happy; tilex++) {
switch (md_definehud(lastmodelid, tilex, xadd, yadd, zadd, angadd, flags)) {
case 0: break;
case -1: happy = 0; break; // invalid model id!?
case -2: initprintf("Invalid tile number on line %s:%d\n",
case 0:
break;
case -1:
happy = 0; break; // invalid model id!?
case -2:
initprintf("Invalid tile number on line %s:%d\n",
script->filename, scriptfile_getlinum(script,hudtokptr));
happy = 0;
break;
case -3: initprintf("Invalid frame name on line %s:%d\n",
case -3:
initprintf("Invalid frame name on line %s:%d\n",
script->filename, scriptfile_getlinum(script,hudtokptr));
happy = 0;
break;
@ -995,14 +1052,22 @@ static int defsparser(scriptfile *script)
while (script->textptr < modelend) {
switch (getatoken(script,skyboxtokens,sizeof(skyboxtokens)/sizeof(tokenlist))) {
//case T_ERROR: initprintf("Error on line %s:%d in skybox tokens\n",script->filename,linenum); break;
case T_TILE: scriptfile_getsymbol(script,&tile ); break;
case T_PAL: scriptfile_getsymbol(script,&pal ); break;
case T_FRONT: scriptfile_getstring(script,&fn[0]); break;
case T_RIGHT: scriptfile_getstring(script,&fn[1]); break;
case T_BACK: scriptfile_getstring(script,&fn[2]); break;
case T_LEFT: scriptfile_getstring(script,&fn[3]); break;
case T_TOP: scriptfile_getstring(script,&fn[4]); break;
case T_BOTTOM:scriptfile_getstring(script,&fn[5]); break;
case T_TILE:
scriptfile_getsymbol(script,&tile ); break;
case T_PAL:
scriptfile_getsymbol(script,&pal ); break;
case T_FRONT:
scriptfile_getstring(script,&fn[0]); break;
case T_RIGHT:
scriptfile_getstring(script,&fn[1]); break;
case T_BACK:
scriptfile_getstring(script,&fn[2]); break;
case T_LEFT:
scriptfile_getstring(script,&fn[3]); break;
case T_TOP:
scriptfile_getstring(script,&fn[4]); break;
case T_BOTTOM:
scriptfile_getstring(script,&fn[5]); break;
}
}
@ -1028,11 +1093,16 @@ static int defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&tintend)) break;
while (script->textptr < tintend) {
switch (getatoken(script,tinttokens,sizeof(tinttokens)/sizeof(tokenlist))) {
case T_PAL: scriptfile_getsymbol(script,&pal); break;
case T_RED: scriptfile_getnumber(script,&red); red = min(255,max(0,red)); break;
case T_GREEN: scriptfile_getnumber(script,&green); green = min(255,max(0,green)); break;
case T_BLUE: scriptfile_getnumber(script,&blue); blue = min(255,max(0,blue)); break;
case T_FLAGS: scriptfile_getsymbol(script,&flags); break;
case T_PAL:
scriptfile_getsymbol(script,&pal); break;
case T_RED:
scriptfile_getnumber(script,&red); red = min(255,max(0,red)); break;
case T_GREEN:
scriptfile_getnumber(script,&green); green = min(255,max(0,green)); break;
case T_BLUE:
scriptfile_getnumber(script,&blue); blue = min(255,max(0,blue)); break;
case T_FLAGS:
scriptfile_getsymbol(script,&flags); break;
}
}
@ -1064,10 +1134,14 @@ static int defsparser(scriptfile *script)
if (scriptfile_getbraces(script,&palend)) break;
while (script->textptr < palend) {
switch (getatoken(script,texturetokens_pal,sizeof(texturetokens_pal)/sizeof(tokenlist))) {
case T_FILE: scriptfile_getstring(script,&fn); break;
case T_ALPHACUT: scriptfile_getdouble(script,&alphacut); break;
case T_NOCOMPRESS: flags |= 1; break;
default: break;
case T_FILE:
scriptfile_getstring(script,&fn); break;
case T_ALPHACUT:
scriptfile_getdouble(script,&alphacut); break;
case T_NOCOMPRESS:
flags |= 1; break;
default:
break;
}
}
@ -1089,7 +1163,8 @@ static int defsparser(scriptfile *script)
hicsetsubsttex(tile,pal,fn,alphacut,flags);
} break;
default: break;
default:
break;
}
}

View file

@ -2976,14 +2976,22 @@ if (!davoxptr && i > 0) { davoxptr = (char *)voxoff[daindex][0]; i = 0; }
{
switch (cnt)
{
case 0: xs = 0; ys = 0; xi = 1; yi = 1; break;
case 1: xs = daxsiz-1; ys = 0; xi = -1; yi = 1; break;
case 2: xs = 0; ys = daysiz-1; xi = 1; yi = -1; break;
case 3: xs = daxsiz-1; ys = daysiz-1; xi = -1; yi = -1; break;
case 4: xs = 0; ys = cbacky; xi = 1; yi = 2; break;
case 5: xs = daxsiz-1; ys = cbacky; xi = -1; yi = 2; break;
case 6: xs = cbackx; ys = 0; xi = 2; yi = 1; break;
case 7: xs = cbackx; ys = daysiz-1; xi = 2; yi = -1; break;
case 0:
xs = 0; ys = 0; xi = 1; yi = 1; break;
case 1:
xs = daxsiz-1; ys = 0; xi = -1; yi = 1; break;
case 2:
xs = 0; ys = daysiz-1; xi = 1; yi = -1; break;
case 3:
xs = daxsiz-1; ys = daysiz-1; xi = -1; yi = -1; break;
case 4:
xs = 0; ys = cbacky; xi = 1; yi = 2; break;
case 5:
xs = daxsiz-1; ys = cbacky; xi = -1; yi = 2; break;
case 6:
xs = cbackx; ys = 0; xi = 2; yi = 1; break;
case 7:
xs = cbackx; ys = daysiz-1; xi = 2; yi = -1; break;
}
xe = cbackx; ye = cbacky;
if (cnt < 4)
@ -3005,17 +3013,33 @@ if (!davoxptr && i > 0) { davoxptr = (char *)voxoff[daindex][0]; i = 0; }
i = ksgn(ys-backy)+ksgn(xs-backx)*3+4;
switch (i)
{
case 6: case 7: x1 = 0; y1 = 0; break;
case 8: case 5: x1 = gxinc; y1 = gyinc; break;
case 0: case 3: x1 = gyinc; y1 = -gxinc; break;
case 2: case 1: x1 = gxinc+gyinc; y1 = gyinc-gxinc; break;
case 6:
case 7:
x1 = 0; y1 = 0; break;
case 8:
case 5:
x1 = gxinc; y1 = gyinc; break;
case 0:
case 3:
x1 = gyinc; y1 = -gxinc; break;
case 2:
case 1:
x1 = gxinc+gyinc; y1 = gyinc-gxinc; break;
}
switch (i)
{
case 2: case 5: x2 = 0; y2 = 0; break;
case 0: case 1: x2 = gxinc; y2 = gyinc; break;
case 8: case 7: x2 = gyinc; y2 = -gxinc; break;
case 6: case 3: x2 = gxinc+gyinc; y2 = gyinc-gxinc; break;
case 2:
case 5:
x2 = 0; y2 = 0; break;
case 0:
case 1:
x2 = gxinc; y2 = gyinc; break;
case 8:
case 7:
x2 = gyinc; y2 = -gxinc; break;
case 6:
case 3:
x2 = gxinc+gyinc; y2 = gyinc-gxinc; break;
}
oand = pow2char[(xs<backx)+0]+pow2char[(ys<backy)+2];
oand16 = oand+16;
@ -4893,10 +4917,14 @@ if (dastat&16) { xoff = 0; yoff = 0; }
switch (y1-oy)
{
case -1: bx -= xv; by -= yv; oy = y1; break;
case 0: break;
case 1: bx += xv; by += yv; oy = y1; break;
default: bx += xv*(y1-oy); by += yv*(y1-oy); oy = y1; break;
case -1:
bx -= xv; by -= yv; oy = y1; break;
case 0:
break;
case 1:
bx += xv; by += yv; oy = y1; break;
default:
bx += xv*(y1-oy); by += yv*(y1-oy); oy = y1; break;
}
p = ylookup[y1]+x+frameplace;
@ -4944,10 +4972,14 @@ if (dastat&16) { xoff = 0; yoff = 0; }
switch (y1-oy)
{
case -1: bx -= xv; by -= yv; oy = y1; break;
case 0: break;
case 1: bx += xv; by += yv; oy = y1; break;
default: bx += xv*(y1-oy); by += yv*(y1-oy); oy = y1; break;
case -1:
bx -= xv; by -= yv; oy = y1; break;
case 0:
break;
case 1:
bx += xv; by += yv; oy = y1; break;
default:
bx += xv*(y1-oy); by += yv*(y1-oy); oy = y1; break;
}
p = ylookup[y1]+x+frameplace;
@ -5446,19 +5478,29 @@ static void sighandler(int sig, const siginfo_t *info, void *ctx)
switch (sig) {
case SIGFPE:
switch (info->si_code) {
case FPE_INTDIV: s = "FPE_INTDIV (integer divide by zero)"; break;
case FPE_INTOVF: s = "FPE_INTOVF (integer overflow)"; break;
case FPE_FLTDIV: s = "FPE_FLTDIV (floating-point divide by zero)"; break;
case FPE_FLTOVF: s = "FPE_FLTOVF (floating-point overflow)"; break;
case FPE_FLTUND: s = "FPE_FLTUND (floating-point underflow)"; break;
case FPE_FLTRES: s = "FPE_FLTRES (floating-point inexact result)"; break;
case FPE_FLTINV: s = "FPE_FLTINV (floating-point invalid operation)"; break;
case FPE_FLTSUB: s = "FPE_FLTSUB (floating-point subscript out of range)"; break;
default: s = "?! (unknown)"; break;
case FPE_INTDIV:
s = "FPE_INTDIV (integer divide by zero)"; break;
case FPE_INTOVF:
s = "FPE_INTOVF (integer overflow)"; break;
case FPE_FLTDIV:
s = "FPE_FLTDIV (floating-point divide by zero)"; break;
case FPE_FLTOVF:
s = "FPE_FLTOVF (floating-point overflow)"; break;
case FPE_FLTUND:
s = "FPE_FLTUND (floating-point underflow)"; break;
case FPE_FLTRES:
s = "FPE_FLTRES (floating-point inexact result)"; break;
case FPE_FLTINV:
s = "FPE_FLTINV (floating-point invalid operation)"; break;
case FPE_FLTSUB:
s = "FPE_FLTSUB (floating-point subscript out of range)"; break;
default:
s = "?! (unknown)"; break;
}
fprintf(stderr, "Caught SIGFPE at address %p, code %s. Aborting.\n", info->si_addr, s);
break;
default: break;
default:
break;
}
abort();
}
@ -6999,7 +7041,8 @@ long loadoldboard(char *filename, char fromwhere, long *daposx, long *daposy, lo
if (numsectors > MAXSECTORS) { kclose(fil); return(-1); }
for (i=0; i<numsectors; i++) {
switch (mapversion) {
case 5: kread(fil,&v5sect,sizeof(struct sectortypev5));
case 5:
kread(fil,&v5sect,sizeof(struct sectortypev5));
v5sect.wallptr = B_LITTLE16(v5sect.wallptr);
v5sect.wallnum = B_LITTLE16(v5sect.wallnum);
v5sect.ceilingpicnum = B_LITTLE16(v5sect.ceilingpicnum);
@ -7012,7 +7055,8 @@ long loadoldboard(char *filename, char fromwhere, long *daposx, long *daposy, lo
v5sect.hitag = B_LITTLE16(v5sect.hitag);
v5sect.extra = B_LITTLE16(v5sect.extra);
break;
case 6: kread(fil,&v6sect,sizeof(struct sectortypev6));
case 6:
kread(fil,&v6sect,sizeof(struct sectortypev6));
v6sect.wallptr = B_LITTLE16(v6sect.wallptr);
v6sect.wallnum = B_LITTLE16(v6sect.wallnum);
v6sect.ceilingpicnum = B_LITTLE16(v6sect.ceilingpicnum);
@ -7027,8 +7071,10 @@ long loadoldboard(char *filename, char fromwhere, long *daposx, long *daposy, lo
break;
}
switch (mapversion) {
case 5: convertv5sectv6(&v5sect,&v6sect);
case 6: convertv6sectv7(&v6sect,&sector[i]);
case 5:
convertv5sectv6(&v5sect,&v6sect);
case 6:
convertv6sectv7(&v6sect,&sector[i]);
}
}
@ -7036,7 +7082,8 @@ long loadoldboard(char *filename, char fromwhere, long *daposx, long *daposy, lo
if (numwalls > MAXWALLS) { kclose(fil); return(-1); }
for (i=0; i<numwalls; i++) {
switch (mapversion) {
case 5: kread(fil,&v5wall,sizeof(struct walltypev5));
case 5:
kread(fil,&v5wall,sizeof(struct walltypev5));
v5wall.x = B_LITTLE32(v5wall.x);
v5wall.y = B_LITTLE32(v5wall.y);
v5wall.point2 = B_LITTLE16(v5wall.point2);
@ -7051,7 +7098,8 @@ if (numwalls > MAXWALLS) { kclose(fil); return(-1); }
v5wall.hitag = B_LITTLE16(v5wall.hitag);
v5wall.extra = B_LITTLE16(v5wall.extra);
break;
case 6: kread(fil,&v6wall,sizeof(struct walltypev6));
case 6:
kread(fil,&v6wall,sizeof(struct walltypev6));
v6wall.x = B_LITTLE32(v6wall.x);
v6wall.y = B_LITTLE32(v6wall.y);
v6wall.point2 = B_LITTLE16(v6wall.point2);
@ -7066,8 +7114,10 @@ if (numwalls > MAXWALLS) { kclose(fil); return(-1); }
break;
}
switch (mapversion) {
case 5: convertv5wallv6(&v5wall,&v6wall,i);
case 6: convertv6wallv7(&v6wall,&wall[i]);
case 5:
convertv5wallv6(&v5wall,&v6wall,i);
case 6:
convertv6wallv7(&v6wall,&wall[i]);
}
}
@ -7075,7 +7125,8 @@ if (numwalls > MAXWALLS) { kclose(fil); return(-1); }
if (numsprites > MAXSPRITES) { kclose(fil); return(-1); }
for (i=0; i<numsprites; i++) {
switch (mapversion) {
case 5: kread(fil,&v5spr,sizeof(struct spritetypev5));
case 5:
kread(fil,&v5spr,sizeof(struct spritetypev5));
v5spr.x = B_LITTLE32(v5spr.x);
v5spr.y = B_LITTLE32(v5spr.y);
v5spr.z = B_LITTLE32(v5spr.z);
@ -7091,7 +7142,8 @@ if (numsprites > MAXSPRITES) { kclose(fil); return(-1); }
v5spr.hitag = B_LITTLE16(v5spr.hitag);
v5spr.extra = B_LITTLE16(v5spr.extra);
break;
case 6: kread(fil,&v6spr,sizeof(struct spritetypev6));
case 6:
kread(fil,&v6spr,sizeof(struct spritetypev6));
v6spr.x = B_LITTLE32(v6spr.x);
v6spr.y = B_LITTLE32(v6spr.y);
v6spr.z = B_LITTLE32(v6spr.z);
@ -7110,8 +7162,10 @@ if (numsprites > MAXSPRITES) { kclose(fil); return(-1); }
break;
}
switch (mapversion) {
case 5: convertv5sprv6(&v5spr,&v6spr);
case 6: convertv6sprv7(&v6spr,&sprite[i]);
case 5:
convertv5sprv6(&v5spr,&v6spr);
case 6:
convertv6sprv7(&v6spr,&sprite[i]);
}
}

View file

@ -257,7 +257,8 @@ static _inline long bitrev (long b, long c)
mov edx, b
mov ecx, c
xor eax, eax
beg: shr edx, 1
beg:
shr edx, 1
adc eax, eax
sub ecx, 1
jnz short beg
@ -524,9 +525,12 @@ static long initpass () //Interlaced images have 7 "passes", non-interlaced have
xsizbpl = ((0x04021301>>(coltype<<2))&15)*ixsiz;
switch (bitdepth)
{
case 1: xsizbpl = ((xsizbpl+7)>>3); break;
case 2: xsizbpl = ((xsizbpl+3)>>2); break;
case 4: xsizbpl = ((xsizbpl+1)>>1); break;
case 1:
xsizbpl = ((xsizbpl+7)>>3); break;
case 2:
xsizbpl = ((xsizbpl+3)>>2); break;
case 4:
xsizbpl = ((xsizbpl+1)>>1); break;
}
memset(olinbuf,0,(xsizbpl+1)*sizeof(olinbuf[0]));
@ -551,11 +555,14 @@ if (coltype == 4) { xr0 = xr0*2; xr1 = xr1*2; }
{
switch (bitdepth)
{
case 1: xr0 += ((-ixsiz)&7)+7;
case 1:
xr0 += ((-ixsiz)&7)+7;
xr1 += ((-ixsiz)&7)+7; break;
case 2: xr0 = ((xr0+((-ixsiz)&3)+3)<<1);
case 2:
xr0 = ((xr0+((-ixsiz)&3)+3)<<1);
xr1 = ((xr1+((-ixsiz)&3)+3)<<1); break;
case 4: xr0 = ((xr0+((-ixsiz)&1)+1)<<2);
case 4:
xr0 = ((xr0+((-ixsiz)&1)+1)<<2);
xr1 = ((xr1+((-ixsiz)&1)+1)<<2); break;
}
}
@ -674,17 +681,20 @@ static _inline void rgbhlineasm (long c, long d, long t, long b)
add edx, offset olinbuf
cmp dword ptr trnsrgb, 0
jz short begit2
begit: mov eax, dword ptr [ecx+edx]
begit:
mov eax, dword ptr [ecx+edx]
or eax, 0xff000000
cmp eax, dword ptr trnsrgb
jne short skipit
and eax, 0xffffff
skipit: sub ecx, 3
skipit:
sub ecx, 3
mov [edi], eax
lea edi, [edi+ebx]
jnz short begit
jmp short endit
begit2: mov eax, dword ptr [ecx+edx]
begit2:
mov eax, dword ptr [ecx+edx]
or eax, 0xff000000
sub ecx, 3
mov [edi], eax
@ -705,7 +715,8 @@ static _inline void pal8hlineasm (long c, long d, long t, long b)
sub ecx, edx
jle short endit
add edx, offset olinbuf
begit: movzx eax, byte ptr [ecx+edx]
begit:
movzx eax, byte ptr [ecx+edx]
mov eax, dword ptr palcol[eax*4]
sub ecx, 1
mov [edi], eax
@ -903,10 +914,14 @@ static void putbuf (const unsigned char *buf, long leng)
default:
switch (bitdepth)
{
case 1: for(;x>xr1;p+=ixstp,x-- ) *(long *)p = palcol[olinbuf[x>>3]>>(x&7)]; break;
case 2: for(;x>xr1;p+=ixstp,x-=2) *(long *)p = palcol[olinbuf[x>>3]>>(x&6)]; break;
case 4: for(;x>xr1;p+=ixstp,x-=4) *(long *)p = palcol[olinbuf[x>>3]>>(x&4)]; break;
case 8: pal8hlineasm(x,xr1,p,ixstp); break; //for(;x>xr1;p+=ixstp,x--) *(long *)p = palcol[olinbuf[x]]; break;
case 1:
for (;x>xr1;p+=ixstp,x-- ) *(long *)p = palcol[olinbuf[x>>3]>>(x&7)]; break;
case 2:
for (;x>xr1;p+=ixstp,x-=2) *(long *)p = palcol[olinbuf[x>>3]>>(x&6)]; break;
case 4:
for (;x>xr1;p+=ixstp,x-=4) *(long *)p = palcol[olinbuf[x>>3]>>(x&4)]; break;
case 8:
pal8hlineasm(x,xr1,p,ixstp); break; //for(;x>xr1;p+=ixstp,x--) *(long *)p = palcol[olinbuf[x]]; break;
}
break;
}
@ -1004,10 +1019,12 @@ static long kpngrend (const char *kfilebuf, long kfilength,
{
switch (coltype)
{
case 0: case 4:
case 0:
case 4:
bakcol = (((long)filptr[0]<<8)+(long)filptr[1])*255/((1<<bitdepth)-1);
bakcol = bakcol*0x10101+0xff000000; break;
case 2: case 6:
case 2:
case 6:
if (bitdepth == 8)
{ bakcol = (((long)filptr[1])<<16)+(((long)filptr[3])<<8)+((long)filptr[5])+0xff000000; }
else
@ -1042,7 +1059,8 @@ static long kpngrend (const char *kfilebuf, long kfilength,
for (i=min(leng,paleng)-1;i>=0;i--)
palcol[i] &= LSWAPIB((((long)filptr[i])<<24)|0xffffff);
break;
default:;
default:
;
}
}
else if (i == LSWAPIB(0x54414449)) { break; } //IDAT
@ -1064,16 +1082,23 @@ static long kpngrend (const char *kfilebuf, long kfilength,
switch (coltype)
{
case 4: xmn[0] = 1; xmn[1] = 0; break;
case 2: xmn[0] = 1; xmn[1] = 2; xmn[2] = 0; break;
case 6: xmn[0] = 1; xmn[1] = 2; xmn[2] = 3; xmn[3] = 0; break;
default: xmn[0] = 0; break;
case 4:
xmn[0] = 1; xmn[1] = 0; break;
case 2:
xmn[0] = 1; xmn[1] = 2; xmn[2] = 0; break;
case 6:
xmn[0] = 1; xmn[1] = 2; xmn[2] = 3; xmn[3] = 0; break;
default:
xmn[0] = 0; break;
}
switch (bitdepth)
{
case 1: for(i=2;i<256;i++) palcol[i] = palcol[i&1]; break;
case 2: for(i=4;i<256;i++) palcol[i] = palcol[i&3]; break;
case 4: for(i=16;i<256;i++) palcol[i] = palcol[i&15]; break;
case 1:
for (i=2;i<256;i++) palcol[i] = palcol[i&1]; break;
case 2:
for (i=4;i<256;i++) palcol[i] = palcol[i&3]; break;
case 4:
for (i=16;i<256;i++) palcol[i] = palcol[i&15]; break;
}
//coltype: bitdepth: format:
@ -1085,9 +1110,12 @@ static long kpngrend (const char *kfilebuf, long kfilength,
xsizbpl = ((0x04021301>>(coltype<<2))&15)*xsiz;
switch (bitdepth)
{
case 1: xsizbpl = ((xsizbpl+7)>>3); break;
case 2: xsizbpl = ((xsizbpl+3)>>2); break;
case 4: xsizbpl = ((xsizbpl+1)>>1); break;
case 1:
xsizbpl = ((xsizbpl+7)>>3); break;
case 2:
xsizbpl = ((xsizbpl+3)>>2); break;
case 4:
xsizbpl = ((xsizbpl+1)>>1); break;
}
//Tests to see if xsiz > allocated space in olinbuf
//Note: xsizbpl gets re-written inside initpass()
@ -1192,7 +1220,8 @@ static long kpngrend (const char *kfilebuf, long kfilength,
putbuf(slidebuf,slidew&32767);
}
kpngrend_goodret:;
kpngrend_goodret:
;
if (!(filterest&~(1<<filter1st))) filtype = filter1st;
else if ((filter1st == 1) && (!(filterest&~(1<<3)))) filtype = 3;
else filtype = 5;
@ -1526,7 +1555,9 @@ static long kpegrend (const char *kfilebuf, long kfilength,
//printf("fileoffs=%08x, marker=%02x,leng=%d",((long)kfileptr)-((long)kfilebuf)-2,marker,leng);
switch (marker)
{
case 0xc0: case 0xc1: case 0xc2:
case 0xc0:
case 0xc1:
case 0xc2:
//processit!
kfileptr++; //numbits = *kfileptr++;
@ -1845,11 +1876,14 @@ case 0xc0: case 0xc1: case 0xc2:
eobrun = 0;
}
}
kpegrend_break2:;
kpegrend_break2:
;
if (!dctbuf) return(0);
passcnt++; kfileptr -= ((curbits>>3)+1); break;
case 0xd9: break;
default: kfileptr += leng; break;
case 0xd9:
break;
default:
kfileptr += leng; break;
}
} while (kfileptr-(unsigned char *)kfilebuf < kfilength);
@ -2011,10 +2045,14 @@ if (ptr[-1]&64) { yinc = 8; ilacefirst = 1; }
if (y >= yspan)
switch (yinc)
{
case 8: if (!ilacefirst) { y = daglobyoffs+2; yinc = 4; break; }
case 8:
if (!ilacefirst) { y = daglobyoffs+2; yinc = 4; break; }
ilacefirst = 0; y = daglobyoffs+4; yinc = 8; break;
case 4: y = daglobyoffs+1; yinc = 2; break;
case 2: case 1: return(0);
case 4:
y = daglobyoffs+1; yinc = 2; break;
case 2:
case 1:
return(0);
}
if ((unsigned long)y < (unsigned long)dayres)
{ yoff = y*dabytesperline+daframeplace; x = daglobxoffs; xend = xspan; }
@ -2099,10 +2137,14 @@ static long ktgarend (const char *header, long fleng,
switch (pixbyte) //For PNGOUT
{
case 1: coltype = 0; bitdepth = 8; palcol[0] = LSWAPIB(0xff000000);
case 1:
coltype = 0; bitdepth = 8; palcol[0] = LSWAPIB(0xff000000);
for (i=1;i<256;i++) palcol[i] = palcol[i-1]+LSWAPIB(0x10101); break;
case 2: case 3: coltype = 2; break;
case 4: coltype = 6; break;
case 2:
case 3:
coltype = 2; break;
case 4:
coltype = 6; break;
}
if (!(header[17]&16)) { x0 = 0; x1 = xsiz; xi = 1; }
@ -2129,12 +2171,16 @@ if (!(header[17]&16)) { x0 = 0; x1 = xsiz; xi = 1; }
switch (pixbyte)
{
case 1: i = palcol[(long)nptr[0]]; break;
case 2: i = (long)SSWAPIB(*(unsigned short *)&nptr[0]);
case 1:
i = palcol[(long)nptr[0]]; break;
case 2:
i = (long)SSWAPIB(*(unsigned short *)&nptr[0]);
i = LSWAPIB(((i&0x7c00)<<9) + ((i&0x03e0)<<6) + ((i&0x001f)<<3) + 0xff000000);
break;
case 3: i = (*(long *)&nptr[0]) | LSWAPIB(0xff000000); break;
case 4: i = (*(long *)&nptr[0]); break;
case 3:
i = (*(long *)&nptr[0]) | LSWAPIB(0xff000000); break;
case 4:
i = (*(long *)&nptr[0]); break;
}
fptr += colbyte;
}
@ -2210,8 +2256,10 @@ static long kbmprend (const char *buf, long fleng,
coltype = 2;
switch (cdim)
{
case 16: palcol[0] = 10; palcol[1] = 5; palcol[2] = 0; palcol[3] = 5; palcol[4] = 5; palcol[5] = 5; break;
case 32: palcol[0] = 16; palcol[1] = 8; palcol[2] = 0; palcol[3] = 8; palcol[4] = 8; palcol[5] = 8; break;
case 16:
palcol[0] = 10; palcol[1] = 5; palcol[2] = 0; palcol[3] = 5; palcol[4] = 5; palcol[5] = 5; break;
case 32:
palcol[0] = 16; palcol[1] = 8; palcol[2] = 0; palcol[3] = 8; palcol[4] = 8; palcol[5] = 8; break;
}
if (comp == 3) //BI_BITFIELD (RGB masks)
{
@ -2252,18 +2300,24 @@ if (ysiz < 0) { ysiz = -ysiz; } else { cptr = &cptr[(ysiz-1)*cptrinc]; cptrinc =
lptr = (long *)(y*dabytesperline-(daglobyoffs<<2)+daframeplace);
switch (cdim)
{
case 1: for(x=x0;x<x1;x++) lptr[x] = palcol[(long)((cptr[x>>3]>>((x&7)^7))&1)]; break;
case 4: for(x=x0;x<x1;x++) lptr[x] = palcol[(long)((cptr[x>>1]>>(((x&1)^1)<<2))&15)]; break;
case 8: for(x=x0;x<x1;x++) lptr[x] = palcol[(long)(cptr[x])]; break;
case 16: for(x=x0;x<x1;x++)
case 1:
for (x=x0;x<x1;x++) lptr[x] = palcol[(long)((cptr[x>>3]>>((x&7)^7))&1)]; break;
case 4:
for (x=x0;x<x1;x++) lptr[x] = palcol[(long)((cptr[x>>1]>>(((x&1)^1)<<2))&15)]; break;
case 8:
for (x=x0;x<x1;x++) lptr[x] = palcol[(long)(cptr[x])]; break;
case 16:
for (x=x0;x<x1;x++)
{
i = ((long)(*(short *)&cptr[x<<1]));
lptr[x] = (_lrotl(i,palcol[0])&palcol[3]) +
(_lrotl(i,palcol[1])&palcol[4]) +
(_lrotl(i,palcol[2])&palcol[5]) + LSWAPIB(0xff000000);
} break;
case 24: for(x=x0;x<x1;x++) lptr[x] = ((*(long *)&cptr[x*3])|LSWAPIB(0xff000000)); break;
case 32: for(x=x0;x<x1;x++)
case 24:
for (x=x0;x<x1;x++) lptr[x] = ((*(long *)&cptr[x*3])|LSWAPIB(0xff000000)); break;
case 32:
for (x=x0;x<x1;x++)
{
i = (*(long *)&cptr[x<<2]);
lptr[x] = (_lrotl(i,palcol[0])&palcol[3]) +
@ -2455,9 +2509,14 @@ static long kddsrend (const char *buf, long leng,
j = ((v>>(ai<<1))&3);
switch (dxt)
{
case 1: z = a[j]; break;
case 2: case 3: z = (( uptr[(ai>>1)-8] >> ((xx&1)<<2) )&15)*17; break;
case 4: case 5: z = a[( al[yy>>1] >> ((ai&7)*3) )&7]; break;
case 1:
z = a[j]; break;
case 2:
case 3:
z = (( uptr[(ai>>1)-8] >> ((xx&1)<<2) )&15)*17; break;
case 4:
case 5:
z = a[( al[yy>>1] >> ((ai&7)*3) )&7]; break;
}
rr = r[j]; gg = g[j]; bb = b[j];
if (!(dxt&1))
@ -2816,7 +2875,8 @@ long kzopen (const char *filnam)
kzfs.pos = 0;
switch (kzfs.comptyp) //Compression method
{
case 0: kzfs.i = 0; return((long)kzfs.fil);
case 0:
kzfs.i = 0; return((long)kzfs.fil);
case 8:
if (!pnginited) { pnginited = 1; initpngtables(); }
kzfs.comptell = 0;
@ -2826,7 +2886,8 @@ long kzopen (const char *filnam)
gslidew = 0x7fffffff; //Force reload at beginning
return((long)kzfs.fil);
default: fclose(kzfs.fil); kzfs.fil = 0; return(0);
default:
fclose(kzfs.fil); kzfs.fil = 0; return(0);
}
}
return(0);
@ -3050,12 +3111,17 @@ long kzread (void *buffer, long leng)
switch (kzfs.jmpplc)
{
case 0: goto kzreadplc0;
case 1: goto kzreadplc1;
case 2: goto kzreadplc2;
case 3: goto kzreadplc3;
case 0:
goto kzreadplc0;
case 1:
goto kzreadplc1;
case 2:
goto kzreadplc2;
case 3:
goto kzreadplc3;
}
kzreadplc0:;
kzreadplc0:
;
do
{
bfinal = getbits(1); btype = getbits(2);
@ -3095,7 +3161,8 @@ kzreadplc0:;
{
kzfs.jmpplc = 1; kzfs.i = i; kzfs.bfinal = bfinal;
goto retkzread;
kzreadplc1:; i = kzfs.i; bfinal = kzfs.bfinal;
kzreadplc1:
; i = kzfs.i; bfinal = kzfs.bfinal;
}
}
slidebuf[(gslidew++)&32767] = (char)getbits(8);
@ -3149,7 +3216,8 @@ kzreadplc1:; i = kzfs.i; bfinal = kzfs.bfinal;
if (gslider-16384 >= kzfs.endpos)
{
kzfs.jmpplc = 2; kzfs.bfinal = bfinal; goto retkzread;
kzreadplc2:; bfinal = kzfs.bfinal;
kzreadplc2:
; bfinal = kzfs.bfinal;
}
}
@ -3178,10 +3246,12 @@ kzreadplc2:; bfinal = kzfs.bfinal;
putbuf4zip(&slidebuf[gslider&32767],gslider,gslidew&~32767);
putbuf4zip(slidebuf,gslidew&~32767,gslidew);
}
kzreadplc3:; kzfs.jmpplc = 3;
kzreadplc3:
; kzfs.jmpplc = 3;
}
retkzread:;
retkzread:
;
i = kzfs.pos;
kzfs.pos += leng; if (kzfs.pos > kzfs.leng) kzfs.pos = kzfs.leng;
return(kzfs.pos-i);
@ -3200,9 +3270,13 @@ long kzseek (long offset, long whence)
if (!kzfs.fil) return(-1);
switch (whence)
{
case SEEK_CUR: kzfs.pos += offset; break;
case SEEK_END: kzfs.pos = kzfs.leng+offset; break;
case SEEK_SET: default: kzfs.pos = offset;
case SEEK_CUR:
kzfs.pos += offset; break;
case SEEK_END:
kzfs.pos = kzfs.leng+offset; break;
case SEEK_SET:
default:
kzfs.pos = offset;
}
if (kzfs.pos < 0) kzfs.pos = 0;
if (kzfs.pos > kzfs.leng) kzfs.pos = kzfs.leng;

View file

@ -49,8 +49,10 @@ child = (long *)malloc((ucompleng+256)*sizeof(long)); if (!child) { free(nodev);
if (sibly[j] < 0) { sibly[j] = numnodes; goto lzwcompbreak2a; }
#endif
}
lzwcompbreak2a: nodev[numnodes] = cptr[0];
lzwcompbreak2b: child[numnodes] = sibly[numnodes] = -1;
lzwcompbreak2a:
nodev[numnodes] = cptr[0];
lzwcompbreak2b:
child[numnodes] = sibly[numnodes] = -1;
#if USENEW
sibry[numnodes] = -1;
#endif

View file

@ -1817,29 +1817,41 @@ if (x < y) { z = x; x = y; y = z; i += 3; }
lptr = &gvox->mytex[(shp[z].y+VOXBORDWIDTH)*gvox->mytexx+(shp[z].x+VOXBORDWIDTH)];
switch (face)
{
case 0: ny = y1; x2 = x0; x0 = x1; x1 = x2; break;
case 1: ny = y0; y0++; y1++; y2++; break;
case 2: nz = z1; y0 = y2; y2 = y1; y1 = y0; z0++; z1++; z2++; break;
case 3: nz = z0; break;
case 4: nx = x1; y2 = y0; y0 = y1; y1 = y2; x0++; x1++; x2++; break;
case 5: nx = x0; break;
case 0:
ny = y1; x2 = x0; x0 = x1; x1 = x2; break;
case 1:
ny = y0; y0++; y1++; y2++; break;
case 2:
nz = z1; y0 = y2; y2 = y1; y1 = y0; z0++; z1++; z2++; break;
case 3:
nz = z0; break;
case 4:
nx = x1; y2 = y0; y0 = y1; y1 = y2; x0++; x1++; x2++; break;
case 5:
nx = x0; break;
}
for (yy=0;yy<y;yy++,lptr+=gvox->mytexx)
for (xx=0;xx<x;xx++)
{
switch (face)
{
case 0: if (i < 3) { nx = x1+x-1-xx; nz = z1+yy; } //back
case 0:
if (i < 3) { nx = x1+x-1-xx; nz = z1+yy; } //back
else { nx = x1+y-1-yy; nz = z1+xx; } break;
case 1: if (i < 3) { nx = x0+xx; nz = z0+yy; } //front
case 1:
if (i < 3) { nx = x0+xx; nz = z0+yy; } //front
else { nx = x0+yy; nz = z0+xx; } break;
case 2: if (i < 3) { nx = x1-x+xx; ny = y1-1-yy; } //bot
case 2:
if (i < 3) { nx = x1-x+xx; ny = y1-1-yy; } //bot
else { nx = x1-1-yy; ny = y1-1-xx; } break;
case 3: if (i < 3) { nx = x0+xx; ny = y0+yy; } //top
case 3:
if (i < 3) { nx = x0+xx; ny = y0+yy; } //top
else { nx = x0+yy; ny = y0+xx; } break;
case 4: if (i < 3) { ny = y1+x-1-xx; nz = z1+yy; } //right
case 4:
if (i < 3) { ny = y1+x-1-xx; nz = z1+yy; } //right
else { ny = y1+y-1-yy; nz = z1+xx; } break;
case 5: if (i < 3) { ny = y0+xx; nz = z0+yy; } //left
case 5:
if (i < 3) { ny = y0+xx; nz = z0+yy; } //left
else { ny = y0+yy; nz = z0+xx; } break;
}
lptr[xx] = getvox(nx,ny,nz);
@ -1973,7 +1985,8 @@ bx0 = (long *)malloc(i<<1); if (!bx0) { free(gvox); return(0); }
for (gvox->mytexy=32;gvox->mytexy<(gmaxy+(VOXBORDWIDTH<<1));gvox->mytexy<<=1);
while (gvox->mytexx*gvox->mytexy*8 < garea*9) //This should be sufficient to fit most skins...
{
skindidntfit:;
skindidntfit:
;
if (gvox->mytexx <= gvox->mytexy) gvox->mytexx <<= 1; else gvox->mytexy <<= 1;
}
mytexo5 = (gvox->mytexx>>5);
@ -2451,9 +2464,12 @@ mdmodel *mdload (const char *filnam)
kread(fil,&i,4); klseek(fil,0,SEEK_SET);
switch (B_LITTLE32(i))
{
case 0x32504449: vm = (mdmodel*)md2load(fil,filnam); break; //IDP2
case 0x33504449: vm = (mdmodel*)md3load(fil); break; //IDP3
default: vm = (mdmodel*)0; break;
case 0x32504449:
vm = (mdmodel*)md2load(fil,filnam); break; //IDP2
case 0x33504449:
vm = (mdmodel*)md3load(fil); break; //IDP3
default:
vm = (mdmodel*)0; break;
}
kclose(fil);
return(vm);

View file

@ -803,9 +803,12 @@ static char *strtoken(char *s, char **ptrptr, int *restart)
break;
} else if (*p == '\\') {
switch (*(++p)) {
case 'n': *p2 = '\n'; break;
case 'r': *p2 = '\r'; break;
default: *p2 = *p; break;
case 'n':
*p2 = '\n'; break;
case 'r':
*p2 = '\r'; break;
default:
*p2 = *p; break;
}
} else {
*p2 = *p;
@ -876,8 +879,10 @@ int OSD_Dispatch(const char *cmd)
ofp.parms = (const char **)parms;
ofp.raw = cmd;
switch (symb->func(&ofp)) {
case OSDCMD_OK: break;
case OSDCMD_SHOWHELP: OSD_Printf("%s\n", symb->help); break;
case OSDCMD_OK:
break;
case OSDCMD_SHOWHELP:
OSD_Printf("%s\n", symb->help); break;
}
state = wtp;

View file

@ -618,9 +618,12 @@ void resizeglcheck ()
switch (glpolygonmode)
{
default:
case 0: bglPolygonMode(GL_FRONT_AND_BACK,GL_FILL); break;
case 1: bglPolygonMode(GL_FRONT_AND_BACK,GL_LINE); break;
case 2: bglPolygonMode(GL_FRONT_AND_BACK,GL_POINT); break;
case 0:
bglPolygonMode(GL_FRONT_AND_BACK,GL_FILL); break;
case 1:
bglPolygonMode(GL_FRONT_AND_BACK,GL_LINE); break;
case 2:
bglPolygonMode(GL_FRONT_AND_BACK,GL_POINT); break;
}
}
if (glpolygonmode) //FUK
@ -683,11 +686,16 @@ void fixtransparency (coltype *dapic, long daxsiz, long daysiz, long daxsiz2, lo
if ((y<daysiz) && (wpptr[daxsiz2].a)) { r += (long)wpptr[daxsiz2].r; g += (long)wpptr[daxsiz2].g; b += (long)wpptr[daxsiz2].b; j++; }
switch (j)
{
case 1: wpptr->r = r ; wpptr->g = g ; wpptr->b = b ; break;
case 2: wpptr->r = ((r + 1)>>1); wpptr->g = ((g + 1)>>1); wpptr->b = ((b + 1)>>1); break;
case 3: wpptr->r = ((r*85+128)>>8); wpptr->g = ((g*85+128)>>8); wpptr->b = ((b*85+128)>>8); break;
case 4: wpptr->r = ((r + 2)>>2); wpptr->g = ((g + 2)>>2); wpptr->b = ((b + 2)>>2); break;
default: break;
case 1:
wpptr->r = r ; wpptr->g = g ; wpptr->b = b ; break;
case 2:
wpptr->r = ((r + 1)>>1); wpptr->g = ((g + 1)>>1); wpptr->b = ((b + 1)>>1); break;
case 3:
wpptr->r = ((r*85+128)>>8); wpptr->g = ((g*85+128)>>8); wpptr->b = ((b*85+128)>>8); break;
case 4:
wpptr->r = ((r + 2)>>2); wpptr->g = ((g + 2)>>2); wpptr->b = ((b + 2)>>2); break;
default:
break;
}
}
}
@ -755,11 +763,16 @@ static void uploadtexture(long doalloc, long xsiz, long ysiz, long intexfmt, lon
switch (k)
{
case 0:
case 1: wpptr->r = r; wpptr->g = g; wpptr->b = b; wpptr->a = a; break;
case 2: wpptr->r = ((r+1)>>1); wpptr->g = ((g+1)>>1); wpptr->b = ((b+1)>>1); wpptr->a = ((a+1)>>1); break;
case 3: wpptr->r = ((r*85+128)>>8); wpptr->g = ((g*85+128)>>8); wpptr->b = ((b*85+128)>>8); wpptr->a = ((a*85+128)>>8); break;
case 4: wpptr->r = ((r+2)>>2); wpptr->g = ((g+2)>>2); wpptr->b = ((b+2)>>2); wpptr->a = ((a+2)>>2); break;
default: break;
case 1:
wpptr->r = r; wpptr->g = g; wpptr->b = b; wpptr->a = a; break;
case 2:
wpptr->r = ((r+1)>>1); wpptr->g = ((g+1)>>1); wpptr->b = ((b+1)>>1); wpptr->a = ((a+1)>>1); break;
case 3:
wpptr->r = ((r*85+128)>>8); wpptr->g = ((g*85+128)>>8); wpptr->b = ((b*85+128)>>8); wpptr->a = ((a*85+128)>>8); break;
case 4:
wpptr->r = ((r+2)>>2); wpptr->g = ((g+2)>>2); wpptr->b = ((b+2)>>2); wpptr->a = ((a+2)>>2); break;
default:
break;
}
//if (wpptr->a) wpptr->a = 255;
}
@ -1479,10 +1492,14 @@ void drawpoly (double *dpx, double *dpy, long n, long method)
pc[0] = pc[1] = pc[2] = f;
switch (method&3)
{
case 0: pc[3] = 1.0; break;
case 1: pc[3] = 1.0; break;
case 2: pc[3] = 0.66; break;
case 3: pc[3] = 0.33; break;
case 0:
pc[3] = 1.0; break;
case 1:
pc[3] = 1.0; break;
case 2:
pc[3] = 0.66; break;
case 3:
pc[3] = 0.33; break;
}
// tinting happens only to hightile textures, and only if the texture we're
// rendering isn't for the same palette as what we asked for
@ -2201,17 +2218,21 @@ void domost (float x0, float y0, float x1, float y1)
{
switch (k)
{
case 1: case 2:
case 1:
case 2:
dpx[0] = dx0; dpy[0] = vsp[i].cy[0];
dpx[1] = dx1; dpy[1] = vsp[i].cy[1];
dpx[2] = dx0; dpy[2] = ny0; drawpoly(dpx,dpy,3,domostpolymethod);
vsp[i].cy[0] = ny0; vsp[i].ctag = gtag; break;
case 3: case 6:
case 3:
case 6:
dpx[0] = dx0; dpy[0] = vsp[i].cy[0];
dpx[1] = dx1; dpy[1] = vsp[i].cy[1];
dpx[2] = dx1; dpy[2] = ny1; drawpoly(dpx,dpy,3,domostpolymethod);
vsp[i].cy[1] = ny1; vsp[i].ctag = gtag; break;
case 4: case 5: case 7:
case 4:
case 5:
case 7:
dpx[0] = dx0; dpy[0] = vsp[i].cy[0];
dpx[1] = dx1; dpy[1] = vsp[i].cy[1];
dpx[2] = dx1; dpy[2] = ny1;
@ -2223,24 +2244,29 @@ void domost (float x0, float y0, float x1, float y1)
dpx[2] = dx1; dpy[2] = vsp[i].fy[1];
dpx[3] = dx0; dpy[3] = vsp[i].fy[0]; drawpoly(dpx,dpy,4,domostpolymethod);
vsp[i].ctag = vsp[i].ftag = -1; break;
default: break;
default:
break;
}
}
else
{
switch (k)
{
case 7: case 6:
case 7:
case 6:
dpx[0] = dx0; dpy[0] = ny0;
dpx[1] = dx1; dpy[1] = vsp[i].fy[1];
dpx[2] = dx0; dpy[2] = vsp[i].fy[0]; drawpoly(dpx,dpy,3,domostpolymethod);
vsp[i].fy[0] = ny0; vsp[i].ftag = gtag; break;
case 5: case 2:
case 5:
case 2:
dpx[0] = dx0; dpy[0] = vsp[i].fy[0];
dpx[1] = dx1; dpy[1] = ny1;
dpx[2] = dx1; dpy[2] = vsp[i].fy[1]; drawpoly(dpx,dpy,3,domostpolymethod);
vsp[i].fy[1] = ny1; vsp[i].ftag = gtag; break;
case 4: case 3: case 1:
case 4:
case 3:
case 1:
dpx[0] = dx0; dpy[0] = ny0;
dpx[1] = dx1; dpy[1] = ny1;
dpx[2] = dx1; dpy[2] = vsp[i].fy[1];
@ -2252,7 +2278,8 @@ void domost (float x0, float y0, float x1, float y1)
dpx[2] = dx1; dpy[2] = vsp[i].fy[1];
dpx[3] = dx0; dpy[3] = vsp[i].fy[0]; drawpoly(dpx,dpy,4,domostpolymethod);
vsp[i].ctag = vsp[i].ftag = -1; break;
default: break;
default:
break;
}
}
}
@ -4603,9 +4630,12 @@ void polymost_fillpolygon (long npoints)
f = ((float)(numpalookups-min(max(globalshade,0),numpalookups)))/((float)numpalookups);
switch ((globalorientation>>7)&3) {
case 0:
case 1: a = 1.0; bglDisable(GL_BLEND); break;
case 2: a = 0.66; bglEnable(GL_BLEND); break;
case 3: a = 0.33; bglEnable(GL_BLEND); break;
case 1:
a = 1.0; bglDisable(GL_BLEND); break;
case 2:
a = 0.66; bglEnable(GL_BLEND); break;
case 3:
a = 0.33; bglEnable(GL_BLEND); break;
}
bglColor4f(f,f,f,a);

View file

@ -663,7 +663,8 @@ void getvalidmodes(void)
#ifdef USE_OPENGL
16,24,32,
#endif
0 };
0
};
static int defaultres[][2] = {
{1280,1024},{1280,960},{1152,864},{1024,768},{800,600},{640,480},
{640,400},{512,384},{480,360},{400,300},{320,240},{320,200},{0,0}
@ -1301,10 +1302,14 @@ int handleevents(void)
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
switch (ev.button.button) {
case SDL_BUTTON_LEFT: j = 0; break;
case SDL_BUTTON_RIGHT: j = 1; break;
case SDL_BUTTON_MIDDLE: j = 2; break;
default: j = ev.button.button; break;
case SDL_BUTTON_LEFT:
j = 0; break;
case SDL_BUTTON_RIGHT:
j = 1; break;
case SDL_BUTTON_MIDDLE:
j = 2; break;
default:
j = ev.button.button; break;
}
if (j<0) break;

View file

@ -95,14 +95,22 @@ void initsb(char dadigistat, char damusistat, long dasamplerate, char danumspeak
}
switch (FSOUND_GetOutput()) {
case FSOUND_OUTPUT_NOSOUND: s = "No Sound"; break;
case FSOUND_OUTPUT_WINMM: s = "WINMM"; break;
case FSOUND_OUTPUT_DSOUND: s = "DirectSound"; break;
case FSOUND_OUTPUT_OSS: s = "OSS"; break;
case FSOUND_OUTPUT_ESD: s = "ESound"; break;
case FSOUND_OUTPUT_ALSA: s = "ALSA"; break;
case FSOUND_OUTPUT_ASIO: s = "ASIO"; break;
default: s = "Other"; break;
case FSOUND_OUTPUT_NOSOUND:
s = "No Sound"; break;
case FSOUND_OUTPUT_WINMM:
s = "WINMM"; break;
case FSOUND_OUTPUT_DSOUND:
s = "DirectSound"; break;
case FSOUND_OUTPUT_OSS:
s = "OSS"; break;
case FSOUND_OUTPUT_ESD:
s = "ESound"; break;
case FSOUND_OUTPUT_ALSA:
s = "ALSA"; break;
case FSOUND_OUTPUT_ASIO:
s = "ASIO"; break;
default:
s = "Other"; break;
}
printOSD("Using FMOD \"%s\" output driver\n", s);

View file

@ -112,10 +112,12 @@ static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
case IDCALWAYSSHOW:
settings.forcesetup = IsDlgButtonChecked(hwndDlg, IDCALWAYSSHOW) == BST_CHECKED;
return TRUE;
default: break;
default:
break;
}
break;
default: break;
default:
break;
}
return FALSE;
}
@ -296,7 +298,8 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
if (mode == TAB_CONFIG) done = 0;
else quitevent++;
return TRUE;
case WIN_STARTWIN_START: done = 1; return TRUE;
case WIN_STARTWIN_START:
done = 1; return TRUE;
}
return FALSE;
@ -305,7 +308,8 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
return (BOOL)GetSysColorBrush(COLOR_WINDOW);
break;
default: break;
default:
break;
}
return FALSE;
@ -422,8 +426,10 @@ int startwin_run(void)
while (done < 0) {
switch (GetMessage(&msg, NULL, 0,0)) {
case 0: done = 1; break;
case -1: return -1;
case 0:
done = 1; break;
case -1:
return -1;
default:
if (IsWindow(startupdlg) && IsDialogMessage(startupdlg, &msg)) break;
TranslateMessage(&msg);

View file

@ -910,7 +910,8 @@ static BOOL CALLBACK InitDirectInput_enum(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRe
);
*/
break;
default: d = "OTHER"; break;
default:
d = "OTHER"; break;
}
initprintf(" * %s: %s\n", d, lpddi->tszProductName);
@ -1494,40 +1495,74 @@ static void ShowDInputErrorBox(const char *m, HRESULT r)
static const char * GetDInputError(HRESULT code)
{
switch (code) {
case DI_OK: return "DI_OK";
case DI_BUFFEROVERFLOW: return "DI_BUFFEROVERFLOW";
case DI_DOWNLOADSKIPPED: return "DI_DOWNLOADSKIPPED";
case DI_EFFECTRESTARTED: return "DI_EFFECTRESTARTED";
case DI_POLLEDDEVICE: return "DI_POLLEDDEVICE";
case DI_TRUNCATED: return "DI_TRUNCATED";
case DI_TRUNCATEDANDRESTARTED: return "DI_TRUNCATEDANDRESTARTED";
case DIERR_ACQUIRED: return "DIERR_ACQUIRED";
case DIERR_ALREADYINITIALIZED: return "DIERR_ALREADYINITIALIZED";
case DIERR_BADDRIVERVER: return "DIERR_BADDRIVERVER";
case DIERR_BETADIRECTINPUTVERSION: return "DIERR_BETADIRECTINPUTVERSION";
case DIERR_DEVICEFULL: return "DIERR_DEVICEFULL";
case DIERR_DEVICENOTREG: return "DIERR_DEVICENOTREG";
case DIERR_EFFECTPLAYING: return "DIERR_EFFECTPLAYING";
case DIERR_HASEFFECTS: return "DIERR_HASEFFECTS";
case DIERR_GENERIC: return "DIERR_GENERIC";
case DIERR_HANDLEEXISTS: return "DIERR_HANDLEEXISTS";
case DIERR_INCOMPLETEEFFECT: return "DIERR_INCOMPLETEEFFECT";
case DIERR_INPUTLOST: return "DIERR_INPUTLOST";
case DIERR_INVALIDPARAM: return "DIERR_INVALIDPARAM";
case DIERR_MOREDATA: return "DIERR_MOREDATA";
case DIERR_NOAGGREGATION: return "DIERR_NOAGGREGATION";
case DIERR_NOINTERFACE: return "DIERR_NOINTERFACE";
case DIERR_NOTACQUIRED: return "DIERR_NOTACQUIRED";
case DIERR_NOTBUFFERED: return "DIERR_NOTBUFFERED";
case DIERR_NOTDOWNLOADED: return "DIERR_NOTDOWNLOADED";
case DIERR_NOTEXCLUSIVEACQUIRED: return "DIERR_NOTEXCLUSIVEACQUIRED";
case DIERR_NOTFOUND: return "DIERR_NOTFOUND";
case DIERR_NOTINITIALIZED: return "DIERR_NOTINITIALIZED";
case DIERR_OLDDIRECTINPUTVERSION: return "DIERR_OLDDIRECTINPUTVERSION";
case DIERR_OUTOFMEMORY: return "DIERR_OUTOFMEMORY";
case DIERR_UNSUPPORTED: return "DIERR_UNSUPPORTED";
case E_PENDING: return "E_PENDING";
default: break;
case DI_OK:
return "DI_OK";
case DI_BUFFEROVERFLOW:
return "DI_BUFFEROVERFLOW";
case DI_DOWNLOADSKIPPED:
return "DI_DOWNLOADSKIPPED";
case DI_EFFECTRESTARTED:
return "DI_EFFECTRESTARTED";
case DI_POLLEDDEVICE:
return "DI_POLLEDDEVICE";
case DI_TRUNCATED:
return "DI_TRUNCATED";
case DI_TRUNCATEDANDRESTARTED:
return "DI_TRUNCATEDANDRESTARTED";
case DIERR_ACQUIRED:
return "DIERR_ACQUIRED";
case DIERR_ALREADYINITIALIZED:
return "DIERR_ALREADYINITIALIZED";
case DIERR_BADDRIVERVER:
return "DIERR_BADDRIVERVER";
case DIERR_BETADIRECTINPUTVERSION:
return "DIERR_BETADIRECTINPUTVERSION";
case DIERR_DEVICEFULL:
return "DIERR_DEVICEFULL";
case DIERR_DEVICENOTREG:
return "DIERR_DEVICENOTREG";
case DIERR_EFFECTPLAYING:
return "DIERR_EFFECTPLAYING";
case DIERR_HASEFFECTS:
return "DIERR_HASEFFECTS";
case DIERR_GENERIC:
return "DIERR_GENERIC";
case DIERR_HANDLEEXISTS:
return "DIERR_HANDLEEXISTS";
case DIERR_INCOMPLETEEFFECT:
return "DIERR_INCOMPLETEEFFECT";
case DIERR_INPUTLOST:
return "DIERR_INPUTLOST";
case DIERR_INVALIDPARAM:
return "DIERR_INVALIDPARAM";
case DIERR_MOREDATA:
return "DIERR_MOREDATA";
case DIERR_NOAGGREGATION:
return "DIERR_NOAGGREGATION";
case DIERR_NOINTERFACE:
return "DIERR_NOINTERFACE";
case DIERR_NOTACQUIRED:
return "DIERR_NOTACQUIRED";
case DIERR_NOTBUFFERED:
return "DIERR_NOTBUFFERED";
case DIERR_NOTDOWNLOADED:
return "DIERR_NOTDOWNLOADED";
case DIERR_NOTEXCLUSIVEACQUIRED:
return "DIERR_NOTEXCLUSIVEACQUIRED";
case DIERR_NOTFOUND:
return "DIERR_NOTFOUND";
case DIERR_NOTINITIALIZED:
return "DIERR_NOTINITIALIZED";
case DIERR_OLDDIRECTINPUTVERSION:
return "DIERR_OLDDIRECTINPUTVERSION";
case DIERR_OUTOFMEMORY:
return "DIERR_OUTOFMEMORY";
case DIERR_UNSUPPORTED:
return "DIERR_UNSUPPORTED";
case E_PENDING:
return "E_PENDING";
default:
break;
}
return "Unknown error";
}
@ -3170,118 +3205,230 @@ static void ShowDDrawErrorBox(const char *m, HRESULT r)
static const char * GetDDrawError(HRESULT code)
{
switch (code) {
case DD_OK: return "DD_OK";
case DDERR_ALREADYINITIALIZED: return "DDERR_ALREADYINITIALIZED";
case DDERR_BLTFASTCANTCLIP: return "DDERR_BLTFASTCANTCLIP";
case DDERR_CANNOTATTACHSURFACE: return "DDERR_CANNOTATTACHSURFACE";
case DDERR_CANNOTDETACHSURFACE: return "DDERR_CANNOTDETACHSURFACE";
case DDERR_CANTCREATEDC: return "DDERR_CANTCREATEDC";
case DDERR_CANTDUPLICATE: return "DDERR_CANTDUPLICATE";
case DDERR_CANTLOCKSURFACE: return "DDERR_CANTLOCKSURFACE";
case DDERR_CANTPAGELOCK: return "DDERR_CANTPAGELOCK";
case DDERR_CANTPAGEUNLOCK: return "DDERR_CANTPAGEUNLOCK";
case DDERR_CLIPPERISUSINGHWND: return "DDERR_CLIPPERISUSINGHWND";
case DDERR_COLORKEYNOTSET: return "DDERR_COLORKEYNOTSET";
case DDERR_CURRENTLYNOTAVAIL: return "DDERR_CURRENTLYNOTAVAIL";
case DDERR_DCALREADYCREATED: return "DDERR_DCALREADYCREATED";
case DDERR_DEVICEDOESNTOWNSURFACE: return "DDERR_DEVICEDOESNTOWNSURFACE";
case DDERR_DIRECTDRAWALREADYCREATED: return "DDERR_DIRECTDRAWALREADYCREATED";
case DDERR_EXCEPTION: return "DDERR_EXCEPTION";
case DDERR_EXCLUSIVEMODEALREADYSET: return "DDERR_EXCLUSIVEMODEALREADYSET";
case DDERR_EXPIRED: return "DDERR_EXPIRED";
case DDERR_GENERIC: return "DDERR_GENERIC";
case DDERR_HEIGHTALIGN: return "DDERR_HEIGHTALIGN";
case DDERR_HWNDALREADYSET: return "DDERR_HWNDALREADYSET";
case DDERR_HWNDSUBCLASSED: return "DDERR_HWNDSUBCLASSED";
case DDERR_IMPLICITLYCREATED: return "DDERR_IMPLICITLYCREATED";
case DDERR_INCOMPATIBLEPRIMARY: return "DDERR_INCOMPATIBLEPRIMARY";
case DDERR_INVALIDCAPS: return "DDERR_INVALIDCAPS";
case DDERR_INVALIDCLIPLIST: return "DDERR_INVALIDCLIPLIST";
case DDERR_INVALIDDIRECTDRAWGUID: return "DDERR_INVALIDDIRECTDRAWGUID";
case DDERR_INVALIDMODE: return "DDERR_INVALIDMODE";
case DDERR_INVALIDOBJECT: return "DDERR_INVALIDOBJECT";
case DDERR_INVALIDPARAMS: return "DDERR_INVALIDPARAMS";
case DDERR_INVALIDPIXELFORMAT: return "DDERR_INVALIDPIXELFORMAT";
case DDERR_INVALIDPOSITION: return "DDERR_INVALIDPOSITION";
case DDERR_INVALIDRECT: return "DDERR_INVALIDRECT";
case DDERR_INVALIDSTREAM: return "DDERR_INVALIDSTREAM";
case DDERR_INVALIDSURFACETYPE: return "DDERR_INVALIDSURFACETYPE";
case DDERR_LOCKEDSURFACES: return "DDERR_LOCKEDSURFACES";
case DDERR_MOREDATA: return "DDERR_MOREDATA";
case DDERR_NO3D: return "DDERR_NO3D";
case DDERR_NOALPHAHW: return "DDERR_NOALPHAHW";
case DDERR_NOBLTHW: return "DDERR_NOBLTHW";
case DDERR_NOCLIPLIST: return "DDERR_NOCLIPLIST";
case DDERR_NOCLIPPERATTACHED: return "DDERR_NOCLIPPERATTACHED";
case DDERR_NOCOLORCONVHW: return "DDERR_NOCOLORCONVHW";
case DDERR_NOCOLORKEY: return "DDERR_NOCOLORKEY";
case DDERR_NOCOLORKEYHW: return "DDERR_NOCOLORKEYHW";
case DDERR_NOCOOPERATIVELEVELSET: return "DDERR_NOCOOPERATIVELEVELSET";
case DDERR_NODC: return "DDERR_NODC";
case DDERR_NODDROPSHW: return "DDERR_NODDROPSHW";
case DDERR_NODIRECTDRAWHW: return "DDERR_NODIRECTDRAWHW";
case DDERR_NODIRECTDRAWSUPPORT: return "DDERR_NODIRECTDRAWSUPPORT";
case DDERR_NOEMULATION: return "DDERR_NOEMULATION";
case DDERR_NOEXCLUSIVEMODE: return "DDERR_NOEXCLUSIVEMODE";
case DDERR_NOFLIPHW: return "DDERR_NOFLIPHW";
case DDERR_NOFOCUSWINDOW: return "DDERR_NOFOCUSWINDOW";
case DDERR_NOGDI: return "DDERR_NOGDI";
case DDERR_NOHWND: return "DDERR_NOHWND";
case DDERR_NOMIPMAPHW: return "DDERR_NOMIPMAPHW";
case DDERR_NOMIRRORHW: return "DDERR_NOMIRRORHW";
case DDERR_NONONLOCALVIDMEM: return "DDERR_NONONLOCALVIDMEM";
case DDERR_NOOPTIMIZEHW: return "DDERR_NOOPTIMIZEHW";
case DDERR_NOOVERLAYDEST: return "DDERR_NOOVERLAYDEST";
case DDERR_NOOVERLAYHW: return "DDERR_NOOVERLAYHW";
case DDERR_NOPALETTEATTACHED: return "DDERR_NOPALETTEATTACHED";
case DDERR_NOPALETTEHW: return "DDERR_NOPALETTEHW";
case DDERR_NORASTEROPHW: return "DDERR_NORASTEROPHW";
case DDERR_NOROTATIONHW: return "DDERR_NOROTATIONHW";
case DDERR_NOSTRETCHHW: return "DDERR_NOSTRETCHHW";
case DDERR_NOT4BITCOLOR: return "DDERR_NOT4BITCOLOR";
case DDERR_NOT4BITCOLORINDEX: return "DDERR_NOT4BITCOLORINDEX";
case DDERR_NOT8BITCOLOR: return "DDERR_NOT8BITCOLOR";
case DDERR_NOTAOVERLAYSURFACE: return "DDERR_NOTAOVERLAYSURFACE";
case DDERR_NOTEXTUREHW: return "DDERR_NOTEXTUREHW";
case DDERR_NOTFLIPPABLE: return "DDERR_NOTFLIPPABLE";
case DDERR_NOTFOUND: return "DDERR_NOTFOUND";
case DDERR_NOTINITIALIZED: return "DDERR_NOTINITIALIZED";
case DDERR_NOTLOADED: return "DDERR_NOTLOADED";
case DDERR_NOTLOCKED: return "DDERR_NOTLOCKED";
case DDERR_NOTPAGELOCKED: return "DDERR_NOTPAGELOCKED";
case DDERR_NOTPALETTIZED: return "DDERR_NOTPALETTIZED";
case DDERR_NOVSYNCHW: return "DDERR_NOVSYNCHW";
case DDERR_NOZBUFFERHW: return "DDERR_NOZBUFFERHW";
case DDERR_NOZOVERLAYHW: return "DDERR_NOZOVERLAYHW";
case DDERR_OUTOFCAPS: return "DDERR_OUTOFCAPS";
case DDERR_OUTOFMEMORY: return "DDERR_OUTOFMEMORY";
case DDERR_OUTOFVIDEOMEMORY: return "DDERR_OUTOFVIDEOMEMORY";
case DDERR_OVERLAPPINGRECTS: return "DDERR_OVERLAPPINGRECTS";
case DDERR_OVERLAYCANTCLIP: return "DDERR_OVERLAYCANTCLIP";
case DDERR_OVERLAYCOLORKEYONLYONEACTIVE: return "DDERR_OVERLAYCOLORKEYONLYONEACTIVE";
case DDERR_OVERLAYNOTVISIBLE: return "DDERR_OVERLAYNOTVISIBLE";
case DDERR_PALETTEBUSY: return "DDERR_PALETTEBUSY";
case DDERR_PRIMARYSURFACEALREADYEXISTS: return "DDERR_PRIMARYSURFACEALREADYEXISTS";
case DDERR_REGIONTOOSMALL: return "DDERR_REGIONTOOSMALL";
case DDERR_SURFACEALREADYATTACHED: return "DDERR_SURFACEALREADYATTACHED";
case DDERR_SURFACEALREADYDEPENDENT: return "DDERR_SURFACEALREADYDEPENDENT";
case DDERR_SURFACEBUSY: return "DDERR_SURFACEBUSY";
case DDERR_SURFACEISOBSCURED: return "DDERR_SURFACEISOBSCURED";
case DDERR_SURFACELOST: return "DDERR_SURFACELOST";
case DDERR_SURFACENOTATTACHED: return "DDERR_SURFACENOTATTACHED";
case DDERR_TOOBIGHEIGHT: return "DDERR_TOOBIGHEIGHT";
case DDERR_TOOBIGSIZE: return "DDERR_TOOBIGSIZE";
case DDERR_TOOBIGWIDTH: return "DDERR_TOOBIGWIDTH";
case DDERR_UNSUPPORTED: return "DDERR_UNSUPPORTED";
case DDERR_UNSUPPORTEDFORMAT: return "DDERR_UNSUPPORTEDFORMAT";
case DDERR_UNSUPPORTEDMASK: return "DDERR_UNSUPPORTEDMASK";
case DDERR_UNSUPPORTEDMODE: return "DDERR_UNSUPPORTEDMODE";
case DDERR_VERTICALBLANKINPROGRESS: return "DDERR_VERTICALBLANKINPROGRESS";
case DDERR_VIDEONOTACTIVE: return "DDERR_VIDEONOTACTIVE";
case DDERR_WASSTILLDRAWING: return "DDERR_WASSTILLDRAWING";
case DDERR_WRONGMODE: return "DDERR_WRONGMODE";
case DDERR_XALIGN: return "DDERR_XALIGN";
default: break;
case DD_OK:
return "DD_OK";
case DDERR_ALREADYINITIALIZED:
return "DDERR_ALREADYINITIALIZED";
case DDERR_BLTFASTCANTCLIP:
return "DDERR_BLTFASTCANTCLIP";
case DDERR_CANNOTATTACHSURFACE:
return "DDERR_CANNOTATTACHSURFACE";
case DDERR_CANNOTDETACHSURFACE:
return "DDERR_CANNOTDETACHSURFACE";
case DDERR_CANTCREATEDC:
return "DDERR_CANTCREATEDC";
case DDERR_CANTDUPLICATE:
return "DDERR_CANTDUPLICATE";
case DDERR_CANTLOCKSURFACE:
return "DDERR_CANTLOCKSURFACE";
case DDERR_CANTPAGELOCK:
return "DDERR_CANTPAGELOCK";
case DDERR_CANTPAGEUNLOCK:
return "DDERR_CANTPAGEUNLOCK";
case DDERR_CLIPPERISUSINGHWND:
return "DDERR_CLIPPERISUSINGHWND";
case DDERR_COLORKEYNOTSET:
return "DDERR_COLORKEYNOTSET";
case DDERR_CURRENTLYNOTAVAIL:
return "DDERR_CURRENTLYNOTAVAIL";
case DDERR_DCALREADYCREATED:
return "DDERR_DCALREADYCREATED";
case DDERR_DEVICEDOESNTOWNSURFACE:
return "DDERR_DEVICEDOESNTOWNSURFACE";
case DDERR_DIRECTDRAWALREADYCREATED:
return "DDERR_DIRECTDRAWALREADYCREATED";
case DDERR_EXCEPTION:
return "DDERR_EXCEPTION";
case DDERR_EXCLUSIVEMODEALREADYSET:
return "DDERR_EXCLUSIVEMODEALREADYSET";
case DDERR_EXPIRED:
return "DDERR_EXPIRED";
case DDERR_GENERIC:
return "DDERR_GENERIC";
case DDERR_HEIGHTALIGN:
return "DDERR_HEIGHTALIGN";
case DDERR_HWNDALREADYSET:
return "DDERR_HWNDALREADYSET";
case DDERR_HWNDSUBCLASSED:
return "DDERR_HWNDSUBCLASSED";
case DDERR_IMPLICITLYCREATED:
return "DDERR_IMPLICITLYCREATED";
case DDERR_INCOMPATIBLEPRIMARY:
return "DDERR_INCOMPATIBLEPRIMARY";
case DDERR_INVALIDCAPS:
return "DDERR_INVALIDCAPS";
case DDERR_INVALIDCLIPLIST:
return "DDERR_INVALIDCLIPLIST";
case DDERR_INVALIDDIRECTDRAWGUID:
return "DDERR_INVALIDDIRECTDRAWGUID";
case DDERR_INVALIDMODE:
return "DDERR_INVALIDMODE";
case DDERR_INVALIDOBJECT:
return "DDERR_INVALIDOBJECT";
case DDERR_INVALIDPARAMS:
return "DDERR_INVALIDPARAMS";
case DDERR_INVALIDPIXELFORMAT:
return "DDERR_INVALIDPIXELFORMAT";
case DDERR_INVALIDPOSITION:
return "DDERR_INVALIDPOSITION";
case DDERR_INVALIDRECT:
return "DDERR_INVALIDRECT";
case DDERR_INVALIDSTREAM:
return "DDERR_INVALIDSTREAM";
case DDERR_INVALIDSURFACETYPE:
return "DDERR_INVALIDSURFACETYPE";
case DDERR_LOCKEDSURFACES:
return "DDERR_LOCKEDSURFACES";
case DDERR_MOREDATA:
return "DDERR_MOREDATA";
case DDERR_NO3D:
return "DDERR_NO3D";
case DDERR_NOALPHAHW:
return "DDERR_NOALPHAHW";
case DDERR_NOBLTHW:
return "DDERR_NOBLTHW";
case DDERR_NOCLIPLIST:
return "DDERR_NOCLIPLIST";
case DDERR_NOCLIPPERATTACHED:
return "DDERR_NOCLIPPERATTACHED";
case DDERR_NOCOLORCONVHW:
return "DDERR_NOCOLORCONVHW";
case DDERR_NOCOLORKEY:
return "DDERR_NOCOLORKEY";
case DDERR_NOCOLORKEYHW:
return "DDERR_NOCOLORKEYHW";
case DDERR_NOCOOPERATIVELEVELSET:
return "DDERR_NOCOOPERATIVELEVELSET";
case DDERR_NODC:
return "DDERR_NODC";
case DDERR_NODDROPSHW:
return "DDERR_NODDROPSHW";
case DDERR_NODIRECTDRAWHW:
return "DDERR_NODIRECTDRAWHW";
case DDERR_NODIRECTDRAWSUPPORT:
return "DDERR_NODIRECTDRAWSUPPORT";
case DDERR_NOEMULATION:
return "DDERR_NOEMULATION";
case DDERR_NOEXCLUSIVEMODE:
return "DDERR_NOEXCLUSIVEMODE";
case DDERR_NOFLIPHW:
return "DDERR_NOFLIPHW";
case DDERR_NOFOCUSWINDOW:
return "DDERR_NOFOCUSWINDOW";
case DDERR_NOGDI:
return "DDERR_NOGDI";
case DDERR_NOHWND:
return "DDERR_NOHWND";
case DDERR_NOMIPMAPHW:
return "DDERR_NOMIPMAPHW";
case DDERR_NOMIRRORHW:
return "DDERR_NOMIRRORHW";
case DDERR_NONONLOCALVIDMEM:
return "DDERR_NONONLOCALVIDMEM";
case DDERR_NOOPTIMIZEHW:
return "DDERR_NOOPTIMIZEHW";
case DDERR_NOOVERLAYDEST:
return "DDERR_NOOVERLAYDEST";
case DDERR_NOOVERLAYHW:
return "DDERR_NOOVERLAYHW";
case DDERR_NOPALETTEATTACHED:
return "DDERR_NOPALETTEATTACHED";
case DDERR_NOPALETTEHW:
return "DDERR_NOPALETTEHW";
case DDERR_NORASTEROPHW:
return "DDERR_NORASTEROPHW";
case DDERR_NOROTATIONHW:
return "DDERR_NOROTATIONHW";
case DDERR_NOSTRETCHHW:
return "DDERR_NOSTRETCHHW";
case DDERR_NOT4BITCOLOR:
return "DDERR_NOT4BITCOLOR";
case DDERR_NOT4BITCOLORINDEX:
return "DDERR_NOT4BITCOLORINDEX";
case DDERR_NOT8BITCOLOR:
return "DDERR_NOT8BITCOLOR";
case DDERR_NOTAOVERLAYSURFACE:
return "DDERR_NOTAOVERLAYSURFACE";
case DDERR_NOTEXTUREHW:
return "DDERR_NOTEXTUREHW";
case DDERR_NOTFLIPPABLE:
return "DDERR_NOTFLIPPABLE";
case DDERR_NOTFOUND:
return "DDERR_NOTFOUND";
case DDERR_NOTINITIALIZED:
return "DDERR_NOTINITIALIZED";
case DDERR_NOTLOADED:
return "DDERR_NOTLOADED";
case DDERR_NOTLOCKED:
return "DDERR_NOTLOCKED";
case DDERR_NOTPAGELOCKED:
return "DDERR_NOTPAGELOCKED";
case DDERR_NOTPALETTIZED:
return "DDERR_NOTPALETTIZED";
case DDERR_NOVSYNCHW:
return "DDERR_NOVSYNCHW";
case DDERR_NOZBUFFERHW:
return "DDERR_NOZBUFFERHW";
case DDERR_NOZOVERLAYHW:
return "DDERR_NOZOVERLAYHW";
case DDERR_OUTOFCAPS:
return "DDERR_OUTOFCAPS";
case DDERR_OUTOFMEMORY:
return "DDERR_OUTOFMEMORY";
case DDERR_OUTOFVIDEOMEMORY:
return "DDERR_OUTOFVIDEOMEMORY";
case DDERR_OVERLAPPINGRECTS:
return "DDERR_OVERLAPPINGRECTS";
case DDERR_OVERLAYCANTCLIP:
return "DDERR_OVERLAYCANTCLIP";
case DDERR_OVERLAYCOLORKEYONLYONEACTIVE:
return "DDERR_OVERLAYCOLORKEYONLYONEACTIVE";
case DDERR_OVERLAYNOTVISIBLE:
return "DDERR_OVERLAYNOTVISIBLE";
case DDERR_PALETTEBUSY:
return "DDERR_PALETTEBUSY";
case DDERR_PRIMARYSURFACEALREADYEXISTS:
return "DDERR_PRIMARYSURFACEALREADYEXISTS";
case DDERR_REGIONTOOSMALL:
return "DDERR_REGIONTOOSMALL";
case DDERR_SURFACEALREADYATTACHED:
return "DDERR_SURFACEALREADYATTACHED";
case DDERR_SURFACEALREADYDEPENDENT:
return "DDERR_SURFACEALREADYDEPENDENT";
case DDERR_SURFACEBUSY:
return "DDERR_SURFACEBUSY";
case DDERR_SURFACEISOBSCURED:
return "DDERR_SURFACEISOBSCURED";
case DDERR_SURFACELOST:
return "DDERR_SURFACELOST";
case DDERR_SURFACENOTATTACHED:
return "DDERR_SURFACENOTATTACHED";
case DDERR_TOOBIGHEIGHT:
return "DDERR_TOOBIGHEIGHT";
case DDERR_TOOBIGSIZE:
return "DDERR_TOOBIGSIZE";
case DDERR_TOOBIGWIDTH:
return "DDERR_TOOBIGWIDTH";
case DDERR_UNSUPPORTED:
return "DDERR_UNSUPPORTED";
case DDERR_UNSUPPORTEDFORMAT:
return "DDERR_UNSUPPORTEDFORMAT";
case DDERR_UNSUPPORTEDMASK:
return "DDERR_UNSUPPORTEDMASK";
case DDERR_UNSUPPORTEDMODE:
return "DDERR_UNSUPPORTEDMODE";
case DDERR_VERTICALBLANKINPROGRESS:
return "DDERR_VERTICALBLANKINPROGRESS";
case DDERR_VIDEONOTACTIVE:
return "DDERR_VIDEONOTACTIVE";
case DDERR_WASSTILLDRAWING:
return "DDERR_WASSTILLDRAWING";
case DDERR_WRONGMODE:
return "DDERR_WRONGMODE";
case DDERR_XALIGN:
return "DDERR_XALIGN";
default:
break;
}
return "Unknown error";
}

View file

@ -118,20 +118,28 @@ void addweaponnoswitch( struct player_struct *p, short weapon)
case KNEE_WEAPON:
case TRIPBOMB_WEAPON:
case HANDREMOTE_WEAPON:
case HANDBOMB_WEAPON: break;
case SHOTGUN_WEAPON: stopspritesound(SHOTGUN_COCK,p->i);break;
case PISTOL_WEAPON: stopspritesound(INSERT_CLIP,p->i);break;
default: stopspritesound(SELECT_WEAPON,p->i);break;
case HANDBOMB_WEAPON:
break;
case SHOTGUN_WEAPON:
stopspritesound(SHOTGUN_COCK,p->i);break;
case PISTOL_WEAPON:
stopspritesound(INSERT_CLIP,p->i);break;
default:
stopspritesound(SELECT_WEAPON,p->i);break;
}
switch (weapon)
{
case KNEE_WEAPON:
case TRIPBOMB_WEAPON:
case HANDREMOTE_WEAPON:
case HANDBOMB_WEAPON: break;
case SHOTGUN_WEAPON: spritesound(SHOTGUN_COCK,p->i);break;
case PISTOL_WEAPON: spritesound(INSERT_CLIP,p->i);break;
default: spritesound(SELECT_WEAPON,p->i);break;
case HANDBOMB_WEAPON:
break;
case SHOTGUN_WEAPON:
spritesound(SHOTGUN_COCK,p->i);break;
case PISTOL_WEAPON:
spritesound(INSERT_CLIP,p->i);break;
default:
spritesound(SELECT_WEAPON,p->i);break;
}
}
@ -3086,6 +3094,7 @@ void moveweapons(void)
if ( s->zvel > 0)
spawn(i,EXPLOSION2BOT);
else { sprite[k].cstat |= 8; sprite[k].z += (48<<8); }
}
}
else if (s->picnum == SHRINKSPARK)
@ -3102,6 +3111,7 @@ void moveweapons(void)
{
if ( s->zvel < 0)
{ sprite[k].cstat |= 8; sprite[k].z += (72<<8); }
}
}
if ( s->picnum == RPG )
@ -4489,9 +4499,12 @@ DETONATEB:
m = 0;
switch (dynamictostatic[s->picnum])
{
case HEAVYHBOMB__STATIC: m = pipebombblastradius;break;
case MORTER__STATIC: m = morterblastradius;break;
case BOUNCEMINE__STATIC: m = bouncemineblastradius;break;
case HEAVYHBOMB__STATIC:
m = pipebombblastradius;break;
case MORTER__STATIC:
m = morterblastradius;break;
case BOUNCEMINE__STATIC:
m = bouncemineblastradius;break;
}
hitradius( i, m,x>>2,x>>1,x-(x>>2),x);
@ -5101,6 +5114,7 @@ void moveexplosions(void) // STATNUM 5
if (t[1] > 20) KILLIT(i);
}
else { s->picnum = JIBS6; t[0] = 0; t[1] = 0; }
}
goto BOLT;

View file

@ -27,7 +27,8 @@ void endanimsounds(long fr)
{
switch (ud.volume_number)
{
case 0:break;
case 0:
break;
case 1:
switch (fr)
{

View file

@ -270,28 +270,50 @@ const char *ExtGetSectorCaption(short sectnum)
{
switch (sector[sectnum].lotag)
{
case 1 : Bsprintf(lo,"1 WATER (SE 7)"); break;
case 2 : Bsprintf(lo,"2 UNDERWATER (SE 7)"); break;
case 9 : Bsprintf(lo,"9 STAR TREK DOORS"); break;
case 15 : Bsprintf(lo,"15 ELEVATOR TRANSPORT (SE 17)"); break;
case 16 : Bsprintf(lo,"16 ELEVATOR PLATFORM DOWN"); break;
case 17 : Bsprintf(lo,"17 ELEVATOR PLATFORM UP"); break;
case 18 : Bsprintf(lo,"18 ELEVATOR DOWN"); break;
case 19 : Bsprintf(lo,"19 ELEVATOR UP"); break;
case 20 : Bsprintf(lo,"20 CEILING DOOR"); break;
case 21 : Bsprintf(lo,"21 FLOOR DOOR"); break;
case 22 : Bsprintf(lo,"22 SPLIT DOOR"); break;
case 23 : Bsprintf(lo,"23 SWING DOOR (SE 11)"); break;
case 25 : Bsprintf(lo,"25 SLIDE DOOR (SE 15)"); break;
case 26 : Bsprintf(lo,"26 SPLIT STAR TREK DOOR"); break;
case 27 : Bsprintf(lo,"27 BRIDGE (SE 20)"); break;
case 28 : Bsprintf(lo,"28 DROP FLOOR (SE 21)"); break;
case 29 : Bsprintf(lo,"29 TEETH DOOR (SE 22)"); break;
case 30 : Bsprintf(lo,"30 ROTATE RISE BRIDGE"); break;
case 31 : Bsprintf(lo,"31 2 WAY TRAIN (SE=30)"); break;
case 32767 : Bsprintf(lo,"32767 SECRET ROOM"); break;
case 65535 : Bsprintf(lo,"65535 END OF LEVEL"); break;
default : Bsprintf(lo,"%hu",sector[sectnum].lotag); break;
case 1 :
Bsprintf(lo,"1 WATER (SE 7)"); break;
case 2 :
Bsprintf(lo,"2 UNDERWATER (SE 7)"); break;
case 9 :
Bsprintf(lo,"9 STAR TREK DOORS"); break;
case 15 :
Bsprintf(lo,"15 ELEVATOR TRANSPORT (SE 17)"); break;
case 16 :
Bsprintf(lo,"16 ELEVATOR PLATFORM DOWN"); break;
case 17 :
Bsprintf(lo,"17 ELEVATOR PLATFORM UP"); break;
case 18 :
Bsprintf(lo,"18 ELEVATOR DOWN"); break;
case 19 :
Bsprintf(lo,"19 ELEVATOR UP"); break;
case 20 :
Bsprintf(lo,"20 CEILING DOOR"); break;
case 21 :
Bsprintf(lo,"21 FLOOR DOOR"); break;
case 22 :
Bsprintf(lo,"22 SPLIT DOOR"); break;
case 23 :
Bsprintf(lo,"23 SWING DOOR (SE 11)"); break;
case 25 :
Bsprintf(lo,"25 SLIDE DOOR (SE 15)"); break;
case 26 :
Bsprintf(lo,"26 SPLIT STAR TREK DOOR"); break;
case 27 :
Bsprintf(lo,"27 BRIDGE (SE 20)"); break;
case 28 :
Bsprintf(lo,"28 DROP FLOOR (SE 21)"); break;
case 29 :
Bsprintf(lo,"29 TEETH DOOR (SE 22)"); break;
case 30 :
Bsprintf(lo,"30 ROTATE RISE BRIDGE"); break;
case 31 :
Bsprintf(lo,"31 2 WAY TRAIN (SE=30)"); break;
case 32767 :
Bsprintf(lo,"32767 SECRET ROOM"); break;
case 65535 :
Bsprintf(lo,"65535 END OF LEVEL"); break;
default :
Bsprintf(lo,"%hu",sector[sectnum].lotag); break;
}
if (sector[sectnum].lotag > 10000 && sector[sectnum].lotag < 32767)
Bsprintf(lo,"%d 1 TIME SOUND",sector[sectnum].lotag);
@ -327,40 +349,74 @@ const char *SectorEffectorText(short spritenum)
{
switch (sprite[spritenum].lotag)
{
case 0: Bsprintf(tempbuf,"SE: ROTATED SECTOR"); break;
case 1: Bsprintf(tempbuf,"SE: PIVOT SPRITE FOR SE 0"); break;
case 2: Bsprintf(tempbuf,"SE: EARTHQUAKE"); break;
case 3: Bsprintf(tempbuf,"SE: RANDOM LIGHTS AFTER SHOT OUT"); break;
case 4: Bsprintf(tempbuf,"SE: RANDOM LIGHTS"); break;
case 6: Bsprintf(tempbuf,"SE: SUBWAY"); break;
case 7: Bsprintf(tempbuf,"SE: TRANSPORT"); break;
case 8: Bsprintf(tempbuf,"SE: UP OPEN DOOR LIGHTS"); break;
case 9: Bsprintf(tempbuf,"SE: DOWN OPEN DOOR LIGHTS"); break;
case 10: Bsprintf(tempbuf,"SE: DOOR AUTO CLOSE (H=DELAY)"); break;
case 11: Bsprintf(tempbuf,"SE: ROTATE SECTOR DOOR"); break;
case 12: Bsprintf(tempbuf,"SE: LIGHT SWITCH"); break;
case 13: Bsprintf(tempbuf,"SE: EXPLOSIVE"); break;
case 14: Bsprintf(tempbuf,"SE: SUBWAY CAR"); break;
case 15: Bsprintf(tempbuf,"SE: SLIDE DOOR (ST 25)"); break;
case 16: Bsprintf(tempbuf,"SE: ROTATE REACTOR SECTOR"); break;
case 17: Bsprintf(tempbuf,"SE: ELEVATOR TRANSPORT (ST 15)"); break;
case 18: Bsprintf(tempbuf,"SE: INCREMENTAL SECTOR RISE/FALL"); break;
case 19: Bsprintf(tempbuf,"SE: CEILING FALL ON EXPLOSION"); break;
case 20: Bsprintf(tempbuf,"SE: BRIDGE (ST 27)"); break;
case 21: Bsprintf(tempbuf,"SE: DROP FLOOR (ST 28)"); break;
case 22: Bsprintf(tempbuf,"SE: TEETH DOOR (ST 29)"); break;
case 23: Bsprintf(tempbuf,"SE: 1-WAY SE7 DESTINATION (H=SE 7)"); break;
case 24: Bsprintf(tempbuf,"SE: CONVAYER BELT"); break;
case 25: Bsprintf(tempbuf,"SE: ENGINE"); break;
case 28: Bsprintf(tempbuf,"SE: LIGHTNING (H= TILE#4890)"); break;
case 27: Bsprintf(tempbuf,"SE: CAMERA FOR PLAYBACK"); break;
case 29: Bsprintf(tempbuf,"SE: FLOAT"); break;
case 30: Bsprintf(tempbuf,"SE: 2 WAY TRAIN (ST=31)"); break;
case 31: Bsprintf(tempbuf,"SE: FLOOR RISE"); break;
case 32: Bsprintf(tempbuf,"SE: CEILING FALL"); break;
case 33: Bsprintf(tempbuf,"SE: SPAWN JIB W/QUAKE"); break;
case 36: Bsprintf(tempbuf,"SE: SKRINK RAY SHOOTER"); break;
default: SpriteName(spritenum,tempbuf); break;
case 0:
Bsprintf(tempbuf,"SE: ROTATED SECTOR"); break;
case 1:
Bsprintf(tempbuf,"SE: PIVOT SPRITE FOR SE 0"); break;
case 2:
Bsprintf(tempbuf,"SE: EARTHQUAKE"); break;
case 3:
Bsprintf(tempbuf,"SE: RANDOM LIGHTS AFTER SHOT OUT"); break;
case 4:
Bsprintf(tempbuf,"SE: RANDOM LIGHTS"); break;
case 6:
Bsprintf(tempbuf,"SE: SUBWAY"); break;
case 7:
Bsprintf(tempbuf,"SE: TRANSPORT"); break;
case 8:
Bsprintf(tempbuf,"SE: UP OPEN DOOR LIGHTS"); break;
case 9:
Bsprintf(tempbuf,"SE: DOWN OPEN DOOR LIGHTS"); break;
case 10:
Bsprintf(tempbuf,"SE: DOOR AUTO CLOSE (H=DELAY)"); break;
case 11:
Bsprintf(tempbuf,"SE: ROTATE SECTOR DOOR"); break;
case 12:
Bsprintf(tempbuf,"SE: LIGHT SWITCH"); break;
case 13:
Bsprintf(tempbuf,"SE: EXPLOSIVE"); break;
case 14:
Bsprintf(tempbuf,"SE: SUBWAY CAR"); break;
case 15:
Bsprintf(tempbuf,"SE: SLIDE DOOR (ST 25)"); break;
case 16:
Bsprintf(tempbuf,"SE: ROTATE REACTOR SECTOR"); break;
case 17:
Bsprintf(tempbuf,"SE: ELEVATOR TRANSPORT (ST 15)"); break;
case 18:
Bsprintf(tempbuf,"SE: INCREMENTAL SECTOR RISE/FALL"); break;
case 19:
Bsprintf(tempbuf,"SE: CEILING FALL ON EXPLOSION"); break;
case 20:
Bsprintf(tempbuf,"SE: BRIDGE (ST 27)"); break;
case 21:
Bsprintf(tempbuf,"SE: DROP FLOOR (ST 28)"); break;
case 22:
Bsprintf(tempbuf,"SE: TEETH DOOR (ST 29)"); break;
case 23:
Bsprintf(tempbuf,"SE: 1-WAY SE7 DESTINATION (H=SE 7)"); break;
case 24:
Bsprintf(tempbuf,"SE: CONVAYER BELT"); break;
case 25:
Bsprintf(tempbuf,"SE: ENGINE"); break;
case 28:
Bsprintf(tempbuf,"SE: LIGHTNING (H= TILE#4890)"); break;
case 27:
Bsprintf(tempbuf,"SE: CAMERA FOR PLAYBACK"); break;
case 29:
Bsprintf(tempbuf,"SE: FLOAT"); break;
case 30:
Bsprintf(tempbuf,"SE: 2 WAY TRAIN (ST=31)"); break;
case 31:
Bsprintf(tempbuf,"SE: FLOOR RISE"); break;
case 32:
Bsprintf(tempbuf,"SE: CEILING FALL"); break;
case 33:
Bsprintf(tempbuf,"SE: SPAWN JIB W/QUAKE"); break;
case 36:
Bsprintf(tempbuf,"SE: SKRINK RAY SHOOTER"); break;
default:
SpriteName(spritenum,tempbuf); break;
}
return (tempbuf);
}
@ -538,7 +594,8 @@ void ExtShowSectorData(short sectnum) //F5
case RESPAWN:
totalrespawn++;
default: break;
default:
break;
}
}
}
@ -1523,9 +1580,9 @@ void Keys3d(void)
}
if (tabgraphic == 1 )
rotatesprite((44+tilesizx[temppicnum])<<16,(114)<<16,32768,0,temppicnum,tempshade,temppal,2,0L,0L,xdim-1L,ydim-1L);
rotatesprite((44+(tilesizx[temppicnum]>>2))<<16,(114)<<16,32768,0,temppicnum,tempshade,temppal,2,0L,0L,xdim-1L,ydim-1L);
else if (tabgraphic == 2 )
rotatesprite((44+tilesizx[temppicnum])<<16,(114)<<16,16384,0,temppicnum,tempshade,temppal,2,0L,0L,xdim-1L,ydim-1L);
rotatesprite((44+(tilesizx[temppicnum]>>2))<<16,(114)<<16,16384,0,temppicnum,tempshade,temppal,2,0L,0L,xdim-1L,ydim-1L);
begindrawing();
j = xdimgame>640?0:1;
@ -1614,9 +1671,12 @@ void Keys3d(void)
keystatus[0x0e] = 0;
switch (searchstat)
{
case 0: case 4: wall[searchwall].cstat = 0; break;
case 0:
case 4:
wall[searchwall].cstat = 0; break;
// case 1: case 2: sector[searchsector].cstat = 0; break;
case 3: sprite[searchwall].cstat = 0; break;
case 3:
sprite[searchwall].cstat = 0; break;
}
}
@ -1857,7 +1917,8 @@ void Keys3d(void)
{
switch (searchstat)
{
case 0: case 4:
case 0:
case 4:
strcpy(buffer,"Wall extra: ");
wall[searchwall].extra = getnumber256(buffer,(long)wall[searchwall].extra,65536L,1);
break;
@ -1995,7 +2056,8 @@ void Keys3d(void)
{
switch (searchstat)
{
case 0: case 4:
case 0:
case 4:
strcpy(buffer,"Wall hitag: ");
wall[searchwall].hitag = getnumber256(buffer,(long)wall[searchwall].hitag,65536L,0);
break;
@ -2440,10 +2502,14 @@ void Keys3d(void)
i = ((i>>3)&1)+((i>>7)&2); //3-x,8-y
switch (i)
{
case 0: i = 1; break;
case 1: i = 3; break;
case 2: i = 0; break;
case 3: i = 2; break;
case 0:
i = 1; break;
case 1:
i = 3; break;
case 2:
i = 0; break;
case 3:
i = 2; break;
}
i = ((i&1)<<3)+((i&2)<<7);
wall[searchwall].cstat &= ~0x0108;
@ -2456,14 +2522,22 @@ void Keys3d(void)
i = (i&0x4)+((i>>4)&3);
switch (i)
{
case 0: i = 6; break;
case 6: i = 3; break;
case 3: i = 5; break;
case 5: i = 1; break;
case 1: i = 7; break;
case 7: i = 2; break;
case 2: i = 4; break;
case 4: i = 0; break;
case 0:
i = 6; break;
case 6:
i = 3; break;
case 3:
i = 5; break;
case 5:
i = 1; break;
case 1:
i = 7; break;
case 7:
i = 2; break;
case 2:
i = 4; break;
case 4:
i = 0; break;
}
i = (i&0x4)+((i&3)<<4);
sector[searchsector].ceilingstat &= ~0x34;
@ -2476,14 +2550,22 @@ void Keys3d(void)
i = (i&0x4)+((i>>4)&3);
switch (i)
{
case 0: i = 6; break;
case 6: i = 3; break;
case 3: i = 5; break;
case 5: i = 1; break;
case 1: i = 7; break;
case 7: i = 2; break;
case 2: i = 4; break;
case 4: i = 0; break;
case 0:
i = 6; break;
case 6:
i = 3; break;
case 3:
i = 5; break;
case 5:
i = 1; break;
case 1:
i = 7; break;
case 7:
i = 2; break;
case 2:
i = 4; break;
case 4:
i = 0; break;
}
i = (i&0x4)+((i&3)<<4);
sector[searchsector].floorstat &= ~0x34;
@ -2503,10 +2585,14 @@ void Keys3d(void)
i = ((i>>2)&3);
switch (i)
{
case 0: i = 1; break;
case 1: i = 3; break;
case 2: i = 0; break;
case 3: i = 2; break;
case 0:
i = 1; break;
case 1:
i = 3; break;
case 2:
i = 0; break;
case 3:
i = 2; break;
}
i <<= 2;
sprite[searchwall].cstat &= ~0xc;
@ -2858,14 +2944,22 @@ void Keys3d(void)
enddrawing();
switch (i)
{
case 8: Bsprintf(tempbuf,"%d",autosave); break;
case 9: Bsprintf(tempbuf,"%s",SKILLMODE[skill]); break;
case 10: Bsprintf(tempbuf,"%d",tabgraphic); break;
case 11: Bsprintf(tempbuf,"%d",framerateon); break;
case 12: Bsprintf(tempbuf,"%s",SPRDSPMODE[nosprites]); break;
case 13: Bsprintf(tempbuf,"%d",shadepreview); break;
case 14: Bsprintf(tempbuf,"%d",purpleon); break;
default : sprintf(tempbuf," "); break;
case 8:
Bsprintf(tempbuf,"%d",autosave); break;
case 9:
Bsprintf(tempbuf,"%s",SKILLMODE[skill]); break;
case 10:
Bsprintf(tempbuf,"%d",tabgraphic); break;
case 11:
Bsprintf(tempbuf,"%d",framerateon); break;
case 12:
Bsprintf(tempbuf,"%s",SPRDSPMODE[nosprites]); break;
case 13:
Bsprintf(tempbuf,"%d",shadepreview); break;
case 14:
Bsprintf(tempbuf,"%d",purpleon); break;
default :
sprintf(tempbuf," "); break;
}
begindrawing();
if (!strcmp(tempbuf,"0"))
@ -3003,12 +3097,14 @@ void Keys3d(void)
keystatus[0x14] = 0;
switch (searchstat)
{
case 0: case 4:
case 0:
case 4:
Bstrcpy(tempbuf,"Wall lotag: ");
wall[searchwall].lotag =
getnumber256(tempbuf,wall[searchwall].lotag,65536L,0);
break;
case 1: case 2:
case 1:
case 2:
Bstrcpy(tempbuf,"Sector lotag: ");
sector[searchsector].lotag =
getnumber256(tempbuf,sector[searchsector].lotag,65536L,0);
@ -3026,12 +3122,14 @@ void Keys3d(void)
keystatus[0x23] = 0;
switch (searchstat)
{
case 0: case 4:
case 0:
case 4:
Bstrcpy(tempbuf,"Wall hitag: ");
wall[searchwall].hitag =
getnumber256(tempbuf,wall[searchwall].hitag,65536L,0);
break;
case 1: case 2:
case 1:
case 2:
Bstrcpy(tempbuf,"Sector hitag: ");
sector[searchsector].hitag =
getnumber256(tempbuf,sector[searchsector].hitag,65536L,0);
@ -3049,12 +3147,14 @@ void Keys3d(void)
keystatus[0x1f] = 0;
switch (searchstat)
{
case 0: case 4:
case 0:
case 4:
Bstrcpy(tempbuf,"Wall shade: ");
wall[searchwall].shade =
getnumber256(tempbuf,wall[searchwall].shade,65536L,1);
break;
case 1: case 2:
case 1:
case 2:
Bstrcpy(tempbuf,"Sector shade: ");
if (searchstat==1)
sector[searchsector].ceilingshade =
@ -3076,7 +3176,8 @@ void Keys3d(void)
keystatus[0x2f] = 0;
switch (searchstat)
{
case 1: case 2:
case 1:
case 2:
Bstrcpy(tempbuf,"Sector visibility: ");
sector[searchsector].visibility =
getnumber256(tempbuf,sector[searchsector].visibility,65536L,0);
@ -3200,10 +3301,14 @@ void Keys3d(void)
sector[searchsector].ceilingstat &= ~(128+256);
switch (i)
{
case 0: sector[searchsector].ceilingstat |= 128; break;
case 128: sector[searchsector].ceilingstat |= 256; break;
case 256: sector[searchsector].ceilingstat |= 384; break;
case 384: sector[searchsector].ceilingstat |= 0; break;
case 0:
sector[searchsector].ceilingstat |= 128; break;
case 128:
sector[searchsector].ceilingstat |= 256; break;
case 256:
sector[searchsector].ceilingstat |= 384; break;
case 384:
sector[searchsector].ceilingstat |= 0; break;
}
asksave = 1;
}
@ -3213,10 +3318,14 @@ void Keys3d(void)
sector[searchsector].floorstat &= ~(128+256);
switch (i)
{
case 0: sector[searchsector].floorstat |= 128; break;
case 128: sector[searchsector].floorstat |= 256; break;
case 256: sector[searchsector].floorstat |= 384; break;
case 384: sector[searchsector].floorstat |= 0; break;
case 0:
sector[searchsector].floorstat |= 128; break;
case 128:
sector[searchsector].floorstat |= 256; break;
case 256:
sector[searchsector].floorstat |= 384; break;
case 384:
sector[searchsector].floorstat |= 0; break;
}
asksave = 1;
}
@ -3225,7 +3334,8 @@ void Keys3d(void)
{
switch (searchstat)
{
case 0: case 4:
case 0:
case 4:
strcpy(buffer,"Wall lotag: ");
wall[searchwall].lotag = getnumber256(buffer,(long)wall[searchwall].lotag,65536L,0);
break;
@ -3282,11 +3392,16 @@ void Keys3d(void)
enddrawing();
switch (searchstat)
{
case 0 : wall[searchwall].picnum = temppicnum; break;
case 1 : sector[searchsector].ceilingpicnum = temppicnum; break;
case 2 : sector[searchsector].floorpicnum = temppicnum; break;
case 3 : sprite[searchwall].picnum = temppicnum; break;
case 4 : wall[searchwall].overpicnum = temppicnum; break;
case 0 :
wall[searchwall].picnum = temppicnum; break;
case 1 :
sector[searchsector].ceilingpicnum = temppicnum; break;
case 2 :
sector[searchsector].floorpicnum = temppicnum; break;
case 3 :
sprite[searchwall].picnum = temppicnum; break;
case 4 :
wall[searchwall].overpicnum = temppicnum; break;
}
keystatus[0x1c]=0;
}
@ -4022,7 +4137,8 @@ enum {
T_LOADGRP = 0,
};
typedef struct { char *text; int tokenid; } tokenlist;
typedef struct { char *text; int tokenid; }
tokenlist;
static int getatoken(scriptfile *sf, tokenlist *tl, int ntokens)
{

View file

@ -132,7 +132,8 @@ enum {
T_ALLOW
};
typedef struct { char *text; int tokenid; } tokenlist;
typedef struct { char *text; int tokenid; }
tokenlist;
static int getatoken(scriptfile *sf, tokenlist *tl, int ntokens)
{
@ -1178,7 +1179,8 @@ void faketimerhandler()
}
extern long cacnum;
typedef struct { long *hand, leng; char *lock; } cactype;
typedef struct { long *hand, leng; char *lock ; }
cactype;
extern cactype cac[];
void caches(void)
@ -1832,6 +1834,8 @@ void coolgaugetext(short snum)
{
for (i=connecthead;i>=0;i=connectpoint2[i])
if (ps[i].frag != sbar.frag[i]) { displayfragbar(); break; }
}
for (i=connecthead;i>=0;i=connectpoint2[i])
if (i != myconnectindex)
@ -1858,14 +1862,22 @@ void coolgaugetext(short snum)
{
switch (p->inven_icon)
{
case 1: i = FIRSTAID_ICON; break;
case 2: i = STEROIDS_ICON; break;
case 3: i = HOLODUKE_ICON; break;
case 4: i = JETPACK_ICON; break;
case 5: i = HEAT_ICON; break;
case 6: i = AIRTANK_ICON; break;
case 7: i = BOOT_ICON; break;
default: i = -1;
case 1:
i = FIRSTAID_ICON; break;
case 2:
i = STEROIDS_ICON; break;
case 3:
i = HOLODUKE_ICON; break;
case 4:
i = JETPACK_ICON; break;
case 5:
i = HEAT_ICON; break;
case 6:
i = AIRTANK_ICON; break;
case 7:
i = BOOT_ICON; break;
default:
i = -1;
}
if (i >= 0) rotatesprite(sbarx(231-o),sbary(200-21),sbarsc(65536L),0,i,0,0,10+16+permbit,0,0,xdim-1,ydim-1);
@ -1874,13 +1886,20 @@ void coolgaugetext(short snum)
j = 0x80000000;
switch (p->inven_icon)
{
case 1: i = p->firstaid_amount; break;
case 2: i = ((p->steroids_amount+3)>>2); break;
case 3: i = ((p->holoduke_amount+15)/24); j = p->holoduke_on; break;
case 4: i = ((p->jetpack_amount+15)>>4); j = p->jetpack_on; break;
case 5: i = p->heat_amount/12; j = p->heat_on; break;
case 6: i = ((p->scuba_amount+63)>>6); break;
case 7: i = (p->boot_amount>>1); break;
case 1:
i = p->firstaid_amount; break;
case 2:
i = ((p->steroids_amount+3)>>2); break;
case 3:
i = ((p->holoduke_amount+15)/24); j = p->holoduke_on; break;
case 4:
i = ((p->jetpack_amount+15)>>4); j = p->jetpack_on; break;
case 5:
i = p->heat_amount/12; j = p->heat_on; break;
case 6:
i = ((p->scuba_amount+63)>>6); break;
case 7:
i = (p->boot_amount>>1); break;
}
invennum(284-30-o,200-6,(char)i,0,10+permbit);
if (j > 0) minitext(288-30-o,180,"ON",0,10+16+permbit + 256);
@ -1892,7 +1911,8 @@ void coolgaugetext(short snum)
//DRAW/UPDATE FULL STATUS BAR:
if (pus) { pus = 0; u = -1; } else u = 0;
if (pus) { pus = 0; u = -1; }
else u = 0;
if (sbar.frag[myconnectindex] != p->frag) { sbar.frag[myconnectindex] = p->frag; u |= 32768; }
if (sbar.got_access != p->got_access) { sbar.got_access = p->got_access; u |= 16384; }
@ -1902,10 +1922,14 @@ if (sbar.frag[myconnectindex] != p->frag) { sbar.frag[myconnectindex] = p->frag;
if (lAmount == -1)
{
if (sbar.shield_amount != p->shield_amount) { sbar.shield_amount = p->shield_amount; u |= 2; }
}
else
{
if (sbar.shield_amount != lAmount) { sbar.shield_amount = lAmount; u |= 2; }
}
}
@ -2020,6 +2044,8 @@ if (sbar.inven_icon != p->inven_icon) { sbar.inven_icon = p->inven_icon; u |= (2
{
if (u&(2048+4096)) { patchstatusbar(231,SBY+13,265,SBY+13+18); }
else { patchstatusbar(250,SBY+24,261,SBY+24+6); }
}
if (p->inven_icon)
{
@ -2029,13 +2055,20 @@ if (sbar.inven_icon != p->inven_icon) { sbar.inven_icon = p->inven_icon; u |= (2
{
switch (p->inven_icon)
{
case 1: i = FIRSTAID_ICON; break;
case 2: i = STEROIDS_ICON; break;
case 3: i = HOLODUKE_ICON; break;
case 4: i = JETPACK_ICON; break;
case 5: i = HEAT_ICON; break;
case 6: i = AIRTANK_ICON; break;
case 7: i = BOOT_ICON; break;
case 1:
i = FIRSTAID_ICON; break;
case 2:
i = STEROIDS_ICON; break;
case 3:
i = HOLODUKE_ICON; break;
case 4:
i = JETPACK_ICON; break;
case 5:
i = HEAT_ICON; break;
case 6:
i = AIRTANK_ICON; break;
case 7:
i = BOOT_ICON; break;
}
rotatesprite(sbarx(231-o),sbary(SBY+13),sbarsc(65536L),0,i,0,0,10+16+permbit,0,0,xdim-1,ydim-1);
minitext(292-30-o,SBY+24,"%",6,10+16+permbit + 256);
@ -2045,10 +2078,14 @@ if (sbar.inven_icon != p->inven_icon) { sbar.inven_icon = p->inven_icon; u |= (2
{
switch (p->inven_icon)
{
case 3: j = p->holoduke_on; break;
case 4: j = p->jetpack_on; break;
case 5: j = p->heat_on; break;
default: j = 0x80000000;
case 3:
j = p->holoduke_on; break;
case 4:
j = p->jetpack_on; break;
case 5:
j = p->heat_on; break;
default:
j = 0x80000000;
}
if (j > 0) minitext(288-30-o,SBY+14,"ON",0,10+16+permbit + 256);
else if ((unsigned long)j != 0x80000000) minitext(284-30-o,SBY+14,"OFF",2,10+16+permbit + 256);
@ -2057,13 +2094,20 @@ if (sbar.inven_icon != p->inven_icon) { sbar.inven_icon = p->inven_icon; u |= (2
{
switch (p->inven_icon)
{
case 1: i = p->firstaid_amount; break;
case 2: i = ((p->steroids_amount+3)>>2); break;
case 3: i = ((p->holoduke_amount+15)/24); break;
case 4: i = ((p->jetpack_amount+15)>>4); break;
case 5: i = p->heat_amount/12; break;
case 6: i = ((p->scuba_amount+63)>>6); break;
case 7: i = (p->boot_amount>>1); break;
case 1:
i = p->firstaid_amount; break;
case 2:
i = ((p->steroids_amount+3)>>2); break;
case 3:
i = ((p->holoduke_amount+15)/24); break;
case 4:
i = ((p->jetpack_amount+15)>>4); break;
case 5:
i = p->heat_amount/12; break;
case 6:
i = ((p->scuba_amount+63)>>6); break;
case 7:
i = (p->boot_amount>>1); break;
}
invennum(284-30-o,SBY+28,(char)i,0,10+permbit);
}
@ -2257,6 +2301,8 @@ void showtwoscreens(void)
rotatesprite(0,0,65536L,0,3290,0,0,2+8+16+64, 0,0,xdim-1,ydim-1);
IFISSOFTMODE fadepal(0,0,0, 63,0,-7); else nextpage();
while ( !KB_KeyWaiting() ) { handleevents(); getpackets(); }
}
}
/*
@ -2655,7 +2701,8 @@ void drawoverheadmap(long cposx, long cposy, long czoom, short cang)
if ( (spr->cstat&257) != 0) switch (spr->cstat&48)
{
case 0: break;
case 0:
break;
ox = sprx-cposx; oy = spry-cposy;
x1 = dmulscale16(ox,xvect,-oy,yvect);
@ -3185,9 +3232,12 @@ void drawbackground(void)
switch (ud.m_volume_number)
{
default:dapicnum = BIGHOLE;break;
case 1:dapicnum = BIGHOLE;break;
case 2:dapicnum = BIGHOLE;break;
default:
dapicnum = BIGHOLE;break;
case 1:
dapicnum = BIGHOLE;break;
case 2:
dapicnum = BIGHOLE;break;
}
if (tilesizx[dapicnum] == 0 || tilesizy[dapicnum] == 0) {
@ -4226,12 +4276,20 @@ short spawn( short j, short pn )
updatesector(sp->x-108,sp->y+108,&s1);
if (s1 >= 0 && sector[s1].floorz != sector[sp->sectnum].floorz)
{ sp->xrepeat = sp->yrepeat = 0;changespritestat(i,5);break;}
}
else { sp->xrepeat = sp->yrepeat = 0;changespritestat(i,5);break;}
}
else { sp->xrepeat = sp->yrepeat = 0;changespritestat(i,5);break;}
}
else { sp->xrepeat = sp->yrepeat = 0;changespritestat(i,5);break;}
}
if ( sector[SECT].lotag == 1 )
@ -4430,10 +4488,16 @@ short spawn( short j, short pn )
updatesector(sp->x-84,sp->y+84,&s1);
if (s1 >= 0 && sector[s1].floorz != sector[sp->sectnum].floorz)
{ sp->xrepeat = sp->yrepeat = 0;changespritestat(i,5);break;}
}
else { sp->xrepeat = sp->yrepeat = 0;break;}
}
else { sp->xrepeat = sp->yrepeat = 0;break;}
}
else { sp->xrepeat = sp->yrepeat = 0;break;}
@ -5725,7 +5789,8 @@ void animatesprites(long x,long y,short a,long smoothratio)
s = &sprite[t->owner];
//greenslime can't be handled through the dynamictostatic system due to addition on constant
if ((t->picnum >= GREENSLIME)&&(t->picnum <= GREENSLIME+7)) {
} else switch(dynamictostatic[t->picnum])
}
else switch (dynamictostatic[t->picnum])
{
case BLOODPOOL__STATIC:
case PUKE__STATIC:
@ -6769,10 +6834,12 @@ FOUNDCHEAT:
fprintf(fp,"WEAPON%d_FIRESOUND %ld\n",i,aplWeaponFireSound[i][j]);
fprintf(fp,"WEAPON%d_SOUND2TIME %ld\n",i,aplWeaponSound2Time[i][j]);
fprintf(fp,"WEAPON%d_SOUND2SOUND %ld\n",i,aplWeaponSound2Sound[i][j]);
fprintf(fp,"WEAPON%d_RELOADSOUND1 %ld\n",i,aplWeaponReloadSound1[i][j]);
fprintf(fp,"WEAPON%d_RELOADSOUND2 %ld\n",i,aplWeaponReloadSound2[i][j]);
}
fprintf(fp,"\n");
}
for (x=0;x<13;x++)
for (x=0;x<MAXSTATUS;x++)
{
j = headspritestat[x];
while (j >= 0)
@ -6800,8 +6867,7 @@ FOUNDCHEAT:
}
}
fprintf(fp,"\n");
y = nextspritestat[j];
j = y;
j = nextspritestat[j];
}
}
DumpGameVars(fp);
@ -8030,6 +8096,8 @@ void checkcommandline(int argc,char **argv)
{ networkmode = 0; initprintf("Network mode: master/slave\n"); }
else if (((c[0] == 'n') || (c[0] == 'N')) && (c[1] == '1'))
{ networkmode = 1; initprintf("Network mode: peer-to-peer\n"); }
}
netparam[i-firstnet-1] = argv[i];
i++;
@ -9300,8 +9368,10 @@ MAIN_LOOP_RESTART:
switch (ud.pteam[myconnectindex])
{
case 0: k = 3; break;
case 1: k = 21; break;
case 0:
k = 3; break;
case 1:
k = 21; break;
}
ps[myconnectindex].palookup = ud.pcolor[myconnectindex] = k;
} else {
@ -10522,8 +10592,10 @@ char domovethings(void)
j = 0;
switch (ps[i].team)
{
case 0: j = 3; break;
case 1: j = 21; break;
case 0:
j = 3; break;
case 1:
j = 21; break;
}
ps[i].palookup = ud.pcolor[i] = j;
}
@ -10618,6 +10690,8 @@ void doorders(void)
rotatesprite(0,0,65536L,0,ORDERING+3,0,0,2+8+16+64, 0,0,xdim-1,ydim-1);
fadepal(0,0,0, 63,0,-7);
while ( !KB_KeyWaiting() ) { handleevents(); getpackets(); }
}
void dobonus(char bonusonly)
@ -10705,6 +10779,8 @@ void dobonus(char bonusonly)
{
rotatesprite(86<<16,59<<16,65536L,0,VICTORY1+8,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1);
if (totalclock >= 750 && bonuscnt == 2) { sound(DUKETALKTOBOSS); bonuscnt++; }
}
for (t=0;t<20;t+=5)
if ( breathe[t+2] && (totalclock%120) > breathe[t] && (totalclock%120) <= breathe[t+1] )
@ -10863,6 +10939,8 @@ void dobonus(char bonusonly)
if (KB_KeyWaiting()) goto ENDANM;
sound(ENDSEQVOL3SND9);
while (issoundplaying(-1,ENDSEQVOL3SND9)) { handleevents(); getpackets(); }
}
KB_FlushKeyBoardQueue();
@ -11114,6 +11192,8 @@ FRAGBONUS:
if (!(ud.volume_number == 0 && ud.last_level-1 == 7)) {
gametext(10,yy+9,"Par Time:",0,2+8+16); yy+=10;
if (!NAM) { gametext(10,yy+9,"3D Realms' Time:",0,2+8+16); yy+=10; }
}
if (playerbest > 0) { gametext(10,yy+9,ps[myconnectindex].player_par<playerbest?"Prev Best Time:":"Your Best Time:",0,2+8+16); yy += 10; }

View file

@ -2639,8 +2639,10 @@ char parsecommand(void)
}
switch (j)
{
case 0: transnum(LABEL_DEFINE); break;
case 1: transnum(LABEL_ACTION); break;
case 0:
transnum(LABEL_DEFINE); break;
case 1:
transnum(LABEL_ACTION); break;
case 2:
if ((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
{
@ -2793,8 +2795,10 @@ char parsecommand(void)
}
switch (j)
{
case 0: transnum(LABEL_DEFINE); break;
case 1: transnum(LABEL_ACTION); break;
case 0:
transnum(LABEL_DEFINE); break;
case 1:
transnum(LABEL_ACTION); break;
case 2:
if ((transnum(LABEL_MOVE|LABEL_DEFINE) == 0) && (*(scriptptr-1) != 0) && (*(scriptptr-1) != 1))
{

View file

@ -3058,6 +3058,17 @@ void OnEvent(int iEventID, short sActor,short sPlayer,long lDist)
done = parse();
while ( done == 0 );
if (killit_flag == 1)
{
// if player was set to squish, first stop that...
if (g_p >= 0 )
{
if (ps[g_p].actorsqu == g_i)
ps[g_p].actorsqu = -1;
}
deletesprite(g_i);
}
// restore old values...
g_i=og_i;
g_p=og_p;
@ -4404,7 +4415,10 @@ SKIPJIBS:
tempbuf[11] = ud.m_noexits;
for (i=connecthead;i>=0;i=connectpoint2[i])
sendpacket(i,tempbuf,12);
{
if (i != myconnectindex) sendpacket(i,tempbuf,12);
if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
}
}
else { ps[myconnectindex].gm |= MODE_EOL; display_bonus_screen = 0; } // MODE_RESTART;
@ -5318,9 +5332,12 @@ SKIPJIBS:
case GET_ACCESS:
switch (g_sp->pal)
{
case 0: ps[g_p].got_access |= 1;break;
case 21: ps[g_p].got_access |= 2;break;
case 23: ps[g_p].got_access |= 4;break;
case 0:
ps[g_p].got_access |= 1;break;
case 21:
ps[g_p].got_access |= 2;break;
case 23:
ps[g_p].got_access |= 4;break;
}
break;
@ -6665,24 +6682,33 @@ good:
j = 0;
switch (*insptr++)
{
case GET_STEROIDS:if( ps[g_p].steroids_amount != *insptr)
case GET_STEROIDS:
if ( ps[g_p].steroids_amount != *insptr)
j = 1;
break;
case GET_SHIELD:if(ps[g_p].shield_amount != max_player_health )
case GET_SHIELD:
if (ps[g_p].shield_amount != max_player_health )
j = 1;
break;
case GET_SCUBA:if(ps[g_p].scuba_amount != *insptr) j = 1;break;
case GET_HOLODUKE:if(ps[g_p].holoduke_amount != *insptr) j = 1;break;
case GET_JETPACK:if(ps[g_p].jetpack_amount != *insptr) j = 1;break;
case GET_SCUBA:
if (ps[g_p].scuba_amount != *insptr) j = 1;break;
case GET_HOLODUKE:
if (ps[g_p].holoduke_amount != *insptr) j = 1;break;
case GET_JETPACK:
if (ps[g_p].jetpack_amount != *insptr) j = 1;break;
case GET_ACCESS:
switch (g_sp->pal)
{
case 0: if(ps[g_p].got_access&1) j = 1;break;
case 21: if(ps[g_p].got_access&2) j = 1;break;
case 23: if(ps[g_p].got_access&4) j = 1;break;
case 0:
if (ps[g_p].got_access&1) j = 1;break;
case 21:
if (ps[g_p].got_access&2) j = 1;break;
case 23:
if (ps[g_p].got_access&4) j = 1;break;
}
break;
case GET_HEATS:if(ps[g_p].heat_amount != *insptr) j = 1;break;
case GET_HEATS:
if (ps[g_p].heat_amount != *insptr) j = 1;break;
case GET_FIRSTAID:
if (ps[g_p].firstaid_amount != *insptr) j = 1;break;
case GET_BOOTS:

View file

@ -9,7 +9,8 @@
#include "grpscan.h"
struct grpfile grpfiles[numgrpfiles] = {
{ "Duke Nukem 3D", 0xBBC9CE44, 26524524, GAMEDUKE, NULL },
{ "Duke Nukem 3D", 0xBBC9CE44, 26524524, GAMEDUKE, NULL }
,
{ "Duke Nukem 3D: Atomic Edition", 0xF514A6AC, 44348015, GAMEDUKE, NULL },
{ "Duke Nukem 3D: Atomic Edition", 0xFD3DCFF1, 44356548, GAMEDUKE, NULL },
{ "Duke Nukem 3D Shareware Version", 0x983AD923, 11035779, GAMEDUKE, NULL },

View file

@ -660,8 +660,10 @@ void menus(void)
if (probey == 2)
{
switch (ud.team) {
case 0: x = 3; break;
case 1: x = 21; break;
case 0:
x = 3; break;
case 1:
x = 21; break;
}
} else x = ud.color;
rotatesprite((280)<<16,(37+(tilesizy[APLAYER]>>1))<<16,49152L,0,1441-((((4-(totalclock>>4)))&3)*5),0,x,10,0,0,xdim-1,ydim-1);
@ -766,16 +768,21 @@ void menus(void)
menutext(40,50+16+16+16+16+16+16,MENUHIGHLIGHT(6),0,"MACRO SETUP");
if (current_menu == 20002) {
gametext(200,50-9,myname,MENUHIGHLIGHT(0),2+8+16); }
gametext(200,50-9,myname,MENUHIGHLIGHT(0),2+8+16);
}
{ char *s[] = { "Auto","","","","","","","","","Blue","Dk red","Green","Gray","Dk gray","Dk green","Brown",
"Dk blue","","","","","Red","","Yellow","","" };
gametext(200,50+16-9,s[ud.color],MENUHIGHLIGHT(1),2+8+16); }
gametext(200,50+16-9,s[ud.color],MENUHIGHLIGHT(1),2+8+16);
}
{ char *s[] = { "Blue", "Red" };
gametext(200,50+16+16-9,s[ud.team],MENUHIGHLIGHT(2),2+8+16); }
gametext(200,50+16+16-9,s[ud.team],MENUHIGHLIGHT(2),2+8+16);
}
{ char *s[] = { "Off", "Full", "Hitscan" };
gametext(200,50+16+16+16-9,s[AutoAim],MENUHIGHLIGHT(3),2+8+16); }
gametext(200,50+16+16+16-9,s[AutoAim],MENUHIGHLIGHT(3),2+8+16);
}
{ char *s[] = { "Off", "On pickup", "When empty", "Both" };
gametext(200,50+16+16+16+16-9,s[ud.weaponswitch],MENUHIGHLIGHT(4),2+8+16); }
gametext(200,50+16+16+16+16-9,s[ud.weaponswitch],MENUHIGHLIGHT(4),2+8+16);
}
gametext(200,50+16+16+16+16+16-9,ud.mouseaiming?"Held":"Toggle",MENUHIGHLIGHT(5),2+8+16);
break;
@ -1673,15 +1680,19 @@ cheat_for_port_credits:
cmenu(100);
break;
//case 1: break;//cmenu(20001);break; // JBF 20031128: I'm taking over the TEN menu option
case 1: cmenu(202);break; // JBF 20031205: was 200
case 1:
cmenu(202);break; // JBF 20031205: was 200
case 2:
if (movesperpacket == 4 && connecthead != myconnectindex)
break;
cmenu(300);
break;
case 3: KB_FlushKeyboardQueue();cmenu(400);break;
case 4: cmenu(990);break;
case 5: cmenu(500);break;
case 3:
KB_FlushKeyboardQueue();cmenu(400);break;
case 4:
cmenu(990);break;
case 5:
cmenu(500);break;
}
}
}
@ -2049,10 +2060,14 @@ cheat_for_port_credits:
{
switch (x)
{
case 0: globalskillsound = JIBBED_ACTOR6;break;
case 1: globalskillsound = BONUS_SPEECH1;break;
case 2: globalskillsound = DUKE_GETWEAPON2;break;
case 3: globalskillsound = JIBBED_ACTOR5;break;
case 0:
globalskillsound = JIBBED_ACTOR6;break;
case 1:
globalskillsound = BONUS_SPEECH1;break;
case 2:
globalskillsound = DUKE_GETWEAPON2;break;
case 3:
globalskillsound = JIBBED_ACTOR5;break;
}
sound(globalskillsound);
@ -2145,32 +2160,40 @@ cheat_for_port_credits:
}
enabled = 1;
switch (io) {
case 0: if (x==io) glwidescreen = 1-glwidescreen;
case 0:
if (x==io) glwidescreen = 1-glwidescreen;
modval(0,1,(int *)&glwidescreen,1,probey==io);
gametextpal(d,yy, glwidescreen ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 1: if (x==io) usehightile = 1-usehightile;
case 1:
if (x==io) usehightile = 1-usehightile;
modval(0,1,(int *)&usehightile,1,probey==io);
gametextpal(d,yy, usehightile ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 2: enabled = usehightile;
case 2:
enabled = usehightile;
if (enabled && x==io) useprecache = !useprecache;
if (enabled) modval(0,1,(int *)&useprecache,1,probey==io);
gametextpal(d,yy, useprecache && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):15, 0); break;
case 3: enabled = usehightile;
case 3:
enabled = usehightile;
if (enabled && x==io) glusetexcompr = !glusetexcompr;
if (enabled) modval(0,1,(int *)&glusetexcompr,1,probey==io);
gametextpal(d,yy, glusetexcompr && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):15, 0); break;
case 4: enabled = (glusetexcompr && usehightile && useprecache);
case 4:
enabled = (glusetexcompr && usehightile && useprecache);
if (enabled && x==io) glusetexcache = !glusetexcache;
if (enabled) modval(0,1,(int *)&glusetexcache,1,probey==io);
gametextpal(d,yy, glusetexcache && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):15, 0); break;
case 5: enabled = (glusetexcompr && usehightile && useprecache && glusetexcache);
case 5:
enabled = (glusetexcompr && usehightile && useprecache && glusetexcache);
if (enabled && x==io) glusetexcachecompression = !glusetexcachecompression;
if (enabled) modval(0,1,(int *)&glusetexcachecompression,1,probey==io);
gametextpal(d,yy, glusetexcachecompression && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):15, 0); break;
case 6: if (x==io) usemodels = 1-usemodels;
case 6:
if (x==io) usemodels = 1-usemodels;
modval(0,1,(int *)&usemodels,1,probey==io);
gametextpal(d,yy, usemodels ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
default: break;
default:
break;
}
gametextpal(c,yy, opts[ii], enabled?MENUHIGHLIGHT(io):15, 2);
io++;
@ -2238,11 +2261,14 @@ cheat_for_port_credits:
}
enabled = 1;
switch (io) {
case 0: if (x==io) ud.crosshair = (ud.crosshair==3)?0:ud.crosshair+1;
case 0:
if (x==io) ud.crosshair = (ud.crosshair==3)?0:ud.crosshair+1;
modval(0,3,(int *)&ud.crosshair,1,probey==io);
{ char *s[] = { "OFF", "ON [100%]", "ON [50%]", "ON [25%]" };
gametextpal(d,yy,s[ud.crosshair], MENUHIGHLIGHT(io), 0); break; }
case 1: if (x==io) ud.levelstats = 1-ud.levelstats;
gametextpal(d,yy,s[ud.crosshair], MENUHIGHLIGHT(io), 0); break;
}
case 1:
if (x==io) ud.levelstats = 1-ud.levelstats;
modval(0,1,(int *)&ud.levelstats,1,probey==io);
gametextpal(d,yy, ud.levelstats ? "Shown" : "Hidden", MENUHIGHLIGHT(io), 0); break;
case 2:
@ -2277,26 +2303,33 @@ cheat_for_port_credits:
}
}
break;
case 4: if (x==io) ud.runkey_mode = 1-ud.runkey_mode;
case 4:
if (x==io) ud.runkey_mode = 1-ud.runkey_mode;
modval(0,1,(int *)&ud.runkey_mode,1,probey==io);
gametextpal(d,yy, ud.runkey_mode ? "Classic" : "Modern", MENUHIGHLIGHT(io), 0); break;
case 5: if (x==io) ud.detail = 1-ud.detail;
case 5:
if (x==io) ud.detail = 1-ud.detail;
modval(0,1,(int *)&ud.detail,1,probey==io);
gametextpal(d,yy, ud.detail ? "High" : "Low", MENUHIGHLIGHT(io), 0); break;
case 6: if (x==io) ud.shadows = 1-ud.shadows;
case 6:
if (x==io) ud.shadows = 1-ud.shadows;
modval(0,1,(int *)&ud.shadows,1,probey==io);
gametextpal(d,yy, ud.shadows ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 7: if (x==io) ud.screen_tilting = 1-ud.screen_tilting;
case 7:
if (x==io) ud.screen_tilting = 1-ud.screen_tilting;
modval(0,1,(int *)&ud.screen_tilting,1,probey==io);
gametextpal(d,yy, ud.screen_tilting ? "On" : "Off", MENUHIGHLIGHT(io), 0); break; // original had a 'full' option
case 8: if (x==io) ud.showweapons = 1-ud.showweapons;
case 8:
if (x==io) ud.showweapons = 1-ud.showweapons;
modval(0,1,(int *)&ud.showweapons,1,probey==io);
ShowOpponentWeapons = ud.showweapons;
gametextpal(d,yy, ShowOpponentWeapons ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 9: if (x==io) ud.democams = 1-ud.democams;
case 9:
if (x==io) ud.democams = 1-ud.democams;
modval(0,1,(int *)&ud.democams,1,probey==io);
gametextpal(d,yy, ud.democams ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 10: if (x==io) {
case 10:
if (x==io) {
enabled = !((ps[myconnectindex].gm&MODE_GAME) && ud.m_recstat != 1);
if ( (ps[myconnectindex].gm&MODE_GAME) ) closedemowrite();
else ud.m_recstat = !ud.m_recstat;
@ -2304,8 +2337,10 @@ cheat_for_port_credits:
if ( (ps[myconnectindex].gm&MODE_GAME) && ud.m_recstat != 1 )
enabled = 0;
gametextpal(d,yy,ud.m_recstat?((ud.m_recstat && enabled && ps[myconnectindex].gm&MODE_GAME)?"Recording":"On"):"Off",enabled?MENUHIGHLIGHT(io):15,enabled?0:1); break;
case 11: if (x==io) cmenu(201); break;
default: break;
case 11:
if (x==io) cmenu(201); break;
default:
break;
}
gametextpal(c,yy, opts[ii], enabled?MENUHIGHLIGHT(io):15, 2);
io++;
@ -2372,29 +2407,41 @@ cheat_for_port_credits:
}
enabled = 1;
switch (io) {
case 0: if(!NAM) { if (x==io) cmenu(10000); } else enabled = 0; break;
case 1: if (x==io) { ud.drawweapon = (ud.drawweapon == 2) ? 0 : ud.drawweapon+1; }
case 0:
if (!NAM) { if (x==io) cmenu(10000); }
else enabled = 0; break;
case 1:
if (x==io) { ud.drawweapon = (ud.drawweapon == 2) ? 0 : ud.drawweapon+1; }
modval(0,2,(int *)&ud.drawweapon,1,probey==io);
{ char *s[] = { "Off", "On", "Icon" };
gametextpal(d,yy, s[ud.drawweapon], MENUHIGHLIGHT(io), 0); break; }
case 2: if (x==io) ud.tickrate = 1-ud.tickrate;
gametextpal(d,yy, s[ud.drawweapon], MENUHIGHLIGHT(io), 0); break;
}
case 2:
if (x==io) ud.tickrate = 1-ud.tickrate;
modval(0,1,(int *)&ud.tickrate,1,probey==io);
gametextpal(d,yy, ud.tickrate ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 3: if (x==io) { ud.autovote = (ud.autovote == 2) ? 0 : ud.autovote+1; }
case 3:
if (x==io) { ud.autovote = (ud.autovote == 2) ? 0 : ud.autovote+1; }
modval(0,2,(int *)&ud.autovote,1,probey==io);
{ char *s[] = { "Off", "Vote No", "Vote Yes" };
gametextpal(d,yy, s[ud.autovote], MENUHIGHLIGHT(io), 0); break; }
case 4: if (x==io) ud.automsg = 1-ud.automsg;
gametextpal(d,yy, s[ud.autovote], MENUHIGHLIGHT(io), 0); break;
}
case 4:
if (x==io) ud.automsg = 1-ud.automsg;
modval(0,1,(int *)&ud.automsg,1,probey==io);
gametextpal(d,yy, ud.automsg ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 5: if (x==io) ud.idplayers = 1-ud.idplayers;
case 5:
if (x==io) ud.idplayers = 1-ud.idplayers;
modval(0,1,(int *)&ud.idplayers,1,probey==io);
gametextpal(d,yy, ud.idplayers ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 6: if (x==io) ForceSetup = 1-ForceSetup;
case 6:
if (x==io) ForceSetup = 1-ForceSetup;
modval(0,1,(int *)&ForceSetup,1,probey==io);
gametextpal(d,yy, ForceSetup ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 7: if (x==io) cmenu(200); break;
default: break;
case 7:
if (x==io) cmenu(200); break;
default:
break;
}
gametextpal(c,yy, opts[ii], enabled?MENUHIGHLIGHT(io):15, 2);
io++;
@ -2670,10 +2717,14 @@ cheat_for_port_credits:
case 5:
if (bpp==8) break;
switch (gltexfiltermode) {
case 0: gltexfiltermode = 3; break;
case 3: gltexfiltermode = 5; break;
case 5: gltexfiltermode = 0; break;
default: gltexfiltermode = 3; break;
case 0:
gltexfiltermode = 3; break;
case 3:
gltexfiltermode = 5; break;
case 5:
gltexfiltermode = 0; break;
default:
gltexfiltermode = 3; break;
}
gltexapplyprops();
break;
@ -2719,10 +2770,14 @@ cheat_for_port_credits:
#if defined(POLYMOST) && defined(USE_OPENGL)
menutext(c,50+62+16+16,MENUHIGHLIGHT(5),bpp==8,"FILTERING");
switch (gltexfiltermode) {
case 0: strcpy(tempbuf,"NEAREST"); break;
case 3: strcpy(tempbuf,"BILINEAR"); break;
case 5: strcpy(tempbuf,"TRILINEAR"); break;
default: strcpy(tempbuf,"OTHER"); break;
case 0:
strcpy(tempbuf,"NEAREST"); break;
case 3:
strcpy(tempbuf,"BILINEAR"); break;
case 5:
strcpy(tempbuf,"TRILINEAR"); break;
default:
strcpy(tempbuf,"OTHER"); break;
}
menutext(c+154,50+62+16+16,MENUHIGHLIGHT(5),bpp==8,tempbuf);
@ -3001,10 +3056,14 @@ cheat_for_port_credits:
} else if (function == 1) {
Bstrcpy(tempbuf,"TO DIGITAL ");
switch (whichkey) {
case 0: Bstrcat(tempbuf, "LEFT"); break;
case 1: Bstrcat(tempbuf, "RIGHT"); break;
case 2: Bstrcat(tempbuf, "UP"); break;
case 3: Bstrcat(tempbuf, "DOWN"); break;
case 0:
Bstrcat(tempbuf, "LEFT"); break;
case 1:
Bstrcat(tempbuf, "RIGHT"); break;
case 2:
Bstrcat(tempbuf, "UP"); break;
case 3:
Bstrcat(tempbuf, "DOWN"); break;
}
} else if (function == 2) {
static char *directions[] = { "UP", "RIGHT", "DOWN", "LEFT" };
@ -3266,14 +3325,18 @@ cheat_for_port_credits:
onbar = 0;
switch (probey) {
case 0:
case 4: onbar = 1; x = probe(88,45+(probey==4)*64,0,1+(4<<twothispage)); break;
case 4:
onbar = 1; x = probe(88,45+(probey==4)*64,0,1+(4<<twothispage)); break;
case 1:
case 2:
case 5:
case 6: x = probe(172+(probey==2||probey==6)*72,45+15+(probey==5||probey==6)*64,0,1+(4<<twothispage)); break;
case 6:
x = probe(172+(probey==2||probey==6)*72,45+15+(probey==5||probey==6)*64,0,1+(4<<twothispage)); break;
case 3:
case 7: x = probe(88,45+15+15+(probey==7)*64,0,1+(4<<twothispage)); break;
default: x = probe(60,79+79*twothispage,0,1+(4<<twothispage)); break;
case 7:
x = probe(88,45+15+15+(probey==7)*64,0,1+(4<<twothispage)); break;
default:
x = probe(60,79+79*twothispage,0,1+(4<<twothispage)); break;
}
switch (x) {
@ -3294,7 +3357,8 @@ cheat_for_port_credits:
case 4: // bar
if (!twothispage && joynumaxes > 2)
cmenu(208);
case 0: break;
case 0:
break;
case 1: // digitals
case 2:
@ -3322,7 +3386,8 @@ cheat_for_port_credits:
mouseyaxismode = -1;
}
break;
default:break;
default:
break;
}
Bsprintf(tempbuf,getjoyname(0,thispage*2));
@ -3578,7 +3643,8 @@ cheat_for_port_credits:
menutext(c,50+16+16+16+16+16+16,MENUHIGHLIGHT(6),(FXDevice<0)||SoundToggle==0,"FLIP STEREO");
{ char *s[] = { "OFF", "LOCAL", "ALL" };
menutext(c+160+40,50+16+16+16+16,MENUHIGHLIGHT(4),(FXDevice<0)||SoundToggle==0,s[VoiceToggle]); }
menutext(c+160+40,50+16+16+16+16,MENUHIGHLIGHT(4),(FXDevice<0)||SoundToggle==0,s[VoiceToggle]);
}
menutext(c+160+40,50+16+16+16+16+16,MENUHIGHLIGHT(5),(FXDevice<0)||SoundToggle==0,AmbienceToggle?"ON":"OFF");

View file

@ -466,7 +466,8 @@ struct cvarmappings {
{ "cl_weaponswitch", "cl_weaponswitch: enable/disable auto weapon switching", (void*)&ud.weaponswitch, CVAR_INT|256, 0, 0, 3 },
#if defined(POLYMOST) && defined(USE_OPENGL)
{ "r_anamorphic", "r_anamorphic: enable/disable widescreen mode", (void*)&glwidescreen, CVAR_BOOL, 0, 0, 1 },
{ "r_anamorphic", "r_anamorphic: enable/disable widescreen mode", (void*)&glwidescreen, CVAR_BOOL, 0, 0, 1 }
,
{ "r_projectionhack", "r_projectionhack: enable/disable projection hack", (void*)&glprojectionhacks, CVAR_BOOL, 0, 0, 1 },
// polymer cvars
{ "pr_cliplanes", "pr_cliplanes: toggles clipping behind map limits (recommended yet may decrease performance in complex maps)", (void*)&pr_cliplanes, CVAR_INT, 0, 0, 1 },
@ -523,7 +524,8 @@ int osdcmd_cvar_set(const osdfuncparm_t *parm)
OSD_Printf("%s %s",cvar[i].name,(char*)cvar[i].var);
}
} break;
default: break;
default:
break;
}
if (cvar[i].type&256)
updatenames();

View file

@ -325,7 +325,8 @@ short aim(spritetype *s,short aang,short atwith)
if (sprite[i].xrepeat < 20) continue;
continue;
} else if ((PN >= GREENSLIME)&&(PN <= GREENSLIME+7)) {
} else {
}
else {
continue;
}
}
@ -3134,9 +3135,12 @@ char doincrements(struct player_struct *p)
checkhitswitch(snum,p->access_spritenum,1);
switch (sprite[p->access_spritenum].pal)
{
case 0:p->got_access &= (0xffff-0x1);break;
case 21:p->got_access &= (0xffff-0x2);break;
case 23:p->got_access &= (0xffff-0x4);break;
case 0:
p->got_access &= (0xffff-0x1);break;
case 21:
p->got_access &= (0xffff-0x2);break;
case 23:
p->got_access &= (0xffff-0x4);break;
}
p->access_spritenum = -1;
}
@ -3145,9 +3149,12 @@ char doincrements(struct player_struct *p)
checkhitswitch(snum,p->access_wallnum,0);
switch (wall[p->access_wallnum].pal)
{
case 0:p->got_access &= (0xffff-0x1);break;
case 21:p->got_access &= (0xffff-0x2);break;
case 23:p->got_access &= (0xffff-0x4);break;
case 0:
p->got_access &= (0xffff-0x1);break;
case 21:
p->got_access &= (0xffff-0x2);break;
case 23:
p->got_access &= (0xffff-0x4);break;
}
}
}
@ -3572,11 +3579,16 @@ void processinput(short snum)
break;
}
break;
case RPG__STATIC: i = 4; break;
case RADIUSEXPLOSION__STATIC: i = 5; break;
case SHRINKSPARK__STATIC: i = 6; break;
case GROWSPARK__STATIC: i = 8; break;
default: i = 0; break;
case RPG__STATIC:
i = 4; break;
case RADIUSEXPLOSION__STATIC:
i = 5; break;
case SHRINKSPARK__STATIC:
i = 6; break;
case GROWSPARK__STATIC:
i = 8; break;
default:
i = 0; break;
}
}
Bstrcpy(name1,&ud.user_name[snum][0]);
@ -3964,10 +3976,14 @@ void processinput(short snum)
{
switch (TRAND&3)
{
case 0: j = spawn(pi,FOOTPRINTS); break;
case 1: j = spawn(pi,FOOTPRINTS2); break;
case 2: j = spawn(pi,FOOTPRINTS3); break;
default: j = spawn(pi,FOOTPRINTS4); break;
case 0:
j = spawn(pi,FOOTPRINTS); break;
case 1:
j = spawn(pi,FOOTPRINTS2); break;
case 2:
j = spawn(pi,FOOTPRINTS3); break;
default:
j = spawn(pi,FOOTPRINTS4); break;
}
sprite[j].pal = p->footprintpal;
sprite[j].shade = p->footprintshade;
@ -5077,41 +5093,73 @@ int getspritescore(long snum, long dapicnum)
{
switch (dynamictostatic[dapicnum])
{
case FIRSTGUNSPRITE__STATIC: return(20);
case CHAINGUNSPRITE__STATIC: return(50);
case RPGSPRITE__STATIC: return(200);
case FREEZESPRITE__STATIC: return(25);
case SHRINKERSPRITE__STATIC: return(80);
case HEAVYHBOMB__STATIC: return(60);
case TRIPBOMBSPRITE__STATIC: return(50);
case SHOTGUNSPRITE__STATIC: return(120);
case DEVISTATORSPRITE__STATIC: return(120);
case FIRSTGUNSPRITE__STATIC:
return(20);
case CHAINGUNSPRITE__STATIC:
return(50);
case RPGSPRITE__STATIC:
return(200);
case FREEZESPRITE__STATIC:
return(25);
case SHRINKERSPRITE__STATIC:
return(80);
case HEAVYHBOMB__STATIC:
return(60);
case TRIPBOMBSPRITE__STATIC:
return(50);
case SHOTGUNSPRITE__STATIC:
return(120);
case DEVISTATORSPRITE__STATIC:
return(120);
case FREEZEAMMO__STATIC: if (ps[snum].ammo_amount[FREEZE_WEAPON] < max_ammo_amount[FREEZE_WEAPON]) return(10); else return(0);
case AMMO__STATIC: if (ps[snum].ammo_amount[PISTOL_WEAPON] < max_ammo_amount[PISTOL_WEAPON]) return(10); else return(0);
case BATTERYAMMO__STATIC: if (ps[snum].ammo_amount[CHAINGUN_WEAPON] < max_ammo_amount[CHAINGUN_WEAPON]) return(20); else return(0);
case DEVISTATORAMMO__STATIC: if (ps[snum].ammo_amount[DEVISTATOR_WEAPON] < max_ammo_amount[DEVISTATOR_WEAPON]) return(25); else return(0);
case RPGAMMO__STATIC: if (ps[snum].ammo_amount[RPG_WEAPON] < max_ammo_amount[RPG_WEAPON]) return(50); else return(0);
case CRYSTALAMMO__STATIC: if (ps[snum].ammo_amount[SHRINKER_WEAPON] < max_ammo_amount[SHRINKER_WEAPON]) return(10); else return(0);
case HBOMBAMMO__STATIC: if (ps[snum].ammo_amount[HANDBOMB_WEAPON] < max_ammo_amount[HANDBOMB_WEAPON]) return(30); else return(0);
case SHOTGUNAMMO__STATIC: if (ps[snum].ammo_amount[SHOTGUN_WEAPON] < max_ammo_amount[SHOTGUN_WEAPON]) return(25); else return(0);
case FREEZEAMMO__STATIC:
if (ps[snum].ammo_amount[FREEZE_WEAPON] < max_ammo_amount[FREEZE_WEAPON]) return(10); else return(0);
case AMMO__STATIC:
if (ps[snum].ammo_amount[PISTOL_WEAPON] < max_ammo_amount[PISTOL_WEAPON]) return(10); else return(0);
case BATTERYAMMO__STATIC:
if (ps[snum].ammo_amount[CHAINGUN_WEAPON] < max_ammo_amount[CHAINGUN_WEAPON]) return(20); else return(0);
case DEVISTATORAMMO__STATIC:
if (ps[snum].ammo_amount[DEVISTATOR_WEAPON] < max_ammo_amount[DEVISTATOR_WEAPON]) return(25); else return(0);
case RPGAMMO__STATIC:
if (ps[snum].ammo_amount[RPG_WEAPON] < max_ammo_amount[RPG_WEAPON]) return(50); else return(0);
case CRYSTALAMMO__STATIC:
if (ps[snum].ammo_amount[SHRINKER_WEAPON] < max_ammo_amount[SHRINKER_WEAPON]) return(10); else return(0);
case HBOMBAMMO__STATIC:
if (ps[snum].ammo_amount[HANDBOMB_WEAPON] < max_ammo_amount[HANDBOMB_WEAPON]) return(30); else return(0);
case SHOTGUNAMMO__STATIC:
if (ps[snum].ammo_amount[SHOTGUN_WEAPON] < max_ammo_amount[SHOTGUN_WEAPON]) return(25); else return(0);
case COLA__STATIC: if (sprite[ps[snum].i].extra < 100) return(10); else return(0);
case SIXPAK__STATIC: if (sprite[ps[snum].i].extra < 100) return(30); else return(0);
case FIRSTAID__STATIC: if (ps[snum].firstaid_amount < 100) return(100); else return(0);
case SHIELD__STATIC: if (ps[snum].shield_amount < 100) return(50); else return(0);
case STEROIDS__STATIC: if (ps[snum].steroids_amount < 400) return(30); else return(0);
case AIRTANK__STATIC: if (ps[snum].scuba_amount < 6400) return(30); else return(0);
case JETPACK__STATIC: if (ps[snum].jetpack_amount < 1600) return(100); else return(0);
case HEATSENSOR__STATIC: if (ps[snum].heat_amount < 1200) return(5); else return(0);
case ACCESSCARD__STATIC: return(1);
case BOOTS__STATIC: if (ps[snum].boot_amount < 200) return(15); else return(0);
case ATOMICHEALTH__STATIC: if (sprite[ps[snum].i].extra < max_player_health<<1) return(50); else return(0);
case HOLODUKE__STATIC: if (ps[snum].holoduke_amount < 2400) return(5); else return(0);
case COLA__STATIC:
if (sprite[ps[snum].i].extra < 100) return(10); else return(0);
case SIXPAK__STATIC:
if (sprite[ps[snum].i].extra < 100) return(30); else return(0);
case FIRSTAID__STATIC:
if (ps[snum].firstaid_amount < 100) return(100); else return(0);
case SHIELD__STATIC:
if (ps[snum].shield_amount < 100) return(50); else return(0);
case STEROIDS__STATIC:
if (ps[snum].steroids_amount < 400) return(30); else return(0);
case AIRTANK__STATIC:
if (ps[snum].scuba_amount < 6400) return(30); else return(0);
case JETPACK__STATIC:
if (ps[snum].jetpack_amount < 1600) return(100); else return(0);
case HEATSENSOR__STATIC:
if (ps[snum].heat_amount < 1200) return(5); else return(0);
case ACCESSCARD__STATIC:
return(1);
case BOOTS__STATIC:
if (ps[snum].boot_amount < 200) return(15); else return(0);
case ATOMICHEALTH__STATIC:
if (sprite[ps[snum].i].extra < max_player_health<<1) return(50); else return(0);
case HOLODUKE__STATIC:
if (ps[snum].holoduke_amount < 2400) return(5); else return(0);
case SECTOREFFECTOR__STATIC: return(1);
case TOUCHPLATE__STATIC: return(1);
case MUSICANDSFX__STATIC: return(1);
case SECTOREFFECTOR__STATIC:
return(1);
case TOUCHPLATE__STATIC:
return(1);
case MUSICANDSFX__STATIC:
return(1);
}
return(0);
}
@ -5188,6 +5236,7 @@ void computergetinput(long snum, input *syn)
dist <<= 1;
if (dist < j) { j = dist; goalplayer[snum] = i; }
}
}
@ -5203,11 +5252,16 @@ void computergetinput(long snum, input *syn)
{
switch (dynamictostatic[sprite[j].picnum])
{
case TONGUE__STATIC: k = 4; break;
case FREEZEBLAST__STATIC: k = 4; break;
case SHRINKSPARK__STATIC: k = 16; break;
case RPG__STATIC: k = 16; break;
default: k = 0; break;
case TONGUE__STATIC:
k = 4; break;
case FREEZEBLAST__STATIC:
k = 4; break;
case SHRINKSPARK__STATIC:
k = 16; break;
case RPG__STATIC:
k = 16; break;
default:
k = 0; break;
}
if (k)
{
@ -5372,6 +5426,7 @@ void computergetinput(long snum, input *syn)
dist = ksqrt(dx*dx+dy*dy);
if (dist > l) { l = dist; k = i; }
}
goalwall[snum] = k;
daang = ((getangle(wall[wall[k].point2].x-wall[k].x,wall[wall[k].point2].y-wall[k].y)+1536)&2047);
@ -5413,6 +5468,7 @@ void computergetinput(long snum, input *syn)
dist = ksqrt(dx*dx+dy*dy);
if ((wall[i].nextsector == goalsect[snum]) && (dist > l))
{ l = dist; k = i; }
}
goalwall[snum] = k;
daang = ((getangle(wall[wall[k].point2].x-wall[k].x,wall[wall[k].point2].y-wall[k].y)+1536)&2047);
@ -5440,6 +5496,7 @@ void computergetinput(long snum, input *syn)
if (getspritescore(snum,sprite[j].picnum) <= 0) continue;
if (cansee(x1,y1,z1-(32<<8),damysect,sprite[j].x,sprite[j].y,sprite[j].z-(4<<8),i))
{ goalx[snum] = sprite[j].x; goaly[snum] = sprite[j].y; goalz[snum] = sprite[j].z; goalsprite[snum] = j; break; }
}
}
}

View file

@ -163,16 +163,24 @@ void cachespritenum(short i)
maxc = 5;
break;
// caching of HUD sprites for weapons that may be in the level
case CHAINGUNSPRITE__STATIC: for (j=CHAINGUN; j<=CHAINGUN+7; j++) tloadtile(j,1); break;
case RPGSPRITE__STATIC: for (j=RPGGUN; j<=RPGGUN+2; j++) tloadtile(j,1); break;
case FREEZESPRITE__STATIC: for (j=FREEZE; j<=FREEZE+5; j++) tloadtile(j,1); break;
case CHAINGUNSPRITE__STATIC:
for (j=CHAINGUN; j<=CHAINGUN+7; j++) tloadtile(j,1); break;
case RPGSPRITE__STATIC:
for (j=RPGGUN; j<=RPGGUN+2; j++) tloadtile(j,1); break;
case FREEZESPRITE__STATIC:
for (j=FREEZE; j<=FREEZE+5; j++) tloadtile(j,1); break;
case GROWSPRITEICON__STATIC:
case SHRINKERSPRITE__STATIC: for (j=SHRINKER-2; j<=SHRINKER+5; j++) tloadtile(j,1); break;
case SHRINKERSPRITE__STATIC:
for (j=SHRINKER-2; j<=SHRINKER+5; j++) tloadtile(j,1); break;
case HBOMBAMMO__STATIC:
case HEAVYHBOMB__STATIC: for (j=HANDREMOTE; j<=HANDREMOTE+5; j++) tloadtile(j,1); break;
case TRIPBOMBSPRITE__STATIC: for (j=HANDHOLDINGLASER; j<=HANDHOLDINGLASER+4; j++) tloadtile(j,1); break;
case SHOTGUNSPRITE__STATIC: tloadtile(SHOTGUNSHELL,1); for (j=SHOTGUN; j<=SHOTGUN+6; j++) tloadtile(j,1); break;
case DEVISTATORSPRITE__STATIC: for (j=DEVISTATOR; j<=DEVISTATOR+1; j++) tloadtile(j,1); break;
case HEAVYHBOMB__STATIC:
for (j=HANDREMOTE; j<=HANDREMOTE+5; j++) tloadtile(j,1); break;
case TRIPBOMBSPRITE__STATIC:
for (j=HANDHOLDINGLASER; j<=HANDHOLDINGLASER+4; j++) tloadtile(j,1); break;
case SHOTGUNSPRITE__STATIC:
tloadtile(SHOTGUNSHELL,1); for (j=SHOTGUN; j<=SHOTGUN+6; j++) tloadtile(j,1); break;
case DEVISTATORSPRITE__STATIC:
for (j=DEVISTATOR; j<=DEVISTATOR+1; j++) tloadtile(j,1); break;
}
@ -1252,8 +1260,10 @@ void resetpspritevars(char g)
{
switch (ud.pteam[j])
{
case 0: k = 3; break;
case 1: k = 21; break;
case 0:
k = 3; break;
case 1:
k = 21; break;
}
ps[j].team = ud.pteam[j];
}
@ -1369,6 +1379,7 @@ void waitforeverybody()
{
if (playerreadyflag[i] < playerreadyflag[myconnectindex]) break;
if ((!networkmode) && (myconnectindex != connecthead)) { i = -1; break; } //slaves in M/S mode only wait for master
}
if (i < 0) return;
}

View file

@ -2283,12 +2283,18 @@ void checkhitsprite(short i,short sn)
case PIPE6__STATIC:
switch (dynamictostatic[PN])
{
case PIPE1__STATIC:PN=PIPE1B;break;
case PIPE2__STATIC:PN=PIPE2B;break;
case PIPE3__STATIC:PN=PIPE3B;break;
case PIPE4__STATIC:PN=PIPE4B;break;
case PIPE5__STATIC:PN=PIPE5B;break;
case PIPE6__STATIC:PN=PIPE6B;break;
case PIPE1__STATIC:
PN=PIPE1B;break;
case PIPE2__STATIC:
PN=PIPE2B;break;
case PIPE3__STATIC:
PN=PIPE3B;break;
case PIPE4__STATIC:
PN=PIPE4B;break;
case PIPE5__STATIC:
PN=PIPE5B;break;
case PIPE6__STATIC:
PN=PIPE6B;break;
}
j = spawn(i,STEAM);
@ -2576,11 +2582,16 @@ void cheatkeys(short snum)
{
switch (p->inven_icon)
{
case 4: sb_snum |= (1<<25);break;
case 3: sb_snum |= (1<<24);break;
case 5: sb_snum |= (1<<15);break;
case 1: sb_snum |= (1<<16);break;
case 2: sb_snum |= (1<<12);break;
case 4:
sb_snum |= (1<<25);break;
case 3:
sb_snum |= (1<<24);break;
case 5:
sb_snum |= (1<<15);break;
case 1:
sb_snum |= (1<<16);break;
case 2:
sb_snum |= (1<<12);break;
}
}
}
@ -2704,13 +2715,20 @@ CHECKINV1:
switch (dainv)
{
case 1: FTA(3,p);break;
case 2: FTA(90,p);break;
case 3: FTA(91,p);break;
case 4: FTA(88,p);break;
case 5: FTA(101,p);break;
case 6: FTA(89,p);break;
case 7: FTA(6,p);break;
case 1:
FTA(3,p);break;
case 2:
FTA(90,p);break;
case 3:
FTA(91,p);break;
case 4:
FTA(88,p);break;
case 5:
FTA(101,p);break;
case 6:
FTA(89,p);break;
case 7:
FTA(6,p);break;
}
}

View file

@ -157,10 +157,12 @@ static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
case IDCINPUTJOY:
settings.usejoy = IsDlgButtonChecked(hwndDlg, IDCINPUTJOY) == BST_CHECKED;
return TRUE;
default: break;
default:
break;
}
break;
default: break;
default:
break;
}
return FALSE;
}
@ -181,10 +183,12 @@ static INT_PTR CALLBACK GamePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
}
return TRUE;
}
default: break;
default:
break;
}
break;
default: break;
default:
break;
}
return FALSE;
}
@ -386,7 +390,8 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
if (mode == TAB_CONFIG) done = 0;
else quitevent++;
return TRUE;
case WIN_STARTWIN_START: done = 1; return TRUE;
case WIN_STARTWIN_START:
done = 1; return TRUE;
}
return FALSE;
@ -395,7 +400,8 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
return (BOOL)GetSysColorBrush(COLOR_WINDOW);
break;
default: break;
default:
break;
}
return FALSE;
@ -519,8 +525,10 @@ int startwin_run(void)
while (done < 0) {
switch (GetMessage(&msg, NULL, 0,0)) {
case 0: done = 1; break;
case -1: return -1;
case 0:
done = 1; break;
case -1:
return -1;
default:
if (IsWindow(startupdlg) && IsDialogMessage(startupdlg, &msg)) break;
TranslateMessage(&msg);