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

This commit is contained in:
terminx 2008-12-28 23:27:24 +00:00
parent 380ad7f536
commit e56fc49d8e
13 changed files with 131 additions and 88 deletions

View file

@ -44,6 +44,9 @@ LIBS=vorbisfile_static.lib vorbis_static.lib ogg_static.lib $(LIBS)
ASFLAGS=/nologo /coff /c
EXESUFFIX=.exe
!ifdef DEBUG
CFLAGS=$(CFLAGS) /DDEBUGGINGAIDS
!endif
JMACTOBJ=$(OBJ)\util_lib.$o \
$(OBJ)\file_lib.$o \

View file

@ -32,7 +32,7 @@ TARGETOPTS=/DNOASM
!ifdef DEBUG
# debugging options
flags_cl=/Ot /Zi
flags_cl=/Ot /Zi
flags_link=/DEBUG
!else
# release options
@ -48,6 +48,9 @@ LINK=link /opt:nowin98 /opt:ref /nologo
CFLAGS=$(CFLAGS) /nologo /MD /J $(flags_cl) $(TARGETOPTS) /I$(INC) /I$(DXROOT)\include /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" # /I$(ENETROOT)\include"
ASFLAGS=/nologo /coff /c
EXESUFFIX=.exe
!ifdef DEBUG
CFLAGS=$(CFLAGS) /DDEBUGGINGAIDS
!endif
ENGINEOBJS= \
!ifdef NOASM

View file

@ -77,7 +77,6 @@ extern "C" {
#pragma pack(push,1);
#endif
//ceilingstat/floorstat:
// bit 0: 1 = parallaxing, 0 = not "P"
// bit 1: 1 = groudraw, 0 = not

View file

@ -76,6 +76,7 @@ extern int editorgridextent; // in engine.c
extern double msens;
int graphicsmode = 0;
extern int xyaspect;
extern int totalclocklock;
int synctics = 0, lockclock = 0;
@ -1622,15 +1623,15 @@ void overheadeditor(void)
i = yxaspect;
Bmemset(show2dsector, 255, sizeof(show2dsector));
Bmemset(show2dwall, 255, sizeof(show2dwall));
Bmemset(show2dsprite, 255, sizeof(show2dsprite));
setview(0, 0, xdim-1, ydim16-1);
yxaspect = xyaspect = 65536;
j = ydim;
ydim -= scale(128, ydim, 768);
ydim -= scale((MAXYDIM/6), ydim, MAXYDIM);
if (graphicsmode == 2)
totalclocklock = totalclock;
drawmapview(posx, posy, zoom, 1536);
yxaspect = i;
@ -3071,6 +3072,7 @@ SKIP:
posx = mousxplc;
posy = mousyplc;
}
_printmessage16("Zoom: %d",zoom);
}
if ((keystatus[buildkeys[BK_MOVEDOWN]] || (bstatus&32)) && (zoom > 8))
{
@ -3082,6 +3084,7 @@ SKIP:
posx = mousxplc;
posy = mousyplc;
}
_printmessage16("Zoom: %d",zoom);
}
if (zoom < 8) zoom = 8;
if (zoom > 16384) zoom = 16384;
@ -4162,8 +4165,18 @@ SKIP:
}
else
{
graphicsmode = !graphicsmode;
printmessage16("2D mode textures %s",graphicsmode?"enabled":"disabled");
if (keystatus[buildkeys[BK_RUN]])
{
if (--graphicsmode < 0)
graphicsmode = 2;
}
else
{
if (++graphicsmode > 2)
graphicsmode = 0;
}
printmessage16("2D mode textures %s",
(graphicsmode == 2)?"enabled w/ animation":graphicsmode?"enabled":"disabled");
keystatus[0x0e] = 0;
}
}

View file

@ -4204,12 +4204,12 @@ static void fillpolygon(int npoints)
if (day2 > day1)
{
x1 += mulscale12((day1<<12)+4095-y1,xinc);
for (y=day1;y<day2;y++) { *dotp2[y]++ = (x1>>12); x1 += xinc; }
for (y=day1;y<day2;y++) { if (!dotp2[y]) { x1 += xinc; continue; } *dotp2[y]++ = (x1>>12); x1 += xinc; }
}
else
{
x2 += mulscale12((day2<<12)+4095-y2,xinc);
for (y=day2;y<day1;y++) { *dotp1[y]++ = (x2>>12); x2 += xinc; }
for (y=day2;y<day1;y++) { if (!dotp1[y]) { x2 += xinc; continue; } *dotp1[y]++ = (x2>>12); x2 += xinc; }
}
}
}
@ -11459,8 +11459,8 @@ int printext16(int xpos, int ypos, short col, short backcol, char *name, char fo
i++;
if (name[i] == 'O') // ^O resets formatting
{
col = ocol;
backcol = obackcol;
col = editorcolors[ocol];
backcol = editorcolors[obackcol];
continue;
}
if (isdigit(name[i]))

View file

@ -391,7 +391,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC
#endif
// install signal handlers
#if !defined(_MSC_VER) || !defined(DEBUGGINGAIDS)
signal(SIGSEGV, SignalHandler);
#endif
if (RegisterWindowClass()) return -1;
@ -3345,7 +3347,9 @@ static int SetupOpenGL(int width, int height, int bitspp)
{
if (!Bstrcmp(glinfo.renderer,"Intel 865G"))
err = 0;
if (!Bstrcmp(glinfo.renderer,"Intel 945GM"))
else if (!Bstrcmp(glinfo.renderer,"Intel 945GM"))
err = 0;
else if (!Bstrcmp(glinfo.renderer,"Intel 965/963 Graphics Media Accelerator"))
err = 0;
else err = 1;
}

View file

@ -7684,7 +7684,7 @@ int A_CheckSwitchTile(int i)
// ACCESSSWITCH and ACCESSSWITCH2 are only active in 1 state so deal with them separately
if ((PN == ACCESSSWITCH) || (PN == ACCESSSWITCH2)) return 1;
//loop to catch both states of switches
for (j=0;j<=1;j++)
for (j=1;j>=0;j--)
{
switch (DynamicTileMap[PN-j])
{
@ -7756,15 +7756,18 @@ void G_MoveWorld(void)
do
{
i = headspritestat[k];
if (i < 0) continue;
do
while (i > 0)
{
if (A_CheckSpriteFlags(i,SPRITE_NOEVENTCODE))
{
i = nextspritestat[i];
continue;
}
j = nextspritestat[i];
pl=A_FindPlayer(&sprite[i],&p);
X_OnEvent(EVENT_GAME,i, pl, p);
i = j;
}
while (i >= 0);
}
while (k--);
}

View file

@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <shellapi.h>
#endif
#define BUILDDATE " 20081219"
#define BUILDDATE " 20081226"
#define VERSION " 1.2.0devel"
static int floor_over_floor;
@ -5908,12 +5908,14 @@ static void Keys3d(void)
{
if (repeatpanalign == 0)
{
while (updownunits--)wall[searchwall].yrepeat = changechar(wall[searchwall].yrepeat,changedir,smooshyalign,1);
while (updownunits--)
wall[searchwall].yrepeat = changechar(wall[searchwall].yrepeat,changedir,smooshyalign,1);
message("Wall %d repeat: %d, %d",searchwall,wall[searchwall].xrepeat,wall[searchwall].yrepeat);
}
else
{
while (updownunits--)wall[searchwall].ypanning = changechar(wall[searchwall].ypanning,changedir,smooshyalign,0);
while (updownunits--)
wall[searchwall].ypanning = changechar(wall[searchwall].ypanning,changedir,smooshyalign,0);
message("Wall %d panning: %d, %d",searchwall,wall[searchwall].xpanning,wall[searchwall].ypanning);
}
}
@ -5921,12 +5923,14 @@ static void Keys3d(void)
{
if (searchstat == 1)
{
while (updownunits--)sector[searchsector].ceilingypanning = changechar(sector[searchsector].ceilingypanning,changedir,smooshyalign,0);
while (updownunits--)
sector[searchsector].ceilingypanning = changechar(sector[searchsector].ceilingypanning,changedir,smooshyalign,0);
message("Sector %d ceiling panning: %d, %d",searchsector,sector[searchsector].ceilingxpanning,sector[searchsector].ceilingypanning);
}
else
{
while (updownunits--)sector[searchsector].floorypanning = changechar(sector[searchsector].floorypanning,changedir,smooshyalign,0);
while (updownunits--)
sector[searchsector].floorypanning = changechar(sector[searchsector].floorypanning,changedir,smooshyalign,0);
message("Sector %d floor panning: %d, %d",searchsector,sector[searchsector].floorxpanning,sector[searchsector].floorypanning);
}
}
@ -7225,6 +7229,11 @@ char vgapal16[4*256] =
*/
extern int getclosestcol(int r, int g, int b);
vgapal16[9*4+0] = 63;
vgapal16[9*4+1] = 31;
vgapal16[9*4+2] = 7;
/* orange */
vgapal16[31*4+0] = 20; // blue
vgapal16[31*4+1] = 45; // green
@ -8783,7 +8792,7 @@ void ExtPreCheckKeys(void) // just before drawrooms
{
for (i=0;i<numsprites;i++)
{
if ((sprite[i].cstat & 48) != 0) continue;
if ((sprite[i].cstat & 48) != 0 || sprite[i].statnum == MAXSTATUS) continue;
picnum = sprite[i].picnum;
ang = flags = frames = shade = 0;
@ -8856,9 +8865,12 @@ void ExtPreCheckKeys(void) // just before drawrooms
}
}
if (frames==2) picnum+=((((4-(totalclock>>5)))&1)*5);
if (frames==4) picnum+=((((4-(totalclock>>5)))&3)*5);
if (frames==5) picnum+=(((totalclock>>5)%5))*5;
if (graphicsmode == 2)
{
if (frames==2) picnum+=((((4-(totalclock>>5)))&1)*5);
if (frames==4) picnum+=((((4-(totalclock>>5)))&3)*5);
if (frames==5) picnum+=(((totalclock>>5)%5))*5;
}
if (tilesizx[picnum] == 0)
picnum -= 5; //Hack, for actors
@ -8878,7 +8890,12 @@ void ExtPreCheckKeys(void) // just before drawrooms
shade = 6;
}
rotatesprite((halfxdim16+xp1)<<16,(midydim16+yp1)<<16,zoom<<5,ang,picnum,
xp1 += halfxdim16;
yp1 += midydim16;
if (xp1 < 4 || xp1 > xdim-6 || yp1 < 4 || yp1 > ydim16-6)
continue;
rotatesprite(xp1<<16,yp1<<16,zoom<<5,ang,picnum,
shade,sprite[i].pal,flags,0,0,xdim-1,ydim16-1);
}
}

View file

@ -850,7 +850,8 @@ enum SpriteFlags_t {
SPRITE_PROJECTILE = 8,
SPRITE_DECAL = 16,
SPRITE_BADGUY = 32,
SPRITE_NOPAL = 64
SPRITE_NOPAL = 64,
SPRITE_NOEVENTCODE = 128,
};
extern short SpriteCacheList[MAXTILES][3];

View file

@ -1211,12 +1211,12 @@ void faketimerhandler(void)
bufferjitter -= ((2 - i) >> 2);
}
#else
if (((g_player[myconnectindex].movefifoend-1)&(TIMERUPDATESIZ-1)) == 0)
{
i = mymaxlag-bufferjitter; mymaxlag = 0;
if (i > 0) bufferjitter += ((3+i)>>2);
else if (i < 0) bufferjitter -= ((1-i)>>2);
}
if (((g_player[myconnectindex].movefifoend-1)&(TIMERUPDATESIZ-1)) == 0)
{
i = mymaxlag-bufferjitter; mymaxlag = 0;
if (i > 0) bufferjitter += ((3+i)>>2);
else if (i < 0) bufferjitter -= ((1-i)>>2);
}
#endif
if (g_networkBroadcastMode == 1)
@ -1264,26 +1264,26 @@ void faketimerhandler(void)
g_player[i].myminlag = 0x7fffffff;
}
#else
if (((g_player[myconnectindex].movefifoend-1)&(TIMERUPDATESIZ-1)) == 0)
{
if (myconnectindex != connecthead)
{
i = g_player[connecthead].myminlag-otherminlag;
if (klabs(i) > 8) i >>= 1;
else if (klabs(i) > 2) i = ksgn(i);
else i = 0;
totalclock -= TICSPERFRAME*i;
g_player[connecthead].myminlag -= i; otherminlag += i;
}
if (myconnectindex == connecthead)
for(i=connectpoint2[connecthead];i>=0;i=connectpoint2[i])
packbuf[j++] = min(max(g_player[i].myminlag,-128),127);
for(i=connecthead;i>=0;i=connectpoint2[i])
g_player[i].myminlag = 0x7fffffff;
}
if (((g_player[myconnectindex].movefifoend-1)&(TIMERUPDATESIZ-1)) == 0)
{
if (myconnectindex != connecthead)
{
i = g_player[connecthead].myminlag-otherminlag;
if (klabs(i) > 8) i >>= 1;
else if (klabs(i) > 2) i = ksgn(i);
else i = 0;
totalclock -= TICSPERFRAME*i;
g_player[connecthead].myminlag -= i; otherminlag += i;
}
if (myconnectindex == connecthead)
for(i=connectpoint2[connecthead];i>=0;i=connectpoint2[i])
packbuf[j++] = min(max(g_player[i].myminlag,-128),127);
for(i=connecthead;i>=0;i=connectpoint2[i])
g_player[i].myminlag = 0x7fffffff;
}
#endif
osyn = (input_t *)&inputfifo[(g_player[myconnectindex].movefifoend-2)&(MOVEFIFOSIZ-1)][myconnectindex];
nsyn = (input_t *)&inputfifo[(g_player[myconnectindex].movefifoend-1)&(MOVEFIFOSIZ-1)][myconnectindex];

View file

@ -51,6 +51,7 @@ void X_ScriptInfo(void)
if (script)
{
intptr_t *p;
if (insptr)
for (p=insptr-20;p<insptr+20;p++)
{
if (*p>>12&&(*p&0xFFF)<CON_END)
@ -58,14 +59,15 @@ void X_ScriptInfo(void)
else
initprintf(" %d",*p);
}
initprintf("current actor: %d (%d)\n",g_i,g_sp->picnum);
if (g_i)
initprintf("current actor: %d (%d)\n",g_i,g_sp->picnum);
initprintf("g_errorLineNum: %d, g_tw: %d\n",g_errorLineNum,g_tw);
}
}
void X_OnEvent(int iEventID, int iActor, int iPlayer, int lDist)
{
if ((iEventID<0 || iEventID >= MAXGAMEEVENTS) && g_scriptSanityChecks)
if (iEventID<0 || iEventID >= MAXGAMEEVENTS)
{
OSD_Printf(CON_ERROR "invalid event ID",g_errorLineNum,keyw[g_tw]);
return;

View file

@ -304,44 +304,41 @@ void Gv_WriteSave(FILE *fil)
void Gv_DumpValues(FILE *fp)
{
int i;
if (!fp)
{
return;
}
fprintf(fp,"// Current Game Definitions\n\n");
for (i=0;i<g_gameVarCount;i++)
{
if (aGameVars[i].dwFlags & (GAMEVAR_SECRET))
{
continue; // do nothing...
}
else
{
fprintf(fp,"gamevar %s ",aGameVars[i].szLabel);
if (aGameVars[i].dwFlags & (GAMEVAR_INTPTR))
fprintf(fp,"%d",*((int*)aGameVars[i].val.lValue));
else if (aGameVars[i].dwFlags & (GAMEVAR_SHORTPTR))
fprintf(fp,"%d",*((short*)aGameVars[i].val.lValue));
else if (aGameVars[i].dwFlags & (GAMEVAR_CHARPTR))
fprintf(fp,"%d",*((char*)aGameVars[i].val.lValue));
else
fprintf(fp,"%" PRIdPTR "",aGameVars[i].val.lValue);
if (aGameVars[i].dwFlags & (GAMEVAR_PERPLAYER))
fprintf(fp," GAMEVAR_PERPLAYER");
else if (aGameVars[i].dwFlags & (GAMEVAR_PERACTOR))
fprintf(fp," GAMEVAR_PERACTOR");
else
fprintf(fp," %d",aGameVars[i].dwFlags & (GAMEVAR_USER_MASK));
fprintf(fp," // ");
if (aGameVars[i].dwFlags & (GAMEVAR_SYSTEM))
fprintf(fp," (system)");
if (aGameVars[i].dwFlags & (GAMEVAR_INTPTR|GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR))
fprintf(fp," (pointer)");
if (aGameVars[i].dwFlags & (GAMEVAR_READONLY))
fprintf(fp," (read only)");
fprintf(fp,"\n");
}
fprintf(fp,"gamevar %s ",aGameVars[i].szLabel);
if (aGameVars[i].dwFlags & (GAMEVAR_INTPTR))
fprintf(fp,"%d",*((int*)aGameVars[i].val.lValue));
else if (aGameVars[i].dwFlags & (GAMEVAR_SHORTPTR))
fprintf(fp,"%d",*((short*)aGameVars[i].val.lValue));
else if (aGameVars[i].dwFlags & (GAMEVAR_CHARPTR))
fprintf(fp,"%d",*((char*)aGameVars[i].val.lValue));
else
fprintf(fp,"%" PRIdPTR "",aGameVars[i].val.lValue);
if (aGameVars[i].dwFlags & (GAMEVAR_PERPLAYER))
fprintf(fp," GAMEVAR_PERPLAYER");
else if (aGameVars[i].dwFlags & (GAMEVAR_PERACTOR))
fprintf(fp," GAMEVAR_PERACTOR");
else
fprintf(fp," %d",aGameVars[i].dwFlags & (GAMEVAR_USER_MASK));
fprintf(fp," // ");
if (aGameVars[i].dwFlags & (GAMEVAR_SYSTEM))
fprintf(fp," (system)");
if (aGameVars[i].dwFlags & (GAMEVAR_INTPTR|GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR))
fprintf(fp," (pointer)");
if (aGameVars[i].dwFlags & (GAMEVAR_READONLY))
fprintf(fp," (read only)");
fprintf(fp,"\n");
}
fprintf(fp,"\n// end of game definitions\n");
}
@ -465,10 +462,11 @@ int Gv_NewVar(const char *pszLabel, int lValue, unsigned int dwFlags)
Bstrcpy(aGameVars[i].szLabel,pszLabel);
aGameVars[i].dwFlags=dwFlags;
if (aGameVars[i].val.plValues)
if (aGameVars[i].dwFlags & GAMEVAR_USER_MASK)
{
// only free if not system
Bfree(aGameVars[i].val.plValues);
if (aGameVars[i].val.plValues)
Bfree(aGameVars[i].val.plValues);
aGameVars[i].val.plValues=NULL;
}
}

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//-------------------------------------------------------------------------
#include "duke3d.h"
const char *s_buildDate = "20081219";
const char *s_buildDate = "20081226";
char *MusicPtr = NULL;
int g_musicSize;