git-svn-id: https://svn.eduke32.com/eduke32@622 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-02-18 08:10:54 +00:00
parent 519fa4cd81
commit c45bd7dd53
14 changed files with 370 additions and 346 deletions

View file

@ -31,12 +31,12 @@ TARGETOPTS=/DNOASM
!ifdef DEBUG !ifdef DEBUG
# debugging options # debugging options
flags_cl=/Ot /Zi /MTd flags_cl=/Ot /Zi
flags_link=/DEBUG flags_link=/DEBUG
!else !else
# release options # release options
#flags_cl=/Ox #flags_cl=/Ox
flags_cl= /O2 /Ox /MT flags_cl= /O2 /Ox
flags_link=/RELEASE flags_link=/RELEASE
!endif !endif
@ -44,7 +44,7 @@ CC=cl
AS=ml AS=ml
RC=rc RC=rc
LINK=link /opt:nowin98 /opt:ref /nologo LINK=link /opt:nowin98 /opt:ref /nologo
CFLAGS=$(CFLAGS) /nologo /J $(flags_cl) $(TARGETOPTS) /I$(INC) /I$(DXROOT)\include /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" CFLAGS=$(CFLAGS) /nologo /MD /J $(flags_cl) $(TARGETOPTS) /I$(INC) /I$(DXROOT)\include /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include"
ASFLAGS=/nologo /coff ASFLAGS=/nologo /coff
EXESUFFIX=.exe EXESUFFIX=.exe

View file

@ -174,8 +174,8 @@ static float fogresult, fogcol[4];
// making this a macro should speed things up at the expense of code size // making this a macro should speed things up at the expense of code size
#define fogcalc(shade, vis, pal) \ #define fogcalc(shade, vis, pal) \
{ \ { \
fogresult = (float)gvisibility*(vis+16+(shade<0?(-(shade)*(shade))*0.125f:((shade)*(shade))*0.125f)); \ fogresult = (float)gvisibility*(vis+16+(shade<0?(-shade*shade)*0.125f:(shade*shade)*0.125f)); \
if (vis > 239) fogresult = (float)gvisibility*((vis-240+(shade<0?(-(shade)*(shade))*0.125f:((shade)*(shade))*0.125f))/(klabs(vis-256))); \ if (vis > 239) fogresult = (float)gvisibility*((vis-240+(shade<0?(-shade*shade)*0.125f:(shade*shade)*0.125f))/(klabs(vis-256))); \
fogresult = min(max(fogresult, 0.01f),10.f); \ fogresult = min(max(fogresult, 0.01f),10.f); \
fogcol[0] = (float)palookupfog[pal].r / 63.f; \ fogcol[0] = (float)palookupfog[pal].r / 63.f; \
fogcol[1] = (float)palookupfog[pal].g / 63.f; \ fogcol[1] = (float)palookupfog[pal].g / 63.f; \
@ -3379,7 +3379,7 @@ static void polymost_drawalls(int bunch)
#ifdef USE_OPENGL #ifdef USE_OPENGL
if (!nofog) if (!nofog)
{ {
fogcalc(sec->ceilingshade,sec->visibility,sec->floorpal); fogcalc(sec->ceilingshade,sec->visibility,sec->ceilingpal);
bglFogf(GL_FOG_DENSITY,fogresult); bglFogf(GL_FOG_DENSITY,fogresult);
bglFogfv(GL_FOG_COLOR,fogcol); bglFogfv(GL_FOG_COLOR,fogcol);
} }
@ -3401,7 +3401,7 @@ static void polymost_drawalls(int bunch)
*/ */
if (!nofog) if (!nofog)
{ {
fogcalc(sec->ceilingshade,sec->visibility,sec->floorpal); fogcalc(sec->ceilingshade,sec->visibility,sec->ceilingpal);
bglFogf(GL_FOG_DENSITY,fogresult * 0.005); bglFogf(GL_FOG_DENSITY,fogresult * 0.005);
bglFogfv(GL_FOG_COLOR,fogcol); bglFogfv(GL_FOG_COLOR,fogcol);
} }
@ -4377,7 +4377,6 @@ void polymost_drawsprite(int snum)
method = 1+4; method = 1+4;
if (tspr->cstat&2) { if (!(tspr->cstat&512)) method = 2+4; else method = 3+4; } if (tspr->cstat&2) { if (!(tspr->cstat&512)) method = 2+4; else method = 3+4; }
#ifdef USE_OPENGL #ifdef USE_OPENGL
if (r_depthpeeling) if (r_depthpeeling)
{ {
@ -4386,6 +4385,7 @@ void polymost_drawsprite(int snum)
if (!(((tspr->cstat&2) || (gltexmayhavealpha(globalpicnum,tspr->pal)))) && peelcompiling) if (!(((tspr->cstat&2) || (gltexmayhavealpha(globalpicnum,tspr->pal)))) && peelcompiling)
return; // discard opaque sprite when composing the depth peels return; // discard opaque sprite when composing the depth peels
} }
if (!nofog && rendmode >= 3) if (!nofog && rendmode >= 3)
{ {
fogcalc(globalshade,sector[tspr->sectnum].visibility,sector[tspr->sectnum].floorpal); fogcalc(globalshade,sector[tspr->sectnum].visibility,sector[tspr->sectnum].floorpal);

View file

@ -161,6 +161,8 @@ void wm_setapptitle(char *name)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int r; int r;
char *argp;
FILE *fp;
buildkeytranslationtable(); buildkeytranslationtable();
@ -172,6 +174,25 @@ int main(int argc, char *argv[])
_buildargc = argc; _buildargc = argc;
_buildargv = (const char**)argv; _buildargv = (const char**)argv;
// pipe standard outputs to files
if ((argp = Bgetenv("BUILD_LOGSTDOUT")) != NULL)
if (!Bstrcasecmp(argp, "TRUE"))
{
fp = freopen("stdout.txt", "w", stdout);
if (!fp)
{
fp = fopen("stdout.txt", "w");
}
if (fp) setvbuf(fp, 0, _IONBF, 0);
*stdout = *fp;
*stderr = *fp;
}
#if defined(USE_OPENGL) && defined(POLYMOST)
if ((argp = Bgetenv("BUILD_NOFOG")) != NULL)
nofog = Batol(argp);
#endif
baselayer_init(); baselayer_init();
r = app_main(_buildargc, _buildargv); r = app_main(_buildargc, _buildargv);

View file

@ -589,7 +589,7 @@ int startwin_idle(void *s)
int startwin_run(void) int startwin_run(void)
{ {
if (!gtkenabled) return 0; if (!gtkenabled) return 1;
if (!startwin) return 1; if (!startwin) return 1;
SetPage(TAB_CONFIG); SetPage(TAB_CONFIG);

View file

@ -34,7 +34,7 @@ inline void updateinterpolations(void) //Stick at beginning of domovethings
for (;i>=0;i--) oldipos[i] = *curipos[i]; for (;i>=0;i--) oldipos[i] = *curipos[i];
} }
void setinterpolation(int *posptr) void setinterpolation(intptr_t *posptr)
{ {
int i=numinterpolations-1; int i=numinterpolations-1;
@ -46,7 +46,7 @@ void setinterpolation(int *posptr)
numinterpolations++; numinterpolations++;
} }
void stopinterpolation(int *posptr) void stopinterpolation(intptr_t *posptr)
{ {
int i=numinterpolations-1; int i=numinterpolations-1;
@ -537,9 +537,9 @@ int movesprite(int spritenum, int xchange, int ychange, int zchange, unsigned in
inline int ssp(int i,unsigned int cliptype) //The set sprite function inline int ssp(int i,unsigned int cliptype) //The set sprite function
{ {
return (movesprite(i, return (movesprite(i,
(sprite[i].xvel*(sintable[(sprite[i].ang+512)&2047]))>>14, (sprite[i].xvel*(sintable[(sprite[i].ang+512)&2047]))>>14,
(sprite[i].xvel*(sintable[sprite[i].ang&2047]))>>14,sprite[i].zvel, (sprite[i].xvel*(sintable[sprite[i].ang&2047]))>>14,sprite[i].zvel,
cliptype)==0); cliptype)==0);
} }
#undef deletesprite #undef deletesprite

View file

@ -184,6 +184,14 @@ void CONFIG_SetDefaults(void)
int32 i,f; int32 i,f;
ud.config.scripthandle = -1; ud.config.scripthandle = -1;
ud.config.ScreenWidth = 1024;
ud.config.ScreenHeight = 768;
ud.config.ScreenMode = 0;
#if defined(POLYMOST) && defined(USE_OPENGL)
ud.config.ScreenBPP = 32;
#else
ud.config.ScreenBPP = 8;
#endif
ud.config.useprecache = 1; ud.config.useprecache = 1;
ud.config.ForceSetup = 1; ud.config.ForceSetup = 1;
ud.config.AmbienceToggle = 1; ud.config.AmbienceToggle = 1;

View file

@ -27,8 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define HEAD "EDuke32"VERSION" (shareware)" #define HEAD "EDuke32"VERSION" (shareware)"
#define HEAD2 "EDuke32"VERSION #define HEAD2 "EDuke32"VERSION
#include "compat.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -692,9 +690,9 @@ extern int everyothertime;
extern int mymaxlag, otherminlag, bufferjitter; extern int mymaxlag, otherminlag, bufferjitter;
extern int numinterpolations, startofdynamicinterpolations; extern int numinterpolations, startofdynamicinterpolations;
extern int oldipos[MAXINTERPOLATIONS]; extern intptr_t oldipos[MAXINTERPOLATIONS];
extern int bakipos[MAXINTERPOLATIONS]; extern intptr_t bakipos[MAXINTERPOLATIONS];
extern int *curipos[MAXINTERPOLATIONS]; extern intptr_t *curipos[MAXINTERPOLATIONS];
extern short numclouds,clouds[128],cloudx[128],cloudy[128]; extern short numclouds,clouds[128],cloudx[128],cloudy[128];
extern int cloudtotalclock,totalmemory; extern int cloudtotalclock,totalmemory;

View file

@ -150,98 +150,98 @@ extern void computergetinput(int snum, input *syn);
keydef keynames[]= keydef keynames[]=
{ {
{"COMMA", sc_Comma}, {"COMMA", sc_Comma},
{"PERIOD", sc_Period}, {"PERIOD", sc_Period},
{"ENTER", sc_Enter}, {"ENTER", sc_Enter},
{"ESCAPE", sc_Escape}, {"ESCAPE", sc_Escape},
{"SPACE", sc_Space}, {"SPACE", sc_Space},
{"BACKSPACE", sc_BackSpace}, {"BACKSPACE", sc_BackSpace},
{"TAB", sc_Tab}, {"TAB", sc_Tab},
{"LEFTALT", sc_LeftAlt}, {"LEFTALT", sc_LeftAlt},
{"LEFTCONTROL", sc_LeftControl}, {"LEFTCONTROL", sc_LeftControl},
{"CAPSLOCK", sc_CapsLock}, {"CAPSLOCK", sc_CapsLock},
{"LEFTSHIFT", sc_LeftShift}, {"LEFTSHIFT", sc_LeftShift},
{"RIGHTSHIFT", sc_RightShift}, {"RIGHTSHIFT", sc_RightShift},
{"F1", sc_F1}, {"F1", sc_F1},
{"F2", sc_F2}, {"F2", sc_F2},
{"F3", sc_F3}, {"F3", sc_F3},
{"F4", sc_F4}, {"F4", sc_F4},
{"F5", sc_F5}, {"F5", sc_F5},
{"F6", sc_F6}, {"F6", sc_F6},
{"F7", sc_F7}, {"F7", sc_F7},
{"F8", sc_F8}, {"F8", sc_F8},
{"F9", sc_F9}, {"F9", sc_F9},
{"F10", sc_F10}, {"F10", sc_F10},
{"F11", sc_F11}, {"F11", sc_F11},
{"F12", sc_F12}, {"F12", sc_F12},
{"KPAD_STAR", sc_Kpad_Star}, {"KPAD_STAR", sc_Kpad_Star},
{"PAUSE", sc_Pause}, {"PAUSE", sc_Pause},
{"SCROLLLOCK", sc_ScrollLock}, {"SCROLLLOCK", sc_ScrollLock},
{"NUMLOCK", sc_NumLock}, {"NUMLOCK", sc_NumLock},
{"SLASH", sc_Slash}, {"SLASH", sc_Slash},
{"SEMICOLON", sc_SemiColon}, {"SEMICOLON", sc_SemiColon},
{"QUOTE", sc_Quote}, {"QUOTE", sc_Quote},
{"TILDE", sc_Tilde}, {"TILDE", sc_Tilde},
{"BACKSLASH", sc_BackSlash}, {"BACKSLASH", sc_BackSlash},
{"OPENBRACKET", sc_OpenBracket}, {"OPENBRACKET", sc_OpenBracket},
{"CLOSEBRACKET",sc_CloseBracket}, {"CLOSEBRACKET",sc_CloseBracket},
{"1", sc_1}, {"1", sc_1},
{"2", sc_2}, {"2", sc_2},
{"3", sc_3}, {"3", sc_3},
{"4", sc_4}, {"4", sc_4},
{"5", sc_5}, {"5", sc_5},
{"6", sc_6}, {"6", sc_6},
{"7", sc_7}, {"7", sc_7},
{"8", sc_8}, {"8", sc_8},
{"9", sc_9}, {"9", sc_9},
{"0", sc_0}, {"0", sc_0},
{"MINUS", sc_Minus}, {"MINUS", sc_Minus},
{"EQUALS", sc_Equals}, {"EQUALS", sc_Equals},
{"PLUS", sc_Plus}, {"PLUS", sc_Plus},
{"KPAD_1", sc_kpad_1}, {"KPAD_1", sc_kpad_1},
{"KPAD_2", sc_kpad_2}, {"KPAD_2", sc_kpad_2},
{"KPAD_3", sc_kpad_3}, {"KPAD_3", sc_kpad_3},
{"KPAD_4", sc_kpad_4}, {"KPAD_4", sc_kpad_4},
{"KPAD_5", sc_kpad_5}, {"KPAD_5", sc_kpad_5},
{"KPAD_6", sc_kpad_6}, {"KPAD_6", sc_kpad_6},
{"KPAD_7", sc_kpad_7}, {"KPAD_7", sc_kpad_7},
{"KPAD_8", sc_kpad_8}, {"KPAD_8", sc_kpad_8},
{"KPAD_9", sc_kpad_9}, {"KPAD_9", sc_kpad_9},
{"KPAD_0", sc_kpad_0}, {"KPAD_0", sc_kpad_0},
{"KPAD_MINUS", sc_kpad_Minus}, {"KPAD_MINUS", sc_kpad_Minus},
{"KPAD_PLUS", sc_kpad_Plus}, {"KPAD_PLUS", sc_kpad_Plus},
{"KPAD_PERIOD", sc_kpad_Period}, {"KPAD_PERIOD", sc_kpad_Period},
{"A", sc_A}, {"A", sc_A},
{"B", sc_B}, {"B", sc_B},
{"C", sc_C}, {"C", sc_C},
{"D", sc_D}, {"D", sc_D},
{"E", sc_E}, {"E", sc_E},
{"F", sc_F}, {"F", sc_F},
{"G", sc_G}, {"G", sc_G},
{"H", sc_H}, {"H", sc_H},
{"I", sc_I}, {"I", sc_I},
{"J", sc_J}, {"J", sc_J},
{"K", sc_K}, {"K", sc_K},
{"L", sc_L}, {"L", sc_L},
{"M", sc_M}, {"M", sc_M},
{"N", sc_N}, {"N", sc_N},
{"O", sc_O}, {"O", sc_O},
{"P", sc_P}, {"P", sc_P},
{"Q", sc_Q}, {"Q", sc_Q},
{"R", sc_R}, {"R", sc_R},
{"S", sc_S}, {"S", sc_S},
{"T", sc_T}, {"T", sc_T},
{"U", sc_U}, {"U", sc_U},
{"V", sc_V}, {"V", sc_V},
{"W", sc_W}, {"W", sc_W},
{"X", sc_X}, {"X", sc_X},
{"Y", sc_Y}, {"Y", sc_Y},
{"Z", sc_Z}, {"Z", sc_Z},
{0,0} {0,0}
}; };
keybind boundkeys[MAXBOUNDKEYS]; keybind boundkeys[MAXBOUNDKEYS];
@ -1224,8 +1224,8 @@ void faketimerhandler(void)
packbuf[j++] = (char)nsyn[0].horz; packbuf[j++] = (char)nsyn[0].horz;
packbuf[k] |= 128; packbuf[k] |= 128;
} }
k++; // k++;
packbuf[k] = 0; packbuf[++k] = 0;
if ((nsyn[0].extbits^osyn[0].extbits)&0x000000ff) packbuf[j++] = (nsyn[0].extbits&255), packbuf[k] |= 1; if ((nsyn[0].extbits^osyn[0].extbits)&0x000000ff) packbuf[j++] = (nsyn[0].extbits&255), packbuf[k] |= 1;
if ((nsyn[0].extbits^osyn[0].extbits)&0x0000ff00) packbuf[j++] = ((nsyn[0].extbits>>8)&255), packbuf[k] |= 2; if ((nsyn[0].extbits^osyn[0].extbits)&0x0000ff00) packbuf[j++] = ((nsyn[0].extbits>>8)&255), packbuf[k] |= 2;
if ((nsyn[0].extbits^osyn[0].extbits)&0x00ff0000) packbuf[j++] = ((nsyn[0].extbits>>16)&255), packbuf[k] |= 4; if ((nsyn[0].extbits^osyn[0].extbits)&0x00ff0000) packbuf[j++] = ((nsyn[0].extbits>>16)&255), packbuf[k] |= 4;
@ -4003,7 +4003,7 @@ void displayrooms(int snum,int smoothratio)
} }
#ifdef POLYMOST #ifdef POLYMOST
if (ud.overhead_on == 2 || ud.show_help || (p->cursectnum == -1 && rendmode != 4)) if (ud.overhead_on == 2 || ud.show_help || (p->cursectnum == -1 && rendmode < 3))
#else #else
if (ud.overhead_on == 2 || ud.show_help || p->cursectnum == -1) if (ud.overhead_on == 2 || ud.show_help || p->cursectnum == -1)
#endif #endif
@ -4018,7 +4018,7 @@ void displayrooms(int snum,int smoothratio)
ud.camerasect = p->cursectnum; ud.camerasect = p->cursectnum;
#ifdef POLYMOST #ifdef POLYMOST
if (rendmode != 4) if (rendmode < 3)
#endif #endif
if (ud.camerasect < 0 || ud.camerasect >= MAXSECTORS) return; if (ud.camerasect < 0 || ud.camerasect >= MAXSECTORS) return;
@ -6731,8 +6731,8 @@ void animatesprites(int x,int y,int a,int smoothratio)
tsprite[spritesortcnt].statnum = 99; tsprite[spritesortcnt].statnum = 99;
/* tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3); /* tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
if (t->yrepeat < 4) t->yrepeat = 4; */ if (t->yrepeat < 4) t->yrepeat = 4; */
tsprite[spritesortcnt].shade = t->shade; tsprite[spritesortcnt].shade = t->shade;
tsprite[spritesortcnt].cstat = 0; tsprite[spritesortcnt].cstat = 0;
@ -7798,12 +7798,12 @@ static void nonsharedkeys(void)
int i,ch; int i,ch;
int j; int j;
for(i=0;i<256;i++) for (i=0;i<256;i++)
if (*boundkeys[i].name&&KB_KeyPressed(i)) if (*boundkeys[i].name&&KB_KeyPressed(i))
{ {
load_script(boundkeys[i].name); load_script(boundkeys[i].name);
KB_ClearKeyDown(i); KB_ClearKeyDown(i);
} }
if (ud.recstat == 2) if (ud.recstat == 2)
{ {
ControlInfo noshareinfo; ControlInfo noshareinfo;

View file

@ -41,7 +41,7 @@ intptr_t *casescriptptr=NULL; // the pointer to the start of the case table
static int casecount = 0; static int casecount = 0;
static int checking_switch = 0, current_event = -1; static int checking_switch = 0, current_event = -1;
static int labelsonly = 0, nokeywordcheck = 0, dynamicremap = 0; static int labelsonly = 0, nokeywordcheck = 0, dynamicremap = 0;
static int num_braces = 0; // init to some sensible defaults static int num_braces = 0;
int redefined_quote_count = 0; int redefined_quote_count = 0;
@ -1377,8 +1377,10 @@ static void transvartype(int type)
if (!(error || warning) && g_ScriptDebug) if (!(error || warning) && g_ScriptDebug)
initprintf("%s:%d: debug: accepted constant %d in place of gamevar.\n",compilefile,line_number,atol(textptr)); initprintf("%s:%d: debug: accepted constant %d in place of gamevar.\n",compilefile,line_number,atol(textptr));
*scriptptr++=MAXGAMEVARS; *scriptptr++=MAXGAMEVARS;
if (tolower(textptr[1])=='x')sscanf(textptr+2,"%x",scriptptr);else if (tolower(textptr[1])=='x')
*scriptptr=atol(textptr); sscanf(textptr+2,"%x",scriptptr);
else
*scriptptr=atol(textptr);
scriptptr++; scriptptr++;
getlabel(); getlabel();
return; return;
@ -1552,8 +1554,9 @@ static int transnum(int type)
} }
if (!(error || warning) && g_ScriptDebug > 1) if (!(error || warning) && g_ScriptDebug > 1)
initprintf("%s:%d: debug: accepted constant %d.\n",compilefile,line_number,atol(textptr)); initprintf("%s:%d: debug: accepted constant %d.\n",compilefile,line_number,atol(textptr));
if (tolower(textptr[1])=='x')sscanf(textptr+2,"%x",scriptptr);else if (tolower(textptr[1])=='x')sscanf(textptr+2,"%x",scriptptr);
*scriptptr = atol(textptr); else
*scriptptr = atol(textptr);
scriptptr++; scriptptr++;
textptr += l; textptr += l;

View file

@ -31,7 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "osd.h" #include "osd.h"
int g_i,g_p; int g_i,g_p;
static intptr_t g_x,*g_t; static int g_x;
static intptr_t *g_t;
static spritetype *g_sp; static spritetype *g_sp;
static int killit_flag; static int killit_flag;
@ -129,55 +130,45 @@ static void DoUserDef(int iSet, int lLabelID, int lVar2)
// if(iSet) // if(iSet)
// { // {
// ud.user_name[MAXPLAYERS][32] = lValue; // ud.user_name[MAXPLAYERS][32] = lValue;
// return;
// } // }
// return; } // SetGameVarID(lVar2, ud.user_name[MAXPLAYERS][32], g_i, g_p);
// {
// SetGameVarID(lVar2, ud.user_name[MAXPLAYERS][32], g_i, g_p);
// }
// return; // return;
// case USERDEFS_RIDECULE: // case USERDEFS_RIDECULE:
// if(iSet) // if(iSet)
// { // {
// ud.ridecule = lValue; // ud.ridecule = lValue;
// return;
// } // }
// return; } // SetGameVarID(lVar2, ud.ridecule, g_i, g_p);
// {
// SetGameVarID(lVar2, ud.ridecule, g_i, g_p);
// }
// return; // return;
// case USERDEFS_SAVEGAME: // case USERDEFS_SAVEGAME:
// if(iSet) // if(iSet)
// { // {
// ud.savegame = lValue; // ud.savegame = lValue;
// return;
// } // }
// return; } // SetGameVarID(lVar2, ud.savegame, g_i, g_p);
// {
// SetGameVarID(lVar2, ud.savegame, g_i, g_p);
// }
// return; // return;
// case USERDEFS_PWLOCKOUT: // case USERDEFS_PWLOCKOUT:
// if(iSet) // if(iSet)
// { // {
// ud.pwlockout = lValue; // ud.pwlockout = lValue;
// return;
// } // }
// return; } // SetGameVarID(lVar2, ud.pwlockout, g_i, g_p);
// {
// SetGameVarID(lVar2, ud.pwlockout, g_i, g_p);
// }
// return; // return;
// case USERDEFS_RTSNAME: // case USERDEFS_RTSNAME:
// if(iSet) // if(iSet)
// { // {
// ud.rtsname = lValue; // ud.rtsname = lValue;
// return;
// } // }
// return; } // SetGameVarID(lVar2, ud.rtsname, g_i, g_p);
// {
// SetGameVarID(lVar2, ud.rtsname, g_i, g_p);
// }
// return; // return;
case USERDEFS_OVERHEAD_ON: case USERDEFS_OVERHEAD_ON:
@ -469,11 +460,9 @@ static void DoUserDef(int iSet, int lLabelID, int lVar2)
// if(iSet) // if(iSet)
// { // {
// ud.wchoice = lValue; // ud.wchoice = lValue;
// return;
// } // }
// return; } // SetGameVarID(lVar2, ud.wchoice, g_i, g_p);
// {
// SetGameVarID(lVar2, ud.wchoice, g_i, g_p);
// }
// return; // return;
case USERDEFS_PLAYERAI: case USERDEFS_PLAYERAI:
@ -5069,24 +5058,31 @@ static int parse(void)
j=GetGameVarID(*insptr++, g_i, g_p); j=GetGameVarID(*insptr++, g_i, g_p);
if (i<MAXQUOTES&&fta_quotes[i] != NULL&&f<NUMGAMEFUNCTIONS) if (i<MAXQUOTES&&fta_quotes[i] != NULL&&f<NUMGAMEFUNCTIONS)
{ {
if (j<2)Bstrcpy(tempbuf,KB_ScanCodeToString(ud.config.KeyboardKeys[f][j]));else if (j<2)
Bstrcpy(tempbuf,KB_ScanCodeToString(ud.config.KeyboardKeys[f][j]));
else
{ {
Bstrcpy(tempbuf,KB_ScanCodeToString(ud.config.KeyboardKeys[f][0])); Bstrcpy(tempbuf,KB_ScanCodeToString(ud.config.KeyboardKeys[f][0]));
if (!*tempbuf) if (!*tempbuf)
Bstrcpy(tempbuf,KB_ScanCodeToString(ud.config.KeyboardKeys[f][1])); Bstrcpy(tempbuf,KB_ScanCodeToString(ud.config.KeyboardKeys[f][1]));
} }
} }
if (*tempbuf)Bstrcpy(fta_quotes[i],tempbuf);
if (*tempbuf)
Bstrcpy(fta_quotes[i],tempbuf);
break; break;
} }
case CON_QSUBSTR: case CON_QSUBSTR:
insptr++; insptr++;
{ {
char *s1,*s2;int q1,q2,st,ln; char *s1,*s2;
int q1,q2,st,ln;
q1 = GetGameVarID(*insptr++, g_i, g_p), q1 = GetGameVarID(*insptr++, g_i, g_p),
q2 = GetGameVarID(*insptr++, g_i, g_p); q2 = GetGameVarID(*insptr++, g_i, g_p);
st = GetGameVarID(*insptr++, g_i, g_p); st = GetGameVarID(*insptr++, g_i, g_p);
ln = GetGameVarID(*insptr++, g_i, g_p); ln = GetGameVarID(*insptr++, g_i, g_p);
if (q1<MAXQUOTES&&fta_quotes[q1] != NULL&&q2<MAXQUOTES&&fta_quotes[q2] != NULL) if (q1<MAXQUOTES&&fta_quotes[q1] != NULL&&q2<MAXQUOTES&&fta_quotes[q2] != NULL)
{ {
s1=fta_quotes[q1]; s1=fta_quotes[q1];
@ -7258,13 +7254,13 @@ static int parse(void)
case CON_GETCURRADDRESS: case CON_GETCURRADDRESS:
insptr++; insptr++;
j=*insptr++; j=*insptr++;
SetGameVarID(j, (intptr_t) insptr, g_i, g_p); SetGameVarID(j, (intptr_t)(insptr-script), g_i, g_p);
break; break;
case CON_JUMP: case CON_JUMP:
insptr++; insptr++;
j = GetGameVarID(*insptr++, g_i, g_p); j = GetGameVarID(*insptr++, g_i, g_p);
insptr = (intptr_t *)j; insptr = (intptr_t *)(j+script);
break; break;
default: default:

View file

@ -163,9 +163,9 @@ int mymaxlag, otherminlag, bufferjitter = 1;
short numclouds,clouds[128],cloudx[128],cloudy[128]; short numclouds,clouds[128],cloudx[128],cloudy[128];
int cloudtotalclock = 0,totalmemory = 0; int cloudtotalclock = 0,totalmemory = 0;
int numinterpolations = 0, startofdynamicinterpolations = 0; int numinterpolations = 0, startofdynamicinterpolations = 0;
int oldipos[MAXINTERPOLATIONS]; intptr_t oldipos[MAXINTERPOLATIONS];
int bakipos[MAXINTERPOLATIONS]; intptr_t bakipos[MAXINTERPOLATIONS];
int *curipos[MAXINTERPOLATIONS]; intptr_t *curipos[MAXINTERPOLATIONS];
int nextvoxid = 0; int nextvoxid = 0;

View file

@ -1,170 +1,164 @@
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
/* /*
Copyright (C) 2004, 2007 - EDuke32 developers Copyright (C) 2004, 2007 - EDuke32 developers
This file is part of EDuke32
EDuke32 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//-------------------------------------------------------------------------
#include "compat.h"
#define TICSPERFRAME 3
// #define VULGARITY
char *defsfilename = "duke3d.def";
extern char keystatus[];
extern short defaultspritecstat;
extern int posx, posy, posz, horiz, qsetmode;
extern short ang, cursectnum;
extern short ceilingheinum, floorheinum;
extern char names[MAXTILES][25];
extern int ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d;
extern int zmode, kensplayerheight, zlock;
extern short editstatus, searchit;
extern int searchx, searchy, osearchx, osearchy; //search input
extern short searchsector, searchwall, searchstat; //search output
extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
extern unsigned char tempshade, temppal, tempvis, tempxrepeat, tempyrepeat, somethingintab;
static int ototalclock = 0, clockval[16], clockcnt = 0;
#define NUMOPTIONS 9
#define NUMKEYS 19
char option[NUMOPTIONS] = {0,0,0,0,0,0,1,0,0};
unsigned char keys[NUMBUILDKEYS] =
{
0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39,
0x1e,0x2c,0xd1,0xc9,0x47,0x49,
0x9c,0x1c,0xd,0xc,0xf,0x29
};
int nextvoxid = 0;
extern int whitecol;
extern char vgapal16[4*256];
extern void AutoAlignWalls(int nWall0, int ply);
extern char changechar(char dachar, int dadir, char smooshyalign, char boundcheck);
extern void _printmessage16(char name[82]);
extern void updatenumsprites(void);
extern int lastpm16time, synctics;
extern int halfxdim16, midydim16, zoom;
extern void fixrepeats(short i);
char autospritehelp=0,autosecthelp=0;
short MinRate=24, MinD=3;
int xoldtimerhandler, lastmessagetime;
char tempbuf[1024]; //1024
int numsprite[MAXSPRITES];
int multisprite[MAXSPRITES];
char lo[32];
char levelname[255];
short curwall=0,curwallnum=0;
short cursearchsprite=0,cursearchspritenum=0,cursector_lotag=0,cursectornum=0;
short search_lotag=0,search_hitag=0;
char wallsprite=0;
char helpon=0;
//static char onwater=0;
unsigned char onnames=4, usedcount=1;
short cursprite;
int mousxplc, mousyplc, ppointhighlight;
int counter=0;
unsigned char nosprites=0,purpleon=0,skill=4;
unsigned char framerateon=1,tabgraphic=2,shadepreview=0,autosave=1,sidemode=0;
extern int vel, svel, hvel, angvel;
int xvel, yvel, timoff;
static void SearchSectorsForward();
static void SearchSectorsBackward();
static inline void SpriteName(short spritenum, char *lo2);
static int ActorMem(int i);
static void PrintStatus(char *string,int num,char x,char y,char color);
static void SetBOSS1Palette();
static void SetSLIMEPalette();
static void SetWATERPalette();
static void SetGAMEPalette();
static void kensetpalette(char *vgapal);
extern short grid;
static void EditSpriteData(short spritenum);
static void EditWallData(short wallnum);
static void EditSectorData(short sectnum);
static void FuncMenu(void);
char GAMEpalette[768];
char WATERpalette[768];
char SLIMEpalette[768];
char TITLEpalette[768];
char REALMSpalette[768];
char BOSS1palette[768];
char num_tables;
int updownunits=1024;
extern short highlightsector[MAXSECTORS], highlightsectorcnt;
extern short highlight[MAXWALLS];
extern short pointhighlight, linehighlight, highlightcnt;
extern short asksave;
char getmessage[162], getmessageleng;
int getmessagetimeoff, charsperline;
extern int startposx, startposy, startposz;
extern short startang, startsectnum;
int autosavetimer;
extern int numsprites;
extern char spritecol2d[MAXTILES][2];
extern char custom2dcolors;
extern char mlook;
int intro=0;
extern int ydim16, halfxdim16, midydim16, zoom;
extern intptr_t frameplace;
extern char pow2char[8];
static int acurpalette=0;
extern void showsectordata(short sectnum);
extern void showwalldata(short wallnum);
extern void showspritedata(short spritenum);
extern int checksectorpointer(short i, short sectnum);
extern double msens;
void ContextHelp(short spritenum);
void ResetKeys();
extern void fixspritesectors(void);
#define KEY_PRESSED(sc) KB_KeyPressed((sc))
// REM : This file should be included in file BUILD.C _ONLY_
#include "names.h" This file is part of EDuke32
EDuke32 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//-------------------------------------------------------------------------
#include "compat.h"
#define TICSPERFRAME 3
// #define VULGARITY
char *defsfilename = "duke3d.def";
extern char keystatus[];
extern short defaultspritecstat;
extern int posx, posy, posz, horiz, qsetmode;
extern short ang, cursectnum;
extern short ceilingheinum, floorheinum;
extern char names[MAXTILES][25];
extern int ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d;
extern int zmode, kensplayerheight, zlock;
extern short editstatus, searchit;
extern int searchx, searchy, osearchx, osearchy; //search input
extern short searchsector, searchwall, searchstat; //search output
extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
extern unsigned char tempshade, temppal, tempvis, tempxrepeat, tempyrepeat, somethingintab;
static int ototalclock = 0, clockval[16], clockcnt = 0;
#define NUMOPTIONS 9
#define NUMKEYS 19
char option[NUMOPTIONS] = {0,0,0,0,0,0,1,0,0};
unsigned char keys[NUMBUILDKEYS] =
{
0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39,
0x1e,0x2c,0xd1,0xc9,0x47,0x49,
0x9c,0x1c,0xd,0xc,0xf,0x29
};
int nextvoxid = 0;
extern int whitecol;
extern char vgapal16[4*256];
extern void AutoAlignWalls(int nWall0, int ply);
extern char changechar(char dachar, int dadir, char smooshyalign, char boundcheck);
extern void _printmessage16(char name[82]);
extern void updatenumsprites(void);
extern int lastpm16time, synctics;
extern int halfxdim16, midydim16, zoom;
extern void fixrepeats(short i);
char autospritehelp=0,autosecthelp=0;
short MinRate=24, MinD=3;
int xoldtimerhandler, lastmessagetime;
char tempbuf[1024]; //1024
int numsprite[MAXSPRITES];
int multisprite[MAXSPRITES];
char lo[32];
char levelname[255];
short curwall=0,curwallnum=0;
short cursearchsprite=0,cursearchspritenum=0,cursector_lotag=0,cursectornum=0;
short search_lotag=0,search_hitag=0;
char wallsprite=0;
char helpon=0;
//static char onwater=0;
unsigned char onnames=4, usedcount=1;
short cursprite;
int mousxplc, mousyplc, ppointhighlight;
int counter=0;
unsigned char nosprites=0,purpleon=0,skill=4;
unsigned char framerateon=1,tabgraphic=2,shadepreview=0,autosave=1,sidemode=0;
extern int vel, svel, hvel, angvel;
int xvel, yvel, timoff;
static void SearchSectorsForward();
static void SearchSectorsBackward();
static inline void SpriteName(short spritenum, char *lo2);
static int ActorMem(int i);
static void PrintStatus(char *string,int num,char x,char y,char color);
static void SetBOSS1Palette();
static void SetSLIMEPalette();
static void SetWATERPalette();
static void SetGAMEPalette();
static void kensetpalette(char *vgapal);
extern short grid;
static void EditSpriteData(short spritenum);
static void EditWallData(short wallnum);
static void EditSectorData(short sectnum);
static void FuncMenu(void);
char GAMEpalette[768];
char WATERpalette[768];
char SLIMEpalette[768];
char TITLEpalette[768];
char REALMSpalette[768];
char BOSS1palette[768];
char num_tables;
int updownunits=1024;
extern short highlightsector[MAXSECTORS], highlightsectorcnt;
extern short highlight[MAXWALLS];
extern short pointhighlight, linehighlight, highlightcnt;
extern short asksave;
char getmessage[162], getmessageleng;
int getmessagetimeoff, charsperline;
extern int startposx, startposy, startposz;
extern short startang, startsectnum;
int autosavetimer;
extern int numsprites;
extern char spritecol2d[MAXTILES][2];
extern char custom2dcolors;
extern char mlook;
int intro=0;
extern int ydim16, halfxdim16, midydim16, zoom;
extern intptr_t frameplace;
extern char pow2char[8];
static int acurpalette=0;
extern void showsectordata(short sectnum);
extern void showwalldata(short wallnum);
extern void showspritedata(short spritenum);
extern int checksectorpointer(short i, short sectnum);
extern double msens;
void ContextHelp(short spritenum);
void ResetKeys();
extern void fixspritesectors(void);
#define KEY_PRESSED(sc) KB_KeyPressed((sc))
// This table defines the various zoom levels, the numbers being the pixel width // This table defines the various zoom levels, the numbers being the pixel width
// and height of the sprite when plotted on the screen. Probably zooms in too far // and height of the sprite when plotted on the screen. Probably zooms in too far
@ -185,26 +179,26 @@ typedef struct
{ {
int *pIds ; // ptr to list of tile Ids int *pIds ; // ptr to list of tile Ids
int nIds ; // num of tile ids int nIds ; // num of tile ids
char *szText ; // description to present to user.
char key1 ; // key1 and key2 are two alternative keypresses used to char key1 ; // key1 and key2 are two alternative keypresses used to
char key2 ; // select tile set. Bodge to do eary upper/lower case handling char key2 ; // select tile set. Bodge to do eary upper/lower case handling
char *szText ; // description to present to user. } TileGroup;
} TileGroup;
#define MAX_TILE_GROUPS 32
#define MAX_TILE_GROUPS 32 #define MAX_TILE_GROUP_ENTRIES 1024
#define MAX_TILE_GROUP_ENTRIES 1024
TileGroup s_TileGroups[MAX_TILE_GROUPS]; TileGroup s_TileGroups[MAX_TILE_GROUPS];
static unsigned int tile_groups = 0; static unsigned int tile_groups = 0;
#define FIRST_USER_ART_TILE 3584 #define FIRST_USER_ART_TILE 3584
// Some atomic tiles are sprinkled in the V1.3d's area but // Some atomic tiles are sprinkled in the V1.3d's area but
// this is where the main atomic tiles start :- // this is where the main atomic tiles start :-
#define FIRST_ATOMIC_TILE 4096 #define FIRST_ATOMIC_TILE 4096
#define FIRST_EXTENDED_TILE 6144 #define FIRST_EXTENDED_TILE 6144
#define SECOND_EXTENDED_TILE 9216 #define SECOND_EXTENDED_TILE 9216
extern short localartfreq[MAXTILES]; extern short localartfreq[MAXTILES];
extern short localartlookup[MAXTILES], localartlookupnum; extern short localartlookup[MAXTILES], localartlookupnum;
extern int lockclock; extern int lockclock;
extern void clearkeys(void); extern void clearkeys(void);

View file

@ -235,7 +235,9 @@ int loadplayer(int spot)
if (kdfread(&sprite[0],sizeof(spritetype),MAXSPRITES,fil) != MAXSPRITES) goto corrupt; if (kdfread(&sprite[0],sizeof(spritetype),MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
if (kdfread(&spriteext[0],sizeof(spriteexttype),MAXSPRITES,fil) != MAXSPRITES) goto corrupt; if (kdfread(&spriteext[0],sizeof(spriteexttype),MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
for(i=0;i<MAXSPRITES;i++)if(spriteext[i].mdanimtims)spriteext[i].mdanimtims+=mdtims; for (i=0;i<MAXSPRITES;i++)
if (spriteext[i].mdanimtims)
spriteext[i].mdanimtims+=mdtims;
#endif #endif
if (kdfread(&headspritesect[0],2,MAXSECTORS+1,fil) != MAXSECTORS+1) goto corrupt; if (kdfread(&headspritesect[0],2,MAXSECTORS+1,fil) != MAXSECTORS+1) goto corrupt;
if (kdfread(&prevspritesect[0],2,MAXSPRITES,fil) != MAXSPRITES) goto corrupt; if (kdfread(&prevspritesect[0],2,MAXSPRITES,fil) != MAXSPRITES) goto corrupt;
@ -588,15 +590,17 @@ int saveplayer(int spot)
dfwrite(&sector[0],sizeof(sectortype),MAXSECTORS,fil); dfwrite(&sector[0],sizeof(sectortype),MAXSECTORS,fil);
dfwrite(&sprite[0],sizeof(spritetype),MAXSPRITES,fil); dfwrite(&sprite[0],sizeof(spritetype),MAXSPRITES,fil);
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
for(i=0;i<MAXSPRITES;i++)if(spriteext[i].mdanimtims) for (i=0;i<MAXSPRITES;i++)
{ if (spriteext[i].mdanimtims)
spriteext[i].mdanimtims=spriteext[i].mdanimtims-mdtims; {
if(!spriteext[i].mdanimtims)spriteext[i].mdanimtims++; spriteext[i].mdanimtims=spriteext[i].mdanimtims-mdtims;
} if (!spriteext[i].mdanimtims)
spriteext[i].mdanimtims++;
}
#endif #endif
dfwrite(&spriteext[0],sizeof(spriteexttype),MAXSPRITES,fil); dfwrite(&spriteext[0],sizeof(spriteexttype),MAXSPRITES,fil);
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
for(i=0;i<MAXSPRITES;i++)if(spriteext[i].mdanimtims)spriteext[i].mdanimtims+=mdtims; for (i=0;i<MAXSPRITES;i++)if (spriteext[i].mdanimtims)spriteext[i].mdanimtims+=mdtims;
#endif #endif
dfwrite(&headspritesect[0],2,MAXSECTORS+1,fil); dfwrite(&headspritesect[0],2,MAXSECTORS+1,fil);
dfwrite(&prevspritesect[0],2,MAXSPRITES,fil); dfwrite(&prevspritesect[0],2,MAXSPRITES,fil);

View file

@ -739,7 +739,7 @@ extern char *duke3dgrp;
int startwin_run(void) int startwin_run(void)
{ {
if (!gtkenabled) return 0; if (!gtkenabled) return 1;
if (!startwin) return 1; if (!startwin) return 1;
SetPage(TAB_CONFIG); SetPage(TAB_CONFIG);