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

This commit is contained in:
terminx 2008-10-31 10:08:51 +00:00
parent a5eb2ea255
commit b0ef9c1c2f
7 changed files with 175 additions and 78 deletions

View file

@ -187,10 +187,10 @@ endif
ifeq ($(PRETTY_OUTPUT),1) ifeq ($(PRETTY_OUTPUT),1)
BUILD_STARTED = printf "\033[K\033[1;36mBuild started using \"$(CC) $(OURCFLAGS)\"\033[0m\n" BUILD_STARTED = printf "\033[K\033[1;36mBuild started using \"$(CC) $(OURCFLAGS)\"\033[0m\n"
BUILD_FINISHED = printf "\033[K\033[1;36mBuild successful:\033[0m\n" BUILD_FINISHED = printf "\033[K\033[1;36mBuild successful:\033[0m\n"
COMPILE_STATUS = printf "\033[K\033[0;37mBuilding object \033[1;37m$@\033[0;37m...\033[0m\r" COMPILE_STATUS = printf "\033[K\033[0mBuilding object \033[1m$@\033[0m...\033[0m\r"
COMPILE_OK = printf "\033[K\033[0;32mBuilt object \033[1;32m$@\033[0;32m.\033[0m\n" COMPILE_OK = printf "\033[K\033[0;32mBuilt object \033[1;32m$@\033[0;32m.\033[0m\n"
COMPILE_FAILED = printf "\033[K\033[0;31mFailed building \033[1;31m$@\033[0;31m from\033[0m \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1 COMPILE_FAILED = printf "\033[K\033[0;31mFailed building \033[1;31m$@\033[0;31m from\033[0m \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1
LINK_STATUS = printf "\033[K\033[0;37mLinking executable \033[1;37m$@\033[0;37m...\033[0m\r" LINK_STATUS = printf "\033[K\033[0;0mLinking executable \033[1m$@\033[0;0m...\033[0m\r"
LINK_OK = printf "\033[K\033[0;32mLinked executable \033[1;32m$@\033[0;32m.\033[0m\n" LINK_OK = printf "\033[K\033[0;32mLinked executable \033[1;32m$@\033[0;32m.\033[0m\n"
LINK_FAILED = printf "\033[K\033[0;31mFailed linking executable \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1 LINK_FAILED = printf "\033[K\033[0;31mFailed linking executable \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1
else else

View file

@ -2743,6 +2743,15 @@ void overheadeditor(void)
if (((bstatus&1) < (oldmousebstatus&1)) && (highlightsectorcnt < 0)) //after dragging if (((bstatus&1) < (oldmousebstatus&1)) && (highlightsectorcnt < 0)) //after dragging
{ {
int wallsdrawn = newnumwalls-numwalls;
if (newnumwalls != -1)
{
newnumwalls = -1;
Bmemcpy(&wall[MAXWALLS-wallsdrawn],&wall[numwalls],sizeof(walltype) * wallsdrawn);
}
else wallsdrawn = -1;
j = 1; j = 1;
if (highlightcnt > 0) if (highlightcnt > 0)
for (i=0;i<highlightcnt;i++) for (i=0;i<highlightcnt;i++)
@ -2795,12 +2804,33 @@ void overheadeditor(void)
{ {
if (wall[i].x == wall[wall[i].point2].x) if (wall[i].x == wall[wall[i].point2].x)
if (wall[i].y == wall[wall[i].point2].y) if (wall[i].y == wall[wall[i].point2].y)
{ if (sector[sectorofwall((short)i)].wallnum > 3)
deletepoint((short)i); if (sector[sectorofwall(wall[i].point2)].wallnum > 3)
printmessage16("Point deleted."); if (!(wall[i].nextwall == -1 ||
asksave = 1; (sector[sectorofwall(wall[i].nextwall)].wallnum > 3 &&
} sector[sectorofwall(wall[wall[i].nextwall].point2)].wallnum > 3)))
{
printmessage16("Invalid operation, delete or join sector instead.");
goto SKIP;
}
} }
for (i=numwalls-1;i>=0;i--) //delete points
{
if (wall[i].x == wall[wall[i].point2].x)
if (wall[i].y == wall[wall[i].point2].y)
if (sector[sectorofwall((short)i)].wallnum > 3)
if (sector[sectorofwall(wall[i].point2)].wallnum > 3)
if (wall[i].nextwall == -1 ||
(sector[sectorofwall(wall[i].nextwall)].wallnum > 3 &&
sector[sectorofwall(wall[wall[i].nextwall].point2)].wallnum > 3))
{
deletepoint((short)i);
printmessage16("Point deleted.");
asksave = 1;
}
}
for (i=0;i<numwalls;i++) //make new red lines? for (i=0;i<numwalls;i++) //make new red lines?
{ {
if ((wall[i].x == dax) && (wall[i].y == day)) if ((wall[i].x == dax) && (wall[i].y == day))
@ -2817,8 +2847,16 @@ void overheadeditor(void)
} }
} }
if (wallsdrawn != -1)
{
Bmemcpy(&wall[numwalls],&wall[MAXWALLS-wallsdrawn],sizeof(walltype) * wallsdrawn);
newnumwalls = numwalls + wallsdrawn;
for (i=numwalls;i<newnumwalls;i++)
wall[i].point2 = i+1;
}
} }
SKIP:
if ((bstatus&1) > 0) //drag points if ((bstatus&1) > 0) //drag points
{ {
if (highlightsectorcnt > 0) if (highlightsectorcnt > 0)
@ -3030,9 +3068,9 @@ void overheadeditor(void)
{ {
gridlock = 1-gridlock, keystatus[0x26] = 0; gridlock = 1-gridlock, keystatus[0x26] = 0;
if (gridlock == 0) if (gridlock == 0)
printmessage16("Grid locking OFF"); printmessage16("Grid locking off");
else else
printmessage16("Grid locking ON"); printmessage16("Grid locking on");
} }
if (keystatus[0x24]) // J (join sectors) if (keystatus[0x24]) // J (join sectors)
@ -3040,12 +3078,58 @@ void overheadeditor(void)
if (joinsector[0] >= 0) if (joinsector[0] >= 0)
{ {
joinsector[1] = -1; joinsector[1] = -1;
for (i=0;i<numsectors;i++) for (i=0;i<numsectors;i++)
{
if (inside(mousxplc,mousyplc,i) == 1) if (inside(mousxplc,mousyplc,i) == 1)
{ {
joinsector[1] = i; startwall = sector[i].wallptr;
break; endwall = startwall + sector[i].wallnum - 1;
for (j=startwall;j<=endwall;j++)
{
if (wall[j].nextsector == joinsector[0])
break;
}
if (j >= endwall)
{
printmessage16("Join non-adjacent sectors? (Y/N)");
showframe(1);
bflushchars(); ch = 0;
while (keystatus[1] == 0)
{
if (handleevents())
{
if (quitevent)
{
quitevent = 0;
}
}
idle();
ch = bgetchar();
if (ch == 'Y' || ch == 'y')
{
joinsector[1] = i;
break;
}
else if (ch == 'N' || ch == 'n' || ch == 13 || ch == ' ')
{
joinsector[1] = joinsector[0];
break;
}
}
break;
}
else
{
joinsector[1] = i;
break;
}
} }
}
if ((joinsector[1] >= 0) && (joinsector[0] != joinsector[1])) if ((joinsector[1] >= 0) && (joinsector[0] != joinsector[1]))
{ {
newnumwalls = numwalls; newnumwalls = numwalls;
@ -4151,6 +4235,15 @@ void overheadeditor(void)
} }
else if (linehighlight >= 0) else if (linehighlight >= 0)
{ {
int wallsdrawn = newnumwalls-numwalls;
if (newnumwalls != -1)
{
newnumwalls = -1;
Bmemcpy(&wall[MAXWALLS-wallsdrawn],&wall[numwalls],sizeof(walltype) * wallsdrawn);
}
else wallsdrawn = -1;
getclosestpointonwall(mousxplc,mousyplc,(int)linehighlight,&dax,&day); getclosestpointonwall(mousxplc,mousyplc,(int)linehighlight,&dax,&day);
adjustmark(&dax,&day,newnumwalls); adjustmark(&dax,&day,newnumwalls);
insertpoint(linehighlight,dax,day); insertpoint(linehighlight,dax,day);
@ -4190,6 +4283,14 @@ void overheadeditor(void)
// } // }
//} //}
if (wallsdrawn != -1)
{
Bmemcpy(&wall[numwalls],&wall[MAXWALLS-wallsdrawn],sizeof(walltype) * wallsdrawn);
newnumwalls = numwalls + wallsdrawn;
for (i=numwalls;i<newnumwalls;i++)
wall[i].point2 = i+1;
}
asksave = 1; asksave = 1;
} }
keystatus[0xd2] = keystatus[0x17] = 0; keystatus[0xd2] = keystatus[0x17] = 0;
@ -6017,7 +6118,7 @@ void printcoords16(int posxe, int posye, short ange)
char snotbuf[80]; char snotbuf[80];
int i,m; int i,m;
Bsprintf(snotbuf,"x=%d y=%d ang=%d",posxe,posye,ange); Bsprintf(snotbuf,"x:%d y:%d ang:%d",posxe,posye,ange);
i = 0; i = 0;
while ((snotbuf[i] != 0) && (i < 30)) while ((snotbuf[i] != 0) && (i < 30))
i++; i++;
@ -6028,14 +6129,15 @@ void printcoords16(int posxe, int posye, short ange)
} }
snotbuf[30] = 0; snotbuf[30] = 0;
printext16(8, ydim-STATUS2DSIZ+128, 9, 0, snotbuf,0);
m = (numsectors > MAXSECTORSV7 || numwalls > MAXWALLSV7 || numsprites > MAXSPRITESV7); m = (numsectors > MAXSECTORSV7 || numwalls > MAXWALLSV7 || numsprites > MAXSPRITESV7);
printext16(8, ydim-STATUS2DSIZ+128+2, 9, 0, snotbuf,0);
Bsprintf(snotbuf,"%d/%d sect. %d/%d walls %d/%d spri.", Bsprintf(snotbuf,"%d/%d sect. %d/%d walls %d/%d spri.",
numsectors,m?MAXSECTORSV8:MAXSECTORSV7, numsectors,m?MAXSECTORSV8:MAXSECTORSV7,
numwalls,m?MAXWALLSV8:MAXWALLSV7, numwalls,m?MAXWALLSV8:MAXWALLSV7,
numsprites,m?MAXSPRITESV8:MAXSPRITESV7); numsprites,m?MAXSPRITESV8:MAXSPRITESV7);
i = 0; i = 0;
while ((snotbuf[i] != 0) && (i < 46)) while ((snotbuf[i] != 0) && (i < 46))
i++; i++;

View file

@ -8003,11 +8003,10 @@ int loadpics(char *filename, int askedsize)
artsize += ((dasiz+15)&0xfffffff0); artsize += ((dasiz+15)&0xfffffff0);
} }
kclose(fil); kclose(fil);
numtilefiles++;
} }
numtilefiles++;
} }
while (k != numtilefiles); while (k != numtilefiles && k < 64);
clearbuf(&gotpic[0],(int)((MAXTILES+31)>>5),0L); clearbuf(&gotpic[0],(int)((MAXTILES+31)>>5),0L);
@ -11140,8 +11139,8 @@ void draw2dscreen(int posxe, int posye, short ange, int zoome, short gride)
if (j < 0) if (j < 0)
{ {
col = 7; col = 15;
if (i == linehighlight) if (totalclock & 16) col += (2<<2); if (i == linehighlight) if (totalclock & 16) col -= (2<<2);
} }
else else
{ {

View file

@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <shellapi.h> #include <shellapi.h>
#endif #endif
#define BUILDDATE " 20081024" #define BUILDDATE " 20081031"
#define VERSION " 1.2.0devel" #define VERSION " 1.2.0devel"
static int floor_over_floor; static int floor_over_floor;

View file

@ -161,6 +161,10 @@ int leveltexttime = 0;
int r_maxfps = 0; int r_maxfps = 0;
unsigned int g_FrameDelay = 0; unsigned int g_FrameDelay = 0;
#ifdef RENDERTYPEWIN
extern char forcegl;
#endif
int kopen4loadfrommod(char *filename, char searchfirst) int kopen4loadfrommod(char *filename, char searchfirst)
{ {
static char fn[BMAX_PATH]; static char fn[BMAX_PATH];
@ -2604,73 +2608,47 @@ static void coolgaugetext(int snum)
} }
} }
#define AVERAGEFRAMES 128
#define COLOR_RED 248 #define COLOR_RED 248
#define COLOR_WHITE 31 #define COLOR_WHITE 31
#define LOW_FPS 30
static void ShowFrameRate(void) static void ShowFrameRate(void)
{ {
// adapted from ZDoom because I like it better than what we had // adapted from ZDoom because I like it better than what we had
// applicable ZDoom code available under GPL from csDoom // applicable ZDoom code available under GPL from csDoom
if (ud.tickrate == 1) static int FrameCount = 0;
static int LastCount = 0;
static int LastSec = 0;
static int LastMS = 0;
int ms = getticks();
int howlong = ms - LastMS;
if (howlong >= 0)
{ {
static int FrameCount = 0; int thisSec = ms/1000;
static int LastCount = 0; int x = (xdim <= 640);
static int LastSec = 0; if (ud.tickrate)
static int LastMS = 0;
int ms = getticks();
int howlong = ms - LastMS;
if (howlong >= 0)
{ {
int thisSec = ms/1000;
int x = (xdim <= 640);
int chars = Bsprintf(tempbuf, "%2u ms (%3u fps)", howlong, LastCount); int chars = Bsprintf(tempbuf, "%2u ms (%3u fps)", howlong, LastCount);
printext256(windowx2-(chars<<(3-x))+1,windowy1+2,0,-1,tempbuf,x); printext256(windowx2-(chars<<(3-x))+1,windowy1+2,0,-1,tempbuf,x);
printext256(windowx2-(chars<<(3-x)),windowy1+1,COLOR_WHITE,-1,tempbuf,x); printext256(windowx2-(chars<<(3-x)),windowy1+1,(LastCount < LOW_FPS) ? COLOR_RED : COLOR_WHITE,-1,tempbuf,x);
if (numplayers > 1) if (numplayers > 1 && (totalclock - lastpackettime) > 1)
if ((totalclock - lastpackettime) > 1)
{
for (howlong = (totalclock - lastpackettime);howlong>0 && howlong<(xdim>>2);howlong--)
printext256(4L*howlong,0,COLOR_WHITE,-1,".",0);
}
if (LastSec < thisSec)
{ {
framerate = LastCount = FrameCount / (thisSec - LastSec); for (howlong = (totalclock - lastpackettime);howlong>0 && howlong<(xdim>>2);howlong--)
LastSec = thisSec; printext256(4L*howlong,0,COLOR_WHITE,-1,".",0);
FrameCount = 0;
} }
FrameCount++;
} }
LastMS = ms;
}
else if (ud.tickrate == 2)
{
static int frameval[AVERAGEFRAMES], framecnt = 0;
if (totalclock != frameval[framecnt]) if (LastSec < thisSec)
{ {
int x = (xdim <= 640); framerate = LastCount = FrameCount / (thisSec - LastSec);
int p = 32>>x; LastSec = thisSec;
FrameCount = 0;
framerate=(timer*AVERAGEFRAMES)/(totalclock-frameval[framecnt]);
frameval[framecnt] = totalclock;
Bsprintf(tempbuf,"%4d",max(framerate,0));
printext256(windowx2-p+1,windowy1+2,0,-1,tempbuf,x);
printext256(windowx2-p,windowy1+1,(framerate < 40) ? COLOR_RED : COLOR_WHITE,-1,tempbuf,x);
if (numplayers > 1)
if ((totalclock - lastpackettime) > 1)
{
for (p = (totalclock - lastpackettime);p>0 && p<(xdim>>2);p--)
printext256(4L*p,0,COLOR_WHITE,-1,".",0);
}
} }
framecnt = ((framecnt+1)&(AVERAGEFRAMES-1)); FrameCount++;
} }
LastMS = ms;
} }
static void ShowCoordinates(int snum) static void ShowCoordinates(int snum)
@ -3949,26 +3927,27 @@ void displayrest(int smoothratio)
{ {
if (ud.screen_size == 4) if (ud.screen_size == 4)
{ {
i = scale(tilesizy[ud.althud ? SHIELD : INVENTORYBOX]+2,ud.statusbarscale,100); i = scale(ud.althud?tilesizy[BIGALPHANUM]+10:tilesizy[INVENTORYBOX]+2,ud.statusbarscale,100);
j = scale(scale(6,ud.config.ScreenWidth,320),ud.statusbarscale,100); // j = scale(scale(6,ud.config.ScreenWidth,320),ud.statusbarscale,100);
} }
else if (ud.screen_size > 2) else if (ud.screen_size > 2)
{ {
i = scale(tilesizy[BOTTOMSTATUSBAR]+1,ud.statusbarscale,100); i = scale(tilesizy[BOTTOMSTATUSBAR]+1,ud.statusbarscale,100);
j = scale(2,ud.config.ScreenWidth,320); // j = scale(2,ud.config.ScreenWidth,320);
} }
else else
{ {
i = 2; i = 2;
j = scale(2,ud.config.ScreenWidth,320); // j = scale(2,ud.config.ScreenWidth,320);
} }
j = scale(2,ud.config.ScreenWidth,320);
Bsprintf(tempbuf,"T:^15%d:%02d.%02d", Bsprintf(tempbuf,"T:^15%d:%02d.%02d",
(g_player[myconnectindex].ps->player_par/(26*60)), (g_player[myconnectindex].ps->player_par/(26*60)),
(g_player[myconnectindex].ps->player_par/26)%60, (g_player[myconnectindex].ps->player_par/26)%60,
((g_player[myconnectindex].ps->player_par%26)*38)/10 ((g_player[myconnectindex].ps->player_par%26)*38)/10
); );
gametext_z(9,STARTALPHANUM, j,scale(200-i,ud.config.ScreenHeight,200)-7-7-7,tempbuf,0,10,26,0, 0, xdim-1, ydim-1, 65536); gametext_z(13,STARTALPHANUM, j,scale(200-i,ud.config.ScreenHeight,200)-textsc(21),tempbuf,0,10,26,0, 0, xdim-1, ydim-1, 65536);
if (ud.player_skill > 3 || (ud.multimode > 1 && !GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY))) if (ud.player_skill > 3 || (ud.multimode > 1 && !GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY)))
Bsprintf(tempbuf,"K:^15%d",(ud.multimode>1 &&!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY))?g_player[myconnectindex].ps->frag-g_player[myconnectindex].ps->fraggedself:g_player[myconnectindex].ps->actors_killed); Bsprintf(tempbuf,"K:^15%d",(ud.multimode>1 &&!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY))?g_player[myconnectindex].ps->frag-g_player[myconnectindex].ps->fraggedself:g_player[myconnectindex].ps->actors_killed);
@ -3983,12 +3962,12 @@ void displayrest(int smoothratio)
g_player[myconnectindex].ps->max_actors_killed>g_player[myconnectindex].ps->actors_killed? g_player[myconnectindex].ps->max_actors_killed>g_player[myconnectindex].ps->actors_killed?
g_player[myconnectindex].ps->max_actors_killed:g_player[myconnectindex].ps->actors_killed); g_player[myconnectindex].ps->max_actors_killed:g_player[myconnectindex].ps->actors_killed);
} }
gametext_z(9,STARTALPHANUM, j,scale(200-i,ud.config.ScreenHeight,200)-7-7,tempbuf,0,10,26,0, 0, xdim-1, ydim-1, 65536); gametext_z(13,STARTALPHANUM, j,scale(200-i,ud.config.ScreenHeight,200)-textsc(14),tempbuf,0,10,26,0, 0, xdim-1, ydim-1, 65536);
if (g_player[myconnectindex].ps->secret_rooms == g_player[myconnectindex].ps->max_secret_rooms) if (g_player[myconnectindex].ps->secret_rooms == g_player[myconnectindex].ps->max_secret_rooms)
Bsprintf(tempbuf,"S:%d/%d", g_player[myconnectindex].ps->secret_rooms,g_player[myconnectindex].ps->max_secret_rooms); Bsprintf(tempbuf,"S:%d/%d", g_player[myconnectindex].ps->secret_rooms,g_player[myconnectindex].ps->max_secret_rooms);
else Bsprintf(tempbuf,"S:^15%d/%d", g_player[myconnectindex].ps->secret_rooms,g_player[myconnectindex].ps->max_secret_rooms); else Bsprintf(tempbuf,"S:^15%d/%d", g_player[myconnectindex].ps->secret_rooms,g_player[myconnectindex].ps->max_secret_rooms);
gametext_z(9,STARTALPHANUM, j,scale(200-i,ud.config.ScreenHeight,200)-7,tempbuf,0,10,26,0, 0, xdim-1, ydim-1, 65536); gametext_z(13,STARTALPHANUM, j,scale(200-i,ud.config.ScreenHeight,200)-textsc(7),tempbuf,0,10,26,0, 0, xdim-1, ydim-1, 65536);
} }
if (g_player[myconnectindex].ps->gm&MODE_TYPE) if (g_player[myconnectindex].ps->gm&MODE_TYPE)
@ -9607,6 +9586,14 @@ static void checkcommandline(int argc, const char **argv)
i++; i++;
continue; continue;
} }
#ifdef RENDERTYPEWIN
if (!Bstrcasecmp(c+1,"forcegl"))
{
forcegl = 1;
i++;
continue;
}
#endif
} }
if (firstnet > 0) if (firstnet > 0)
@ -10774,6 +10761,10 @@ void app_main(int argc,const char **argv)
checkcommandline(argc,argv); checkcommandline(argc,argv);
#ifdef RENDERTYPEWIN
if (forcegl) initprintf("GL driver blacklist disabled.\n");
#endif
g_player[0].ps = (player_struct *) Bcalloc(1, sizeof(player_struct)); g_player[0].ps = (player_struct *) Bcalloc(1, sizeof(player_struct));
g_player[0].sync = (input_t *) Bcalloc(1, sizeof(input_t)); g_player[0].sync = (input_t *) Bcalloc(1, sizeof(input_t));

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "duke3d.h" #include "duke3d.h"
char *s_builddate = "20081024"; char *s_builddate = "20081031";
char *MusicPtr = NULL; char *MusicPtr = NULL;
int Musicsize; int Musicsize;

View file

@ -1733,7 +1733,9 @@ int enterlevel(int g)
p[2]='g'; p[2]='g';
p[3]='g'; p[3]='g';
p[4]=0; p[4]=0;
fil = kopen4loadfrommod(levname,0); fil = kopen4loadfrommod(levname,0);
if (fil > -1) if (fil > -1)
{ {
kclose(fil); kclose(fil);
@ -1748,11 +1750,14 @@ int enterlevel(int g)
Bfree(map[ud.m_level_number].musicfn1); Bfree(map[ud.m_level_number].musicfn1);
map[ud.m_level_number].musicfn1 = NULL; map[ud.m_level_number].musicfn1 = NULL;
} }
p[1]='m'; p[1]='m';
p[2]='i'; p[2]='i';
p[3]='d'; p[3]='d';
p[4]=0; p[4]=0;
fil = kopen4loadfrommod(levname,0); fil = kopen4loadfrommod(levname,0);
if (fil == -1) if (fil == -1)
Bsprintf(levname,"dethtoll.mid"); Bsprintf(levname,"dethtoll.mid");
else kclose(fil); else kclose(fil);