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

This commit is contained in:
terminx 2008-06-01 01:57:01 +00:00
parent b0a2d52771
commit 59b8d7b757
6 changed files with 98 additions and 75 deletions

View file

@ -7554,7 +7554,7 @@ void showsectordata(short sectnum)
{ {
char snotbuf[80]; 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); printext16(8,ydim-STATUS2DSIZ+32,11,-1,snotbuf,0);
Bsprintf(snotbuf,"Firstwall: %d",sector[sectnum].wallptr); Bsprintf(snotbuf,"Firstwall: %d",sector[sectnum].wallptr);
printext16(8,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0); printext16(8,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0);
@ -7611,7 +7611,7 @@ void showwalldata(short wallnum)
int dax, day, dist; int dax, day, dist;
char snotbuf[80]; 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); printext16(8,ydim-STATUS2DSIZ+32,11,-1,snotbuf,0);
Bsprintf(snotbuf,"X-coordinate: %d",wall[wallnum].x); Bsprintf(snotbuf,"X-coordinate: %d",wall[wallnum].x);
printext16(8,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0); printext16(8,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0);
@ -7669,7 +7669,7 @@ void showspritedata(short spritenum)
{ {
char snotbuf[80]; 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); printext16(8,ydim-STATUS2DSIZ+32,11,-1,snotbuf,0);
Bsprintf(snotbuf,"X-coordinate: %d",sprite[spritenum].x); Bsprintf(snotbuf,"X-coordinate: %d",sprite[spritenum].x);
printext16(8,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0); printext16(8,ydim-STATUS2DSIZ+48,11,-1,snotbuf,0);

View file

@ -342,7 +342,7 @@ int writesetup(const char *fn)
"; Turning deceleration\n" "; Turning deceleration\n"
"turndecel = %d\n" "turndecel = %d\n"
"\n" "\n"
"; Autosave map interval (minutes)\n" "; Autosave map interval (seconds)\n"
"autosave = %d\n" "autosave = %d\n"
"\n" "\n"
#if 1 #if 1

View file

@ -548,9 +548,9 @@ void deletespriteEVENT(int s)
if (apScriptGameEvent[EVENT_KILLIT]) if (apScriptGameEvent[EVENT_KILLIT])
{ {
int p; int p;
int pl=findplayer(&sprite[s],(int *)&p); int pl=findplayer(&sprite[s],(int *)&p);
SetGameVarID(g_iReturnVarID,0, -1, -1); SetGameVarID(g_iReturnVarID,0, -1, -1);
OnEvent(EVENT_KILLIT, s, pl, p); OnEvent(EVENT_KILLIT, s, pl, p);
if (GetGameVarID(g_iReturnVarID, -1, -1)) if (GetGameVarID(g_iReturnVarID, -1, -1))
return; return;
} }
@ -7589,10 +7589,10 @@ void moveobjects(void)
i = headspritestat[k]; i = headspritestat[k];
while (i >= 0) while (i >= 0)
{ {
int pl; int pl;
j = nextspritestat[i]; j = nextspritestat[i];
pl=findplayer(&sprite[i],(int *)&p); pl=findplayer(&sprite[i],(int *)&p);
OnEvent(EVENT_GAME,i, pl, p); OnEvent(EVENT_GAME,i, pl, p);
i = j; i = j;
} }
} }

View file

@ -2676,14 +2676,13 @@ static void Keys3d(void)
Bsprintf(lines[num++],"Repeat: %3d, %3d",wall[searchwall].xrepeat,wall[searchwall].yrepeat); Bsprintf(lines[num++],"Repeat: %3d, %3d",wall[searchwall].xrepeat,wall[searchwall].yrepeat);
Bsprintf(lines[num++],"Overpic: %3d",wall[searchwall].overpicnum); Bsprintf(lines[num++],"Overpic: %3d",wall[searchwall].overpicnum);
lines[num++][0]=0; lines[num++][0]=0;
if (!getmessageleng) if (getmessageleng)
{ break;
Bsprintf(lines[num++],"^251Wall %d^31",searchwall); Bsprintf(lines[num++],"^251Wall %d^31",searchwall);
if (wall[searchwall].nextsector!=-1) if (wall[searchwall].nextsector!=-1)
Bsprintf(lines[num++],"LoHeight:%d, HiHeight:%d, Length:%d",height1,height3,dist); Bsprintf(lines[num++],"LoHeight:%d, HiHeight:%d, Length:%d",height1,height3,dist);
else else
Bsprintf(lines[num++],"Height:%d, Length:%d",height2,dist); Bsprintf(lines[num++],"Height:%d, Length:%d",height2,dist);
}
break; break;
case 1: case 1:
drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].ceilingpicnum,sector[searchsector].ceilingshade, 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++],"CeilingZ: %d",sector[searchsector].ceilingz);
Bsprintf(lines[num++],"Slope: %d",sector[searchsector].ceilingheinum); Bsprintf(lines[num++],"Slope: %d",sector[searchsector].ceilingheinum);
lines[num++][0]=0; lines[num++][0]=0;
if (!getmessageleng) if (getmessageleng)
{ break;
Bsprintf(lines[num++],"^251Sector %d^31 ceiling Lotag:%s",searchsector,ExtGetSectorCaption(searchsector)); Bsprintf(lines[num++],"^251Sector %d^31 ceiling Lotag:%s",searchsector,ExtGetSectorCaption(searchsector));
Bsprintf(lines[num++],"Height: %d, Visibility:%d",height2,sector[searchsector].visibility); Bsprintf(lines[num++],"Height: %d, Visibility:%d",height2,sector[searchsector].visibility);
}
break; break;
case 2: case 2:
drawtileinfo("Current",WIND1X,WIND1Y,sector[searchsector].floorpicnum,sector[searchsector].floorshade, 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++],"FloorZ: %d",sector[searchsector].floorz);
Bsprintf(lines[num++],"Slope: %d",sector[searchsector].floorheinum); Bsprintf(lines[num++],"Slope: %d",sector[searchsector].floorheinum);
lines[num++][0]=0; lines[num++][0]=0;
if (!getmessageleng) if (getmessageleng)
{ break;
Bsprintf(lines[num++],"^251Sector %d^31 floor Lotag:%s",searchsector,ExtGetSectorCaption(searchsector)); Bsprintf(lines[num++],"^251Sector %d^31 floor Lotag:%s",searchsector,ExtGetSectorCaption(searchsector));
Bsprintf(lines[num++],"Height:%d, Visibility:%d",height2,sector[searchsector].visibility); Bsprintf(lines[num++],"Height:%d, Visibility:%d",height2,sector[searchsector].visibility);
}
break; break;
case 3: case 3:
drawtileinfo("Current",WIND1X,WIND1Y,sprite[searchwall].picnum,sprite[searchwall].shade, 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 Bsprintf(lines[num++],"PosZ: "" %d",sprite[searchwall].z);// prevents tab character
lines[num++][0]=0; 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));
if (sprite[searchwall].picnum==SECTOREFFECTOR) else Bsprintf(lines[num++],"^251Sprite %d^31 %s",searchwall,names[sprite[searchwall].picnum]);
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);
} }
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; break;
} }
} }
@ -5598,6 +5594,7 @@ static void Keys2d(void)
char col; char col;
int repeatcountx=0,repeatcounty=0,smooshyalign,changedir; int repeatcountx=0,repeatcounty=0,smooshyalign,changedir;
static int opointhighlight=0, olinehighlight=0, ocursectornum=0;
/* /*
for(i=0;i<0x50;i++) for(i=0;i<0x50;i++)
{if(keystatus[i]==1) {Bsprintf(tempbuf,"key %d",i); printmessage16(tempbuf); {if(keystatus[i]==1) {Bsprintf(tempbuf,"key %d",i); printmessage16(tempbuf);
@ -5642,7 +5639,31 @@ static void Keys2d(void)
else _printmessage16(""); 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(); begindrawing();
for (i=0;i<numsprites;i++) // Game specific 2D sprite stuff goes here. Drawn on top of everything else. for (i=0;i<numsprites;i++) // Game specific 2D sprite stuff goes here. Drawn on top of everything else.
{ {
xp1 = mulscale14(sprite[i].x-posx,zoom); xp1 = mulscale14(sprite[i].x-posx,zoom);
@ -5651,9 +5672,9 @@ static void Keys2d(void)
if (sprite[i].picnum == 5 /*&& zoom >= 256*/ && sprite[i].sectnum != MAXSECTORS) if (sprite[i].picnum == 5 /*&& zoom >= 256*/ && sprite[i].sectnum != MAXSECTORS)
{ {
radius = mulscale15(sprite[i].hitag,zoom); radius = mulscale15(sprite[i].hitag,zoom);
col = 6; col = 14;
if (i+16384 == pointhighlight) if (i+16384 == pointhighlight)
if (totalclock & 32) col += (2<<2); if (totalclock & 32) col -= (2<<2);
drawlinepat = 0xf0f0f0f0; drawlinepat = 0xf0f0f0f0;
drawcircle16(halfxdim16+xp1, midydim16+yp1, radius, col); drawcircle16(halfxdim16+xp1, midydim16+yp1, radius, col);
drawlinepat = 0xffffffff; drawlinepat = 0xffffffff;
@ -7312,7 +7333,7 @@ int ExtInit(void)
getmessagetimeoff = 0; getmessagetimeoff = 0;
Bstrcpy(apptitle, "Mapster32"VERSION""); Bstrcpy(apptitle, "Mapster32"VERSION"");
autosavetimer = totalclock+120*autosave*60; autosavetimer = totalclock+120*autosave;
#if defined(_WIN32) && defined(DUKEOSD) #if defined(_WIN32) && defined(DUKEOSD)
OSD_SetFunctions( OSD_SetFunctions(
@ -7544,7 +7565,7 @@ static void Keys2d3d(void)
if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_A]) // ' a if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_A]) // ' a
{ {
keystatus[KEYSC_A] = 0; keystatus[KEYSC_A] = 0;
autosave=autosave?0:3; autosave=autosave?0:180; // 3 minutes
if (autosave) message("Autosave ON"); if (autosave) message("Autosave ON");
else message("Autosave OFF"); else message("Autosave OFF");
} }
@ -7567,7 +7588,7 @@ static void Keys2d3d(void)
if ((totalclock > autosavetimer) && (autosave)) if ((totalclock > autosavetimer) && (autosave))
{ {
if (asksave) if (asksave == 1)
{ {
fixspritesectors(); //Do this before saving! fixspritesectors(); //Do this before saving!
// updatesector(startposx,startposy,&startsectnum); // updatesector(startposx,startposy,&startsectnum);
@ -7575,8 +7596,9 @@ static void Keys2d3d(void)
saveboard("autosave.map",&startposx,&startposy,&startposz,&startang,&startsectnum); saveboard("autosave.map",&startposx,&startposy,&startposz,&startang,&startsectnum);
ExtSaveMap("autosave.map"); ExtSaveMap("autosave.map");
message("Board autosaved to AUTOSAVE.MAP"); message("Board autosaved to AUTOSAVE.MAP");
asksave = 2;
} }
autosavetimer = totalclock+120*autosave*60; autosavetimer = totalclock+120*autosave;
} }
if (eitherCTRL) //CTRL if (eitherCTRL) //CTRL
@ -7692,27 +7714,28 @@ static void Keys2d3d(void)
{ {
// charsperline = 64; // charsperline = 64;
//if (dimensionmode[snum] == 2) charsperline = 80; //if (dimensionmode[snum] == 2) charsperline = 80;
/* if (qsetmode == 200) /* if (qsetmode == 200)
{
for (i=0;i<=getmessageleng;i+=charsperline)
{
for (j=0;j<charsperline;j++)
tempbuf[j] = getmessage[i+j];
if (getmessageleng < i+charsperline)
tempbuf[(getmessageleng-i)] = 0;
else
tempbuf[charsperline] = 0;
begindrawing();
if (tempbuf[charsperline] != 0)
{ {
printext256((MESSAGEX*(xdimgame/320.))+2,(MESSAGEY*(ydimgame/200.))+2,0,-1,tempbuf,xdimgame>640?0:1); for (i=0;i<=getmessageleng;i+=charsperline)
printext256(MESSAGEX*(xdimgame/320.),MESSAGEY*(ydimgame/200.), {
(totalclock > (lastmessagetime + 120*5))?whitecol:256-5,-1,tempbuf,xdimgame>640?0:1); for (j=0;j<charsperline;j++)
tempbuf[j] = getmessage[i+j];
if (getmessageleng < i+charsperline)
tempbuf[(getmessageleng-i)] = 0;
else
tempbuf[charsperline] = 0;
begindrawing();
if (tempbuf[charsperline] != 0)
{
printext256((MESSAGEX*(xdimgame/320.))+2,(MESSAGEY*(ydimgame/200.))+2,0,-1,tempbuf,xdimgame>640?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); printmessage16(getmessage);
if (totalclock > getmessagetimeoff) if (totalclock > getmessagetimeoff)
getmessageleng = 0; getmessageleng = 0;

View file

@ -400,12 +400,12 @@ void CONFIG_SetupMouse(void)
Bsprintf(str,"MouseButton%d",i); Bsprintf(str,"MouseButton%d",i);
temp[0] = 0; temp[0] = 0;
if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp)) 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); Bsprintf(str,"MouseButtonClicked%d",i);
temp[0] = 0; temp[0] = 0;
if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp)) 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 // map over the axes
@ -475,12 +475,12 @@ void CONFIG_SetupJoystick(void)
Bsprintf(str,"JoystickButton%d",i); Bsprintf(str,"JoystickButton%d",i);
temp[0] = 0; temp[0] = 0;
if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp)) 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); Bsprintf(str,"JoystickButtonClicked%d",i);
temp[0] = 0; temp[0] = 0;
if (!SCRIPT_GetString(ud.config.scripthandle,"Controls", str,temp)) 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 // map over the axes

View file

@ -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); ResetActorGameVars(i);
hittype[i].flags = 0; hittype[i].flags = 0;
{ {
int pl=findplayer(&sprite[i],&p); int pl=findplayer(&sprite[i],&p);
if (apScriptGameEvent[EVENT_EGS]) if (apScriptGameEvent[EVENT_EGS])
OnEvent(EVENT_EGS,i, pl, p); OnEvent(EVENT_EGS,i, pl, p);
} }
return(i); return(i);
} }
@ -6348,11 +6348,11 @@ int spawn(int j, int pn)
break; break;
} }
{ {
int pl=findplayer(&sprite[i],&p); int pl=findplayer(&sprite[i],&p);
if (apScriptGameEvent[EVENT_SPAWN]) if (apScriptGameEvent[EVENT_SPAWN])
OnEvent(EVENT_SPAWN,i, pl, p); OnEvent(EVENT_SPAWN,i, pl, p);
} }
return i; return i;
} }