mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-23 23:50:40 +00:00
KenBuild: Astyle and Uncrustify all source.
git-svn-id: https://svn.eduke32.com/eduke32@5327 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
8fb903a83a
commit
8f82bc5239
9 changed files with 6777 additions and 6592 deletions
|
@ -4,7 +4,8 @@
|
||||||
#include "baselayer.h"
|
#include "baselayer.h"
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
|
||||||
static struct {
|
static struct
|
||||||
|
{
|
||||||
int fullscreen;
|
int fullscreen;
|
||||||
int xdim3d, ydim3d, bpp3d;
|
int xdim3d, ydim3d, bpp3d;
|
||||||
int forcesetup;
|
int forcesetup;
|
||||||
|
@ -53,13 +54,17 @@ static struct {
|
||||||
int idx3d = -1;
|
int idx3d = -1;
|
||||||
int xdim, ydim, bpp;
|
int xdim, ydim, bpp;
|
||||||
|
|
||||||
if (firstTime) {
|
if (firstTime)
|
||||||
|
{
|
||||||
xdim = settings.xdim3d;
|
xdim = settings.xdim3d;
|
||||||
ydim = settings.ydim3d;
|
ydim = settings.ydim3d;
|
||||||
bpp = settings.bpp3d;
|
bpp = settings.bpp3d;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
mode3d = [[modeslist3d objectAtIndex:[videoMode3DPUButton indexOfSelectedItem]] intValue];
|
mode3d = [[modeslist3d objectAtIndex:[videoMode3DPUButton indexOfSelectedItem]] intValue];
|
||||||
if (mode3d >= 0) {
|
if (mode3d >= 0)
|
||||||
|
{
|
||||||
xdim = validmode[mode3d].xdim;
|
xdim = validmode[mode3d].xdim;
|
||||||
ydim = validmode[mode3d].ydim;
|
ydim = validmode[mode3d].ydim;
|
||||||
bpp = validmode[mode3d].bpp;
|
bpp = validmode[mode3d].bpp;
|
||||||
|
@ -67,10 +72,12 @@ static struct {
|
||||||
|
|
||||||
}
|
}
|
||||||
mode3d = checkvideomode(&xdim, &ydim, bpp, fullscreen, 1);
|
mode3d = checkvideomode(&xdim, &ydim, bpp, fullscreen, 1);
|
||||||
if (mode3d < 0) {
|
if (mode3d < 0)
|
||||||
|
{
|
||||||
int i, cd[] = { 32, 24, 16, 15, 8, 0 };
|
int i, cd[] = { 32, 24, 16, 15, 8, 0 };
|
||||||
for (i=0; cd[i]; ) { if (cd[i] >= bpp) i++; else break; }
|
for (i=0; cd[i]; ) { if (cd[i] >= bpp) i++; else break; }
|
||||||
for ( ; cd[i]; i++) {
|
for (; cd[i]; i++)
|
||||||
|
{
|
||||||
mode3d = checkvideomode(&xdim, &ydim, cd[i], fullscreen, 1);
|
mode3d = checkvideomode(&xdim, &ydim, cd[i], fullscreen, 1);
|
||||||
if (mode3d < 0) continue;
|
if (mode3d < 0) continue;
|
||||||
break;
|
break;
|
||||||
|
@ -82,8 +89,10 @@ static struct {
|
||||||
|
|
||||||
modeslist3d = [[NSMutableArray alloc] init];
|
modeslist3d = [[NSMutableArray alloc] init];
|
||||||
|
|
||||||
for (i = 0; i < validmodecnt; i++) {
|
for (i = 0; i < validmodecnt; i++)
|
||||||
if (fullscreen == validmode[i].fs) {
|
{
|
||||||
|
if (fullscreen == validmode[i].fs)
|
||||||
|
{
|
||||||
if (i == mode3d) idx3d = [modeslist3d count];
|
if (i == mode3d) idx3d = [modeslist3d count];
|
||||||
[modeslist3d addObject:[NSNumber numberWithInt:i]];
|
[modeslist3d addObject:[NSNumber numberWithInt:i]];
|
||||||
[videoMode3DPUButton addItemWithTitle:[NSString stringWithFormat:@"%d %C %d %d-bpp",
|
[videoMode3DPUButton addItemWithTitle:[NSString stringWithFormat:@"%d %C %d %d-bpp",
|
||||||
|
@ -111,7 +120,8 @@ static struct {
|
||||||
- (IBAction)start:(id)sender
|
- (IBAction)start:(id)sender
|
||||||
{
|
{
|
||||||
int mode = [[modeslist3d objectAtIndex:[videoMode3DPUButton indexOfSelectedItem]] intValue];
|
int mode = [[modeslist3d objectAtIndex:[videoMode3DPUButton indexOfSelectedItem]] intValue];
|
||||||
if (mode >= 0) {
|
if (mode >= 0)
|
||||||
|
{
|
||||||
settings.xdim3d = validmode[mode].xdim;
|
settings.xdim3d = validmode[mode].xdim;
|
||||||
settings.ydim3d = validmode[mode].ydim;
|
settings.ydim3d = validmode[mode].ydim;
|
||||||
settings.bpp3d = validmode[mode].bpp;
|
settings.bpp3d = validmode[mode].bpp;
|
||||||
|
@ -151,7 +161,8 @@ static struct {
|
||||||
// user can enable it if they want to while waiting for something else to happen
|
// user can enable it if they want to while waiting for something else to happen
|
||||||
NSEnumerator *enumerator = [[[[tabView tabViewItemAtIndex:0] view] subviews] objectEnumerator];
|
NSEnumerator *enumerator = [[[[tabView tabViewItemAtIndex:0] view] subviews] objectEnumerator];
|
||||||
NSControl *control;
|
NSControl *control;
|
||||||
while (control = [enumerator nextObject]) {
|
while (control = [enumerator nextObject])
|
||||||
|
{
|
||||||
if (control == alwaysShowButton) continue;
|
if (control == alwaysShowButton) continue;
|
||||||
[control setEnabled:false];
|
[control setEnabled:false];
|
||||||
}
|
}
|
||||||
|
@ -175,7 +186,8 @@ static struct {
|
||||||
[messagesView replaceCharactersInRange:end withString:str];
|
[messagesView replaceCharactersInRange:end withString:str];
|
||||||
[text endEditing];
|
[text endEditing];
|
||||||
|
|
||||||
if (shouldAutoScroll) {
|
if (shouldAutoScroll)
|
||||||
|
{
|
||||||
end.location = [text length];
|
end.location = [text length];
|
||||||
end.length = 0;
|
end.length = 0;
|
||||||
[messagesView scrollRangeToVisible:end];
|
[messagesView scrollRangeToVisible:end];
|
||||||
|
@ -265,7 +277,8 @@ int startwin_run(void)
|
||||||
|
|
||||||
[startwin setupRunMode];
|
[startwin setupRunMode];
|
||||||
|
|
||||||
switch ([NSApp runModalForWindow:[startwin window]]) {
|
switch ([NSApp runModalForWindow:[startwin window]])
|
||||||
|
{
|
||||||
case NSRunStoppedResponse: retval = 1; break;
|
case NSRunStoppedResponse: retval = 1; break;
|
||||||
case NSRunAbortedResponse: retval = 0; break;
|
case NSRunAbortedResponse: retval = 0; break;
|
||||||
default: retval = -1;
|
default: retval = -1;
|
||||||
|
@ -273,7 +286,8 @@ int startwin_run(void)
|
||||||
|
|
||||||
[startwin setupMessagesMode];
|
[startwin setupMessagesMode];
|
||||||
|
|
||||||
if (retval) {
|
if (retval)
|
||||||
|
{
|
||||||
fullscreen = settings.fullscreen;
|
fullscreen = settings.fullscreen;
|
||||||
xdimgame = settings.xdim3d;
|
xdimgame = settings.xdim3d;
|
||||||
ydimgame = settings.ydim3d;
|
ydimgame = settings.ydim3d;
|
||||||
|
|
|
@ -172,9 +172,12 @@ void ExtPreCheckKeys(void)
|
||||||
keystatus[0x3e] = 0;
|
keystatus[0x3e] = 0;
|
||||||
|
|
||||||
//cycle through all vesa modes, then screen-buffer mode
|
//cycle through all vesa modes, then screen-buffer mode
|
||||||
if (keystatus[0x2a]|keystatus[0x36]) {
|
if (keystatus[0x2a]|keystatus[0x36])
|
||||||
|
{
|
||||||
setgamemode(!fullscreen, xdim, ydim, bpp);
|
setgamemode(!fullscreen, xdim, ydim, bpp);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
//cycle through all modes
|
//cycle through all modes
|
||||||
j=-1;
|
j=-1;
|
||||||
|
@ -191,7 +194,8 @@ void ExtPreCheckKeys(void)
|
||||||
if (validmode[k].fs == fullscreen && validmode[k].bpp == bpp) break;
|
if (validmode[k].fs == fullscreen && validmode[k].bpp == bpp) break;
|
||||||
|
|
||||||
if (j==-1) j=k;
|
if (j==-1) j=k;
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
j++;
|
j++;
|
||||||
if (j==validmodecnt) j=k;
|
if (j==validmodecnt) j=k;
|
||||||
}
|
}
|
||||||
|
@ -279,8 +283,10 @@ void ExtAnalyzeSprites(int32_t ourx, int32_t oury, int32_t oura, int32_t smoothr
|
||||||
switch (tspr->picnum)
|
switch (tspr->picnum)
|
||||||
{
|
{
|
||||||
case PLAYER:
|
case PLAYER:
|
||||||
if (!voxoff[ tiletovox[PLAYER] ][0]) {
|
if (!voxoff[tiletovox[PLAYER]][0])
|
||||||
if (qloadkvx(tiletovox[PLAYER],"voxel000.kvx")) {
|
{
|
||||||
|
if (qloadkvx(tiletovox[PLAYER],"voxel000.kvx"))
|
||||||
|
{
|
||||||
tiletovox[PLAYER] = -1;
|
tiletovox[PLAYER] = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -292,8 +298,10 @@ void ExtAnalyzeSprites(int32_t ourx, int32_t oury, int32_t oura, int32_t smoothr
|
||||||
tspr->shade -= 6;
|
tspr->shade -= 6;
|
||||||
break;
|
break;
|
||||||
case BROWNMONSTER:
|
case BROWNMONSTER:
|
||||||
if (!voxoff[ tiletovox[BROWNMONSTER] ][0]) {
|
if (!voxoff[tiletovox[BROWNMONSTER]][0])
|
||||||
if (qloadkvx(tiletovox[BROWNMONSTER],"voxel001.kvx")) {
|
{
|
||||||
|
if (qloadkvx(tiletovox[BROWNMONSTER],"voxel001.kvx"))
|
||||||
|
{
|
||||||
tiletovox[BROWNMONSTER] = -1;
|
tiletovox[BROWNMONSTER] = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -413,7 +421,7 @@ const char *ExtGetSectorCaption(short sectnum)
|
||||||
Bsprintf((char *)tempbuf,"%hu,%hu",(unsigned short)sector[sectnum].hitag,
|
Bsprintf((char *)tempbuf,"%hu,%hu",(unsigned short)sector[sectnum].hitag,
|
||||||
(unsigned short)sector[sectnum].lotag);
|
(unsigned short)sector[sectnum].lotag);
|
||||||
}
|
}
|
||||||
return((char *)tempbuf);
|
return (char *)tempbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *ExtGetWallCaption(short wallnum)
|
const char *ExtGetWallCaption(short wallnum)
|
||||||
|
@ -427,7 +435,7 @@ const char *ExtGetWallCaption(short wallnum)
|
||||||
Bsprintf((char *)tempbuf,"%hu,%hu",(unsigned short)wall[wallnum].hitag,
|
Bsprintf((char *)tempbuf,"%hu,%hu",(unsigned short)wall[wallnum].hitag,
|
||||||
(unsigned short)wall[wallnum].lotag);
|
(unsigned short)wall[wallnum].lotag);
|
||||||
}
|
}
|
||||||
return((char *)tempbuf);
|
return (char *)tempbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *ExtGetSpriteCaption(short spritenum)
|
const char *ExtGetSpriteCaption(short spritenum)
|
||||||
|
@ -441,7 +449,7 @@ const char *ExtGetSpriteCaption(short spritenum)
|
||||||
Bsprintf((char *)tempbuf,"%hu,%hu",(unsigned short)sprite[spritenum].hitag,
|
Bsprintf((char *)tempbuf,"%hu,%hu",(unsigned short)sprite[spritenum].hitag,
|
||||||
(unsigned short)sprite[spritenum].lotag);
|
(unsigned short)sprite[spritenum].lotag);
|
||||||
}
|
}
|
||||||
return((char *)tempbuf);
|
return (char *)tempbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
//printext16 parameters:
|
//printext16 parameters:
|
||||||
|
@ -590,6 +598,7 @@ void faketimerhandler(void)
|
||||||
void M32RunScript(const char *s) { UNREFERENCED_PARAMETER(s); }
|
void M32RunScript(const char *s) { UNREFERENCED_PARAMETER(s); }
|
||||||
void G_Polymer_UnInit(void) { }
|
void G_Polymer_UnInit(void) { }
|
||||||
void SetGamePalette(int32_t j) { UNREFERENCED_PARAMETER(j); }
|
void SetGamePalette(int32_t j) { UNREFERENCED_PARAMETER(j); }
|
||||||
|
|
||||||
int32_t AmbienceToggle, MixRate, ParentalLock;
|
int32_t AmbienceToggle, MixRate, ParentalLock;
|
||||||
|
|
||||||
int32_t taglab_linktags(int32_t spritep, int32_t num)
|
int32_t taglab_linktags(int32_t spritep, int32_t num)
|
||||||
|
@ -643,16 +652,30 @@ int32_t taglab_getnextfreetag(int32_t *duetoptr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t S_InvalidSound(int32_t num) { UNREFERENCED_PARAMETER(num); return 1; };
|
int32_t S_InvalidSound(int32_t num) {
|
||||||
int32_t S_CheckSoundPlaying(int32_t i, int32_t num) { UNREFERENCED_PARAMETER(i); UNREFERENCED_PARAMETER(num); return 0; };
|
UNREFERENCED_PARAMETER(num); return 1;
|
||||||
int32_t S_SoundsPlaying(int32_t i) { UNREFERENCED_PARAMETER(i); return -1; }
|
};
|
||||||
int32_t S_SoundFlags(int32_t num) { UNREFERENCED_PARAMETER(num); return 0; };
|
int32_t S_CheckSoundPlaying(int32_t i, int32_t num) {
|
||||||
int32_t A_PlaySound(uint32_t num, int32_t i) { UNREFERENCED_PARAMETER(num); UNREFERENCED_PARAMETER(i); return 0; };
|
UNREFERENCED_PARAMETER(i); UNREFERENCED_PARAMETER(num); return 0;
|
||||||
void S_StopSound(int32_t num) { UNREFERENCED_PARAMETER(num); };
|
};
|
||||||
|
int32_t S_SoundsPlaying(int32_t i) {
|
||||||
|
UNREFERENCED_PARAMETER(i); return -1;
|
||||||
|
}
|
||||||
|
int32_t S_SoundFlags(int32_t num) {
|
||||||
|
UNREFERENCED_PARAMETER(num); return 0;
|
||||||
|
};
|
||||||
|
int32_t A_PlaySound(uint32_t num, int32_t i) {
|
||||||
|
UNREFERENCED_PARAMETER(num); UNREFERENCED_PARAMETER(i); return 0;
|
||||||
|
};
|
||||||
|
void S_StopSound(int32_t num) {
|
||||||
|
UNREFERENCED_PARAMETER(num);
|
||||||
|
};
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
#endif
|
#endif
|
||||||
int32_t FX_StopAllSounds(void) { return 0; };
|
int32_t FX_StopAllSounds(void) {
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
//Just thought you might want my getnumber16 code
|
//Just thought you might want my getnumber16 code
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -26,7 +26,8 @@ const char *G_DefFile(void)
|
||||||
return defaultdeffilename;
|
return defaultdeffilename;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *basepaltable[1] = {
|
uint8_t *basepaltable[1] =
|
||||||
|
{
|
||||||
palette
|
palette
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ static int readconfig(BFILE *fp, const char *key, char *value, unsigned len)
|
||||||
|
|
||||||
Brewind(fp);
|
Brewind(fp);
|
||||||
|
|
||||||
while (1) {
|
while (1)
|
||||||
|
{
|
||||||
if (!Bfgets(buf, 1000, fp)) return 0;
|
if (!Bfgets(buf, 1000, fp)) return 0;
|
||||||
|
|
||||||
if (buf[0] == ';') continue;
|
if (buf[0] == ';') continue;
|
||||||
|
@ -108,7 +109,8 @@ int loadsetup(const char *fn)
|
||||||
|
|
||||||
if (readconfig(fp, "forcesetup", val, VL) > 0) { if (Batoi(val) != 0) forcesetup = 1; else forcesetup = 0; }
|
if (readconfig(fp, "forcesetup", val, VL) > 0) { if (Batoi(val) != 0) forcesetup = 1; else forcesetup = 0; }
|
||||||
if (readconfig(fp, "fullscreen", val, VL) > 0) { if (Batoi(val) != 0) fullscreen = 1; else fullscreen = 0; }
|
if (readconfig(fp, "fullscreen", val, VL) > 0) { if (Batoi(val) != 0) fullscreen = 1; else fullscreen = 0; }
|
||||||
if (readconfig(fp, "resolution", val, VL) > 0) {
|
if (readconfig(fp, "resolution", val, VL) > 0)
|
||||||
|
{
|
||||||
i = Batoi(val) & 0x0f;
|
i = Batoi(val) & 0x0f;
|
||||||
if ((unsigned)i<13) { xdimgame = xdim2d = vesares[i][0]; ydimgame = ydim2d = vesares[i][1]; }
|
if ((unsigned)i<13) { xdimgame = xdim2d = vesares[i][0]; ydimgame = ydim2d = vesares[i][1]; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,7 +377,8 @@ static int osdcmd_vidmode(const osdfuncparm_t *parm)
|
||||||
|
|
||||||
if (parm->numparms < 1 || parm->numparms > 4) return OSDCMD_SHOWHELP;
|
if (parm->numparms < 1 || parm->numparms > 4) return OSDCMD_SHOWHELP;
|
||||||
|
|
||||||
switch (parm->numparms) {
|
switch (parm->numparms)
|
||||||
|
{
|
||||||
case 1: // bpp switch
|
case 1: // bpp switch
|
||||||
newbpp = Batol(parm->parms[0]);
|
newbpp = Batol(parm->parms[0]);
|
||||||
break;
|
break;
|
||||||
|
@ -401,7 +402,8 @@ static int osdcmd_vidmode(const osdfuncparm_t *parm)
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int osdcmd_map(const osdfuncparm_t *parm) {
|
static int osdcmd_map(const osdfuncparm_t *parm)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
char *dot, namebuf[BMAX_PATH+1];
|
char *dot, namebuf[BMAX_PATH+1];
|
||||||
|
|
||||||
|
@ -410,7 +412,8 @@ static int osdcmd_map(const osdfuncparm_t *parm) {
|
||||||
strncpy(namebuf, parm->parms[0], BMAX_PATH);
|
strncpy(namebuf, parm->parms[0], BMAX_PATH);
|
||||||
namebuf[BMAX_PATH] = 0;
|
namebuf[BMAX_PATH] = 0;
|
||||||
dot = strrchr(namebuf, '.');
|
dot = strrchr(namebuf, '.');
|
||||||
if ((!dot || Bstrcasecmp(dot, ".map")) && strlen(namebuf) <= BMAX_PATH-4) {
|
if ((!dot || Bstrcasecmp(dot, ".map")) && strlen(namebuf) <= BMAX_PATH-4)
|
||||||
|
{
|
||||||
strcat(namebuf, ".map");
|
strcat(namebuf, ".map");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,22 +463,28 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
|
|
||||||
Bstrcpy(boardfilename, "nukeland.map");
|
Bstrcpy(boardfilename, "nukeland.map");
|
||||||
j = 0; netparm = argc;
|
j = 0; netparm = argc;
|
||||||
for (i=1;i<argc;i++) {
|
for (i=1; i<argc; i++)
|
||||||
|
{
|
||||||
if ((!Bstrcasecmp("-net",argv[i])) || (!Bstrcasecmp("/net",argv[i]))) { j = 1; netparm = i; continue; }
|
if ((!Bstrcasecmp("-net",argv[i])) || (!Bstrcasecmp("/net",argv[i]))) { j = 1; netparm = i; continue; }
|
||||||
if (j) {
|
if (j)
|
||||||
if (argv[i][0] == '-' || argv[i][0] == '/') {
|
{
|
||||||
|
if (argv[i][0] == '-' || argv[i][0] == '/')
|
||||||
|
{
|
||||||
if (((argv[i][1] == 'n') || (argv[i][1] == 'N')) && (argv[i][2] == '0')) { networkmode = 0; continue; }
|
if (((argv[i][1] == 'n') || (argv[i][1] == 'N')) && (argv[i][2] == '0')) { networkmode = 0; continue; }
|
||||||
if (((argv[i][1] == 'n') || (argv[i][1] == 'N')) && (argv[i][2] == '1')) { networkmode = 1; continue; }
|
if (((argv[i][1] == 'n') || (argv[i][1] == 'N')) && (argv[i][2] == '1')) { networkmode = 1; continue; }
|
||||||
}
|
}
|
||||||
if (isvalidipaddress(argv[i])) continue;
|
if (isvalidipaddress(argv[i])) continue;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (!Bstrcasecmp(argv[i], "-setup"))
|
if (!Bstrcasecmp(argv[i], "-setup"))
|
||||||
{
|
{
|
||||||
#if defined STARTUP_SETUP_WINDOW
|
#if defined STARTUP_SETUP_WINDOW
|
||||||
cmdsetup = 1;
|
cmdsetup = 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
Bstrcpy(boardfilename, argv[i]);
|
Bstrcpy(boardfilename, argv[i]);
|
||||||
if (!Bstrrchr(boardfilename,'.')) Bstrcat(boardfilename,".map");
|
if (!Bstrrchr(boardfilename,'.')) Bstrcat(boardfilename,".map");
|
||||||
}
|
}
|
||||||
|
@ -486,14 +495,16 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
buildputs("Configuration file not found, using defaults.\n");
|
buildputs("Configuration file not found, using defaults.\n");
|
||||||
|
|
||||||
#if defined STARTUP_SETUP_WINDOW
|
#if defined STARTUP_SETUP_WINDOW
|
||||||
if (i || forcesetup || cmdsetup) {
|
if (i || forcesetup || cmdsetup)
|
||||||
|
{
|
||||||
if (quitevent || !startwin_run()) return -1;
|
if (quitevent || !startwin_run()) return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
writesetup(setupfilename);
|
writesetup(setupfilename);
|
||||||
|
|
||||||
initgroupfile(G_GrpFile());
|
initgroupfile(G_GrpFile());
|
||||||
if (initengine()) {
|
if (initengine())
|
||||||
|
{
|
||||||
buildprintf("There was a problem initialising the engine: %s.\n", engineerrstr);
|
buildprintf("There was a problem initialising the engine: %s.\n", engineerrstr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -508,11 +519,14 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
inittimer(TIMERINTSPERSECOND);
|
inittimer(TIMERINTSPERSECOND);
|
||||||
|
|
||||||
//initmultiplayers(argc-netparm,&argv[netparm],option[4],option[5],0);
|
//initmultiplayers(argc-netparm,&argv[netparm],option[4],option[5],0);
|
||||||
if (initmultiplayersparms(argc-netparm,&argv[netparm])) {
|
if (initmultiplayersparms(argc-netparm,&argv[netparm]))
|
||||||
|
{
|
||||||
buildputs("Waiting for players...\n");
|
buildputs("Waiting for players...\n");
|
||||||
while (initmultiplayerscycle()) {
|
while (initmultiplayerscycle())
|
||||||
|
{
|
||||||
handleevents();
|
handleevents();
|
||||||
if (quitevent) {
|
if (quitevent)
|
||||||
|
{
|
||||||
sendlogoff(); //Signing off
|
sendlogoff(); //Signing off
|
||||||
musicoff();
|
musicoff();
|
||||||
uninitmultiplayers();
|
uninitmultiplayers();
|
||||||
|
@ -593,8 +607,10 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
if (packbuf[0] == 255)
|
if (packbuf[0] == 255)
|
||||||
keystatus[1] = 1;
|
keystatus[1] = 1;
|
||||||
|
|
||||||
if (handleevents()) {
|
if (handleevents())
|
||||||
if (quitevent) {
|
{
|
||||||
|
if (quitevent)
|
||||||
|
{
|
||||||
keystatus[1] = 1;
|
keystatus[1] = 1;
|
||||||
quitevent = 0;
|
quitevent = 0;
|
||||||
}
|
}
|
||||||
|
@ -631,7 +647,8 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (j == 1) Bstrcat(getmessage," (Master)");
|
if (j == 1) Bstrcat(getmessage," (Master)");
|
||||||
else Bstrcat(getmessage," (Slave)");
|
else Bstrcat(getmessage," (Slave)");
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
Bstrcat(getmessage," (Even)");
|
Bstrcat(getmessage," (Even)");
|
||||||
getmessageleng = Bstrlen(getmessage);
|
getmessageleng = Bstrlen(getmessage);
|
||||||
getmessagetimeoff = totalclock+120;
|
getmessagetimeoff = totalclock+120;
|
||||||
|
@ -649,8 +666,10 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
|
|
||||||
while (!keystatus[1]) //Main loop starts here
|
while (!keystatus[1]) //Main loop starts here
|
||||||
{
|
{
|
||||||
if (handleevents()) {
|
if (handleevents())
|
||||||
if (quitevent) {
|
{
|
||||||
|
if (quitevent)
|
||||||
|
{
|
||||||
keystatus[1] = 1;
|
keystatus[1] = 1;
|
||||||
quitevent = 0;
|
quitevent = 0;
|
||||||
}
|
}
|
||||||
|
@ -727,11 +746,12 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
uninitsb();
|
uninitsb();
|
||||||
uninitgroupfile();
|
uninitgroupfile();
|
||||||
|
|
||||||
return(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operatesector(short dasector)
|
void operatesector(short dasector)
|
||||||
{ //Door code
|
{
|
||||||
|
//Door code
|
||||||
int i, j, /*k, s, nexti, good, cnt,*/ datag;
|
int i, j, /*k, s, nexti, good, cnt,*/ datag;
|
||||||
int /*dax, day,*/ daz, dax2, day2, /*daz2,*/ centx, centy;
|
int /*dax, day,*/ daz, dax2, day2, /*daz2,*/ centx, centy;
|
||||||
short startwall, endwall, wallfind[2];
|
short startwall, endwall, wallfind[2];
|
||||||
|
@ -923,7 +943,8 @@ void operatesector(short dasector)
|
||||||
for (j=0; j<2; j++)
|
for (j=0; j<2; j++)
|
||||||
{
|
{
|
||||||
if ((((wall[wallfind[j]].x+wall[wall[wallfind[j]].point2].x)>>1) == centx) && (((wall[wallfind[j]].y+wall[wall[wallfind[j]].point2].y)>>1) == centy))
|
if ((((wall[wallfind[j]].x+wall[wall[wallfind[j]].point2].x)>>1) == centx) && (((wall[wallfind[j]].y+wall[wall[wallfind[j]].point2].y)>>1) == centy))
|
||||||
{ //door was closed
|
{
|
||||||
|
//door was closed
|
||||||
//find what direction door should open
|
//find what direction door should open
|
||||||
i = wallfind[j]-1; if (i < startwall) i = endwall-1;
|
i = wallfind[j]-1; if (i < startwall) i = endwall-1;
|
||||||
dax2 = wall[i].x-wall[wallfind[j]].x;
|
dax2 = wall[i].x-wall[wallfind[j]].x;
|
||||||
|
@ -948,7 +969,8 @@ void operatesector(short dasector)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //door was not closed
|
{
|
||||||
|
//door was not closed
|
||||||
i = wallfind[j]-1; if (i < startwall) i = endwall-1;
|
i = wallfind[j]-1; if (i < startwall) i = endwall-1;
|
||||||
dax2 = wall[i].x-wall[wallfind[j]].x;
|
dax2 = wall[i].x-wall[wallfind[j]].x;
|
||||||
day2 = wall[i].y-wall[wallfind[j]].y;
|
day2 = wall[i].y-wall[wallfind[j]].y;
|
||||||
|
@ -1014,60 +1036,72 @@ int changehealth(short snum, short deltahealth)
|
||||||
printext((xdim>>1)-(Bstrlen((char *)tempbuf)<<2),ydim-24,(char *)tempbuf,ALPHABET /*,80*/);
|
printext((xdim>>1)-(Bstrlen((char *)tempbuf)<<2),ydim-24,(char *)tempbuf,ALPHABET /*,80*/);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(health[snum] <= 0); //You were just injured
|
return health[snum] <= 0; //You were just injured
|
||||||
}
|
}
|
||||||
|
|
||||||
void changenumbombs(short snum, short deltanumbombs) { // Andy did this
|
void changenumbombs(short snum, short deltanumbombs) // Andy did this
|
||||||
|
{
|
||||||
numbombs[snum] += deltanumbombs;
|
numbombs[snum] += deltanumbombs;
|
||||||
if (numbombs[snum] > 999) numbombs[snum] = 999;
|
if (numbombs[snum] > 999) numbombs[snum] = 999;
|
||||||
if (numbombs[snum] <= 0) {
|
if (numbombs[snum] <= 0)
|
||||||
|
{
|
||||||
wsayfollow("doh.wav",4096L+(krand()&127)-64,256L,&pos[snum].x,&pos[snum].y,1);
|
wsayfollow("doh.wav",4096L+(krand()&127)-64,256L,&pos[snum].x,&pos[snum].y,1);
|
||||||
numbombs[snum] = 0;
|
numbombs[snum] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((snum == screenpeek) && (screensize <= xdim)) {
|
if ((snum == screenpeek) && (screensize <= xdim))
|
||||||
|
{
|
||||||
sprintf((char *)tempbuf,"B:%3d",numbombs[snum]);
|
sprintf((char *)tempbuf,"B:%3d",numbombs[snum]);
|
||||||
printext(8L,(ydim - 28L),(char *)tempbuf,ALPHABET /*,80*/);
|
printext(8L,(ydim - 28L),(char *)tempbuf,ALPHABET /*,80*/);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void changenummissiles(short snum, short deltanummissiles) { // Andy did this
|
void changenummissiles(short snum, short deltanummissiles) // Andy did this
|
||||||
|
{
|
||||||
nummissiles[snum] += deltanummissiles;
|
nummissiles[snum] += deltanummissiles;
|
||||||
if (nummissiles[snum] > 999) nummissiles[snum] = 999;
|
if (nummissiles[snum] > 999) nummissiles[snum] = 999;
|
||||||
if (nummissiles[snum] <= 0) {
|
if (nummissiles[snum] <= 0)
|
||||||
|
{
|
||||||
wsayfollow("doh.wav",4096L+(krand()&127)-64,256L,&pos[snum].x,&pos[snum].y,1);
|
wsayfollow("doh.wav",4096L+(krand()&127)-64,256L,&pos[snum].x,&pos[snum].y,1);
|
||||||
nummissiles[snum] = 0;
|
nummissiles[snum] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((snum == screenpeek) && (screensize <= xdim)) {
|
if ((snum == screenpeek) && (screensize <= xdim))
|
||||||
|
{
|
||||||
sprintf((char *)tempbuf,"M:%3d",nummissiles[snum]);
|
sprintf((char *)tempbuf,"M:%3d",nummissiles[snum]);
|
||||||
printext(8L,(ydim - 20L),(char *)tempbuf,ALPHABET /*,80*/);
|
printext(8L,(ydim - 20L),(char *)tempbuf,ALPHABET /*,80*/);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void changenumgrabbers(short snum, short deltanumgrabbers) { // Andy did this
|
void changenumgrabbers(short snum, short deltanumgrabbers) // Andy did this
|
||||||
|
{
|
||||||
numgrabbers[snum] += deltanumgrabbers;
|
numgrabbers[snum] += deltanumgrabbers;
|
||||||
if (numgrabbers[snum] > 999) numgrabbers[snum] = 999;
|
if (numgrabbers[snum] > 999) numgrabbers[snum] = 999;
|
||||||
if (numgrabbers[snum] <= 0) {
|
if (numgrabbers[snum] <= 0)
|
||||||
|
{
|
||||||
wsayfollow("doh.wav",4096L+(krand()&127)-64,256L,&pos[snum].x,&pos[snum].y,1);
|
wsayfollow("doh.wav",4096L+(krand()&127)-64,256L,&pos[snum].x,&pos[snum].y,1);
|
||||||
numgrabbers[snum] = 0;
|
numgrabbers[snum] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((snum == screenpeek) && (screensize <= xdim)) {
|
if ((snum == screenpeek) && (screensize <= xdim))
|
||||||
|
{
|
||||||
sprintf((char *)tempbuf,"G:%3d",numgrabbers[snum]);
|
sprintf((char *)tempbuf,"G:%3d",numgrabbers[snum]);
|
||||||
printext(8L,(ydim - 12L),(char *)tempbuf,ALPHABET /*,80*/);
|
printext(8L,(ydim - 12L),(char *)tempbuf,ALPHABET /*,80*/);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ostatusflytime = 0x80000000;
|
static int ostatusflytime = 0x80000000;
|
||||||
void drawstatusflytime(short snum) { // Andy did this
|
void drawstatusflytime(short snum) // Andy did this
|
||||||
|
{
|
||||||
int nstatusflytime;
|
int nstatusflytime;
|
||||||
|
|
||||||
if ((snum == screenpeek) && (screensize <= xdim)) {
|
if ((snum == screenpeek) && (screensize <= xdim))
|
||||||
|
{
|
||||||
nstatusflytime = (((flytime[snum] + 119) - lockclock) / 120);
|
nstatusflytime = (((flytime[snum] + 119) - lockclock) / 120);
|
||||||
if (nstatusflytime > 1000) nstatusflytime = 1000;
|
if (nstatusflytime > 1000) nstatusflytime = 1000;
|
||||||
else if (nstatusflytime < 0) nstatusflytime = 0;
|
else if (nstatusflytime < 0) nstatusflytime = 0;
|
||||||
if (nstatusflytime != ostatusflytime) {
|
if (nstatusflytime != ostatusflytime)
|
||||||
|
{
|
||||||
if (nstatusflytime > 999) sprintf((char *)tempbuf,"FT:BIG");
|
if (nstatusflytime > 999) sprintf((char *)tempbuf,"FT:BIG");
|
||||||
else sprintf((char *)tempbuf,"FT:%3d",nstatusflytime);
|
else sprintf((char *)tempbuf,"FT:%3d",nstatusflytime);
|
||||||
printext((xdim - 56L),(ydim - 20L),(char *)tempbuf,ALPHABET /*,80*/);
|
printext((xdim - 56L),(ydim - 20L),(char *)tempbuf,ALPHABET /*,80*/);
|
||||||
|
@ -1076,10 +1110,12 @@ void drawstatusflytime(short snum) { // Andy did this
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawstatusbar(short snum) { // Andy did this
|
void drawstatusbar(short snum) // Andy did this
|
||||||
|
{
|
||||||
int nstatusflytime;
|
int nstatusflytime;
|
||||||
|
|
||||||
if ((snum == screenpeek) && (screensize <= xdim)) {
|
if ((snum == screenpeek) && (screensize <= xdim))
|
||||||
|
{
|
||||||
sprintf((char *)tempbuf,"Deaths:%d",deaths[snum]);
|
sprintf((char *)tempbuf,"Deaths:%d",deaths[snum]);
|
||||||
printext((xdim>>1)-(strlen((char *)tempbuf)<<2),ydim-16,(char *)tempbuf,ALPHABET /*,80*/);
|
printext((xdim>>1)-(strlen((char *)tempbuf)<<2),ydim-16,(char *)tempbuf,ALPHABET /*,80*/);
|
||||||
sprintf((char *)tempbuf,"Health:%3d",health[snum]);
|
sprintf((char *)tempbuf,"Health:%3d",health[snum]);
|
||||||
|
@ -1093,15 +1129,18 @@ void drawstatusbar(short snum) { // Andy did this
|
||||||
printext(8L,(ydim - 12L),(char *)tempbuf,ALPHABET /*,80*/);
|
printext(8L,(ydim - 12L),(char *)tempbuf,ALPHABET /*,80*/);
|
||||||
|
|
||||||
nstatusflytime = (((flytime[snum] + 119) - lockclock) / 120);
|
nstatusflytime = (((flytime[snum] + 119) - lockclock) / 120);
|
||||||
if (nstatusflytime < 0) {
|
if (nstatusflytime < 0)
|
||||||
|
{
|
||||||
sprintf((char *)tempbuf,"FT: 0");
|
sprintf((char *)tempbuf,"FT: 0");
|
||||||
ostatusflytime = 0;
|
ostatusflytime = 0;
|
||||||
}
|
}
|
||||||
else if (nstatusflytime > 999) {
|
else if (nstatusflytime > 999)
|
||||||
|
{
|
||||||
sprintf((char *)tempbuf,"FT:BIG");
|
sprintf((char *)tempbuf,"FT:BIG");
|
||||||
ostatusflytime = 999;
|
ostatusflytime = 999;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprintf((char *)tempbuf,"FT:%3d",nstatusflytime);
|
sprintf((char *)tempbuf,"FT:%3d",nstatusflytime);
|
||||||
ostatusflytime = nstatusflytime;
|
ostatusflytime = nstatusflytime;
|
||||||
}
|
}
|
||||||
|
@ -1136,7 +1175,9 @@ void prepareboard(char *daboardfilename)
|
||||||
uninitgroupfile();
|
uninitgroupfile();
|
||||||
printf("Board not found\n");
|
printf("Board not found\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
char tempfn[BMAX_PATH + 1], *fp;
|
char tempfn[BMAX_PATH + 1], *fp;
|
||||||
|
|
||||||
strncpy(tempfn, daboardfilename, BMAX_PATH);
|
strncpy(tempfn, daboardfilename, BMAX_PATH);
|
||||||
|
@ -1145,7 +1186,8 @@ void prepareboard(char *daboardfilename)
|
||||||
fp = strrchr(tempfn,'.');
|
fp = strrchr(tempfn,'.');
|
||||||
if (fp) *fp = 0;
|
if (fp) *fp = 0;
|
||||||
|
|
||||||
if (strlen(tempfn) <= BMAX_PATH-4) {
|
if (strlen(tempfn) <= BMAX_PATH-4)
|
||||||
|
{
|
||||||
strcat(tempfn,".mhk");
|
strcat(tempfn,".mhk");
|
||||||
loadmaphack(tempfn);
|
loadmaphack(tempfn);
|
||||||
}
|
}
|
||||||
|
@ -1291,7 +1333,8 @@ void prepareboard(char *daboardfilename)
|
||||||
{
|
{
|
||||||
k = wall[wall[wall[wall[j].point2].point2].point2].point2;
|
k = wall[wall[wall[wall[j].point2].point2].point2].point2;
|
||||||
if ((wall[j].x == wall[k].x) && (wall[j].y == wall[k].y))
|
if ((wall[j].x == wall[k].x) && (wall[j].y == wall[k].y))
|
||||||
{ //Door opens counterclockwise
|
{
|
||||||
|
//Door opens counterclockwise
|
||||||
swingwall[swingcnt][0] = j;
|
swingwall[swingcnt][0] = j;
|
||||||
swingwall[swingcnt][1] = wall[j].point2;
|
swingwall[swingcnt][1] = wall[j].point2;
|
||||||
swingwall[swingcnt][2] = wall[wall[j].point2].point2;
|
swingwall[swingcnt][2] = wall[wall[j].point2].point2;
|
||||||
|
@ -1301,7 +1344,8 @@ void prepareboard(char *daboardfilename)
|
||||||
swingangopendir[swingcnt] = -1;
|
swingangopendir[swingcnt] = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //Door opens clockwise
|
{
|
||||||
|
//Door opens clockwise
|
||||||
swingwall[swingcnt][0] = wall[j].point2;
|
swingwall[swingcnt][0] = wall[j].point2;
|
||||||
swingwall[swingcnt][1] = j;
|
swingwall[swingcnt][1] = j;
|
||||||
swingwall[swingcnt][2] = lastwall(j);
|
swingwall[swingcnt][2] = lastwall(j);
|
||||||
|
@ -1584,7 +1628,8 @@ void checktouchsprite(short snum, short sectnum)
|
||||||
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,192L,&sprite[i].x,&sprite[i].y,0);
|
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,192L,&sprite[i].x,&sprite[i].y,0);
|
||||||
changehealth(snum,5);
|
changehealth(snum,5);
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 120*60;
|
sprite[i].extra = 120*60;
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1594,7 +1639,8 @@ void checktouchsprite(short snum, short sectnum)
|
||||||
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
||||||
changehealth(snum,15);
|
changehealth(snum,15);
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 120*120;
|
sprite[i].extra = 120*120;
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1604,7 +1650,8 @@ void checktouchsprite(short snum, short sectnum)
|
||||||
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
||||||
changehealth(snum,25);
|
changehealth(snum,25);
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 120*180;
|
sprite[i].extra = 120*180;
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1614,7 +1661,8 @@ void checktouchsprite(short snum, short sectnum)
|
||||||
wsayfollow("getstuff.wav",4096L+(krand()&127)+256-mulscale4(sprite[i].xrepeat,sprite[i].yrepeat),208L,&sprite[i].x,&sprite[i].y,0);
|
wsayfollow("getstuff.wav",4096L+(krand()&127)+256-mulscale4(sprite[i].xrepeat,sprite[i].yrepeat),208L,&sprite[i].x,&sprite[i].y,0);
|
||||||
changehealth(snum,max(mulscale8(sprite[i].xrepeat,sprite[i].yrepeat),1));
|
changehealth(snum,max(mulscale8(sprite[i].xrepeat,sprite[i].yrepeat),1));
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 90*(sprite[i].xrepeat+sprite[i].yrepeat);
|
sprite[i].extra = 90*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1625,7 +1673,8 @@ void checktouchsprite(short snum, short sectnum)
|
||||||
if (snum == myconnectindex) keystatus[4] = 1;
|
if (snum == myconnectindex) keystatus[4] = 1;
|
||||||
changenumbombs(snum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
changenumbombs(snum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 60*(sprite[i].xrepeat+sprite[i].yrepeat);
|
sprite[i].extra = 60*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1636,7 +1685,8 @@ void checktouchsprite(short snum, short sectnum)
|
||||||
if (snum == myconnectindex) keystatus[5] = 1;
|
if (snum == myconnectindex) keystatus[5] = 1;
|
||||||
changenummissiles(snum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
changenummissiles(snum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 90*(sprite[i].xrepeat+sprite[i].yrepeat);
|
sprite[i].extra = 90*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1647,7 +1697,8 @@ void checktouchsprite(short snum, short sectnum)
|
||||||
if (snum == myconnectindex) keystatus[6] = 1;
|
if (snum == myconnectindex) keystatus[6] = 1;
|
||||||
changenumgrabbers(snum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
changenumgrabbers(snum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 120*(sprite[i].xrepeat+sprite[i].yrepeat);
|
sprite[i].extra = 120*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1659,7 +1710,8 @@ void checktouchsprite(short snum, short sectnum)
|
||||||
flytime[snum] += 60*(sprite[i].xrepeat+sprite[i].yrepeat);
|
flytime[snum] += 60*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
drawstatusflytime(snum);
|
drawstatusflytime(snum);
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 120*(sprite[i].xrepeat+sprite[i].yrepeat);
|
sprite[i].extra = 120*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1690,7 +1742,8 @@ void checkgrabbertouchsprite(short snum, short sectnum) // Andy did this
|
||||||
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,192L,&sprite[i].x,&sprite[i].y,0);
|
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,192L,&sprite[i].x,&sprite[i].y,0);
|
||||||
changehealth(onum,5);
|
changehealth(onum,5);
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 120*60;
|
sprite[i].extra = 120*60;
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1700,7 +1753,8 @@ void checkgrabbertouchsprite(short snum, short sectnum) // Andy did this
|
||||||
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
||||||
changehealth(onum,15);
|
changehealth(onum,15);
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 120*120;
|
sprite[i].extra = 120*120;
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1710,7 +1764,8 @@ void checkgrabbertouchsprite(short snum, short sectnum) // Andy did this
|
||||||
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
wsayfollow("getstuff.wav",4096L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
||||||
changehealth(onum,25);
|
changehealth(onum,25);
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 120*180;
|
sprite[i].extra = 120*180;
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1720,7 +1775,8 @@ void checkgrabbertouchsprite(short snum, short sectnum) // Andy did this
|
||||||
wsayfollow("getstuff.wav",4096L+(krand()&127)+256-mulscale4(sprite[i].xrepeat,sprite[i].yrepeat),208L,&sprite[i].x,&sprite[i].y,0);
|
wsayfollow("getstuff.wav",4096L+(krand()&127)+256-mulscale4(sprite[i].xrepeat,sprite[i].yrepeat),208L,&sprite[i].x,&sprite[i].y,0);
|
||||||
changehealth(onum,max(mulscale8(sprite[i].xrepeat,sprite[i].yrepeat),1));
|
changehealth(onum,max(mulscale8(sprite[i].xrepeat,sprite[i].yrepeat),1));
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 90*(sprite[i].xrepeat+sprite[i].yrepeat);
|
sprite[i].extra = 90*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1731,7 +1787,8 @@ void checkgrabbertouchsprite(short snum, short sectnum) // Andy did this
|
||||||
if (onum == myconnectindex) keystatus[4] = 1;
|
if (onum == myconnectindex) keystatus[4] = 1;
|
||||||
changenumbombs(onum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
changenumbombs(onum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 60*(sprite[i].xrepeat+sprite[i].yrepeat);
|
sprite[i].extra = 60*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1742,7 +1799,8 @@ void checkgrabbertouchsprite(short snum, short sectnum) // Andy did this
|
||||||
if (onum == myconnectindex) keystatus[5] = 1;
|
if (onum == myconnectindex) keystatus[5] = 1;
|
||||||
changenummissiles(onum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
changenummissiles(onum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 90*(sprite[i].xrepeat+sprite[i].yrepeat);
|
sprite[i].extra = 90*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1753,7 +1811,8 @@ void checkgrabbertouchsprite(short snum, short sectnum) // Andy did this
|
||||||
if (onum == myconnectindex) keystatus[6] = 1;
|
if (onum == myconnectindex) keystatus[6] = 1;
|
||||||
changenumgrabbers(onum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
changenumgrabbers(onum,((sprite[i].xrepeat+sprite[i].yrepeat)>>1));
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 120*(sprite[i].xrepeat+sprite[i].yrepeat);
|
sprite[i].extra = 120*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1765,7 +1824,8 @@ void checkgrabbertouchsprite(short snum, short sectnum) // Andy did this
|
||||||
flytime[onum] += 60*(sprite[i].xrepeat+sprite[i].yrepeat);
|
flytime[onum] += 60*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
drawstatusflytime(onum);
|
drawstatusflytime(onum);
|
||||||
if (sprite[i].statnum == 12) deletesprite((short)i);
|
if (sprite[i].statnum == 12) deletesprite((short)i);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
sprite[i].cstat |= 0x8000;
|
sprite[i].cstat |= 0x8000;
|
||||||
sprite[i].extra = 120*(sprite[i].xrepeat+sprite[i].yrepeat);
|
sprite[i].extra = 120*(sprite[i].xrepeat+sprite[i].yrepeat);
|
||||||
changespritestat((short)i,11);
|
changespritestat((short)i,11);
|
||||||
|
@ -1801,7 +1861,8 @@ void shootgun(short snum, const vec3_t *vector,
|
||||||
wsayfollow("hello.wav",4096L+(krand()&127)-64,256L,&wall[hitinfo.wall].x,&wall[hitinfo.wall].y,0);
|
wsayfollow("hello.wav",4096L+(krand()&127)-64,256L,&wall[hitinfo.wall].x,&wall[hitinfo.wall].y,0);
|
||||||
}
|
}
|
||||||
else if (((hitinfo.wall < 0) && (hitinfo.sprite < 0) && (hitinfo.pos.z >= vector->z) && ((sector[hitinfo.sect].floorpicnum == SLIME) || (sector[hitinfo.sect].floorpicnum == FLOORMIRROR))) || ((hitinfo.wall >= 0) && (wall[hitinfo.wall].picnum == SLIME)))
|
else if (((hitinfo.wall < 0) && (hitinfo.sprite < 0) && (hitinfo.pos.z >= vector->z) && ((sector[hitinfo.sect].floorpicnum == SLIME) || (sector[hitinfo.sect].floorpicnum == FLOORMIRROR))) || ((hitinfo.wall >= 0) && (wall[hitinfo.wall].picnum == SLIME)))
|
||||||
{ //If you shoot slime, make a splash
|
{
|
||||||
|
//If you shoot slime, make a splash
|
||||||
wsayfollow("splash.wav",4096L+(krand()&511)-256,256L,&hitinfo.pos.x,&hitinfo.pos.y,0);
|
wsayfollow("splash.wav",4096L+(krand()&511)-256,256L,&hitinfo.pos.x,&hitinfo.pos.y,0);
|
||||||
spawnsprite(j,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,2,0,0,32,64,64,0,0,SPLASH,daang,
|
spawnsprite(j,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,2,0,0,32,64,64,0,0,SPLASH,daang,
|
||||||
0,0,0,snum+4096,hitinfo.sect,4,63,0,0); //63=time left for splash
|
0,0,0,snum+4096,hitinfo.sect,4,63,0,0); //63=time left for splash
|
||||||
|
@ -2148,7 +2209,8 @@ void tagcode(void)
|
||||||
}
|
}
|
||||||
cnt--;
|
cnt--;
|
||||||
}
|
}
|
||||||
} while ((good == 0) && (cnt > 0));
|
}
|
||||||
|
while ((good == 0) && (cnt > 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2556,25 +2618,31 @@ void statuslistcode(void)
|
||||||
hitobject = 0;
|
hitobject = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sprite[i].picnum == GRABBER) { // Andy did this (& Ken) !Homing!
|
if (sprite[i].picnum == GRABBER) // Andy did this (& Ken) !Homing!
|
||||||
|
{
|
||||||
checkgrabbertouchsprite(i,sprite[i].sectnum);
|
checkgrabbertouchsprite(i,sprite[i].sectnum);
|
||||||
l = 0x7fffffff;
|
l = 0x7fffffff;
|
||||||
for (j = connecthead; j >= 0; j = connectpoint2[j]) // Players
|
for (j = connecthead; j >= 0; j = connectpoint2[j]) // Players
|
||||||
if (j != (sprite[i].owner & (MAXSPRITES - 1)))
|
if (j != (sprite[i].owner & (MAXSPRITES - 1)))
|
||||||
if (cansee(sprite[i].x,sprite[i].y,sprite[i].z,sprite[i].sectnum,pos[j].x,pos[j].y,pos[j].z,cursectnum[j])) {
|
if (cansee(sprite[i].x,sprite[i].y,sprite[i].z,sprite[i].sectnum,pos[j].x,pos[j].y,pos[j].z,cursectnum[j]))
|
||||||
|
{
|
||||||
k = ksqrt(sqr(pos[j].x - sprite[i].x) + sqr(pos[j].y - sprite[i].y) + (sqr(pos[j].z - sprite[i].z) >> 8));
|
k = ksqrt(sqr(pos[j].x - sprite[i].x) + sqr(pos[j].y - sprite[i].y) + (sqr(pos[j].z - sprite[i].z) >> 8));
|
||||||
if (k < l) {
|
if (k < l)
|
||||||
|
{
|
||||||
l = k;
|
l = k;
|
||||||
dax = (pos[j].x - sprite[i].x);
|
dax = (pos[j].x - sprite[i].x);
|
||||||
day = (pos[j].y - sprite[i].y);
|
day = (pos[j].y - sprite[i].y);
|
||||||
daz = (pos[j].z - sprite[i].z);
|
daz = (pos[j].z - sprite[i].z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(j = headspritestat[1]; j >= 0; j = nextj) { // Active monsters
|
for (j = headspritestat[1]; j >= 0; j = nextj) // Active monsters
|
||||||
|
{
|
||||||
nextj = nextspritestat[j];
|
nextj = nextspritestat[j];
|
||||||
if (cansee(sprite[i].x,sprite[i].y,sprite[i].z,sprite[i].sectnum,sprite[j].x,sprite[j].y,sprite[j].z,sprite[j].sectnum)) {
|
if (cansee(sprite[i].x,sprite[i].y,sprite[i].z,sprite[i].sectnum,sprite[j].x,sprite[j].y,sprite[j].z,sprite[j].sectnum))
|
||||||
|
{
|
||||||
k = ksqrt(sqr(sprite[j].x - sprite[i].x) + sqr(sprite[j].y - sprite[i].y) + (sqr(sprite[j].z - sprite[i].z) >> 8));
|
k = ksqrt(sqr(sprite[j].x - sprite[i].x) + sqr(sprite[j].y - sprite[i].y) + (sqr(sprite[j].z - sprite[i].z) >> 8));
|
||||||
if (k < l) {
|
if (k < l)
|
||||||
|
{
|
||||||
l = k;
|
l = k;
|
||||||
dax = (sprite[j].x - sprite[i].x);
|
dax = (sprite[j].x - sprite[i].x);
|
||||||
day = (sprite[j].y - sprite[i].y);
|
day = (sprite[j].y - sprite[i].y);
|
||||||
|
@ -2582,11 +2650,14 @@ void statuslistcode(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(j = headspritestat[2]; j >= 0; j = nextj) { // Inactive monsters
|
for (j = headspritestat[2]; j >= 0; j = nextj) // Inactive monsters
|
||||||
|
{
|
||||||
nextj = nextspritestat[j];
|
nextj = nextspritestat[j];
|
||||||
if (cansee(sprite[i].x,sprite[i].y,sprite[i].z,sprite[i].sectnum,sprite[j].x,sprite[j].y,sprite[j].z,sprite[j].sectnum)) {
|
if (cansee(sprite[i].x,sprite[i].y,sprite[i].z,sprite[i].sectnum,sprite[j].x,sprite[j].y,sprite[j].z,sprite[j].sectnum))
|
||||||
|
{
|
||||||
k = ksqrt(sqr(sprite[j].x - sprite[i].x) + sqr(sprite[j].y - sprite[i].y) + (sqr(sprite[j].z - sprite[i].z) >> 8));
|
k = ksqrt(sqr(sprite[j].x - sprite[i].x) + sqr(sprite[j].y - sprite[i].y) + (sqr(sprite[j].z - sprite[i].z) >> 8));
|
||||||
if (k < l) {
|
if (k < l)
|
||||||
|
{
|
||||||
l = k;
|
l = k;
|
||||||
dax = (sprite[j].x - sprite[i].x);
|
dax = (sprite[j].x - sprite[i].x);
|
||||||
day = (sprite[j].y - sprite[i].y);
|
day = (sprite[j].y - sprite[i].y);
|
||||||
|
@ -2594,7 +2665,8 @@ void statuslistcode(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (l != 0x7fffffff) {
|
if (l != 0x7fffffff)
|
||||||
|
{
|
||||||
sprite[i].xvel = (divscale7(dax,l) + sprite[i].xvel); // 1/5 of velocity is homing, 4/5 is momentum
|
sprite[i].xvel = (divscale7(dax,l) + sprite[i].xvel); // 1/5 of velocity is homing, 4/5 is momentum
|
||||||
sprite[i].yvel = (divscale7(day,l) + sprite[i].yvel); // 1/5 of velocity is homing, 4/5 is momentum
|
sprite[i].yvel = (divscale7(day,l) + sprite[i].yvel); // 1/5 of velocity is homing, 4/5 is momentum
|
||||||
sprite[i].zvel = (divscale7(daz,l) + sprite[i].zvel); // 1/5 of velocity is homing, 4/5 is momentum
|
sprite[i].zvel = (divscale7(daz,l) + sprite[i].zvel); // 1/5 of velocity is homing, 4/5 is momentum
|
||||||
|
@ -2787,9 +2859,11 @@ void statuslistcode(void)
|
||||||
}
|
}
|
||||||
else if ((hitobject&0xc000) == 49152) //Bullet hit a sprite
|
else if ((hitobject&0xc000) == 49152) //Bullet hit a sprite
|
||||||
{
|
{
|
||||||
if ((sprite[hitobject&4095].lotag == 5) && (sprite[i].picnum == GRABBER)) { // Basketball hoop (Andy's addition)
|
if ((sprite[hitobject&4095].lotag == 5) && (sprite[i].picnum == GRABBER)) // Basketball hoop (Andy's addition)
|
||||||
|
{
|
||||||
wsayfollow("niceshot.wav",3840L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
wsayfollow("niceshot.wav",3840L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
||||||
switch (krand() & 63) {
|
switch (krand() & 63)
|
||||||
|
{
|
||||||
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9:
|
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9:
|
||||||
sprite[i].picnum = COIN; break;
|
sprite[i].picnum = COIN; break;
|
||||||
case 10: case 11: case 12: case 13: case 14: case 15: case 16:
|
case 10: case 11: case 12: case 13: case 14: case 15: case 16:
|
||||||
|
@ -2823,7 +2897,8 @@ void statuslistcode(void)
|
||||||
if (playersprite[j] == (hitobject&4095))
|
if (playersprite[j] == (hitobject&4095))
|
||||||
{
|
{
|
||||||
wsayfollow("ouch.wav",4096L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
wsayfollow("ouch.wav",4096L+(krand()&127)-64,256L,&sprite[i].x,&sprite[i].y,0);
|
||||||
if (sprite[i].picnum == GRABBER) { // Andy did this
|
if (sprite[i].picnum == GRABBER) // Andy did this
|
||||||
|
{
|
||||||
k = ((sprite[i].xrepeat * sprite[i].yrepeat) * 3) >> 9;
|
k = ((sprite[i].xrepeat * sprite[i].yrepeat) * 3) >> 9;
|
||||||
changehealth((sprite[i].owner - 4096),k);
|
changehealth((sprite[i].owner - 4096),k);
|
||||||
changehealth(j,-k);
|
changehealth(j,-k);
|
||||||
|
@ -2840,8 +2915,10 @@ void statuslistcode(void)
|
||||||
switch (sprite[j].picnum)
|
switch (sprite[j].picnum)
|
||||||
{
|
{
|
||||||
case BROWNMONSTER:
|
case BROWNMONSTER:
|
||||||
if (sprite[j].lotag > 0) {
|
if (sprite[j].lotag > 0)
|
||||||
if (sprite[i].picnum == GRABBER) { // Andy did this
|
{
|
||||||
|
if (sprite[i].picnum == GRABBER) // Andy did this
|
||||||
|
{
|
||||||
k = ((sprite[i].xrepeat * sprite[i].yrepeat) * 3) >> 9;
|
k = ((sprite[i].xrepeat * sprite[i].yrepeat) * 3) >> 9;
|
||||||
changehealth((sprite[i].owner - 4096),k);
|
changehealth((sprite[i].owner - 4096),k);
|
||||||
sprite[j].lotag -= k;
|
sprite[j].lotag -= k;
|
||||||
|
@ -3176,7 +3253,8 @@ void processinput(short snum)
|
||||||
sprite[playersprite[snum]].cstat |= 1;
|
sprite[playersprite[snum]].cstat |= 1;
|
||||||
|
|
||||||
if (ssync[snum].avel != 0) //ang += avel * constant
|
if (ssync[snum].avel != 0) //ang += avel * constant
|
||||||
{ //ENGINE calculates avel for you
|
{
|
||||||
|
//ENGINE calculates avel for you
|
||||||
doubvel = TICSPERFRAME;
|
doubvel = TICSPERFRAME;
|
||||||
if ((ssync[snum].bits&256) > 0) //Lt. shift makes turn velocity 50% faster
|
if ((ssync[snum].bits&256) > 0) //Lt. shift makes turn velocity 50% faster
|
||||||
doubvel += (TICSPERFRAME>>1);
|
doubvel += (TICSPERFRAME>>1);
|
||||||
|
@ -3334,12 +3412,14 @@ void processinput(short snum)
|
||||||
if (health[snum] >= 0)
|
if (health[snum] >= 0)
|
||||||
{
|
{
|
||||||
if ((cursectnum[snum] < 0) || (cursectnum[snum] >= numsectors))
|
if ((cursectnum[snum] < 0) || (cursectnum[snum] >= numsectors))
|
||||||
{ //How did you get in the wrong sector?
|
{
|
||||||
|
//How did you get in the wrong sector?
|
||||||
wsayfollow("ouch.wav",4096L+(krand()&127)-64,64L,&pos[snum].x,&pos[snum].y,1);
|
wsayfollow("ouch.wav",4096L+(krand()&127)-64,64L,&pos[snum].x,&pos[snum].y,1);
|
||||||
changehealth(snum,-TICSPERFRAME);
|
changehealth(snum,-TICSPERFRAME);
|
||||||
}
|
}
|
||||||
else if (globhiz+(8<<8) > globloz)
|
else if (globhiz+(8<<8) > globloz)
|
||||||
{ //Ceiling and floor are smooshing you!
|
{
|
||||||
|
//Ceiling and floor are smooshing you!
|
||||||
wsayfollow("ouch.wav",4096L+(krand()&127)-64,64L,&pos[snum].x,&pos[snum].y,1);
|
wsayfollow("ouch.wav",4096L+(krand()&127)-64,64L,&pos[snum].x,&pos[snum].y,1);
|
||||||
changehealth(snum,-TICSPERFRAME);
|
changehealth(snum,-TICSPERFRAME);
|
||||||
}
|
}
|
||||||
|
@ -3435,7 +3515,8 @@ void processinput(short snum)
|
||||||
if (neartagsprite >= 0)
|
if (neartagsprite >= 0)
|
||||||
{
|
{
|
||||||
if (sprite[neartagsprite].lotag == 1)
|
if (sprite[neartagsprite].lotag == 1)
|
||||||
{ //if you're shoving innocent little AL around, he gets mad!
|
{
|
||||||
|
//if you're shoving innocent little AL around, he gets mad!
|
||||||
if (sprite[neartagsprite].picnum == AL)
|
if (sprite[neartagsprite].picnum == AL)
|
||||||
{
|
{
|
||||||
sprite[neartagsprite].picnum = EVILAL;
|
sprite[neartagsprite].picnum = EVILAL;
|
||||||
|
@ -3475,7 +3556,8 @@ void processinput(short snum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ssync[snum].bits & 2048) > 0) { // Shoot a bullet
|
if ((ssync[snum].bits & 2048) > 0) // Shoot a bullet
|
||||||
|
{
|
||||||
if ((numbombs[snum] == 0) && (((ssync[snum].bits >> 13) & 7) == 2) && (myconnectindex == snum))
|
if ((numbombs[snum] == 0) && (((ssync[snum].bits >> 13) & 7) == 2) && (myconnectindex == snum))
|
||||||
locselectedgun = 0;
|
locselectedgun = 0;
|
||||||
if ((nummissiles[snum] == 0) && (((ssync[snum].bits >> 13) & 7) == 3) && (myconnectindex == snum))
|
if ((nummissiles[snum] == 0) && (((ssync[snum].bits >> 13) & 7) == 3) && (myconnectindex == snum))
|
||||||
|
@ -3484,9 +3566,11 @@ void processinput(short snum)
|
||||||
locselectedgun = 1;
|
locselectedgun = 1;
|
||||||
|
|
||||||
if ((health[snum] >= 0) || ((krand() & 127) > -health[snum]))
|
if ((health[snum] >= 0) || ((krand() & 127) > -health[snum]))
|
||||||
switch((ssync[snum].bits >> 13) & 7) {
|
switch ((ssync[snum].bits >> 13) & 7)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if (lockclock > lastchaingun[snum]+8) {
|
if (lockclock > lastchaingun[snum]+8)
|
||||||
|
{
|
||||||
lastchaingun[snum] = lockclock;
|
lastchaingun[snum] = lockclock;
|
||||||
shootgun(snum,&pos[snum],ang[snum],horiz[snum],cursectnum[snum],0);
|
shootgun(snum,&pos[snum],ang[snum],horiz[snum],cursectnum[snum],0);
|
||||||
}
|
}
|
||||||
|
@ -3497,21 +3581,24 @@ void processinput(short snum)
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if ((oflags[snum] & 2048) == 0)
|
if ((oflags[snum] & 2048) == 0)
|
||||||
if (numbombs[snum] > 0) {
|
if (numbombs[snum] > 0)
|
||||||
|
{
|
||||||
shootgun(snum,&pos[snum],ang[snum],horiz[snum],cursectnum[snum],2);
|
shootgun(snum,&pos[snum],ang[snum],horiz[snum],cursectnum[snum],2);
|
||||||
changenumbombs(snum,-1);
|
changenumbombs(snum,-1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if ((oflags[snum] & 2048) == 0)
|
if ((oflags[snum] & 2048) == 0)
|
||||||
if (nummissiles[snum] > 0) {
|
if (nummissiles[snum] > 0)
|
||||||
|
{
|
||||||
shootgun(snum,&pos[snum],ang[snum],horiz[snum],cursectnum[snum],3);
|
shootgun(snum,&pos[snum],ang[snum],horiz[snum],cursectnum[snum],3);
|
||||||
changenummissiles(snum,-1);
|
changenummissiles(snum,-1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if ((oflags[snum] & 2048) == 0)
|
if ((oflags[snum] & 2048) == 0)
|
||||||
if (numgrabbers[snum] > 0) {
|
if (numgrabbers[snum] > 0)
|
||||||
|
{
|
||||||
shootgun(snum,&pos[snum],ang[snum],horiz[snum],cursectnum[snum],4);
|
shootgun(snum,&pos[snum],ang[snum],horiz[snum],cursectnum[snum],4);
|
||||||
changenumgrabbers(snum,-1);
|
changenumgrabbers(snum,-1);
|
||||||
}
|
}
|
||||||
|
@ -3803,7 +3890,8 @@ void drawscreen(short snum, int dasmoothratio)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Init for screen rotation
|
//Init for screen rotation
|
||||||
if (getrendermode() == 0) { // JBF 20031220
|
if (getrendermode() == 0) // JBF 20031220
|
||||||
|
{
|
||||||
tiltlock = screentilt;
|
tiltlock = screentilt;
|
||||||
if ((tiltlock) || (detailmode))
|
if ((tiltlock) || (detailmode))
|
||||||
{
|
{
|
||||||
|
@ -3815,7 +3903,8 @@ void drawscreen(short snum, int dasmoothratio)
|
||||||
else
|
else
|
||||||
setviewtotile(TILE_TILT,320L>>detailmode,320L>>detailmode);
|
setviewtotile(TILE_TILT,320L>>detailmode,320L>>detailmode);
|
||||||
if ((tiltlock&1023) == 512)
|
if ((tiltlock&1023) == 512)
|
||||||
{ //Block off unscreen section of 90¯ tilted screen
|
{
|
||||||
|
//Block off unscreen section of 90¯ tilted screen
|
||||||
j = ((320-60)>>detailmode);
|
j = ((320-60)>>detailmode);
|
||||||
for (i=(60>>detailmode)-1; i>=0; i--)
|
for (i=(60>>detailmode)-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
|
@ -3828,7 +3917,9 @@ void drawscreen(short snum, int dasmoothratio)
|
||||||
i = sintable[i+512]*8 + sintable[i]*5L;
|
i = sintable[i+512]*8 + sintable[i]*5L;
|
||||||
setaspect(i>>1,yxaspect);
|
setaspect(i>>1,yxaspect);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
tiltlock = screentilt;
|
tiltlock = screentilt;
|
||||||
// Ken loves to interpolate
|
// Ken loves to interpolate
|
||||||
setrollangle(oscreentilt + mulscale16(((screentilt-oscreentilt+1024)&2047)-1024,smoothratio));
|
setrollangle(oscreentilt + mulscale16(((screentilt-oscreentilt+1024)&2047)-1024,smoothratio));
|
||||||
|
@ -3856,7 +3947,8 @@ void drawscreen(short snum, int dasmoothratio)
|
||||||
drawmasks();
|
drawmasks();
|
||||||
|
|
||||||
//Temp horizon
|
//Temp horizon
|
||||||
if (getrendermode() == 0) {
|
if (getrendermode() == 0)
|
||||||
|
{
|
||||||
l = scale(choriz-100,windowx2-windowx1,320)+((windowy1+windowy2)>>1);
|
l = scale(choriz-100,windowx2-windowx1,320)+((windowy1+windowy2)>>1);
|
||||||
begindrawing(); //{{{
|
begindrawing(); //{{{
|
||||||
for (y1=windowy1,y2=windowy2; y1<y2; y1++,y2--)
|
for (y1=windowy1,y2=windowy2; y1<y2; y1++,y2--)
|
||||||
|
@ -3946,7 +4038,8 @@ void drawscreen(short snum, int dasmoothratio)
|
||||||
drawmasks();
|
drawmasks();
|
||||||
|
|
||||||
//Finish for screen rotation
|
//Finish for screen rotation
|
||||||
if (getrendermode() == 0) { // JBF 20031220
|
if (getrendermode() == 0) // JBF 20031220
|
||||||
|
{
|
||||||
if ((tiltlock) || (detailmode))
|
if ((tiltlock) || (detailmode))
|
||||||
{
|
{
|
||||||
setviewback();
|
setviewback();
|
||||||
|
@ -3999,7 +4092,8 @@ void drawscreen(short snum, int dasmoothratio)
|
||||||
if ((gotpic[SLIME>>3]&(1<<(SLIME&7))) > 0)
|
if ((gotpic[SLIME>>3]&(1<<(SLIME&7))) > 0)
|
||||||
{
|
{
|
||||||
gotpic[SLIME>>3] &= ~(1<<(SLIME&7));
|
gotpic[SLIME>>3] &= ~(1<<(SLIME&7));
|
||||||
if (waloff[SLIME] != 0) {
|
if (waloff[SLIME] != 0)
|
||||||
|
{
|
||||||
movelava((char *)waloff[SLIME]);
|
movelava((char *)waloff[SLIME]);
|
||||||
invalidatetile(SLIME,0,1); // JBF 20031228
|
invalidatetile(SLIME,0,1); // JBF 20031228
|
||||||
}
|
}
|
||||||
|
@ -4110,9 +4204,12 @@ void drawscreen(short snum, int dasmoothratio)
|
||||||
{
|
{
|
||||||
keystatus[0x3e] = 0;
|
keystatus[0x3e] = 0;
|
||||||
|
|
||||||
if (keystatus[0x2a]|keystatus[0x36]) {
|
if (keystatus[0x2a]|keystatus[0x36])
|
||||||
|
{
|
||||||
setgamemode(!fullscreen, xdim, ydim, bpp);
|
setgamemode(!fullscreen, xdim, ydim, bpp);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
//cycle through all modes
|
//cycle through all modes
|
||||||
j=-1;
|
j=-1;
|
||||||
|
@ -4129,7 +4226,8 @@ void drawscreen(short snum, int dasmoothratio)
|
||||||
if (validmode[k].fs == fullscreen && validmode[k].bpp == bpp) break;
|
if (validmode[k].fs == fullscreen && validmode[k].bpp == bpp) break;
|
||||||
|
|
||||||
if (j==-1) j=k;
|
if (j==-1) j=k;
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
j++;
|
j++;
|
||||||
if (j==validmodecnt) j=k;
|
if (j==validmodecnt) j=k;
|
||||||
}
|
}
|
||||||
|
@ -4251,7 +4349,8 @@ void fakedomovethings(void)
|
||||||
getzrange(&my,mycursectnum,&globhiz,&globhihit,&globloz,&globlohit,128L,CLIPMASK0);
|
getzrange(&my,mycursectnum,&globhiz,&globhihit,&globloz,&globlohit,128L,CLIPMASK0);
|
||||||
|
|
||||||
if (syn->avel != 0) //ang += avel * constant
|
if (syn->avel != 0) //ang += avel * constant
|
||||||
{ //ENGINE calculates avel for you
|
{
|
||||||
|
//ENGINE calculates avel for you
|
||||||
doubvel = TICSPERFRAME;
|
doubvel = TICSPERFRAME;
|
||||||
if ((syn->bits&256) > 0) //Lt. shift makes turn velocity 50% faster
|
if ((syn->bits&256) > 0) //Lt. shift makes turn velocity 50% faster
|
||||||
doubvel += (TICSPERFRAME>>1);
|
doubvel += (TICSPERFRAME>>1);
|
||||||
|
@ -4661,8 +4760,10 @@ void playback(void)
|
||||||
recstat = 0; i = reccnt;
|
recstat = 0; i = reccnt;
|
||||||
while (!keystatus[1])
|
while (!keystatus[1])
|
||||||
{
|
{
|
||||||
if (handleevents()) {
|
if (handleevents())
|
||||||
if (quitevent) {
|
{
|
||||||
|
if (quitevent)
|
||||||
|
{
|
||||||
keystatus[1] = 1;
|
keystatus[1] = 1;
|
||||||
quitevent = 0;
|
quitevent = 0;
|
||||||
}
|
}
|
||||||
|
@ -4789,7 +4890,8 @@ void findrandomspot(int *x, int *y, short *sectnum)
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
dasector = mulscale16(krand(),numsectors);
|
dasector = mulscale16(krand(),numsectors);
|
||||||
} while ((sector[dasector].ceilingz+(8<<8) >= sector[dasector].floorz) || ((sector[dasector].lotag|sector[dasector].hitag) != 0) || ((sector[dasector].floorstat&1) != 0));
|
}
|
||||||
|
while ((sector[dasector].ceilingz+(8<<8) >= sector[dasector].floorz) || ((sector[dasector].lotag|sector[dasector].hitag) != 0) || ((sector[dasector].floorstat&1) != 0));
|
||||||
|
|
||||||
startwall = sector[dasector].wallptr;
|
startwall = sector[dasector].wallptr;
|
||||||
endwall = startwall+sector[dasector].wallnum;
|
endwall = startwall+sector[dasector].wallnum;
|
||||||
|
@ -4838,7 +4940,8 @@ void warp(int *x, int *y, int *z, short *daang, short *dasector)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
if (i >= warpsectorcnt) i = 0;
|
if (i >= warpsectorcnt) i = 0;
|
||||||
} while (sector[warpsectorlist[i]].hitag != j);
|
}
|
||||||
|
while (sector[warpsectorlist[i]].hitag != j);
|
||||||
*dasector = warpsectorlist[i];
|
*dasector = warpsectorlist[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4921,7 +5024,8 @@ int addlava(int);
|
||||||
#elif defined(_MSC_VER) && !defined(NOASM)
|
#elif defined(_MSC_VER) && !defined(NOASM)
|
||||||
inline int addlava(void *b)
|
inline int addlava(void *b)
|
||||||
{
|
{
|
||||||
_asm {
|
_asm
|
||||||
|
{
|
||||||
mov ebx, b
|
mov ebx, b
|
||||||
mov al, byte ptr [ebx-133]
|
mov al, byte ptr [ebx-133]
|
||||||
mov dl, byte ptr [ebx-1]
|
mov dl, byte ptr [ebx-1]
|
||||||
|
@ -5074,15 +5178,15 @@ int getanimationgoal(int *animptr)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=animatecnt-1; i>=0; i--)
|
for (i=animatecnt-1; i>=0; i--)
|
||||||
if (animptr == animateptr[i]) return(i);
|
if (animptr == animateptr[i]) return i;
|
||||||
return(-1);
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int setanimation(int *animptr, int thegoal, int thevel, int theacc)
|
int setanimation(int *animptr, int thegoal, int thevel, int theacc)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
if (animatecnt >= MAXANIMATES) return(-1);
|
if (animatecnt >= MAXANIMATES) return -1;
|
||||||
|
|
||||||
j = animatecnt;
|
j = animatecnt;
|
||||||
for (i=animatecnt-1; i>=0; i--)
|
for (i=animatecnt-1; i>=0; i--)
|
||||||
|
@ -5096,7 +5200,7 @@ int setanimation(int *animptr, int thegoal, int thevel, int theacc)
|
||||||
animatevel[j] = thevel;
|
animatevel[j] = thevel;
|
||||||
animateacc[j] = theacc;
|
animateacc[j] = theacc;
|
||||||
if (j == animatecnt) animatecnt++;
|
if (j == animatecnt) animatecnt++;
|
||||||
return(j);
|
return j;
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkmasterslaveswitch(void)
|
void checkmasterslaveswitch(void)
|
||||||
|
@ -5165,16 +5269,16 @@ int testneighborsectors(short sect1, short sect2)
|
||||||
startwall = sector[sect1].wallptr;
|
startwall = sector[sect1].wallptr;
|
||||||
for (i=num1-1; i>=0; i--)
|
for (i=num1-1; i>=0; i--)
|
||||||
if (wall[i+startwall].nextsector == sect2)
|
if (wall[i+startwall].nextsector == sect2)
|
||||||
return(1);
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
startwall = sector[sect2].wallptr;
|
startwall = sector[sect2].wallptr;
|
||||||
for (i=num2-1; i>=0; i--)
|
for (i=num2-1; i>=0; i--)
|
||||||
if (wall[i+startwall].nextsector == sect1)
|
if (wall[i+startwall].nextsector == sect1)
|
||||||
return(1);
|
return 1;
|
||||||
}
|
}
|
||||||
return(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int loadgame(void)
|
int loadgame(void)
|
||||||
|
@ -5184,7 +5288,7 @@ int loadgame(void)
|
||||||
int fil;
|
int fil;
|
||||||
int tmpanimateptr[MAXANIMATES];
|
int tmpanimateptr[MAXANIMATES];
|
||||||
|
|
||||||
if ((fil = kopen4load("save0000.gam",0)) == -1) return(-1);
|
if ((fil = kopen4load("save0000.gam",0)) == -1) return -1;
|
||||||
|
|
||||||
kdfread(&numplayers,4,1,fil);
|
kdfread(&numplayers,4,1,fil);
|
||||||
kdfread(&myconnectindex,4,1,fil);
|
kdfread(&myconnectindex,4,1,fil);
|
||||||
|
@ -5360,7 +5464,7 @@ int loadgame(void)
|
||||||
Bstrcpy(getmessage,"Game loaded.");
|
Bstrcpy(getmessage,"Game loaded.");
|
||||||
getmessageleng = Bstrlen(getmessage);
|
getmessageleng = Bstrlen(getmessage);
|
||||||
getmessagetimeoff = totalclock+360+(getmessageleng<<4);
|
getmessagetimeoff = totalclock+360+(getmessageleng<<4);
|
||||||
return(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int savegame(void)
|
int savegame(void)
|
||||||
|
@ -5370,7 +5474,7 @@ int savegame(void)
|
||||||
BFILE *fil;
|
BFILE *fil;
|
||||||
int tmpanimateptr[MAXANIMATES];
|
int tmpanimateptr[MAXANIMATES];
|
||||||
|
|
||||||
if ((fil = Bfopen("save0000.gam","wb")) == 0) return(-1);
|
if ((fil = Bfopen("save0000.gam","wb")) == 0) return -1;
|
||||||
|
|
||||||
dfwrite(&numplayers,4,1,fil);
|
dfwrite(&numplayers,4,1,fil);
|
||||||
dfwrite(&myconnectindex,4,1,fil);
|
dfwrite(&myconnectindex,4,1,fil);
|
||||||
|
@ -5534,7 +5638,7 @@ int savegame(void)
|
||||||
Bstrcpy(getmessage,"Game saved.");
|
Bstrcpy(getmessage,"Game saved.");
|
||||||
getmessageleng = Bstrlen(getmessage);
|
getmessageleng = Bstrlen(getmessage);
|
||||||
getmessagetimeoff = totalclock+360+(getmessageleng<<4);
|
getmessagetimeoff = totalclock+360+(getmessageleng<<4);
|
||||||
return(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void faketimerhandler(void)
|
void faketimerhandler(void)
|
||||||
|
@ -5722,7 +5826,8 @@ void getpackets(void)
|
||||||
{
|
{
|
||||||
syncstat |= (syncval[syncvaltottail]^othersyncval[syncvaltottail]);
|
syncstat |= (syncval[syncvaltottail]^othersyncval[syncvaltottail]);
|
||||||
syncvaltottail = ((syncvaltottail+1)&(MOVEFIFOSIZ-1));
|
syncvaltottail = ((syncvaltottail+1)&(MOVEFIFOSIZ-1));
|
||||||
} while ((syncvalhead != syncvaltottail) && (othersyncvalhead != syncvaltottail));
|
}
|
||||||
|
while ((syncvalhead != syncvaltottail) && (othersyncvalhead != syncvaltottail));
|
||||||
}
|
}
|
||||||
|
|
||||||
movethings(); //Move all players and sprites
|
movethings(); //Move all players and sprites
|
||||||
|
@ -5779,7 +5884,8 @@ void getpackets(void)
|
||||||
{
|
{
|
||||||
syncstat |= (syncval[syncvaltottail]^othersyncval[syncvaltottail]);
|
syncstat |= (syncval[syncvaltottail]^othersyncval[syncvaltottail]);
|
||||||
syncvaltottail = ((syncvaltottail+1)&(MOVEFIFOSIZ-1));
|
syncvaltottail = ((syncvaltottail+1)&(MOVEFIFOSIZ-1));
|
||||||
} while ((syncvalhead != syncvaltottail) && (othersyncvalhead != syncvaltottail));
|
}
|
||||||
|
while ((syncvalhead != syncvaltottail) && (othersyncvalhead != syncvaltottail));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -6076,11 +6182,11 @@ int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordi
|
||||||
daz = spr->z+zoffs + dz;
|
daz = spr->z+zoffs + dz;
|
||||||
if ((daz <= globhiz) || (daz > globloz))
|
if ((daz <= globhiz) || (daz > globloz))
|
||||||
{
|
{
|
||||||
if (retval != 0) return(retval);
|
if (retval != 0) return retval;
|
||||||
return(16384+dasectnum);
|
return 16384+dasectnum;
|
||||||
}
|
}
|
||||||
spr->z = daz-zoffs;
|
spr->z = daz-zoffs;
|
||||||
return(retval);
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6136,7 +6242,8 @@ void waitforeverybody ()
|
||||||
nextpage();
|
nextpage();
|
||||||
|
|
||||||
|
|
||||||
if (quitevent || keystatus[1]) {
|
if (quitevent || keystatus[1])
|
||||||
|
{
|
||||||
sendlogoff(); //Signing off
|
sendlogoff(); //Signing off
|
||||||
musicoff();
|
musicoff();
|
||||||
uninitmultiplayers();
|
uninitmultiplayers();
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
#define TAB_CONFIG 0
|
#define TAB_CONFIG 0
|
||||||
#define TAB_MESSAGES 1
|
#define TAB_MESSAGES 1
|
||||||
|
|
||||||
static struct {
|
static struct
|
||||||
|
{
|
||||||
int fullscreen;
|
int fullscreen;
|
||||||
int xdim3d, ydim3d, bpp3d;
|
int xdim3d, ydim3d, bpp3d;
|
||||||
int forcesetup;
|
int forcesetup;
|
||||||
|
@ -78,10 +79,12 @@ static void PopulateForm(void)
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, settings.bpp3d, settings.fullscreen, 1);
|
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, settings.bpp3d, settings.fullscreen, 1);
|
||||||
if (mode3d < 0) {
|
if (mode3d < 0)
|
||||||
|
{
|
||||||
int i, cd[] = { 32, 24, 16, 15, 8, 0 };
|
int i, cd[] = { 32, 24, 16, 15, 8, 0 };
|
||||||
for (i=0; cd[i]; ) { if (cd[i] >= settings.bpp3d) i++; else break; }
|
for (i=0; cd[i]; ) { if (cd[i] >= settings.bpp3d) i++; else break; }
|
||||||
for ( ; cd[i]; i++) {
|
for (; cd[i]; i++)
|
||||||
|
{
|
||||||
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1);
|
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1);
|
||||||
if (mode3d < 0) continue;
|
if (mode3d < 0) continue;
|
||||||
settings.bpp3d = cd[i];
|
settings.bpp3d = cd[i];
|
||||||
|
@ -96,14 +99,16 @@ static void PopulateForm(void)
|
||||||
modes3d = GTK_LIST_STORE(gtk_combo_box_get_model(box3d));
|
modes3d = GTK_LIST_STORE(gtk_combo_box_get_model(box3d));
|
||||||
gtk_list_store_clear(modes3d);
|
gtk_list_store_clear(modes3d);
|
||||||
|
|
||||||
for (i=0; i<validmodecnt; i++) {
|
for (i=0; i<validmodecnt; i++)
|
||||||
|
{
|
||||||
if (validmode[i].fs != settings.fullscreen) continue;
|
if (validmode[i].fs != settings.fullscreen) continue;
|
||||||
|
|
||||||
// all modes get added to the 3D mode list
|
// all modes get added to the 3D mode list
|
||||||
Bsprintf(buf, "%ld x %ld %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
|
Bsprintf(buf, "%ld x %ld %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
|
||||||
gtk_list_store_append(modes3d, &iter);
|
gtk_list_store_append(modes3d, &iter);
|
||||||
gtk_list_store_set(modes3d, &iter, 0,buf, 1,i, -1);
|
gtk_list_store_set(modes3d, &iter, 0,buf, 1,i, -1);
|
||||||
if (i == mode3d) {
|
if (i == mode3d)
|
||||||
|
{
|
||||||
g_signal_handlers_block_by_func(box3d, on_vmode3dcombo_changed, NULL);
|
g_signal_handlers_block_by_func(box3d, on_vmode3dcombo_changed, NULL);
|
||||||
gtk_combo_box_set_active_iter(box3d, &iter);
|
gtk_combo_box_set_active_iter(box3d, &iter);
|
||||||
g_signal_handlers_unblock_by_func(box3d, on_vmode3dcombo_changed, NULL);
|
g_signal_handlers_unblock_by_func(box3d, on_vmode3dcombo_changed, NULL);
|
||||||
|
@ -428,7 +433,8 @@ int startwin_open(void)
|
||||||
if (startwin) return 1;
|
if (startwin) return 1;
|
||||||
|
|
||||||
startwin = create_window();
|
startwin = create_window();
|
||||||
if (startwin) {
|
if (startwin)
|
||||||
|
{
|
||||||
SetPage(TAB_MESSAGES);
|
SetPage(TAB_MESSAGES);
|
||||||
gtk_widget_show(startwin);
|
gtk_widget_show(startwin);
|
||||||
gtk_main_iteration_do(FALSE);
|
gtk_main_iteration_do(FALSE);
|
||||||
|
@ -460,8 +466,10 @@ int startwin_puts(const char *str)
|
||||||
textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
|
textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
|
||||||
|
|
||||||
gtk_text_buffer_get_end_iter(textbuffer, &enditer);
|
gtk_text_buffer_get_end_iter(textbuffer, &enditer);
|
||||||
for (aptr = bptr = str; *aptr != 0; ) {
|
for (aptr = bptr = str; *aptr != 0; )
|
||||||
switch (*bptr) {
|
{
|
||||||
|
switch (*bptr)
|
||||||
|
{
|
||||||
case '\b':
|
case '\b':
|
||||||
if (bptr > aptr)
|
if (bptr > aptr)
|
||||||
gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr)-1);
|
gtk_text_buffer_insert(textbuffer, &enditer, (const gchar *)aptr, (gint)(bptr-aptr)-1);
|
||||||
|
@ -532,7 +540,8 @@ int startwin_run(void)
|
||||||
gtk_main();
|
gtk_main();
|
||||||
|
|
||||||
SetPage(TAB_MESSAGES);
|
SetPage(TAB_MESSAGES);
|
||||||
if (retval) {
|
if (retval)
|
||||||
|
{
|
||||||
fullscreen = settings.fullscreen;
|
fullscreen = settings.fullscreen;
|
||||||
xdimgame = settings.xdim3d;
|
xdimgame = settings.xdim3d;
|
||||||
ydimgame = settings.ydim3d;
|
ydimgame = settings.ydim3d;
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
#define TAB_CONFIG 0
|
#define TAB_CONFIG 0
|
||||||
#define TAB_MESSAGES 1
|
#define TAB_MESSAGES 1
|
||||||
|
|
||||||
static struct {
|
static struct
|
||||||
|
{
|
||||||
int fullscreen;
|
int fullscreen;
|
||||||
int xdim3d, ydim3d, bpp3d;
|
int xdim3d, ydim3d, bpp3d;
|
||||||
int forcesetup;
|
int forcesetup;
|
||||||
|
@ -38,10 +39,12 @@ static void PopulateForm(void)
|
||||||
hwnd3d = GetDlgItem(pages[TAB_CONFIG], IDC3DVMODE);
|
hwnd3d = GetDlgItem(pages[TAB_CONFIG], IDC3DVMODE);
|
||||||
|
|
||||||
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, settings.bpp3d, settings.fullscreen, 1);
|
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, settings.bpp3d, settings.fullscreen, 1);
|
||||||
if (mode3d < 0) {
|
if (mode3d < 0)
|
||||||
|
{
|
||||||
int cd[] = { 32, 24, 16, 15, 8, 0 };
|
int cd[] = { 32, 24, 16, 15, 8, 0 };
|
||||||
for (i=0; cd[i]; ) { if (cd[i] >= settings.bpp3d) i++; else break; }
|
for (i=0; cd[i]; ) { if (cd[i] >= settings.bpp3d) i++; else break; }
|
||||||
for ( ; cd[i]; i++) {
|
for (; cd[i]; i++)
|
||||||
|
{
|
||||||
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1);
|
mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1);
|
||||||
if (mode3d < 0) continue;
|
if (mode3d < 0) continue;
|
||||||
settings.bpp3d = cd[i];
|
settings.bpp3d = cd[i];
|
||||||
|
@ -53,7 +56,8 @@ static void PopulateForm(void)
|
||||||
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCALWAYSSHOW), (settings.forcesetup ? BST_CHECKED : BST_UNCHECKED));
|
Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCALWAYSSHOW), (settings.forcesetup ? BST_CHECKED : BST_UNCHECKED));
|
||||||
|
|
||||||
ComboBox_ResetContent(hwnd3d);
|
ComboBox_ResetContent(hwnd3d);
|
||||||
for (i=0; i<validmodecnt; i++) {
|
for (i=0; i<validmodecnt; i++)
|
||||||
|
{
|
||||||
if (validmode[i].fs != settings.fullscreen) continue;
|
if (validmode[i].fs != settings.fullscreen) continue;
|
||||||
|
|
||||||
// all modes get added to the 3D mode list
|
// all modes get added to the 3D mode list
|
||||||
|
@ -66,19 +70,23 @@ static void PopulateForm(void)
|
||||||
|
|
||||||
static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
static INT_PTR CALLBACK ConfigPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch (uMsg) {
|
switch (uMsg)
|
||||||
|
{
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
switch (LOWORD(wParam)) {
|
switch (LOWORD(wParam))
|
||||||
|
{
|
||||||
case IDCFULLSCREEN:
|
case IDCFULLSCREEN:
|
||||||
settings.fullscreen = !settings.fullscreen;
|
settings.fullscreen = !settings.fullscreen;
|
||||||
PopulateForm();
|
PopulateForm();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case IDC3DVMODE:
|
case IDC3DVMODE:
|
||||||
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
if (HIWORD(wParam) == CBN_SELCHANGE)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
i = ComboBox_GetCurSel((HWND)lParam);
|
i = ComboBox_GetCurSel((HWND)lParam);
|
||||||
if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
|
if (i != CB_ERR) i = ComboBox_GetItemData((HWND)lParam, i);
|
||||||
if (i != CB_ERR) {
|
if (i != CB_ERR)
|
||||||
|
{
|
||||||
settings.xdim3d = validmode[i].xdim;
|
settings.xdim3d = validmode[i].xdim;
|
||||||
settings.ydim3d = validmode[i].ydim;
|
settings.ydim3d = validmode[i].ydim;
|
||||||
settings.bpp3d = validmode[i].bpp;
|
settings.bpp3d = validmode[i].bpp;
|
||||||
|
@ -125,8 +133,10 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
||||||
static HBITMAP hbmp = NULL;
|
static HBITMAP hbmp = NULL;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
|
|
||||||
switch (uMsg) {
|
switch (uMsg)
|
||||||
case WM_INITDIALOG: {
|
{
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
{
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
RECT r, rdlg, chrome, rtab, rcancel, rstart;
|
RECT r, rdlg, chrome, rtab, rcancel, rstart;
|
||||||
int xoffset = 0, yoffset = 0;
|
int xoffset = 0, yoffset = 0;
|
||||||
|
@ -226,18 +236,22 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_NOTIFY: {
|
case WM_NOTIFY:
|
||||||
|
{
|
||||||
LPNMHDR nmhdr = (LPNMHDR)lParam;
|
LPNMHDR nmhdr = (LPNMHDR)lParam;
|
||||||
int cur;
|
int cur;
|
||||||
if (nmhdr->idFrom != WIN_STARTWIN_TABCTL) break;
|
if (nmhdr->idFrom != WIN_STARTWIN_TABCTL) break;
|
||||||
cur = (int)SendMessage(nmhdr->hwndFrom, TCM_GETCURSEL,0,0);
|
cur = (int)SendMessage(nmhdr->hwndFrom, TCM_GETCURSEL,0,0);
|
||||||
switch (nmhdr->code) {
|
switch (nmhdr->code)
|
||||||
case TCN_SELCHANGING: {
|
{
|
||||||
|
case TCN_SELCHANGING:
|
||||||
|
{
|
||||||
if (cur < 0 || !pages[cur]) break;
|
if (cur < 0 || !pages[cur]) break;
|
||||||
ShowWindow(pages[cur],SW_HIDE);
|
ShowWindow(pages[cur],SW_HIDE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
case TCN_SELCHANGE: {
|
case TCN_SELCHANGE:
|
||||||
|
{
|
||||||
if (cur < 0 || !pages[cur]) break;
|
if (cur < 0 || !pages[cur]) break;
|
||||||
ShowWindow(pages[cur],SW_SHOW);
|
ShowWindow(pages[cur],SW_SHOW);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -252,12 +266,14 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
if (hbmp) {
|
if (hbmp)
|
||||||
|
{
|
||||||
DeleteObject(hbmp);
|
DeleteObject(hbmp);
|
||||||
hbmp = NULL;
|
hbmp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pages[TAB_CONFIG]) {
|
if (pages[TAB_CONFIG])
|
||||||
|
{
|
||||||
DestroyWindow(pages[TAB_CONFIG]);
|
DestroyWindow(pages[TAB_CONFIG]);
|
||||||
pages[TAB_CONFIG] = NULL;
|
pages[TAB_CONFIG] = NULL;
|
||||||
}
|
}
|
||||||
|
@ -266,7 +282,8 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
switch (LOWORD(wParam)) {
|
switch (LOWORD(wParam))
|
||||||
|
{
|
||||||
case WIN_STARTWIN_CANCEL:
|
case WIN_STARTWIN_CANCEL:
|
||||||
if (mode == TAB_CONFIG) done = 0;
|
if (mode == TAB_CONFIG) done = 0;
|
||||||
else quitevent++;
|
else quitevent++;
|
||||||
|
@ -295,7 +312,8 @@ int startwin_open(void)
|
||||||
icc.dwICC = ICC_TAB_CLASSES;
|
icc.dwICC = ICC_TAB_CLASSES;
|
||||||
InitCommonControlsEx(&icc);
|
InitCommonControlsEx(&icc);
|
||||||
startupdlg = CreateDialog((HINSTANCE)win_gethinstance(), MAKEINTRESOURCE(WIN_STARTWIN), NULL, startup_dlgproc);
|
startupdlg = CreateDialog((HINSTANCE)win_gethinstance(), MAKEINTRESOURCE(WIN_STARTWIN), NULL, startup_dlgproc);
|
||||||
if (startupdlg) {
|
if (startupdlg)
|
||||||
|
{
|
||||||
SetPage(TAB_MESSAGES);
|
SetPage(TAB_MESSAGES);
|
||||||
EnableConfig(0);
|
EnableConfig(0);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -332,25 +350,33 @@ int startwin_puts(const char *buf)
|
||||||
SendMessage(edctl, EM_SETSEL, (WPARAM)curlen, (LPARAM)curlen);
|
SendMessage(edctl, EM_SETSEL, (WPARAM)curlen, (LPARAM)curlen);
|
||||||
linesbefore = SendMessage(edctl, EM_GETLINECOUNT, 0,0);
|
linesbefore = SendMessage(edctl, EM_GETLINECOUNT, 0,0);
|
||||||
p = buf;
|
p = buf;
|
||||||
while (*p) {
|
while (*p)
|
||||||
if (newline) {
|
{
|
||||||
|
if (newline)
|
||||||
|
{
|
||||||
SendMessage(edctl, EM_REPLACESEL, 0, (LPARAM)"\r\n");
|
SendMessage(edctl, EM_REPLACESEL, 0, (LPARAM)"\r\n");
|
||||||
newline = 0;
|
newline = 0;
|
||||||
}
|
}
|
||||||
q = p;
|
q = p;
|
||||||
while (*q && *q != '\n') q++;
|
while (*q && *q != '\n') q++;
|
||||||
memcpy(workbuf, p, q-p);
|
memcpy(workbuf, p, q-p);
|
||||||
if (*q == '\n') {
|
if (*q == '\n')
|
||||||
if (!q[1]) {
|
{
|
||||||
|
if (!q[1])
|
||||||
|
{
|
||||||
newline = 1;
|
newline = 1;
|
||||||
workbuf[q-p] = 0;
|
workbuf[q-p] = 0;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
workbuf[q-p] = '\r';
|
workbuf[q-p] = '\r';
|
||||||
workbuf[q-p+1] = '\n';
|
workbuf[q-p+1] = '\n';
|
||||||
workbuf[q-p+2] = 0;
|
workbuf[q-p+2] = 0;
|
||||||
}
|
}
|
||||||
p = q+1;
|
p = q+1;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
workbuf[q-p] = 0;
|
workbuf[q-p] = 0;
|
||||||
p = q;
|
p = q;
|
||||||
}
|
}
|
||||||
|
@ -395,8 +421,10 @@ int startwin_run(void)
|
||||||
settings.forcesetup = forcesetup;
|
settings.forcesetup = forcesetup;
|
||||||
PopulateForm();
|
PopulateForm();
|
||||||
|
|
||||||
while (done < 0) {
|
while (done < 0)
|
||||||
switch (GetMessage(&msg, NULL, 0,0)) {
|
{
|
||||||
|
switch (GetMessage(&msg, NULL, 0,0))
|
||||||
|
{
|
||||||
case 0: done = 1; break;
|
case 0: done = 1; break;
|
||||||
case -1: return -1;
|
case -1: return -1;
|
||||||
default:
|
default:
|
||||||
|
@ -409,7 +437,8 @@ int startwin_run(void)
|
||||||
|
|
||||||
SetPage(TAB_MESSAGES);
|
SetPage(TAB_MESSAGES);
|
||||||
EnableConfig(0);
|
EnableConfig(0);
|
||||||
if (done) {
|
if (done)
|
||||||
|
{
|
||||||
fullscreen = settings.fullscreen;
|
fullscreen = settings.fullscreen;
|
||||||
xdimgame = settings.xdim3d;
|
xdimgame = settings.xdim3d;
|
||||||
ydimgame = settings.ydim3d;
|
ydimgame = settings.ydim3d;
|
||||||
|
|
Loading…
Reference in a new issue