From 467a72226ad22dc030f3b3be9810e0a1975a5458 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 16 Nov 2008 00:48:02 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1138 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/winlayer.c | 7 ++++++- polymer/eduke32/source/actors.c | 8 ++++++++ polymer/eduke32/source/astub.c | 2 +- polymer/eduke32/source/game.c | 22 +++++++++++++++++++--- polymer/eduke32/source/global.c | 2 +- polymer/eduke32/source/premap.c | 6 +++--- 6 files changed, 38 insertions(+), 9 deletions(-) diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index ff6851e1f..8135354d2 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -242,6 +242,8 @@ void wm_setapptitle(char *name) startwin_settitle(apptitle); } +static int setgammaramp(WORD gt[3][256]); + // // SignalHandler() -- called when we've sprung a leak // @@ -251,6 +253,9 @@ static void SignalHandler(int signum) { case SIGSEGV: printOSD("Fatal Signal caught: SIGSEGV. Bailing out.\n"); + if (gammabrightness) + setgammaramp(sysgamma); + gammabrightness = 0; app_crashhandler(); uninitsystem(); if (stdout) fclose(stdout); @@ -3654,7 +3659,7 @@ static BOOL CreateAppWindow(int modenum) #endif { // set exclusive cooperative level - result = IDirectDraw_SetCooperativeLevel(lpDD, hWindow, DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN); + result = IDirectDraw_SetCooperativeLevel(lpDD, hWindow, DDSCL_ALLOWMODEX|DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN); if (result != DD_OK) { ShowDDrawErrorBox("Error setting cooperative level", result); diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index ab1519a74..f3ce80e5c 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -542,8 +542,16 @@ inline int ssp(int i,unsigned int cliptype) //The set sprite function } #undef deletesprite + +int block_deletesprite = 0; + void deletesprite_(int s) { + if (block_deletesprite) + { + OSD_Printf(OSD_ERROR "deletesprite_(): tried to remove sprite %d in EVENT_EGS\n",s); + return; + } if (apScriptGameEvent[EVENT_KILLIT]) { static int p, pl; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index abf91def3..daff30a5a 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #endif -#define BUILDDATE " 20081114" +#define BUILDDATE " 20081115" #define VERSION " 1.2.0devel" static int floor_over_floor; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 0e47fe84b..dbff03c28 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -4169,9 +4169,10 @@ void drawbackground(void) if (g_player[myconnectindex].ps->gm & MODE_GAME || ud.recstat == 2) //if (ud.recstat == 0 || ud.recstat == 1 || (ud.recstat == 2 && ud.reccnt > 0)) // JBF 20040717 { - if (ud.screen_size == 8 && ud.statusbarmode == 0) - y1 = scale(ydim,200-scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100),200); - else if (gametype_flags[ud.coop] & GAMETYPE_FLAG_FRAGBAR) +// if (ud.screen_size == 8 && ud.statusbarmode == 0) + // y1 = scale(ydim,200-scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100),200); + //else + if (gametype_flags[ud.coop] & GAMETYPE_FLAG_FRAGBAR) { if (ud.multimode > 1) y1 += scale(ydim,8,200); if (ud.multimode > 4) y1 += scale(ydim,8,200); @@ -4220,6 +4221,7 @@ void drawbackground(void) // draw in the bits to the left and right of the non-fullsize status bar if (ud.statusbarscale < 100 && ud.screen_size >= 8 && ud.statusbarmode == 0) { + /* y1 = y2; x2 = (xdim - scale(xdim,ud.statusbarscale,100)) >> 1; x1 = xdim-x2; @@ -4230,6 +4232,16 @@ void drawbackground(void) rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,0,y1,x2-1,ydim-1); rotatesprite((x+x1)<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,xdim-x2,y1,xdim-1,ydim-1); } + */ + // when not rendering a game, fullscreen wipe + x2 = (xdim - scale(xdim,ud.statusbarscale,100)) >> 1; + for (y=y2-y2%tilesizy[dapicnum];y>1;x+=tilesizx[dapicnum]) + { + rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,0,y2,x2,ydim-1); + rotatesprite((xdim-x)<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,xdim-x2-1,y2,xdim-1,ydim-1); + } + } if (ud.screen_size > 8) @@ -4880,8 +4892,12 @@ int EGS(int whatsect,int s_x,int s_y,int s_z,int s_pn,int s_s,int s_xr,int s_yr, if (apScriptGameEvent[EVENT_EGS]) { + extern int block_deletesprite; int pl=findplayer(&sprite[i],&p); + + block_deletesprite++; OnEvent(EVENT_EGS,i, pl, p); + block_deletesprite--; } return(i); diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index d7e040422..bc0da1ac4 100644 --- a/polymer/eduke32/source/global.c +++ b/polymer/eduke32/source/global.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- #include "duke3d.h" -char *s_builddate = "20081114"; +char *s_builddate = "20081115"; char *MusicPtr = NULL; int Musicsize; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 08010e07a..c9c42259c 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -285,9 +285,9 @@ static int getsound(unsigned int num) if (num >= MAXSOUNDS || ud.config.SoundToggle == 0) return 0; if (ud.config.FXDevice < 0) return 0; - if (!g_sounds[num].filename) return 0; - if (g_sounds[num].filename1)fp = kopen4loadfrommod(g_sounds[num].filename1,loadfromgrouponly); - if (fp == -1)fp = kopen4loadfrommod(g_sounds[num].filename,loadfromgrouponly); + if (!g_sounds[num].filename && !g_sounds[num].filename1) return 0; + if (g_sounds[num].filename1) fp = kopen4loadfrommod(g_sounds[num].filename1,loadfromgrouponly); + if (fp == -1) fp = kopen4loadfrommod(g_sounds[num].filename,loadfromgrouponly); if (fp == -1) { initprintf("Sound '%s' not found\n",g_sounds[num].filename);