From 59b8d7b75748f056635fdaf0199fe91e946fb3fe Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 1 Jun 2008 01:57:01 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@753 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/build.c | 6 +- polymer/build/src/config.c | 2 +- polymer/eduke32/source/actors.c | 10 +-- polymer/eduke32/source/astub.c | 127 +++++++++++++++++++------------- polymer/eduke32/source/config.c | 8 +- polymer/eduke32/source/game.c | 20 ++--- 6 files changed, 98 insertions(+), 75 deletions(-) diff --git a/polymer/build/src/build.c b/polymer/build/src/build.c index 1802c8104..57bb150c9 100644 --- a/polymer/build/src/build.c +++ b/polymer/build/src/build.c @@ -7554,7 +7554,7 @@ void showsectordata(short sectnum) { char snotbuf[80]; - Bsprintf(snotbuf,"Sector %d",sectnum); + Bsprintf(snotbuf,"Sector %d (F7 to edit)",sectnum); printext16(8,ydim-STATUS2DSIZ+32,11,-1,snotbuf,0); Bsprintf(snotbuf,"Firstwall: %d",sector[sectnum].wallptr); printext16(8,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0); @@ -7611,7 +7611,7 @@ void showwalldata(short wallnum) int dax, day, dist; char snotbuf[80]; - Bsprintf(snotbuf,"Wall %d",wallnum); + Bsprintf(snotbuf,"Wall %d (F8 to edit)",wallnum); printext16(8,ydim-STATUS2DSIZ+32,11,-1,snotbuf,0); Bsprintf(snotbuf,"X-coordinate: %d",wall[wallnum].x); printext16(8,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0); @@ -7669,7 +7669,7 @@ void showspritedata(short spritenum) { char snotbuf[80]; - Bsprintf(snotbuf,"Sprite %d",spritenum); + Bsprintf(snotbuf,"Sprite %d (F8 to edit)",spritenum); printext16(8,ydim-STATUS2DSIZ+32,11,-1,snotbuf,0); Bsprintf(snotbuf,"X-coordinate: %d",sprite[spritenum].x); printext16(8,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0); diff --git a/polymer/build/src/config.c b/polymer/build/src/config.c index ef904c585..e209eb593 100644 --- a/polymer/build/src/config.c +++ b/polymer/build/src/config.c @@ -342,7 +342,7 @@ int writesetup(const char *fn) "; Turning deceleration\n" "turndecel = %d\n" "\n" - "; Autosave map interval (minutes)\n" + "; Autosave map interval (seconds)\n" "autosave = %d\n" "\n" #if 1 diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 2bf8d9dfa..fcac9eb63 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -548,9 +548,9 @@ void deletespriteEVENT(int s) if (apScriptGameEvent[EVENT_KILLIT]) { int p; - int pl=findplayer(&sprite[s],(int *)&p); + int pl=findplayer(&sprite[s],(int *)&p); SetGameVarID(g_iReturnVarID,0, -1, -1); - OnEvent(EVENT_KILLIT, s, pl, p); + OnEvent(EVENT_KILLIT, s, pl, p); if (GetGameVarID(g_iReturnVarID, -1, -1)) return; } @@ -7589,10 +7589,10 @@ void moveobjects(void) i = headspritestat[k]; while (i >= 0) { - int pl; + int pl; j = nextspritestat[i]; - pl=findplayer(&sprite[i],(int *)&p); - OnEvent(EVENT_GAME,i, pl, p); + pl=findplayer(&sprite[i],(int *)&p); + OnEvent(EVENT_GAME,i, pl, p); i = j; } } diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 8f1795db0..fe4a09a23 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -2676,14 +2676,13 @@ static void Keys3d(void) Bsprintf(lines[num++],"Repeat: %3d, %3d",wall[searchwall].xrepeat,wall[searchwall].yrepeat); Bsprintf(lines[num++],"Overpic: %3d",wall[searchwall].overpicnum); lines[num++][0]=0; - if (!getmessageleng) - { - Bsprintf(lines[num++],"^251Wall %d^31",searchwall); - if (wall[searchwall].nextsector!=-1) - Bsprintf(lines[num++],"LoHeight:%d, HiHeight:%d, Length:%d",height1,height3,dist); - else - Bsprintf(lines[num++],"Height:%d, Length:%d",height2,dist); - } + if (getmessageleng) + break; + Bsprintf(lines[num++],"^251Wall %d^31",searchwall); + if (wall[searchwall].nextsector!=-1) + Bsprintf(lines[num++],"LoHeight:%d, HiHeight:%d, Length:%d",height1,height3,dist); + else + Bsprintf(lines[num++],"Height:%d, Length:%d",height2,dist); break; case 1: drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].ceilingpicnum,sector[searchsector].ceilingshade, @@ -2694,11 +2693,10 @@ static void Keys3d(void) Bsprintf(lines[num++],"CeilingZ: %d",sector[searchsector].ceilingz); Bsprintf(lines[num++],"Slope: %d",sector[searchsector].ceilingheinum); lines[num++][0]=0; - if (!getmessageleng) - { - Bsprintf(lines[num++],"^251Sector %d^31 ceiling Lotag:%s",searchsector,ExtGetSectorCaption(searchsector)); - Bsprintf(lines[num++],"Height: %d, Visibility:%d",height2,sector[searchsector].visibility); - } + if (getmessageleng) + break; + Bsprintf(lines[num++],"^251Sector %d^31 ceiling Lotag:%s",searchsector,ExtGetSectorCaption(searchsector)); + Bsprintf(lines[num++],"Height: %d, Visibility:%d",height2,sector[searchsector].visibility); break; case 2: drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].floorpicnum,sector[searchsector].floorshade, @@ -2709,11 +2707,10 @@ static void Keys3d(void) Bsprintf(lines[num++],"FloorZ: %d",sector[searchsector].floorz); Bsprintf(lines[num++],"Slope: %d",sector[searchsector].floorheinum); lines[num++][0]=0; - if (!getmessageleng) - { - Bsprintf(lines[num++],"^251Sector %d^31 floor Lotag:%s",searchsector,ExtGetSectorCaption(searchsector)); - Bsprintf(lines[num++],"Height:%d, Visibility:%d",height2,sector[searchsector].visibility); - } + if (getmessageleng) + break; + Bsprintf(lines[num++],"^251Sector %d^31 floor Lotag:%s",searchsector,ExtGetSectorCaption(searchsector)); + Bsprintf(lines[num++],"Height:%d, Visibility:%d",height2,sector[searchsector].visibility); break; case 3: drawtileinfo("Current",WIND1X,WIND1Y,sprite[searchwall].picnum,sprite[searchwall].shade, @@ -2725,17 +2722,16 @@ static void Keys3d(void) Bsprintf(lines[num++],"PosZ: "" %d",sprite[searchwall].z);// prevents tab character lines[num++][0]=0; - if (!getmessageleng) + if (getmessageleng) + break; + if (strlen(names[sprite[searchwall].picnum]) > 0) { - if (strlen(names[sprite[searchwall].picnum]) > 0) - { - if (sprite[searchwall].picnum==SECTOREFFECTOR) - Bsprintf(lines[num++],"^251Sprite %d^31 %s",searchwall,SectorEffectorText(searchwall)); - else Bsprintf(lines[num++],"^251Sprite %d^31 %s",searchwall,names[sprite[searchwall].picnum]); - } - else Bsprintf(lines[num++],"^251Sprite %d^31, picnum %d",searchwall,sprite[searchwall].picnum); - Bsprintf(lines[num++],"Elevation:%d",getflorzofslope(searchsector,sprite[searchwall].x,sprite[searchwall].y)-sprite[searchwall].z); + if (sprite[searchwall].picnum==SECTOREFFECTOR) + Bsprintf(lines[num++],"^251Sprite %d^31 %s",searchwall,SectorEffectorText(searchwall)); + else Bsprintf(lines[num++],"^251Sprite %d^31 %s",searchwall,names[sprite[searchwall].picnum]); } + else Bsprintf(lines[num++],"^251Sprite %d^31, picnum %d",searchwall,sprite[searchwall].picnum); + Bsprintf(lines[num++],"Elevation:%d",getflorzofslope(searchsector,sprite[searchwall].x,sprite[searchwall].y)-sprite[searchwall].z); break; } } @@ -5598,6 +5594,7 @@ static void Keys2d(void) char col; int repeatcountx=0,repeatcounty=0,smooshyalign,changedir; + static int opointhighlight=0, olinehighlight=0, ocursectornum=0; /* for(i=0;i<0x50;i++) {if(keystatus[i]==1) {Bsprintf(tempbuf,"key %d",i); printmessage16(tempbuf); @@ -5642,7 +5639,31 @@ static void Keys2d(void) else _printmessage16(""); } + if (opointhighlight != pointhighlight || olinehighlight != linehighlight || ocursectornum != cursectornum) + { + if (pointhighlight >= 16384) + { + i = pointhighlight-16384; + clearmidstatbar16(); + showspritedata((short)i); + } + else if ((linehighlight >= 0) && (sectorofwall(linehighlight) == cursectornum)) + { + clearmidstatbar16(); + showwalldata((short)linehighlight); + } + else if (cursectornum >= 0) + { + clearmidstatbar16(); + showsectordata((short)cursectornum); + } + opointhighlight = pointhighlight; + olinehighlight = linehighlight; + ocursectornum = cursectornum; + } + begindrawing(); + for (i=0;i= 256*/ && sprite[i].sectnum != MAXSECTORS) { radius = mulscale15(sprite[i].hitag,zoom); - col = 6; + col = 14; if (i+16384 == pointhighlight) - if (totalclock & 32) col += (2<<2); + if (totalclock & 32) col -= (2<<2); drawlinepat = 0xf0f0f0f0; drawcircle16(halfxdim16+xp1, midydim16+yp1, radius, col); drawlinepat = 0xffffffff; @@ -7312,7 +7333,7 @@ int ExtInit(void) getmessagetimeoff = 0; Bstrcpy(apptitle, "Mapster32"VERSION""); - autosavetimer = totalclock+120*autosave*60; + autosavetimer = totalclock+120*autosave; #if defined(_WIN32) && defined(DUKEOSD) OSD_SetFunctions( @@ -7544,7 +7565,7 @@ static void Keys2d3d(void) if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_A]) // ' a { keystatus[KEYSC_A] = 0; - autosave=autosave?0:3; + autosave=autosave?0:180; // 3 minutes if (autosave) message("Autosave ON"); else message("Autosave OFF"); } @@ -7567,7 +7588,7 @@ static void Keys2d3d(void) if ((totalclock > autosavetimer) && (autosave)) { - if (asksave) + if (asksave == 1) { fixspritesectors(); //Do this before saving! // updatesector(startposx,startposy,&startsectnum); @@ -7575,8 +7596,9 @@ static void Keys2d3d(void) saveboard("autosave.map",&startposx,&startposy,&startposz,&startang,&startsectnum); ExtSaveMap("autosave.map"); message("Board autosaved to AUTOSAVE.MAP"); + asksave = 2; } - autosavetimer = totalclock+120*autosave*60; + autosavetimer = totalclock+120*autosave; } if (eitherCTRL) //CTRL @@ -7692,27 +7714,28 @@ static void Keys2d3d(void) { // charsperline = 64; //if (dimensionmode[snum] == 2) charsperline = 80; -/* if (qsetmode == 200) - { - for (i=0;i<=getmessageleng;i+=charsperline) - { - for (j=0;j640?0:1); - printext256(MESSAGEX*(xdimgame/320.),MESSAGEY*(ydimgame/200.), - (totalclock > (lastmessagetime + 120*5))?whitecol:256-5,-1,tempbuf,xdimgame>640?0:1); + for (i=0;i<=getmessageleng;i+=charsperline) + { + for (j=0;j640?0:1); + printext256(MESSAGEX*(xdimgame/320.),MESSAGEY*(ydimgame/200.), + (totalclock > (lastmessagetime + 120*5))?whitecol:256-5,-1,tempbuf,xdimgame>640?0:1); + } + enddrawing(); + } } - enddrawing(); - } - } - else */ if (qsetmode != 200) + else */ + if (qsetmode != 200) printmessage16(getmessage); if (totalclock > getmessagetimeoff) getmessageleng = 0; diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 4375b9669..c88b6e5ae 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -400,12 +400,12 @@ void CONFIG_SetupMouse(void) Bsprintf(str,"MouseButton%d",i); temp[0] = 0; if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp)) - ud.config.MouseFunctions[i][0] = CONFIG_FunctionNameToNum(temp); + ud.config.MouseFunctions[i][0] = CONFIG_FunctionNameToNum(temp); Bsprintf(str,"MouseButtonClicked%d",i); temp[0] = 0; if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp)) - ud.config.MouseFunctions[i][1] = CONFIG_FunctionNameToNum(temp); + ud.config.MouseFunctions[i][1] = CONFIG_FunctionNameToNum(temp); } // map over the axes @@ -475,12 +475,12 @@ void CONFIG_SetupJoystick(void) Bsprintf(str,"JoystickButton%d",i); temp[0] = 0; if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp)) - ud.config.JoystickFunctions[i][0] = CONFIG_FunctionNameToNum(temp); + ud.config.JoystickFunctions[i][0] = CONFIG_FunctionNameToNum(temp); Bsprintf(str,"JoystickButtonClicked%d",i); temp[0] = 0; if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp)) - ud.config.JoystickFunctions[i][1] = CONFIG_FunctionNameToNum(temp); + ud.config.JoystickFunctions[i][1] = CONFIG_FunctionNameToNum(temp); } // map over the axes diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 274b47aa0..54a25e5b7 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -4416,11 +4416,11 @@ 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, ResetActorGameVars(i); hittype[i].flags = 0; - { - int pl=findplayer(&sprite[i],&p); - if (apScriptGameEvent[EVENT_EGS]) - OnEvent(EVENT_EGS,i, pl, p); - } + { + int pl=findplayer(&sprite[i],&p); + if (apScriptGameEvent[EVENT_EGS]) + OnEvent(EVENT_EGS,i, pl, p); + } return(i); } @@ -6348,11 +6348,11 @@ int spawn(int j, int pn) break; } - { - int pl=findplayer(&sprite[i],&p); - if (apScriptGameEvent[EVENT_SPAWN]) - OnEvent(EVENT_SPAWN,i, pl, p); - } + { + int pl=findplayer(&sprite[i],&p); + if (apScriptGameEvent[EVENT_SPAWN]) + OnEvent(EVENT_SPAWN,i, pl, p); + } return i; }