Part of a patch from Philipp Kutin (Helixhorned) plus MSVC build fix

git-svn-id: https://svn.eduke32.com/eduke32@726 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2008-05-15 03:16:38 +00:00
parent 09110012e8
commit 3844f1eb55
10 changed files with 832 additions and 554 deletions

View file

@ -9,7 +9,7 @@ OBJ=obj.msc
!endif !endif
INC=include\ # INC=include\ #
!ifndef CFLAGS !ifndef CFLAGS
CFLAGS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DKSFORBUILD CFLAGS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DKSFORBUILD /DPOLYMER
!endif !endif
o=obj o=obj
@ -71,7 +71,9 @@ ENGINEOBJS= \
$(OBJ)\pragmas.$o \ $(OBJ)\pragmas.$o \
$(OBJ)\scriptfile.$o \ $(OBJ)\scriptfile.$o \
$(OBJ)\winlayer.$o \ $(OBJ)\winlayer.$o \
!ifdef POLYMER
$(OBJ)\polymer.$o $(OBJ)\polymer.$o
!endif
EDITOROBJS=$(OBJ)\build.$o \ EDITOROBJS=$(OBJ)\build.$o \
$(OBJ)\startwin.editor.$o \ $(OBJ)\startwin.editor.$o \

View file

@ -56,6 +56,12 @@ void _printmessage16(char name[82]);
int vel, svel, angvel; int vel, svel, angvel;
// 0 1 2 3 4 5 6 7
// up, down, left, right, lshift, rctrl, lctrl, space
// 8 9 10 11 12 13
// a, z, pgdn, pgup, [,], [.]
// 14 15 16 17 18 19
// kpenter, enter, =, -, tab, `
unsigned char buildkeys[NUMBUILDKEYS] = unsigned char buildkeys[NUMBUILDKEYS] =
{ {
0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39, 0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39,
@ -123,6 +129,7 @@ unsigned char tempshade, temppal, tempvis, tempxrepeat, tempyrepeat;
unsigned char somethingintab = 255; unsigned char somethingintab = 255;
char mlook = 0; char mlook = 0;
char unrealedlook=0, quickmapcycling=0; //PK
static char boardfilename[BMAX_PATH], selectedboardfilename[BMAX_PATH]; static char boardfilename[BMAX_PATH], selectedboardfilename[BMAX_PATH];
@ -159,6 +166,9 @@ static char scantoascwithshift[128] =
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
}; };
*/ */
int pk_turnaccel=16;
int pk_turndecel=12;
int pk_uedaccel=3;
char changechar(char dachar, int dadir, char smooshyalign, char boundcheck); char changechar(char dachar, int dadir, char smooshyalign, char boundcheck);
int adjustmark(int *xplc, int *yplc, short danumwalls); int adjustmark(int *xplc, int *yplc, short danumwalls);
@ -192,6 +202,9 @@ void AutoAlignWalls(int nWall0, int ply);
int gettile(int tilenum); int gettile(int tilenum);
int menuselect(void); int menuselect(void);
int menuselect_pk(int); //PK
int getfilenames(char *path, char *kind); int getfilenames(char *path, char *kind);
void clearfilenames(void); void clearfilenames(void);
void loadmhk(); void loadmhk();
@ -571,10 +584,13 @@ void editinput(void)
short /*sectnum, nextsectnum,*/ startwall, endwall, dasector, daang; short /*sectnum, nextsectnum,*/ startwall, endwall, dasector, daang;
int mousz, bstatus; int mousz, bstatus;
int i, j, k, /*cnt,*/ tempint=0, doubvel, changedir/*, wallfind[2], daz[2]*/; int i, j, k, /*cnt,*/ tempint=0, doubvel, changedir/*, wallfind[2], daz[2]*/;
int dashade[2], goalz, xvect, yvect, hiz, loz; int dashade[2], goalz, xvect, yvect, /*PK*/ zvect, hiz, loz;
short hitsect, hitwall, hitsprite; short hitsect, hitwall, hitsprite;
int hitx, hity, hitz, dax, day, hihit, lohit; int hitx, hity, hitz, dax, day, hihit, lohit;
// 3B 3C 3D 3E 3F 40 41 42 43 44 57 58 46
// F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 SCROLL
if (keystatus[0x57] > 0) //F11 - brightness if (keystatus[0x57] > 0) //F11 - brightness
{ {
keystatus[0x57] = 0; keystatus[0x57] = 0;
@ -598,7 +614,78 @@ void editinput(void)
ld = ldiv((int)(mousy), (1<<16)); mousy = ld.quot; mouseysurp = ld.rem; ld = ldiv((int)(mousy), (1<<16)); mousy = ld.quot; mouseysurp = ld.rem;
} }
if (mlook) // UnrealEd:
// rmb: mouselook
// lbm: x:turn y:fwd/back local x
// lmb&rmb: x:strafe y:up/dn (move in local yz plane)
// mmb: fwd/back in viewing vector
if (unrealedlook) //PK
{
if ((bstatus&1) && !(bstatus&(2|4)))
{
ang += (mousx>>1)*msens;
if (mousx && !(mousx>>1))
ang++;
xvect = -((mousy*(int)sintable[(ang+2560)&2047])<<pk_uedaccel);
yvect = -((mousy*(int)sintable[(ang+2048)&2047])<<pk_uedaccel);
if (noclip)
{
posx += xvect>>14;
posy += yvect>>14;
updatesector(posx,posy,&cursectnum);
}
else clipmove(&posx,&posy,&posz,&cursectnum,xvect,yvect,128L,4L<<8,4L<<8,CLIPMASK0);
}
else if (!mlook && (bstatus&2) && !(bstatus&(1|4)))
{
mlook=2;
}
else if ((bstatus&1) && (bstatus&2) && !(bstatus&4))
{
zmode = 2;
xvect = -((mousx*(int)sintable[(ang+2048)&2047])<<pk_uedaccel);
yvect = -((mousx*(int)sintable[(ang+1536)&2047])<<pk_uedaccel);
posz += mousy<<(4+pk_uedaccel);
if (noclip)
{
posx += xvect>>14;
posy += yvect>>14;
updatesectorz(posx,posy,posz,&cursectnum);
}
else clipmove(&posx,&posy,&posz,&cursectnum,xvect,yvect,128L,4L<<8,4L<<8,CLIPMASK0);
}
else if (bstatus&4)
{
zmode = 2;
// horiz-100 of 200 is viewing at 326.4 build angle units (=atan(200/128)) upward
tempint = getangle(128, horiz-100);
xvect = -((mousy*
((int)sintable[(ang+2560)&2047]>>6)*
((int)sintable[(tempint+512)&2047])>>6)
<<pk_uedaccel);
yvect = -((mousy*
((int)sintable[(ang+2048)&2047]>>6)*
((int)sintable[(tempint+512)&2047])>>6)
<<pk_uedaccel);
zvect = mousy*(((int)sintable[(tempint+2048)&2047])>>(10-pk_uedaccel));
posz += zvect;
if (noclip)
{
posx += xvect>>16;
posy += yvect>>16;
updatesectorz(posx,posy,posz,&cursectnum);
}
else clipmove(&posx,&posy,&posz,&cursectnum,xvect>>2,yvect>>2,128L,4L<<8,4L<<8,CLIPMASK0);
}
}
if (mlook && !(unrealedlook && bstatus&(1|4)))
{ {
ang += (mousx>>1)*msens; ang += (mousx>>1)*msens;
horiz -= (mousy>>2)*msens; horiz -= (mousy>>2)*msens;
@ -619,7 +706,7 @@ void editinput(void)
osearchx = searchx-mousx; osearchx = searchx-mousx;
osearchy = searchy-mousy; osearchy = searchy-mousy;
} }
else else if (!(unrealedlook && (bstatus&(1|2|4))))
{ {
osearchx = searchx; osearchx = searchx;
osearchy = searchy; osearchy = searchy;
@ -693,6 +780,7 @@ void editinput(void)
} }
getzrange(posx,posy,posz,cursectnum,&hiz,&hihit,&loz,&lohit,128L,CLIPMASK0); getzrange(posx,posy,posz,cursectnum,&hiz,&hihit,&loz,&lohit,128L,CLIPMASK0);
// zmode: 0: normal 1: z-locked 2: free z-movement
if (keystatus[0x3a] > 0) if (keystatus[0x3a] > 0)
{ {
zmode++; zmode++;
@ -5587,8 +5675,70 @@ void overheadeditor(void)
else else
printmessage16("Arrow must be inside a sector before entering 3D mode."); printmessage16("Arrow must be inside a sector before entering 3D mode.");
} }
// vvv PK ------------------------------------ (LShift) Ctrl-X: (prev) next map
// this is copied from 'L' (load map), but without copying the highlighted sectors
if (quickmapcycling && (keystatus[0x2d] > 0)) //X
{
if ((keystatus[0x1d]|keystatus[0x9d]) > 0) //Ctrl
{
// bad = 0;
i = menuselect_pk(keystatus[0x2a]>0 ? 0:1); // Left Shift: prev map
if (i < 0)
{
if (i == -2)
printmessage16("No .MAP files found.");
else if (i == -3)
printmessage16("Load map first!");
}
else
{
Bstrcpy(boardfilename, selectedboardfilename);
highlightcnt = -1;
sectorhighlightstat = -1;
newnumwalls = -1;
joinsector[0] = -1;
circlewall = -1;
circlepoints = 7;
for (i=0;i<MAXSECTORS;i++) sector[i].extra = -1;
for (i=0;i<MAXWALLS;i++) wall[i].extra = -1;
for (i=0;i<MAXSPRITES;i++) sprite[i].extra = -1;
ExtPreLoadMap();
i = loadboard(boardfilename,(!pathsearchmode&&grponlymode?2:0),&posx,&posy,&posz,&ang,&cursectnum);
if (i == -2) i = loadoldboard(boardfilename,(!pathsearchmode&&grponlymode?2:0),&posx,&posy,&posz,&ang,&cursectnum);
if (i < 0)
{
printmessage16("Invalid map format.");
}
else
{
ExtLoadMap(boardfilename);
if (mapversion < 7) printmessage16("Map loaded successfully and autoconverted to V7!");
else printmessage16("Map loaded successfully.");
}
updatenumsprites();
startposx = posx; //this is same
startposy = posy;
startposz = posz;
startang = ang;
startsectnum = cursectnum;
}
showframe(1);
keystatus[0x1c] = 0;
keystatus[0x2d]=keystatus[0x13]=0;
}
}
// ^^^ PK ------------------------------------
CANCEL: CANCEL:
if (keystatus[1] > 0 && joinsector[0] >= 0){keystatus[1]=0;joinsector[0]=-1;} if (keystatus[1] > 0 && joinsector[0] >= 0) {keystatus[1]=0;joinsector[0]=-1;}
if (keystatus[1] > 0) if (keystatus[1] > 0)
{ {
keystatus[1] = 0; keystatus[1] = 0;
@ -6663,16 +6813,59 @@ int getfilenames(char *path, char *kind)
return(0); return(0);
} }
// vvv PK ------------------------------------
// copied off menuselect
const char *g_oldpath=NULL;
int menuselect_pk(int direction) // 20080104: jump to next (direction!=0) or prev (direction==0) file
{
const char *chptr;
if (!g_oldpath) return -3;
else Bmemcpy(selectedboardfilename, g_oldpath, BMAX_PATH);
if (pathsearchmode)
Bcanonicalisefilename(selectedboardfilename, 1); // clips off the last token and compresses relative path
else
Bcorrectfilename(selectedboardfilename, 1);
getfilenames(selectedboardfilename, "*.map");
chptr = strrchr(boardfilename,'/'); // PK
if (!chptr) chptr=boardfilename; else chptr++;
for (; findfileshigh; findfileshigh=findfileshigh->next)
{
if (!Bstrcmp(findfileshigh->name,chptr)) break;
}
if (!findfileshigh) findfileshigh=findfiles;
if (direction)
{
if (findfileshigh->next) findfileshigh=findfileshigh->next;
}
else
{
if (findfileshigh->prev) findfileshigh=findfileshigh->prev;
}
Bstrcat(selectedboardfilename, findfileshigh->name);
return(0);
}
// ^^^ PK ------------------------------------
int menuselect(void) int menuselect(void)
{ {
int listsize; int listsize;
int i; int i;
char ch, buffer[78]; char ch, buffer[78], /*PK*/ *chptr;
static char oldpath[BMAX_PATH]; static char oldpath[BMAX_PATH];
CACHE1D_FIND_REC *dir; CACHE1D_FIND_REC *dir;
int bakpathsearchmode = pathsearchmode; int bakpathsearchmode = pathsearchmode;
g_oldpath=oldpath; //PK: need it in menuselect_pk
listsize = (ydim16-32)/8; listsize = (ydim16-32)/8;
Bstrcpy(selectedboardfilename, oldpath); Bstrcpy(selectedboardfilename, oldpath);
@ -6683,6 +6876,15 @@ int menuselect(void)
getfilenames(selectedboardfilename, "*.map"); getfilenames(selectedboardfilename, "*.map");
// PK 20080103: start with last selected map
chptr = strrchr(boardfilename,'/');
if (!chptr) chptr=boardfilename; else chptr++;
for (; findfileshigh; findfileshigh=findfileshigh->next)
{
if (!Bstrcmp(findfileshigh->name,chptr)) break;
}
if (!findfileshigh) findfileshigh=findfiles;
begindrawing(); begindrawing();
printmessage16("Select map file with arrow keys and enter."); printmessage16("Select map file with arrow keys and enter.");
enddrawing(); enddrawing();
@ -6713,7 +6915,7 @@ int menuselect(void)
for (i=listsize/2-1; i>=0; i--) if (!dir->prev) break; else dir=dir->prev; for (i=listsize/2-1; i>=0; i--) if (!dir->prev) break; else dir=dir->prev;
for (i=0; i<listsize && dir; i++, dir=dir->next) for (i=0; i<listsize && dir; i++, dir=dir->next)
{ {
int c = dir->type == CACHE1D_FIND_DIR ? 4 : 3; int c = dir->type == CACHE1D_FIND_DIR ? 2/*4*/ : 3; //PK
memset(buffer,0,sizeof(buffer)); memset(buffer,0,sizeof(buffer));
strncpy(buffer,dir->name,25); strncpy(buffer,dir->name,25);
if (strlen(buffer) == 25) if (strlen(buffer) == 25)
@ -6788,7 +6990,8 @@ int menuselect(void)
else if ((keystatus[0xc9]|keystatus[0xd1]) > 0) // page up/down else if ((keystatus[0xc9]|keystatus[0xd1]) > 0) // page up/down
{ {
seeker = currentlist?findfileshigh:finddirshigh; seeker = currentlist?findfileshigh:finddirshigh;
i = (ydim2d-STATUS2DSIZ-48)>>3; i = (ydim2d-STATUS2DSIZ-48)>>5/*3*/; //PK
while (i>0) while (i>0)
{ {
if (keystatus[0xd1]?seeker->next:seeker->prev) if (keystatus[0xd1]?seeker->next:seeker->prev)
@ -7487,8 +7690,9 @@ void keytimerstuff(void)
if (keystatus[buildkeys[5]] == 0) if (keystatus[buildkeys[5]] == 0)
{ {
if (keystatus[buildkeys[2]] > 0) angvel = max(angvel-16,-128); // PK: With GCC and Polymost, keyboard turning lags
if (keystatus[buildkeys[3]] > 0) angvel = min(angvel+16,127); if (keystatus[buildkeys[2]] > 0) angvel = max(angvel-pk_turnaccel /* 16 */,-128);
if (keystatus[buildkeys[3]] > 0) angvel = min(angvel+pk_turnaccel /* 16 */,127);
} }
else else
{ {
@ -7500,8 +7704,8 @@ void keytimerstuff(void)
/* if (keystatus[buildkeys[12]] > 0) svel = min(svel+8,127); /* if (keystatus[buildkeys[12]] > 0) svel = min(svel+8,127);
if (keystatus[buildkeys[13]] > 0) svel = max(svel-8,-128); */ if (keystatus[buildkeys[13]] > 0) svel = max(svel-8,-128); */
if (angvel < 0) angvel = min(angvel+12,0); if (angvel < 0) angvel = min(angvel+pk_turndecel /*12*/,0);
if (angvel > 0) angvel = max(angvel-12,0); if (angvel > 0) angvel = max(angvel-pk_turndecel /*12*/,0);
if (svel < 0) svel = min(svel+6,0); if (svel < 0) svel = min(svel+6,0);
if (svel > 0) svel = max(svel-6,0); if (svel > 0) svel = max(svel-6,0);
if (vel < 0) vel = min(vel+6,0); if (vel < 0) vel = min(vel+6,0);

View file

@ -1006,8 +1006,8 @@ static int defsparser(scriptfile *script)
#endif #endif
} }
break; break;
case T_SKIN: case T_DETAIL: case T_GLOW: case T_SKIN: case T_DETAIL: case T_GLOW:
case T_REDPAL: case T_BLUEPAL: case T_BROWNPAL: case T_GREYPAL: case T_GREENPAL: case T_SPECPAL: case T_REDPAL: case T_BLUEPAL: case T_BROWNPAL: case T_GREYPAL: case T_GREENPAL: case T_SPECPAL:
{ {
char *skintokptr = script->ltextptr; char *skintokptr = script->ltextptr;
char *skinend, *skinfn = 0; char *skinend, *skinfn = 0;
@ -1398,8 +1398,8 @@ case T_REDPAL: case T_BLUEPAL: case T_BROWNPAL: case T_GREYPAL: case T_GREENPAL:
if (pal<30)palbits|=1<<pal; if (pal<30)palbits|=1<<pal;
} }
break; break;
case T_DETAIL: case T_GLOW: case T_DETAIL: case T_GLOW:
case T_REDPAL: case T_BLUEPAL: case T_BROWNPAL: case T_GREYPAL: case T_GREENPAL: case T_SPECPAL: case T_REDPAL: case T_BLUEPAL: case T_BROWNPAL: case T_GREYPAL: case T_GREENPAL: case T_SPECPAL:
{ {
char *detailtokptr = script->ltextptr, *detailend; char *detailtokptr = script->ltextptr, *detailend;
int pal = 0, i; int pal = 0, i;

View file

@ -8,7 +8,7 @@ int addtileP(int model,int tile,int pallet)
{ {
UNREFERENCED_PARAMETER(model); UNREFERENCED_PARAMETER(model);
if (curextra==MAXTILES+EXTRATILES-2)return curextra; if (curextra==MAXTILES+EXTRATILES-2)return curextra;
if (tile2model[tile].modelid==-1){tile2model[tile].pal=pallet;return tile;} if (tile2model[tile].modelid==-1) {tile2model[tile].pal=pallet;return tile;}
if (tile2model[tile].pal==pallet)return tile; if (tile2model[tile].pal==pallet)return tile;
while (tile2model[tile].next!=-1) while (tile2model[tile].next!=-1)
{ {

View file

@ -225,7 +225,7 @@ static inline void ftol(float f, int *a)
#if 0 //(__GNUC__ >= 3) #if 0 //(__GNUC__ >= 3)
"flds %1; fistpl %0;" "flds %1; fistpl %0;"
#else #else
"flds %1; fistpl (%0);" "flds %1; fistpl (%0);"
#endif #endif
: "=r"(a) : "m"(f) : "memory","cc"); : "=r"(a) : "m"(f) : "memory","cc");
} }
@ -236,7 +236,7 @@ static inline void dtol(double d, int *a)
#if 0 //(__GNUC__ >= 3) #if 0 //(__GNUC__ >= 3)
"fldl %1; fistpl %0;" "fldl %1; fistpl %0;"
#else #else
"fldl %1; fistpl (%0);" "fldl %1; fistpl (%0);"
#endif #endif
: "=r"(a) : "m"(d) : "memory","cc"); : "=r"(a) : "m"(d) : "memory","cc");
} }
@ -6055,8 +6055,8 @@ int dxtfilter(int fil, texcachepicture *pict, char *pic, void *midbuf, char *pac
} }
else writebuf = packbuf; else writebuf = packbuf;
#else #else
cleng = lzwcompress(midbuf,(miplen/stride)*8,packbuf); cleng = lzwcompress(midbuf,(miplen/stride)*8,packbuf);
writebuf = packbuf; writebuf = packbuf;
#endif #endif
} }
else else
@ -6086,8 +6086,8 @@ int dxtfilter(int fil, texcachepicture *pict, char *pic, void *midbuf, char *pac
} }
else writebuf = packbuf; else writebuf = packbuf;
#else #else
cleng = lzwcompress(midbuf,(miplen/stride)*4,packbuf); cleng = lzwcompress(midbuf,(miplen/stride)*4,packbuf);
writebuf = packbuf; writebuf = packbuf;
#endif #endif
} }
else else
@ -6122,8 +6122,8 @@ int dxtfilter(int fil, texcachepicture *pict, char *pic, void *midbuf, char *pac
} }
else writebuf = packbuf; else writebuf = packbuf;
#else #else
cleng = lzwcompress(midbuf,(miplen/stride)*4,packbuf); cleng = lzwcompress(midbuf,(miplen/stride)*4,packbuf);
writebuf = packbuf; writebuf = packbuf;
#endif #endif
} }
else else
@ -6177,8 +6177,8 @@ int dedxtfilter(int fil, texcachepicture *pict, char *pic, void *midbuf, char *p
if (ispacked && cleng < j) if (ispacked && cleng < j)
if (lzf_decompress(packbuf,cleng,midbuf,j) == 0) return -1; if (lzf_decompress(packbuf,cleng,midbuf,j) == 0) return -1;
#else #else
if (kread(fil,inbuf,cleng) < cleng) return -1; if (kread(fil,inbuf,cleng) < cleng) return -1;
if (ispacked && lzwuncompress(packbuf,cleng,midbuf,j) != j) return -1; if (ispacked && lzwuncompress(packbuf,cleng,midbuf,j) != j) return -1;
#endif #endif
cptr = midbuf; cptr = midbuf;
for (k=0;k<8;k++) pic[k] = *cptr++; for (k=0;k<8;k++) pic[k] = *cptr++;

View file

@ -27,7 +27,7 @@ DXROOT=c:\sdks\dx6
MSSDKROOT="C:\Program Files\Microsoft Visual Studio 8\VC MSSDKROOT="C:\Program Files\Microsoft Visual Studio 8\VC
PLATFORMSDK="C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK PLATFORMSDK="C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
ENGINEOPTS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DUSE_OPENAL ENGINEOPTS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DUSE_OPENAL /DPOLYMER
CC=cl CC=cl
AS=ml AS=ml

View file

@ -723,15 +723,15 @@ void ExtShowSectorData(short sectnum) //F5
printext16(x*8,ydim16+y*8,11,-1,"Item Count",0); printext16(x*8,ydim16+y*8,11,-1,"Item Count",0);
enddrawing(); enddrawing();
PrintStatus("10%health=",numsprite[COLA],x,y+2,11); PrintStatus("10%health=",numsprite[COLA],x,y+2,11);
PrintStatus("",multisprite[COLA],x2,y+2,1); PrintStatus("",multisprite[COLA],x2,y+2,9);
PrintStatus("30%health=",numsprite[SIXPAK],x,y+3,11); PrintStatus("30%health=",numsprite[SIXPAK],x,y+3,11);
PrintStatus("",multisprite[SIXPAK],x2,y+3,1); PrintStatus("",multisprite[SIXPAK],x2,y+3,9);
PrintStatus("Med-Kit =",numsprite[FIRSTAID],x,y+4,11); PrintStatus("Med-Kit =",numsprite[FIRSTAID],x,y+4,11);
PrintStatus("",multisprite[FIRSTAID],x2,y+4,1); PrintStatus("",multisprite[FIRSTAID],x2,y+4,9);
PrintStatus("Atom =",numsprite[ATOMICHEALTH],x,y+5,11); PrintStatus("Atom =",numsprite[ATOMICHEALTH],x,y+5,11);
PrintStatus("",multisprite[ATOMICHEALTH],x2,y+5,1); PrintStatus("",multisprite[ATOMICHEALTH],x2,y+5,9);
PrintStatus("Shields =",numsprite[SHIELD],x,y+6,11); PrintStatus("Shields =",numsprite[SHIELD],x,y+6,11);
PrintStatus("",multisprite[SHIELD],x2,y+6,1); PrintStatus("",multisprite[SHIELD],x2,y+6,9);
x=17; x=17;
x2=30; x2=30;
@ -740,17 +740,17 @@ void ExtShowSectorData(short sectnum) //F5
printext16(x*8,ydim16+y*8,11,-1,"Inventory",0); printext16(x*8,ydim16+y*8,11,-1,"Inventory",0);
enddrawing(); enddrawing();
PrintStatus("Steroids =",numsprite[STEROIDS],x,y+2,11); PrintStatus("Steroids =",numsprite[STEROIDS],x,y+2,11);
PrintStatus("",multisprite[STEROIDS],x2,y+2,1); PrintStatus("",multisprite[STEROIDS],x2,y+2,9);
PrintStatus("Airtank =",numsprite[AIRTANK],x,y+3,11); PrintStatus("Airtank =",numsprite[AIRTANK],x,y+3,11);
PrintStatus("",multisprite[AIRTANK],x2,y+3,1); PrintStatus("",multisprite[AIRTANK],x2,y+3,9);
PrintStatus("Jetpack =",numsprite[JETPACK],x,y+4,11); PrintStatus("Jetpack =",numsprite[JETPACK],x,y+4,11);
PrintStatus("",multisprite[JETPACK],x2,y+4,1); PrintStatus("",multisprite[JETPACK],x2,y+4,9);
PrintStatus("Goggles =",numsprite[HEATSENSOR],x,y+5,11); PrintStatus("Goggles =",numsprite[HEATSENSOR],x,y+5,11);
PrintStatus("",multisprite[HEATSENSOR],x2,y+5,1); PrintStatus("",multisprite[HEATSENSOR],x2,y+5,9);
PrintStatus("Boots =",numsprite[BOOTS],x,y+6,11); PrintStatus("Boots =",numsprite[BOOTS],x,y+6,11);
PrintStatus("",multisprite[BOOTS],x2,y+6,1); PrintStatus("",multisprite[BOOTS],x2,y+6,9);
PrintStatus("HoloDuke =",numsprite[HOLODUKE],x,y+7,11); PrintStatus("HoloDuke =",numsprite[HOLODUKE],x,y+7,11);
PrintStatus("",multisprite[HOLODUKE],x2,y+7,1); PrintStatus("",multisprite[HOLODUKE],x2,y+7,9);
PrintStatus("Multi D =",numsprite[APLAYER],x,y+8,11); PrintStatus("Multi D =",numsprite[APLAYER],x,y+8,11);
x=33; x=33;
@ -760,23 +760,23 @@ void ExtShowSectorData(short sectnum) //F5
printext16(x*8,ydim16+y*8,11,-1,"Weapon Count",0); printext16(x*8,ydim16+y*8,11,-1,"Weapon Count",0);
enddrawing(); enddrawing();
PrintStatus("Pistol =",numsprite[FIRSTGUNSPRITE],x,y+2,11); PrintStatus("Pistol =",numsprite[FIRSTGUNSPRITE],x,y+2,11);
PrintStatus("",multisprite[FIRSTGUNSPRITE],x2,y+2,1); PrintStatus("",multisprite[FIRSTGUNSPRITE],x2,y+2,9);
PrintStatus("Shotgun =",numsprite[SHOTGUNSPRITE],x,y+3,11); PrintStatus("Shotgun =",numsprite[SHOTGUNSPRITE],x,y+3,11);
PrintStatus("",multisprite[SHOTGUNSPRITE],x2,y+3,1); PrintStatus("",multisprite[SHOTGUNSPRITE],x2,y+3,9);
PrintStatus("Chaingun =",numsprite[CHAINGUNSPRITE],x,y+4,11); PrintStatus("Chaingun =",numsprite[CHAINGUNSPRITE],x,y+4,11);
PrintStatus("",multisprite[CHAINGUNSPRITE],x2,y+4,1); PrintStatus("",multisprite[CHAINGUNSPRITE],x2,y+4,9);
PrintStatus("RPG =",numsprite[RPGSPRITE],x,y+5,11); PrintStatus("RPG =",numsprite[RPGSPRITE],x,y+5,11);
PrintStatus("",multisprite[RPGSPRITE],x2,y+5,1); PrintStatus("",multisprite[RPGSPRITE],x2,y+5,9);
PrintStatus("Pipe Bomb=",numsprite[HEAVYHBOMB],x,y+6,11); PrintStatus("Pipe Bomb=",numsprite[HEAVYHBOMB],x,y+6,11);
PrintStatus("",multisprite[HEAVYHBOMB],x2,y+6,1); PrintStatus("",multisprite[HEAVYHBOMB],x2,y+6,9);
PrintStatus("Shrinker =",numsprite[SHRINKERSPRITE],x,y+7,11); PrintStatus("Shrinker =",numsprite[SHRINKERSPRITE],x,y+7,11);
PrintStatus("",multisprite[SHRINKERSPRITE],x2,y+7,1); PrintStatus("",multisprite[SHRINKERSPRITE],x2,y+7,9);
PrintStatus("Devastatr=",numsprite[DEVISTATORSPRITE],x,y+8,11); PrintStatus("Devastatr=",numsprite[DEVISTATORSPRITE],x,y+8,11);
PrintStatus("",multisprite[DEVISTATORSPRITE],x2,y+8,1); PrintStatus("",multisprite[DEVISTATORSPRITE],x2,y+8,9);
PrintStatus("Trip mine=",numsprite[TRIPBOMBSPRITE],x,y+9,11); PrintStatus("Trip mine=",numsprite[TRIPBOMBSPRITE],x,y+9,11);
PrintStatus("",multisprite[TRIPBOMBSPRITE],x2,y+9,1); PrintStatus("",multisprite[TRIPBOMBSPRITE],x2,y+9,9);
PrintStatus("Freezeray=",numsprite[FREEZESPRITE],x,y+10,11); PrintStatus("Freezeray=",numsprite[FREEZESPRITE],x,y+10,11);
PrintStatus("",multisprite[FREEZESPRITE],x2,y+10,1); PrintStatus("",multisprite[FREEZESPRITE],x2,y+10,9);
x=49; x=49;
x2=62; x2=62;
@ -785,23 +785,23 @@ void ExtShowSectorData(short sectnum) //F5
printext16(x*8,ydim16+y*8,11,-1,"Ammo Count",0); printext16(x*8,ydim16+y*8,11,-1,"Ammo Count",0);
enddrawing(); enddrawing();
PrintStatus("Pistol =",numsprite[AMMO],x,y+2,11); PrintStatus("Pistol =",numsprite[AMMO],x,y+2,11);
PrintStatus("",multisprite[AMMO],x2,y+2,1); PrintStatus("",multisprite[AMMO],x2,y+2,9);
PrintStatus("Shot =",numsprite[SHOTGUNAMMO],x,y+3,11); PrintStatus("Shot =",numsprite[SHOTGUNAMMO],x,y+3,11);
PrintStatus("",multisprite[SHOTGUNAMMO],x2,y+3,1); PrintStatus("",multisprite[SHOTGUNAMMO],x2,y+3,9);
PrintStatus("Chain =",numsprite[BATTERYAMMO],x,y+4,11); PrintStatus("Chain =",numsprite[BATTERYAMMO],x,y+4,11);
PrintStatus("",multisprite[BATTERYAMMO],x2,y+4,1); PrintStatus("",multisprite[BATTERYAMMO],x2,y+4,9);
PrintStatus("RPG Box =",numsprite[RPGAMMO],x,y+5,11); PrintStatus("RPG Box =",numsprite[RPGAMMO],x,y+5,11);
PrintStatus("",multisprite[RPGAMMO],x2,y+5,1); PrintStatus("",multisprite[RPGAMMO],x2,y+5,9);
PrintStatus("Pipe Bomb=",numsprite[HBOMBAMMO],x,y+6,11); PrintStatus("Pipe Bomb=",numsprite[HBOMBAMMO],x,y+6,11);
PrintStatus("",multisprite[HBOMBAMMO],x2,y+6,1); PrintStatus("",multisprite[HBOMBAMMO],x2,y+6,9);
PrintStatus("Shrinker =",numsprite[CRYSTALAMMO],x,y+7,11); PrintStatus("Shrinker =",numsprite[CRYSTALAMMO],x,y+7,11);
PrintStatus("",multisprite[CRYSTALAMMO],x2,y+7,1); PrintStatus("",multisprite[CRYSTALAMMO],x2,y+7,9);
PrintStatus("Devastatr=",numsprite[DEVISTATORAMMO],x,y+8,11); PrintStatus("Devastatr=",numsprite[DEVISTATORAMMO],x,y+8,11);
PrintStatus("",multisprite[DEVISTATORAMMO],x2,y+8,1); PrintStatus("",multisprite[DEVISTATORAMMO],x2,y+8,9);
PrintStatus("Expander =",numsprite[GROWAMMO],x,y+9,11); PrintStatus("Expander =",numsprite[GROWAMMO],x,y+9,11);
PrintStatus("",multisprite[GROWAMMO],x2,y+9,1); PrintStatus("",multisprite[GROWAMMO],x2,y+9,9);
PrintStatus("Freezeray=",numsprite[FREEZEAMMO],x,y+10,11); PrintStatus("Freezeray=",numsprite[FREEZEAMMO],x,y+10,11);
PrintStatus("",multisprite[FREEZEAMMO],x2,y+10,1); PrintStatus("",multisprite[FREEZEAMMO],x2,y+10,9);
begindrawing(); begindrawing();
printext16(65*8,ydim16+4*8,11,-1,"MISC",0); printext16(65*8,ydim16+4*8,11,-1,"MISC",0);
@ -2156,7 +2156,7 @@ static int OnGotoTile(int iTile)
bflushchars(); bflushchars();
iNewTile = iTemp = iTile; iNewTile = iTemp = 0; //iTile; //PK
while (keystatus[1] == 0) while (keystatus[1] == 0)
{ {
@ -2435,6 +2435,8 @@ static int DrawTiles(int iTopLeft, int iSelected, int nXTiles, int nYTiles, int
} }
extern char unrealedlook; //PK
static void Keys3d(void) static void Keys3d(void)
{ {
int i,count,rate,nexti; int i,count,rate,nexti;
@ -2634,6 +2636,15 @@ static void Keys3d(void)
keystatus[KEYSC_F3] = 0; keystatus[KEYSC_F3] = 0;
} }
// PK
if (keystatus[KEYSC_F5])
{
unrealedlook = 1-unrealedlook;
Bsprintf(tempbuf,"UnrealEd mouse navigation: %d",unrealedlook);
message(tempbuf);
keystatus[KEYSC_F5] = 0;
}
if (keystatus[KEYSC_QUOTE]==1 && keystatus[0x0e]==1) // ' del if (keystatus[KEYSC_QUOTE]==1 && keystatus[0x0e]==1) // ' del
{ {
keystatus[0x0e] = 0; keystatus[0x0e] = 0;
@ -3074,12 +3085,15 @@ static void Keys3d(void)
if (mlook == 2) if (mlook == 2)
mlook = 0; mlook = 0;
if (bstatus&4) if (!unrealedlook && (bstatus&4)) mlook = 2;
// if (bstatus&4)
if (bstatus&(16|32) && !(bstatus&(1|2|4))) // PK: no btn: wheel changes shade
{ {
if (bstatus&1) // if (bstatus&1)
{ // {
mlook = 2; // mlook = 2;
} // }
if (bstatus&32) // - if (bstatus&32) // -
{ {
mouseb &= ~32; mouseb &= ~32;
@ -3092,7 +3106,7 @@ static void Keys3d(void)
} }
else else
{ {
if ((keystatus[0x2a]|keystatus[0x36]) == 0) if ((keystatus[0x2a]|keystatus[0x36]) == 0) //not SHIFT
k = 16; k = 16;
else k = 1; else k = 1;
@ -3258,7 +3272,9 @@ static void Keys3d(void)
} }
} }
if ((keystatus[KEYSC_DASH]|keystatus[KEYSC_EQUAL]|((bstatus&(16|32)) && !(bstatus&2))) > 0) // mousewheel, -, and +, cycle picnum // if ((keystatus[KEYSC_DASH]|keystatus[KEYSC_EQUAL]|((bstatus&(16|32)) && !(bstatus&2))) > 0) // mousewheel, -, and +, cycle picnum
if (keystatus[KEYSC_DASH] | keystatus[KEYSC_EQUAL] | (bstatus&(16|32) && (bstatus&1) && !(bstatus&2))) // PK: lmb only & mousewheel, -, and +, cycle picnum
{ {
j = i = (keystatus[KEYSC_EQUAL]|(bstatus&16))?1:-1; j = i = (keystatus[KEYSC_EQUAL]|(bstatus&16))?1:-1;
switch (searchstat) switch (searchstat)
@ -3357,7 +3373,7 @@ static void Keys3d(void)
if (searchstat == 2) if (searchstat == 2)
{ {
sector[searchsector].floorstat ^= 64; sector[searchsector].floorstat ^= 64;
sprintf(getmessage,"Sector %d ceiling texture relativity %s",searchsector,sector[searchsector].floorstat&64?"ON":"OFF"); sprintf(getmessage,"Sector %d floor texture relativity %s",searchsector,sector[searchsector].floorstat&64?"ON":"OFF"); //PK (was ceiling in string)
message(getmessage); message(getmessage);
asksave = 1; asksave = 1;
} }
@ -3532,7 +3548,8 @@ static void Keys3d(void)
else else
updownunits = 1024; updownunits = 1024;
if ((keystatus[0xc9] > 0) || ((bstatus&2) && (bstatus&16))) // PGUP // if ((keystatus[0xc9] > 0) || ((bstatus&2) && (bstatus&16))) // PGUP
if ((keystatus[0xc9] > 0) || ((bstatus&2) && (bstatus&16) && !(bstatus&1))) // PK: PGUP, rmb only & mwheel
{ {
k = 0; k = 0;
if (highlightsectorcnt >= 0) if (highlightsectorcnt >= 0)
@ -3668,7 +3685,8 @@ static void Keys3d(void)
keystatus[0xc9] = 0; keystatus[0xc9] = 0;
mouseb &= ~16; mouseb &= ~16;
} }
if ((keystatus[0xd1] > 0) || ((bstatus&2) && (bstatus&32))) // PGDN // if ((keystatus[0xd1] > 0) || ((bstatus&2) && (bstatus&32))) // PGDN
if ((keystatus[0xd1] > 0) || ((bstatus&2) && (bstatus&32) && !(bstatus&1))) // PK: PGDN, rmb only & mwheel
{ {
k = 0; k = 0;
if (highlightsectorcnt >= 0) if (highlightsectorcnt >= 0)
@ -3830,15 +3848,16 @@ static void Keys3d(void)
clockcnt = ((clockcnt+1)&15); clockcnt = ((clockcnt+1)&15);
tempbuf[0] = 0; tempbuf[0] = 0;
if (bstatus&4) if (bstatus&4 && !(bstatus&(1|2)) && !unrealedlook) //PK
{ {
if (bstatus&1) Bsprintf(tempbuf,"VIEW"); Bsprintf(tempbuf,"VIEW");
else Bsprintf(tempbuf,"SHADE"); // else Bsprintf(tempbuf,"SHADE");
} }
else if (bstatus&2) else if (bstatus&2 && !(bstatus&1))
Bsprintf(tempbuf,"Z"); Bsprintf(tempbuf,"Z");
else if (bstatus&1) else if (bstatus&1 && !(bstatus&2))
Bsprintf(tempbuf,"LOCK"); Bsprintf(tempbuf,"LOCK");
if (tempbuf[0] != 0) if (tempbuf[0] != 0)
{ {
i = (Bstrlen(tempbuf)<<3)+6; i = (Bstrlen(tempbuf)<<3)+6;
@ -5399,6 +5418,54 @@ static int osdcmd_noclip(const osdfuncparm_t *parm)
return OSDCMD_OK; return OSDCMD_OK;
} }
//PK vvv ------------
extern int pk_turnaccel, pk_turndecel, pk_uedaccel;
extern char quickmapcycling;
static int osdcmd_vars_pk(const osdfuncparm_t *parm)
{
int showval = (parm->numparms < 1);
// this is something of a misnomer, since it's actually accel+decel
if (!Bstrcasecmp(parm->name, "pk_turnaccel"))
{
if (showval) { OSD_Printf("Turning acceleration+declaration is %d\n", pk_turnaccel); }
else
{
pk_turnaccel = atoi(parm->parms[0]);
pk_turnaccel = pk_turnaccel<=pk_turndecel ? (pk_turndecel+1):pk_turnaccel;
pk_turnaccel = pk_turnaccel>256 ? 256:pk_turnaccel;
}
}
else if (!Bstrcasecmp(parm->name, "pk_turndecel"))
{
if (showval) { OSD_Printf("Turning deceleration is %d\n", pk_turndecel); }
else
{
pk_turndecel = atoi(parm->parms[0]);
pk_turndecel = pk_turndecel<=0 ? 1:pk_turndecel;
pk_turndecel = pk_turndecel>=pk_turnaccel ? (pk_turnaccel-1):pk_turndecel;
pk_turndecel = pk_turndecel>128 ? 128:pk_turndecel;
}
}
else if (!Bstrcasecmp(parm->name, "pk_quickmapcycling"))
{
OSD_Printf("Quick map cycling ((LShift-)Ctrl-X): %s\n",
(quickmapcycling = !quickmapcycling) ? "on":"off");
}
else if (!Bstrcasecmp(parm->name, "pk_uedaccel"))
{
if (showval) { OSD_Printf("UnrealEd mouse navigation acceleration is %d\n", pk_uedaccel); }
else
{
pk_uedaccel = atoi(parm->parms[0]);
pk_uedaccel = pk_uedaccel<0 ? 0:pk_uedaccel;
pk_uedaccel = pk_uedaccel>5 ? 5:pk_uedaccel;
}
}
return OSDCMD_OK;
}
static int registerosdcommands(void) static int registerosdcommands(void)
{ {
OSD_RegisterFunction("addpath","addpath <path>: adds path to game filesystem", osdcmd_addpath); OSD_RegisterFunction("addpath","addpath <path>: adds path to game filesystem", osdcmd_addpath);
@ -5419,6 +5486,11 @@ static int registerosdcommands(void)
OSD_RegisterFunction("sensitivity","sensitivity <value>: changes the mouse sensitivity", osdcmd_sensitivity); OSD_RegisterFunction("sensitivity","sensitivity <value>: changes the mouse sensitivity", osdcmd_sensitivity);
//PK
OSD_RegisterFunction("pk_turnaccel", "pk_turnaccel: sets turning acceleration", osdcmd_vars_pk);
OSD_RegisterFunction("pk_turndecel", "pk_turndecel: sets turning deceleration", osdcmd_vars_pk);
OSD_RegisterFunction("pk_uedaccel", "pk_uedaccel: sets UnrealEd movement speed factor (0-5, exponentially)", osdcmd_vars_pk);
OSD_RegisterFunction("pk_quickmapcycling", "pk_quickmapcycling: allows cycling of maps with (Shift-)Ctrl-X", osdcmd_vars_pk);
return 0; return 0;
} }

View file

@ -3885,7 +3885,7 @@ static int parsecommand(void)
{ {
t=tempscrptr[i];n=i; t=tempscrptr[i];n=i;
for (j=i+2;j<3+tempscrptr[1]*2;j+=2) for (j=i+2;j<3+tempscrptr[1]*2;j+=2)
if (tempscrptr[j]<t){t=tempscrptr[j];n=j;} if (tempscrptr[j]<t) {t=tempscrptr[j];n=j;}
if (n!=i) if (n!=i)
{ {
t=tempscrptr[i ];tempscrptr[i ]=tempscrptr[n ];tempscrptr[n ]=t; t=tempscrptr[i ];tempscrptr[i ]=tempscrptr[n ];tempscrptr[n ]=t;

View file

@ -5097,7 +5097,7 @@ static int parse(void)
s1=fta_quotes[q1]; s1=fta_quotes[q1];
s2=fta_quotes[q2]; s2=fta_quotes[q2];
while (*s2&&st--)s2++; while (*s2&&st--)s2++;
while ((*s1=*s2)&&ln--){s1++;s2++;} while ((*s1=*s2)&&ln--) {s1++;s2++;}
*s1=0; *s1=0;
} }
break; break;
@ -5624,7 +5624,7 @@ static int parse(void)
int x1=GetGameVarID(*insptr++,g_i,g_p), y1=GetGameVarID(*insptr++,g_i,g_p); int x1=GetGameVarID(*insptr++,g_i,g_p), y1=GetGameVarID(*insptr++,g_i,g_p);
int x2=GetGameVarID(*insptr++,g_i,g_p), y2=GetGameVarID(*insptr++,g_i,g_p); int x2=GetGameVarID(*insptr++,g_i,g_p), y2=GetGameVarID(*insptr++,g_i,g_p);
if (tw == CON_ROTATESPRITE){x<<=16;y<<=16;} if (tw == CON_ROTATESPRITE) {x<<=16;y<<=16;}
rotatesprite(x,y,z,a,tilenum,shade,pal,2|orientation,x1,y1,x2,y2); rotatesprite(x,y,z,a,tilenum,shade,pal,2|orientation,x1,y1,x2,y2);
break; break;
} }

File diff suppressed because it is too large Load diff