A week worth of Mapster hacking: first, there is an experimental side view mode toggled with [F3]. Nav keys are {QWAZ}, MMB and RMB. Use with care because it is still in construction. The sector selection routines have been rewritten -- it is now possible to paste the selection into a room and a new inner loop will be added automatically (MickyC's idea). Adds m32script commands drawline16z and drawcircle16z.

git-svn-id: https://svn.eduke32.com/eduke32@1730 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2010-11-27 22:12:24 +00:00
parent c0fd65345e
commit 639cabc0e6
15 changed files with 1669 additions and 756 deletions

View file

@ -101,6 +101,7 @@ void initprintf(const char *, ...);
void debugprintf(const char *,...); void debugprintf(const char *,...);
int32_t handleevents(void); int32_t handleevents(void);
extern void (*after_handleevents_hook)(void);
extern inline void idle(void); extern inline void idle(void);
extern inline void idle_waitevent(void); extern inline void idle_waitevent(void);
extern inline void idle_waitevent_timeout(uint32_t timeout); extern inline void idle_waitevent_timeout(uint32_t timeout);

View file

@ -488,6 +488,7 @@ int32_t hitscan(const vec3_t *sv, int16_t sectnum, int32_t vx, int32_t vy, int
int32_t neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange, int16_t *neartagsector, int16_t *neartagwall, int16_t *neartagsprite, int32_t *neartaghitdist, int32_t neartagrange, char tagsearch); int32_t neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange, int16_t *neartagsector, int16_t *neartagwall, int16_t *neartagsprite, int32_t *neartaghitdist, int32_t neartagrange, char tagsearch);
int32_t cansee(int32_t x1, int32_t y1, int32_t z1, int16_t sect1, int32_t x2, int32_t y2, int32_t z2, int16_t sect2); int32_t cansee(int32_t x1, int32_t y1, int32_t z1, int16_t sect1, int32_t x2, int32_t y2, int32_t z2, int16_t sect2);
void updatesector(int32_t x, int32_t y, int16_t *sectnum); void updatesector(int32_t x, int32_t y, int16_t *sectnum);
void updatesectorexclude(int32_t x, int32_t y, int16_t *sectnum, const uint8_t *excludesectbitmap);
void updatesectorz(int32_t x, int32_t y, int32_t z, int16_t *sectnum); void updatesectorz(int32_t x, int32_t y, int32_t z, int16_t *sectnum);
int32_t inside(int32_t x, int32_t y, int16_t sectnum); int32_t inside(int32_t x, int32_t y, int16_t sectnum);
void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day); void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day);
@ -584,10 +585,10 @@ void qsetmode640350(void);
void qsetmode640480(void); void qsetmode640480(void);
void qsetmodeany(int32_t,int32_t); void qsetmodeany(int32_t,int32_t);
void clear2dscreen(void); void clear2dscreen(void);
void draw2dgrid(int32_t posxe, int32_t posye, int16_t ange, int32_t zoome, int16_t gride); void draw2dgrid(int32_t posxe, int32_t posye, int32_t posze, int16_t ange, int32_t zoome, int16_t gride);
void draw2dscreen(int32_t posxe, int32_t posye, int16_t ange, int32_t zoome, int16_t gride); void draw2dscreen(const vec3_t *pos, int16_t ange, int32_t zoome, int16_t gride);
void drawline16(int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col); int32_t drawline16(int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col);
void drawcircle16(int32_t x1, int32_t y1, int32_t r, char col); void drawcircle16(int32_t x1, int32_t y1, int32_t r, int32_t eccen, char col);
int32_t setrendermode(int32_t renderer); int32_t setrendermode(int32_t renderer);
int32_t getrendermode(void); int32_t getrendermode(void);

View file

@ -67,6 +67,20 @@ extern int32_t m32_osd_tryscript;
extern int32_t showheightindicators; extern int32_t showheightindicators;
extern int32_t showambiencesounds; extern int32_t showambiencesounds;
// editor side view
extern int32_t m32_sideview;
extern int32_t m32_sideelev;
extern int16_t m32_sideang;
extern int32_t m32_sidecos, m32_sidesin;
extern int32_t m32_swcnt;
extern int16_t *m32_wallsprite;
extern int8_t sideview_reversehrot;
extern inline int32_t scalescreeny(int32_t sy);
extern void screencoords(int32_t *xres, int32_t *yres, int32_t x, int32_t y, int32_t zoome);
extern inline int32_t getscreenvdisp(int32_t bz, int32_t zoome);
extern void setup_sideview_sincos(void);
extern void m32_setkeyfilter(int32_t on);
extern int32_t ExtInit(void); extern int32_t ExtInit(void);
extern int32_t ExtPreInit(int32_t argc,const char **argv); extern int32_t ExtPreInit(int32_t argc,const char **argv);
extern void ExtUnInit(void); extern void ExtUnInit(void);

View file

@ -24,6 +24,7 @@ int32_t joyaxespresent=0;
void(*keypresscallback)(int32_t,int32_t) = 0; void(*keypresscallback)(int32_t,int32_t) = 0;
void(*mousepresscallback)(int32_t,int32_t) = 0; void(*mousepresscallback)(int32_t,int32_t) = 0;
void(*joypresscallback)(int32_t,int32_t) = 0; void(*joypresscallback)(int32_t,int32_t) = 0;
void (*after_handleevents_hook)(void) = 0;
extern int16_t brightness; extern int16_t brightness;

File diff suppressed because it is too large Load diff

View file

@ -216,13 +216,14 @@ int32_t loadsetup(const char *fn)
if (readconfig(fp, "mousesensitivity", val, VL) > 0) msens = Bstrtod(val, NULL); if (readconfig(fp, "mousesensitivity", val, VL) > 0) msens = Bstrtod(val, NULL);
if (readconfig(fp, "mousenavigation", val, VL) > 0) unrealedlook = Batoi(val); if (readconfig(fp, "mousenavigation", val, VL) > 0) unrealedlook = !!Batoi(val);
if (readconfig(fp, "mousenavigationaccel", val, VL) > 0) pk_uedaccel = Batoi(val); if (readconfig(fp, "mousenavigationaccel", val, VL) > 0) pk_uedaccel = Batoi(val);
if (readconfig(fp, "quickmapcycling", val, VL) > 0) quickmapcycling = Batoi(val); if (readconfig(fp, "quickmapcycling", val, VL) > 0) quickmapcycling = Batoi(val);
if (readconfig(fp, "revertCTRL", val, VL) > 0) revertCTRL = Batoi(val); if (readconfig(fp, "sideview_reversehorizrot", val, VL) > 0) sideview_reversehrot = !!Batoi(val);
if (readconfig(fp, "revertCTRL", val, VL) > 0) revertCTRL = !!Batoi(val);
if (readconfig(fp, "scrollamount", val, VL) > 0) scrollamount = Batoi(val); if (readconfig(fp, "scrollamount", val, VL) > 0) scrollamount = Batoi(val);
@ -242,10 +243,10 @@ int32_t loadsetup(const char *fn)
graphicsmode = min(max(Batoi(val),0),2); graphicsmode = min(max(Batoi(val),0),2);
if (readconfig(fp, "samplerate", val, VL) > 0) MixRate = min(max(8000, Batoi(val)), 48000); if (readconfig(fp, "samplerate", val, VL) > 0) MixRate = min(max(8000, Batoi(val)), 48000);
if (readconfig(fp, "ambiencetoggle", val, VL) > 0) AmbienceToggle = Batoi(val); if (readconfig(fp, "ambiencetoggle", val, VL) > 0) AmbienceToggle = !!Batoi(val);
if (readconfig(fp, "parlock", val, VL) > 0) ParentalLock = Batoi(val); if (readconfig(fp, "parlock", val, VL) > 0) ParentalLock = !!Batoi(val);
if (readconfig(fp, "osdtryscript", val, VL) > 0) m32_osd_tryscript = Batoi(val); if (readconfig(fp, "osdtryscript", val, VL) > 0) m32_osd_tryscript = !!Batoi(val);
for (i=0; i<256; i++) for (i=0; i<256; i++)
remap[i]=i; remap[i]=i;
@ -399,12 +400,15 @@ int32_t writesetup(const char *fn)
"; 1 - Yes\n" "; 1 - Yes\n"
"quickmapcycling = %d\n" "quickmapcycling = %d\n"
"\n" "\n"
"; Reverse meaning of Q and W keys in side view mode\n"
"sideview_reversehorizrot = %d\n"
"\n"
"; Revert CTRL for tile selction\n" "; Revert CTRL for tile selction\n"
"; 0 - WHEEL:scrolling, CTRL+WHEEL:zooming\n" "; 0 - WHEEL:scrolling, CTRL+WHEEL:zooming\n"
"; 1 - CTRL+WHEEL:scrolling, WHEEL:zooming\n" "; 1 - CTRL+WHEEL:scrolling, WHEEL:zooming\n"
"revertCTRL = %d\n" "revertCTRL = %d\n"
"\n" "\n"
"; Scroll amount for WHEEL in the tile selcetion\n" "; Scroll amount for WHEEL in the tile selection\n"
"scrollamount = %d\n" "scrollamount = %d\n"
"\n" "\n"
"; Turning acceleration+declaration\n" "; Turning acceleration+declaration\n"
@ -480,10 +484,9 @@ int32_t writesetup(const char *fn)
#endif #endif
// "; Console key scancode, in hex\n" // "; Console key scancode, in hex\n"
"keyconsole = %X\n" "keyconsole = %X\n"
"; example: make 'Q' function as CapsLock, KP. as AltGr\n" "; example: make KP0 function as KP5 (counters inability\n"
"; and KP0 as KP5 (counters inability to pan using Shift-KP5-KP8/2\n" "; inability to pan using Shift-KP5-KP8/2 in 3D mode)\n"
"; in 3D mode)\n" "; remap = 52-4C\n"
"; remap = 10-3A,52-4C,53-B8\n"
"remap = ", "remap = ",
forcesetup, fullscreen, xdim2d, ydim2d, xdimgame, ydimgame, bppgame, vsync, forcesetup, fullscreen, xdim2d, ydim2d, xdimgame, ydimgame, bppgame, vsync,
@ -506,6 +509,7 @@ int32_t writesetup(const char *fn)
option[7]>>4, option[2], option[7]>>4, option[2],
#endif #endif
option[3], msens, unrealedlook, pk_uedaccel, quickmapcycling, option[3], msens, unrealedlook, pk_uedaccel, quickmapcycling,
sideview_reversehrot,
revertCTRL,scrollamount,pk_turnaccel,pk_turndecel,autosave, revertCTRL,scrollamount,pk_turnaccel,pk_turndecel,autosave,
showheightindicators,showambiencesounds,graphicsmode, showheightindicators,showambiencesounds,graphicsmode,
MixRate,AmbienceToggle,ParentalLock, !!m32_osd_tryscript, MixRate,AmbienceToggle,ParentalLock, !!m32_osd_tryscript,

File diff suppressed because it is too large Load diff

View file

@ -1829,6 +1829,9 @@ int32_t handleevents(void)
#undef SetKey #undef SetKey
if (after_handleevents_hook)
after_handleevents_hook();
return rv; return rv;
} }

View file

@ -764,6 +764,9 @@ int32_t handleevents(void)
sampletimer(); sampletimer();
if (after_handleevents_hook)
after_handleevents_hook();
return rv; return rv;
} }

View file

@ -22,9 +22,10 @@ define SFACTORSTEPS 100
// color of various drawing enhancements // color of various drawing enhancements
define PREVIEW_DRAW_COLOR 11 define PREVIEW_DRAW_COLOR 11
gamevar showpal 0 0
// 2d mode corruption checker interval, 120 = 1 second // 2d mode corruption checker interval, 120 = 1 second
gamevar checkinterval 600 0 gamevar checkinterval 1200 0
// whether to use overridden aspect/range values when entering 3d mode (software/Polymost). // whether to use overridden aspect/range values when entering 3d mode (software/Polymost).
// tweak with keys 7,8,9,0 on the top row // tweak with keys 7,8,9,0 on the top row
@ -72,14 +73,15 @@ definequote LIGHTQUOTE light %d %d %d %d %d %d %d %d %d %d %d %d %d %d
// Corruption checker // Corruption checker
definequote 19 PANIC!!! SECTOR OR WALL LIMIT EXCEEDED!!! definequote 19 PANIC!!! SECTOR OR WALL LIMIT EXCEEDED!!!
definequote 20 SECTOR[%d].WALLPTR=%d out of range: numwalls=%d!!! definequote 20 SECTOR[%d].WALLPTR=%d out of range: numwalls=%d
definequote 21 SECTOR[%d].WALLPTR=%d inconsistent, expected %d!!! definequote 21 SECTOR[%d].WALLPTR=%d inconsistent, expected %d
definequote 22 SECTOR[%d]: wallptr+wallnum=%d out of range: numwalls=%d!!! definequote 22 SECTOR[%d]: wallptr+wallnum=%d out of range: numwalls=%d
definequote 23 WALL[%d].POINT2=%d out of range: sector[%d].wallptr=%d, endwall=%d!!! definequote 23 WALL[%d].POINT2=%d out of range [%d, %d]
definequote 24 WALL[%d].NEXTWALL=%d out of range: numwalls=%d!!! definequote 24 WALL[%d].NEXTWALL=%d out of range: numwalls=%d
definequote 25 WALL[%d].NEXTSECTOR=%d out of range: numsectors=%d!!! definequote 25 WALL[%d].NEXTSECTOR=%d out of range: numsectors=%d
definequote 26 SPRITE[%d].SECTNUM=%d. Expect problems! definequote 26 SPRITE[%d].SECTNUM=%d. Expect problems!
definequote 27 SPRITE[%d].PICNUM=%d out of range, resetting to 0 definequote 27 SPRITE[%d].PICNUM=%d out of range, resetting to 0
definequote 28 WALL[%d] has nextsector but no nextwall or vice versa!
define PRSCALE 1000 define PRSCALE 1000
define MAXSPECULAR 100000 define MAXSPECULAR 100000
@ -477,7 +479,7 @@ defstate connectlocators
{ {
set j ar[i] set j ar[i]
set k i, add k 1, set k ar[k] set k i, add k 1, set k ar[k]
drawline16b sprite[j].x sprite[j].y sprite[k].x sprite[k].y drawcol drawline16z sprite[j].x sprite[j].y sprite[j].z sprite[k].x sprite[k].y sprite[k].z drawcol
} }
ends ends
@ -504,13 +506,12 @@ defstate draw_prlightprojections
set x .x, set x2 .x, set y .y, set y2 .y set x .x, set x2 .x, set y .y, set y2 .y
add x d, add y d, sub x2 d, sub y2 d add x d, add y d, sub x2 d, sub y2 d
drawline16b x y x2 y2 c drawline16z x y .z x2 y2 .z c
set x .x, set x2 .x, set y .y, set y2 .y set x .x, set x2 .x, set y .y, set y2 .y
add x d, sub y d, sub x2 d, add y2 d add x d, sub y d, sub x2 d, add y2 d
drawline16b x y x2 y2 c drawline16z x y .z x2 y2 .z c
drawcircle16z .x .y .z .hitag c
drawcircle16b .x .y .hitag c
} }
else ife .lotag 50 // spot light else ife .lotag 50 // spot light
{ {
@ -543,8 +544,8 @@ defstate draw_prlightprojections
add xx[0] dx, add yy[0] dy add xx[0] dx, add yy[0] dy
add xx[1] dx, add yy[1] dy add xx[1] dx, add yy[1] dy
drawline16b .x .y xx[0] yy[0] c drawline16z .x .y .z xx[0] yy[0] .z c
drawline16b .x .y xx[1] yy[1] c drawline16z .x .y .z xx[1] yy[1] .z c
} }
} }
} }
@ -559,7 +560,7 @@ defstate previewdoors2d
set valid 0 set valid 0
set sect searchsector set sect searchsector
ifge sect 0 ifge sect 0 ifl sect numsectors
{ {
set lo sector[sect].lotag set lo sector[sect].lotag
ife lo 23 set valid 1 ife lo 23 set valid 1
@ -630,7 +631,7 @@ defstate previewdoors2d
for i range numw for i range numw
{ {
set j i, add j 1 set j i, add j 1
drawline16b xx[i] yy[i] xx[j] yy[j] PREVIEW_DRAW_COLOR drawline16z xx[i] yy[i] sector[sect].floorz xx[j] yy[j] sector[sect].floorz PREVIEW_DRAW_COLOR
} }
set drawlinepat 0xffffffff set drawlinepat 0xffffffff
} }
@ -1014,10 +1015,13 @@ ends
defstate corruptchk defstate corruptchk
var ewall var ewall
var endwall var endwall
var ok
ifle numsectors MAXSECTORS ifle numwalls MAXWALLS nullop else ifle numsectors MAXSECTORS ifle numwalls MAXWALLS nullop else
{ quote 19 printmessage16 19 return } { quote 19 printmessage16 19 return }
set ok 1
set ewall 0 // expected wall index set ewall 0 // expected wall index
for i allsectors for i allsectors
{ {
@ -1044,26 +1048,43 @@ defstate corruptchk
set k 0 set k 0
} }
and ok k
ifn k 0 ifn k 0
{ {
sub endwall 1
for j wallsofsector i for j wallsofsector i
{ {
ifge wall[j].point2 sector[i].wallptr ifl wall[i].point2 endwall nullop else ifge wall[j].point2 sector[i].wallptr ifle wall[i].point2 endwall nullop else
{ {
qsprintf TQUOTE 23 j wall[j].point2 i sector[i].wallptr endwall qsprintf TQUOTE 23 j wall[j].point2 sector[i].wallptr endwall
quote TQUOTE printmessage16 TQUOTE quote TQUOTE printmessage16 TQUOTE
set ok 0
} }
ifge wall[i].nextwall numwalls ifge wall[j].nextwall numwalls
{ {
qsprintf TQUOTE 24 j wall[j].nextwall numwalls qsprintf TQUOTE 24 j wall[j].nextwall numwalls
quote TQUOTE printmessage16 TQUOTE quote TQUOTE printmessage16 TQUOTE
set ok 0
} }
ifge wall[i].nextsector numsectors ifge wall[j].nextsector numsectors
{ {
qsprintf TQUOTE 25 j wall[j].nextsector numsectors qsprintf TQUOTE 25 j wall[j].nextsector numsectors
quote TQUOTE printmessage16 TQUOTE quote TQUOTE printmessage16 TQUOTE
set ok 0
}
set k 0
ifge wall[j].nextsector 0, xor k 1
ifge wall[j].nextwall 0, xor k 1
ife k 1
{
qsprintf TQUOTE 28 j
quote TQUOTE printmessage16 TQUOTE
set ok 0
} }
} }
} }
@ -1075,6 +1096,7 @@ defstate corruptchk
{ {
qsprintf TQUOTE 26 i .sectnum qsprintf TQUOTE 26 i .sectnum
quote TQUOTE printmessage16 TQUOTE quote TQUOTE printmessage16 TQUOTE
set ok 0
} }
ifge .picnum 0 ifl .picnum MAXTILES nullop else ifge .picnum 0 ifl .picnum MAXTILES nullop else
@ -1082,14 +1104,19 @@ defstate corruptchk
qsprintf TQUOTE 27 i .picnum qsprintf TQUOTE 27 i .picnum
quote TQUOTE printmessage16 TQUOTE quote TQUOTE printmessage16 TQUOTE
set .picnum 0 set .picnum 0
set ok 0
} }
} }
ife ok 0
print "--"
ends ends
gamevar d2d_lastcheck 0 0 gamevar d2d_lastcheck 0 0
onevent EVENT_DRAW2DSCREEN onevent EVENT_DRAW2DSCREEN
var tmp var tmp
var xx
ifge cursectnum 0 ifge cursectnum 0
{ {
@ -1106,6 +1133,25 @@ onevent EVENT_DRAW2DSCREEN
set d2d_lastcheck totalclock set d2d_lastcheck totalclock
state corruptchk state corruptchk
} }
ifn showpal 0
{
set xx 100
for tmp range 256
{
drawline16 xx 100 xx 200 -tmp
add xx 1
drawline16 xx 100 xx 200 -tmp
add xx 1
ifge tmp 240
{
drawline16 xx 100 xx 200 -tmp
add xx 1
drawline16 xx 100 xx 200 -tmp
add xx 1
}
}
}
endevent endevent

View file

@ -4137,6 +4137,8 @@ ENDFOR1:
{ {
i = insertsprite(sect,0); i = insertsprite(sect,0);
Bmemcpy(&sprite[i], &sprite[linebegspr], sizeof(spritetype)); Bmemcpy(&sprite[i], &sprite[linebegspr], sizeof(spritetype));
sprite[i].sectnum = sect;
sprite[i].x = dax, sprite[i].y = day; sprite[i].x = dax, sprite[i].y = day;
sprite[i].picnum = t; sprite[i].picnum = t;
sprite[i].ang = daang; sprite[i].ang = daang;
@ -6710,7 +6712,7 @@ static void Keys2d(void)
drawgradient(); drawgradient();
showspritedata(pointhighlight&16383, 0); showspritedata(pointhighlight&16383, 0);
} }
else if (linehighlight >= 0 && ((bstatus&1) || sectorofwall(linehighlight)==cursectornum)) else if (linehighlight >= 0 /* && ((bstatus&1) || sectorofwall(linehighlight)==cursectornum)*/)
{ {
drawgradient(); drawgradient();
showwalldata(linehighlight, 0); showwalldata(linehighlight, 0);
@ -6823,14 +6825,24 @@ static void Keys2d(void)
{ {
// PK_ // PK_
if (numhelppages>0) if (numhelppages>0)
{
m32_setkeyfilter(0);
IntegratedHelp(); IntegratedHelp();
m32_setkeyfilter(1);
}
else else
printmessage16("m32help.hlp invalid or not found!"); printmessage16("m32help.hlp invalid or not found!");
} }
if (PRESSED_KEYSC(F2)) if (PRESSED_KEYSC(F2))
if (g_numsounds > 0) if (g_numsounds > 0)
{
m32_setkeyfilter(0);
SoundDisplay(); SoundDisplay();
m32_setkeyfilter(1);
}
// F3: side view toggle (handled in build.c)
getpoint(searchx,searchy, &mousxplc,&mousyplc); getpoint(searchx,searchy, &mousxplc,&mousyplc);
ppointhighlight = getpointhighlight(mousxplc,mousyplc, ppointhighlight); ppointhighlight = getpointhighlight(mousxplc,mousyplc, ppointhighlight);
@ -7739,6 +7751,11 @@ static int32_t osdcmd_vars_pk(const osdfuncparm_t *parm)
m32_osd_tryscript = !m32_osd_tryscript; m32_osd_tryscript = !m32_osd_tryscript;
OSD_Printf("Try M32 script execution on invalid OSD command: %s\n", m32_osd_tryscript?"on":"off"); OSD_Printf("Try M32 script execution on invalid OSD command: %s\n", m32_osd_tryscript?"on":"off");
} }
else if (!Bstrcasecmp(parm->name, "sideview_reversehorizrot"))
{
sideview_reversehrot = !sideview_reversehrot;
OSD_Printf("Side view reverse horizontal rotation: %s\n", sideview_reversehrot?"on":"off");
}
else if (!Bstrcasecmp(parm->name, "script_expertmode")) else if (!Bstrcasecmp(parm->name, "script_expertmode"))
{ {
m32_script_expertmode = !m32_script_expertmode; m32_script_expertmode = !m32_script_expertmode;
@ -8060,6 +8077,7 @@ static int32_t registerosdcommands(void)
OSD_RegisterFunction("enableevent", "enableevent <all|EVENT_...|(event number)>", osdcmd_endisableevent); OSD_RegisterFunction("enableevent", "enableevent <all|EVENT_...|(event number)>", osdcmd_endisableevent);
OSD_RegisterFunction("disableevent", "disableevent <all|EVENT_...|(event number)>", osdcmd_endisableevent); OSD_RegisterFunction("disableevent", "disableevent <all|EVENT_...|(event number)>", osdcmd_endisableevent);
OSD_RegisterFunction("osd_tryscript", "osd_tryscript: toggles execution of M32 script on invalid OSD command", osdcmd_vars_pk); OSD_RegisterFunction("osd_tryscript", "osd_tryscript: toggles execution of M32 script on invalid OSD command", osdcmd_vars_pk);
OSD_RegisterFunction("sideview_reversehorizrot", "sideview_reversehorizrot: toggles reversion of Q and W keys in side view mode", osdcmd_vars_pk);
#ifdef DEBUGGINGAIDS #ifdef DEBUGGINGAIDS
OSD_RegisterFunction("disasm", "disasm [s|e] <state or event number>", osdcmd_disasm); OSD_RegisterFunction("disasm", "disasm [s|e] <state or event number>", osdcmd_disasm);
#endif #endif
@ -9352,7 +9370,7 @@ void ExtPreCheckKeys(void) // just before drawrooms
// if (cursectornum >= 0) // if (cursectornum >= 0)
// fillsector(cursectornum, 31); // fillsector(cursectornum, 31);
if (graphicsmode && zoom >= 256) if (graphicsmode && !m32_sideview && zoom >= 256)
{ {
for (i=ii=0; i<MAXSPRITES && ii < numsprites; i++) for (i=ii=0; i<MAXSPRITES && ii < numsprites; i++)
{ {
@ -9469,25 +9487,29 @@ void ExtPreCheckKeys(void) // just before drawrooms
} }
if (showambiencesounds) if (showambiencesounds)
for (i=0; i<numsprites; i++) {
if (sprite[i].picnum == MUSICANDSFX /*&& zoom >= 256*/ && sprite[i].sectnum != MAXSECTORS) for (ii=0; ii<numsectors; ii++)
for (i=headspritesect[ii]; i>=0; i=nextspritesect[i])
if (sprite[i].picnum == MUSICANDSFX /*&& zoom >= 256*/ )
{ {
if (showambiencesounds==1 && sprite[i].sectnum!=cursectnum) if (showambiencesounds==1 && sprite[i].sectnum!=cursectnum)
continue; continue;
xp1 = mulscale14(sprite[i].x-pos.x,zoom); screencoords(&xp1,&yp1, sprite[i].x-pos.x,sprite[i].y-pos.y, zoom);
yp1 = mulscale14(sprite[i].y-pos.y,zoom); if (m32_sideview)
yp1 += getscreenvdisp(sprite[i].z-pos.z, zoom);
radius = mulscale14(sprite[i].hitag,zoom); radius = mulscale14(sprite[i].hitag,zoom);
col = 6; col = 6;
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, editorcolors[(int32_t)col]); drawcircle16(halfxdim16+xp1, midydim16+yp1, radius, scalescreeny(16384), editorcolors[(int32_t)col]);
drawlinepat = 0xffffffff; drawlinepat = 0xffffffff;
// radius = mulscale15(sprite[i].hitag,zoom); // radius = mulscale15(sprite[i].hitag,zoom);
// drawcircle16(halfxdim16+xp1, midydim16+yp1, radius, col); // drawcircle16(halfxdim16+xp1, midydim16+yp1, radius, col);
} }
}
enddrawing(); enddrawing();
} }

View file

@ -409,8 +409,10 @@ const char *keyw[] =
"drawline16", "drawline16",
"drawline16b", "drawline16b",
"drawline16z",
"drawcircle16", "drawcircle16",
"drawcircle16b", "drawcircle16b",
"drawcircle16z",
"rotatesprite16", "rotatesprite16",
"rotatesprite", "rotatesprite",
"setgamepalette", "setgamepalette",
@ -3401,14 +3403,21 @@ repeatcase:
case CON_DRAWLINE16: case CON_DRAWLINE16:
case CON_DRAWLINE16B: case CON_DRAWLINE16B:
case CON_DRAWLINE16Z:
case CON_DRAWCIRCLE16: case CON_DRAWCIRCLE16:
case CON_DRAWCIRCLE16B: case CON_DRAWCIRCLE16B:
case CON_DRAWCIRCLE16Z:
if (cs.parsingEventOfs < 0 && cs.currentStateIdx < 0) if (cs.parsingEventOfs < 0 && cs.currentStateIdx < 0)
{ {
C_ReportError(ERROR_EVENTONLY); C_ReportError(ERROR_EVENTONLY);
g_numCompilerErrors++; g_numCompilerErrors++;
} }
C_GetManyVars((tw==CON_DRAWLINE16||tw==CON_DRAWLINE16B) ? 5 : 4); if (tw==CON_DRAWLINE16 || tw==CON_DRAWLINE16B || tw==CON_DRAWCIRCLE16Z)
C_GetManyVars(5);
else if (tw==CON_DRAWLINE16Z)
C_GetManyVars(7);
else
C_GetManyVars(4);
break; break;
case CON_ROTATESPRITE16: case CON_ROTATESPRITE16:

View file

@ -531,8 +531,10 @@ enum ScriptKeywords_t
/// CON_DIGITALNUMBERZ, /// CON_DIGITALNUMBERZ,
CON_DRAWLINE16, CON_DRAWLINE16,
CON_DRAWLINE16B, CON_DRAWLINE16B,
CON_DRAWLINE16Z,
CON_DRAWCIRCLE16, CON_DRAWCIRCLE16,
CON_DRAWCIRCLE16B, CON_DRAWCIRCLE16B,
CON_DRAWCIRCLE16Z,
CON_ROTATESPRITE16, CON_ROTATESPRITE16,
CON_ROTATESPRITE, CON_ROTATESPRITE,
CON_SETGAMEPALETTE, CON_SETGAMEPALETTE,

View file

@ -2822,19 +2822,27 @@ dodefault:
// ^^^ // ^^^
case CON_DRAWLINE16: case CON_DRAWLINE16:
case CON_DRAWLINE16B: case CON_DRAWLINE16B:
case CON_DRAWLINE16Z:
insptr++; insptr++;
{ {
int32_t x1=Gv_GetVarX(*insptr++), y1=Gv_GetVarX(*insptr++); int32_t x1=Gv_GetVarX(*insptr++), y1=Gv_GetVarX(*insptr++);
int32_t z1=tw==CON_DRAWLINE16Z?Gv_GetVarX(*insptr++):0;
int32_t x2=Gv_GetVarX(*insptr++), y2=Gv_GetVarX(*insptr++); int32_t x2=Gv_GetVarX(*insptr++), y2=Gv_GetVarX(*insptr++);
int32_t z2=tw==CON_DRAWLINE16Z?Gv_GetVarX(*insptr++):0;
int32_t col=Gv_GetVarX(*insptr++), odrawlinepat=drawlinepat; int32_t col=Gv_GetVarX(*insptr++), odrawlinepat=drawlinepat;
int32_t xofs=0, yofs=0; int32_t xofs=0, yofs=0;
if (tw==CON_DRAWLINE16B) if (tw==CON_DRAWLINE16B || tw==CON_DRAWLINE16Z)
{ {
x1 = mulscale14(x1-pos.x,zoom); screencoords(&x1,&y1, x1-pos.x,y1-pos.y, zoom);
y1 = mulscale14(y1-pos.y,zoom); screencoords(&x2,&y2, x2-pos.x,y2-pos.y, zoom);
x2 = mulscale14(x2-pos.x,zoom);
y2 = mulscale14(y2-pos.y,zoom); if (tw==CON_DRAWLINE16Z && m32_sideview)
{
y1 += getscreenvdisp(z1-pos.z,zoom);
y2 += getscreenvdisp(z2-pos.z,zoom);
}
xofs = halfxdim16; xofs = halfxdim16;
yofs = midydim16; yofs = midydim16;
} }
@ -2847,24 +2855,28 @@ dodefault:
case CON_DRAWCIRCLE16: case CON_DRAWCIRCLE16:
case CON_DRAWCIRCLE16B: case CON_DRAWCIRCLE16B:
case CON_DRAWCIRCLE16Z:
insptr++; insptr++;
{ {
int32_t x1=Gv_GetVarX(*insptr++), y1=Gv_GetVarX(*insptr++); int32_t x1=Gv_GetVarX(*insptr++), y1=Gv_GetVarX(*insptr++);
int32_t z1 = tw==CON_DRAWCIRCLE16Z ? Gv_GetVarX(*insptr++) : 0;
int32_t r=Gv_GetVarX(*insptr++); int32_t r=Gv_GetVarX(*insptr++);
int32_t col=Gv_GetVarX(*insptr++), odrawlinepat=drawlinepat; int32_t col=Gv_GetVarX(*insptr++), odrawlinepat=drawlinepat;
int32_t xofs=0, yofs=0; int32_t xofs=0, yofs=0, eccen=16384;
if (tw==CON_DRAWCIRCLE16B) if (tw==CON_DRAWCIRCLE16B)
{ {
x1 = mulscale14(x1-pos.x,zoom); screencoords(&x1,&y1, x1-pos.x,y1-pos.y, zoom);
y1 = mulscale14(y1-pos.y,zoom); if (m32_sideview)
y1 += getscreenvdisp(z1, zoom);
r = mulscale14(r,zoom); r = mulscale14(r,zoom);
eccen = scalescreeny(eccen);
xofs = halfxdim16; xofs = halfxdim16;
yofs = midydim16; yofs = midydim16;
} }
drawlinepat = m32_drawlinepat; drawlinepat = m32_drawlinepat;
drawcircle16(xofs+x1, yofs+y1, r, col>=0?editorcolors[col&15]:(-col&255)); drawcircle16(xofs+x1, yofs+y1, r, eccen, col>=0?editorcolors[col&15]:(-col&255));
drawlinepat = odrawlinepat; drawlinepat = odrawlinepat;
continue; continue;
} }

View file

@ -617,6 +617,7 @@ static void Gv_AddSystemVars(void)
Gv_NewVar("halfxdim16", (intptr_t)&halfxdim16, GAMEVAR_READONLY | GAMEVAR_INTPTR | GAMEVAR_SYSTEM); Gv_NewVar("halfxdim16", (intptr_t)&halfxdim16, GAMEVAR_READONLY | GAMEVAR_INTPTR | GAMEVAR_SYSTEM);
Gv_NewVar("midydim16", (intptr_t)&midydim16, GAMEVAR_READONLY | GAMEVAR_INTPTR | GAMEVAR_SYSTEM); Gv_NewVar("midydim16", (intptr_t)&midydim16, GAMEVAR_READONLY | GAMEVAR_INTPTR | GAMEVAR_SYSTEM);
Gv_NewVar("ydim16",(intptr_t)&ydim16, GAMEVAR_INTPTR | GAMEVAR_SYSTEM | GAMEVAR_READONLY); Gv_NewVar("ydim16",(intptr_t)&ydim16, GAMEVAR_INTPTR | GAMEVAR_SYSTEM | GAMEVAR_READONLY);
Gv_NewVar("m32_sideview",(intptr_t)&m32_sideview, GAMEVAR_INTPTR | GAMEVAR_SYSTEM | GAMEVAR_READONLY);
Gv_NewVar("SV1",(intptr_t)&m32_sortvar1, GAMEVAR_INTPTR | GAMEVAR_SYSTEM | GAMEVAR_READONLY); Gv_NewVar("SV1",(intptr_t)&m32_sortvar1, GAMEVAR_INTPTR | GAMEVAR_SYSTEM | GAMEVAR_READONLY);
Gv_NewVar("SV2",(intptr_t)&m32_sortvar2, GAMEVAR_INTPTR | GAMEVAR_SYSTEM | GAMEVAR_READONLY); Gv_NewVar("SV2",(intptr_t)&m32_sortvar2, GAMEVAR_INTPTR | GAMEVAR_SYSTEM | GAMEVAR_READONLY);