From 917b924a0d729c9b2c38af1089288165ebecf850 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Tue, 17 Aug 2010 20:00:44 +0000 Subject: [PATCH] Fixes crash in 2d map drawing where sector[-1] was accessed; added commands a2xy and ah2xyz to m32script, coded 2d preview of swinging and sliding doors; added "samprate" setting to configuration, useful if the default one gives jittering/echoey audio git-svn-id: https://svn.eduke32.com/eduke32@1697 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/editor.h | 4 + polymer/eduke32/build/src/build.c | 37 +- polymer/eduke32/build/src/config.c | 14 +- polymer/eduke32/build/src/engine.c | 2 +- polymer/eduke32/m32help.hlp | 681 ++++++++++++++-------- polymer/eduke32/samples/a.m32 | 125 +++- polymer/eduke32/source/astub.c | 37 +- polymer/eduke32/source/enet/Makefile | 10 +- polymer/eduke32/source/jaudiolib/Makefile | 14 +- polymer/eduke32/source/m32def.c | 29 +- polymer/eduke32/source/m32def.h | 2 + polymer/eduke32/source/m32exec.c | 40 +- polymer/eduke32/source/mapster32.h | 3 - polymer/eduke32/source/sounds_mapster32.c | 9 +- 14 files changed, 671 insertions(+), 336 deletions(-) diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index 27f8098e3..8b158a15d 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -88,6 +88,10 @@ extern void ExtEditWallData(int16_t wallnum); extern void ExtEditSpriteData(int16_t spritenum); extern const char *ExtGetSectorType(int32_t lotag); +extern void showsectordata(int16_t sectnum, int16_t small); +extern void showwalldata(int16_t wallnum, int16_t small); +extern void showspritedata(int16_t spritenum, int16_t small); + extern int32_t circlewall; int32_t loadsetup(const char *fn); // from config.c diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 61a22a745..ad1778f7c 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -208,9 +208,6 @@ int32_t fillsector(int16_t sectnum, char fillcolor); int16_t whitelinescan(int16_t dalinehighlight); void printcoords16(int32_t posxe, int32_t posye, int16_t ange); void copysector(int16_t soursector, int16_t destsector, int16_t deststartwall, char copystat); -void showsectordata(int16_t sectnum); -void showwalldata(int16_t wallnum); -void showspritedata(int16_t spritenum); int32_t drawtilescreen(int32_t pictopleft, int32_t picbox); void overheadeditor(void); static int32_t getlinehighlight(int32_t xplc, int32_t yplc, int32_t line); @@ -6119,18 +6116,16 @@ void copysector(int16_t soursector, int16_t destsector, int16_t deststartwall, c Bsprintf(snotbuf, fmt, ## __VA_ARGS__); \ printext16(8+col*200, ydim/*-(row*96)*/-STATUS2DSIZ+Yofs, color, -1, snotbuf, 0); -void showsectordata(int16_t sectnum) +void showsectordata(int16_t sectnum, int16_t small) { sectortype *sec; char snotbuf[80]; int32_t col=0; //,row = 0; - int32_t mode = (sectnum & 16384); - int32_t color = mode?whitecol:editorcolors[11]; + int32_t color = small ? whitecol : editorcolors[11]; - sectnum &= ~16384; sec = §or[sectnum]; - if (mode) + if (small) { _printmessage16("^10Sector %d %s ^O(F7 to edit)", sectnum, ExtGetSectorCaption(sectnum)); return; @@ -6169,19 +6164,17 @@ void showsectordata(int16_t sectnum) DOPRINT(96, "Palookup number: %d", sec->floorpal); } -void showwalldata(int16_t wallnum) +void showwalldata(int16_t wallnum, int16_t small) { walltype *wal; int32_t sec; char snotbuf[80]; int32_t col=0; //, row = 0; - int32_t mode = (wallnum & 16384); - int32_t color = mode?whitecol:editorcolors[11]; + int32_t color = small ? whitecol : editorcolors[11]; - wallnum &= ~16384; wal = &wall[wallnum]; - if (mode) + if (small) { _printmessage16("^10Wall %d %s ^O(F8 to edit)", wallnum, ExtGetWallCaption(wallnum)); return; @@ -6209,30 +6202,28 @@ void showwalldata(int16_t wallnum) col++; - DOPRINT(48-(mode?16:0), "nextsector: %d", wal->nextsector); - DOPRINT(56-(mode?16:0), "nextwall: %d", wal->nextwall); + DOPRINT(48-(small?16:0), "nextsector: %d", wal->nextsector); + DOPRINT(56-(small?16:0), "nextwall: %d", wal->nextwall); - DOPRINT(72-(mode?16:0), "Extra: %d", wal->extra); + DOPRINT(72-(small?16:0), "Extra: %d", wal->extra); // TX 20050102 I'm not sure what unit dist<<4 is supposed to be, but dist itself is correct in terms of game coordinates as one would expect - DOPRINT(96-(mode?16:0), "Wall length: %d", wallength(wallnum)); + DOPRINT(96-(small?16:0), "Wall length: %d", wallength(wallnum)); sec = sectorofwall(wallnum); - DOPRINT(104-(mode?16:0), "Pixel height: %d", (sector[sec].floorz-sector[sec].ceilingz)>>8); + DOPRINT(104-(small?16:0), "Pixel height: %d", (sector[sec].floorz-sector[sec].ceilingz)>>8); } -void showspritedata(int16_t spritenum) +void showspritedata(int16_t spritenum, int16_t small) { spritetype *spr; char snotbuf[80]; int32_t col=0; //, row = 0; - int32_t mode = (spritenum & 16384); - int32_t color = mode?whitecol:editorcolors[11]; + int32_t color = small ? whitecol : editorcolors[11]; - spritenum &= ~16384; spr = &sprite[spritenum]; - if (mode) + if (small) { _printmessage16("^10Sprite %d %s ^O(F8 to edit)",spritenum, ExtGetSpriteCaption(spritenum)); return; diff --git a/polymer/eduke32/build/src/config.c b/polymer/eduke32/build/src/config.c index d2f39c091..a90b095d7 100644 --- a/polymer/eduke32/build/src/config.c +++ b/polymer/eduke32/build/src/config.c @@ -67,7 +67,7 @@ extern double msens; extern int32_t editorgridextent, grid, autogrid; static int32_t default_grid=3; extern int32_t graphicsmode; -extern int32_t AmbienceToggle; +extern int32_t AmbienceToggle, MixRate; extern int32_t ParentalLock; /* @@ -133,7 +133,7 @@ int32_t loadsetup(const char *fn) if (readconfig(fp, "ydim2d", val, VL) > 0) ydim2d = Batoi(val); if (readconfig(fp, "xdim3d", val, VL) > 0) xdimgame = Batoi(val); if (readconfig(fp, "ydim3d", val, VL) > 0) ydimgame = Batoi(val); - if (readconfig(fp, "samplerate", val, VL) > 0) option[7] = (Batoi(val) & 0x0f) << 4; +// if (readconfig(fp, "samplerate", val, VL) > 0) option[7] = (Batoi(val) & 0x0f) << 4; if (readconfig(fp, "music", val, VL) > 0) { if (Batoi(val) != 0) option[2] = 1; else option[2] = 0; } if (readconfig(fp, "mouse", val, VL) > 0) { if (Batoi(val) != 0) option[3] = 1; else option[3] = 0; } if (readconfig(fp, "bpp", val, VL) > 0) bppgame = Batoi(val); @@ -241,6 +241,7 @@ int32_t loadsetup(const char *fn) if (readconfig(fp, "graphicsmode", val, VL) > 0) graphicsmode = min(max(Batoi(val),0),2); + 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, "parlock", val, VL) > 0) ParentalLock = Batoi(val); @@ -422,7 +423,10 @@ int32_t writesetup(const char *fn) "showambiencesounds = %d\n" "\n" "; 2D mode display type (0:classic, 1:textured, 2:textured/animated)\n" - "graphicsmode = %d\n\n" + "graphicsmode = %d\n" + "\n" + "; Sample rate in Hz\n" + "samplerate = %d\n" "; Ambient sounds in 3D mode (0:off, 1:on)\n" "ambiencetoggle = %d\n" "parlock = %d\n" @@ -503,8 +507,8 @@ int32_t writesetup(const char *fn) #endif option[3], msens, unrealedlook, pk_uedaccel, quickmapcycling, revertCTRL,scrollamount,pk_turnaccel,pk_turndecel,autosave, - showheightindicators,showambiencesounds,graphicsmode,AmbienceToggle,ParentalLock, - !!m32_osd_tryscript, + showheightindicators,showambiencesounds,graphicsmode, + MixRate,AmbienceToggle,ParentalLock, !!m32_osd_tryscript, #if 1 keys[0], keys[1], keys[2], keys[3], keys[4], keys[5], keys[6], keys[7], keys[8], keys[9], keys[10], keys[11], diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 91a5bb4c1..05d457774 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -11086,7 +11086,7 @@ void draw2dscreen(int32_t posxe, int32_t posye, int16_t ange, int32_t zoome, int if (i == linehighlight || ((linehighlight >= 0) && (i == wall[linehighlight].nextwall))) if (totalclock & 16) col -= (2<<2); } - else if (showfirstwall && (sector[searchsector].wallptr == i || sector[searchsector].wallptr == wall[i].nextwall)) + else if (showfirstwall && searchsector>=0 && (sector[searchsector].wallptr == i || sector[searchsector].wallptr == wall[i].nextwall)) { col = 14; if (i == linehighlight) if (totalclock & 16) col -= (2<<2); diff --git a/polymer/eduke32/m32help.hlp b/polymer/eduke32/m32help.hlp index 448dac750..a3029e25f 100644 --- a/polymer/eduke32/m32help.hlp +++ b/polymer/eduke32/m32help.hlp @@ -6,10 +6,13 @@ 5. 3D mode tile selector refrence 6. Sector effector reference 7. Sector tag reference +8. Long SE reference +9. Colors ^P -The purpose of mouse in 2D mode is pointing, selecting, moving object in a map. +The purpose of mouse in 2D mode is pointing, selecting and +moving objects in a map. -Every time mouse is pointing at one of these: +^3Every time mouse is pointing at one of these: 1. Nothing 2. Sector 3. Sector and wall @@ -20,115 +23,112 @@ Every time mouse is pointing at one of these: Some commands work differently depending on the currently selected object. Press ALT to work with a wall or sprite instead of any adjacent sectors. -^14RSHIFT^O select vertex/sprites -^14RALT^O select sectors -^14WHEEL^O zoom -^14WHEEL+ALT^O move camera and zoom -^14LEFT BUTTON^O drag sectors/vertex/sprites -^14RIGHT BUTTON^O move camera -^14RIGHT MIDDLE^O move camera +^14RSHIFT^O Select vertex/sprites +^14RALT^O Select sectors +^14WHEEL^O Zoom +^14WHEEL+ALT^O Move camera and zoom +^14LEFT BUTTON^O Drag sectors/vertex/sprites +^14RIGHT BUTTON^O Move camera +^14RIGHT MIDDLE^O Move camera ^P -LSHIFT show coordinates -F1 show help -F9 show the Sector Tags help -M set extra of sector -M+ALT set extra of wall/sprite -/ Reset panning, size and flags to defaults -/+SHIFT make square - set xrepeat to yrepeat +LSHIFT Show coordinates +F1 Show help +F9 Show the Sector Tags help +M Set extra of sector +M+ALT Set extra of wall/sprite +/ Reset panning, size and flags to defaults +/+SHIFT Make square - set xrepeat to yrepeat -KP_4 scaling sprite horizontally -KP_6 scaling sprite horizontally -KP_2 scaling sprite vertically -KP_8 scaling sprite vertically -+KP_5 speed up +KP_4 Scaling sprite horizontally +KP_6 Scaling sprite horizontally +KP_2 Scaling sprite vertically +KP_8 Scaling sprite vertically ++KP_5 Speed up -R cycle sprite alignment -' S set sprite size -' F function menu -F7+ALT search sector lotag -F8+ALT search wall/sprite lotag -[ search backward -] search forward -G cycle grid size -G+SHIFT cycle grid size backward -' L set sprite/wall coordinates -' 3 cycle modes of showing object's name -' 7 swap lotag and hitag of wall/sprite -' J goto X,Y +R Cycle sprite alignment +' S Set sprite size +' F Function menu +F7+ALT Search sector lotag +F8+ALT Search wall/sprite lotag +[ Search backward +] Search forward +G Cycle grid size +G+SHIFT Cycle grid size backward +' L Set sprite/wall coordinates +' 3 Cycle modes of showing object's name +' 7 Swap lotag and hitag of wall/sprite +' J Goto X,Y -X flip selected sectors in x -Y flip selected sectors in y -X+ALT mirror selected sectors in x -Y+ALT mirror selected sectors in y +X Flip selected sectors in x +Y Flip selected sectors in y +X+ALT Mirror selected sectors in x +Y+ALT Mirror selected sectors in y -F12 screenshot -F12+SHIFT inverted screenshot +F12 Screenshot +F12+SHIFT Inverted screenshot -B toggle blocking -B+SHIFT toggle one-sided blocking for a wall -F+ALT set the first wall of a sector -O ornament sprite flat onto wall +B Toggle blocking +B+SHIFT Toggle one-sided blocking for a wall +F+ALT Set the first wall of a sector +O Ornament sprite flat onto wall -, rotate sprite/selected sectors -. rotate sprite/selected sectors -< slowly rotate sprite/selected sectors -> slowly rotate sprite/selected sectors +, Rotate sprite/selected sectors +. Rotate sprite/selected sectors +< Slowly rotate sprite/selected sectors +> Slowly rotate sprite/selected sectors -SCROLL LOCK set starting position -F5 show item count -F6 show actor count -F6 show Sector Effector help when pointed at sprite -F7 edit sector data -F8 edit wall/sprite data +SCROLL LOCK Set starting position +F5 Show item count +F6 Show actor count +F6 Show Sector Effector help when pointed at sprite +F7 Edit sector data +F8 Edit wall/sprite data -T set sector lotag -T+ALT set wall/sprite lotag -T+CTRL toggle show tags +T Set sector lotag +T+ALT Set wall/sprite lotag +T+CTRL Toggle show tags -H set sector hitag -H+ALT set wall/sprite hitag -H+CTRL toggle hitscan sensitivity -H+CTRL+SHIFT toggle hitscan sensitivity +H Set sector hitag +H+ALT Set wall/sprite hitag +H+CTRL Toggle hitscan sensitivity -P set sector palette -E set sprite status list -TAB show sector data -TAB+CTRL show wall/sprite data -TAB+ALT show wall/sprite data (The Windows cool switch may trigger when used.) +P Set sector palette +E Set sprite status list +TAB Show sector data +TAB+SHIFT Show wall/sprite data +TAB+CTRL Show wall/sprite data -LCTRL+RSHIFT select all walls of the current sector -(point at a wall and, holding CTRL, press SHIFT) +LCTRL+RSHIFT Select all walls of the current sector + (point at a wall and, holding CTRL, press SHIFT) -A zoom in -Z zoom out -L toggle grid lock -J join sectors -S insert sprite - pressing a key from 1 to 0 on the upper row before pressing S will make the - inserted sprite's picnum be 1 to 10, respectively -S+ALT make inner sector -C duplicate sectors/sprites -C start circle attached to a wall -KP_+ increase amount of walls in circle -KP_- decrease amount of walls in circle -SPACE start/end drawing of sector, end drawing of circle -LENTER check all pointers for the current sector -LSHIFT+LCTRL+LENTER check ALL pointers (manual attempt to recover map) -BACKSPACE remove the last wall during drawing sector -DEL delete sprite -DEL+CTRL delete sector -INS duplicate sectors/sprites -INS start circle attached to a wall -INS add vertex to wall -RENETER switch to 3D mode -ESC menu +A Zoom in +Z Zoom out +L Toggle grid lock +J Join sectors +S Insert sprite (see samples/tiles.cfg for customization) +S+ALT Make inner sector +C Duplicate sectors/sprites +C Start circle attached to a wall +KP_+ Increase amount of walls in circle +KP_- Decrease amount of walls in circle +SPACE Start/end drawing of sector, end drawing of circle +LENTER Check all pointers for the current sector +LSHIFT+LCTRL+LENTER Check ALL pointers (manual attempt to recover map) +BACKSPACE Remove the last wall during drawing sector +DEL Delete sprite +DEL+CTRL Delete sector +INS Duplicate sectors/sprites +INS Start circle attached to a wall +INS Add vertex to wall +RENTER Switch to 3D mode +ESC Menu -' A toggle autosave (every 3 minutes) -' N toggle clipping -S+CTRL save map -L+CTRL load map +' A Toggle autosave (every 3 minutes) +' N Toggle clipping +S+CTRL Save map +L+CTRL Load map ^P -The mouse pointer always points at one of these objects: +^3The mouse pointer always points at one of these objects: 1. wall 2. ceiling of sector 3. floor of sector @@ -136,203 +136,203 @@ The mouse pointer always points at one of these objects: 5. masked wall (non-transparent or semi-transparent wall between sectors) It's important to understand this concept. -Some commands work differently depending on the "current object",the object -the mouse points at. +Some commands work differently depending on the "current object", +the object the mouse points at. Some commands only manipulate the "current object", but other commands manipulate the sprites and sectors which are "selected" in 2D mode. Other commands work globally. -Mouse buttons: -^14LEFT^O lock the current object. The current object won't +^3Mouse buttons: +^14LEFT^O Lock the current object. The current object won't change as long as the button is pressed. -^14LEFT+MIDDLE^O toggle mouselook -^14WHEEL^O change shade/visibility -^14LEFT+WHEEL^O change tile -^14RIGHT+WHEEL^O move object up/down +^14LEFT+MIDDLE^O Toggle mouselook +^14WHEEL^O Change shade/visibility +^14LEFT+WHEEL^O Change tile +^14RIGHT+WHEEL^O Move object up/down -Additionally, there is now UnrealEd-style mouse navigation in 3D mode (toggle -it with ^14F5^O), with the following bindings: +Additionally, there is UnrealEd-style mouse navigation in 3D mode +(toggle it with ^14F5^O) with the following bindings: ^14RIGHT^O mouselook ^14LEFT^O x: turning, y: move forward/back ^14LEFT+RIGHT^O x: strafe left/right, y: move up/down ^14MIDDLE^O y: move in viewing direction -The console variable 'pk_uedaccel' changes the speed of navigation -exponentially (valid values are 0-5). + The console variable 'pk_uedaccel' changes the speed + of navigation exponentially (valid values are 0-5). -^14LEFT+ALT^O move object up/down -^14LEFT+SHIFT^O pan ceiling/floor/wall -^14LEFT+SHIFT^O move sprite in horizontal plane -^14LEFT+CTRL^O scale wall texture or size of sprite -^14LEFT+CTRL^O change slope of sector +^14LEFT+ALT^O Move object up/down +^14LEFT+SHIFT^O Pan ceiling/floor/wall +^14LEFT+SHIFT^O Move sprite in horizontal plane +^14LEFT+CTRL^O Scale wall texture or size of sprite +^14LEFT+CTRL^O Change slope of sector ^P -UP move forward -DOWN move backward -LEFT+RCTRL move left -RIGHT+RCTRL move right -A move up -Z move down -F4+ALT toggle showing the first wall -+LSHIFT speed up movements +UP Move forward +DOWN Move backward +LEFT+RCTRL Move left +RIGHT+RCTRL Move right +A Move up +Z Move down +F4+ALT Toggle showing the first wall ++LSHIFT Speed up movements -LEFT turn left -RIGHT turn right -A+CTRL look down -Z+CTRL lood up +LEFT Turn left +RIGHT Turn right +A+CTRL Look down +Z+CTRL Look up -' V set sector visibility -; V set sector visibility on all selected sectors -V choose tile -3 toggle "sector over sector". -F3 toggle mouselook -' BACKSPACE clear all flags for wall/sprite -' P paste palette to all selected sectors -; P paste palette to all selected sectors & sprites -DEL delete sprite -F6 toggle automatic Sector Effector help -F7 toggle automatic sector tag help +' V Set sector visibility +; V Set sector visibility on all selected sectors +V Choose tile +3 Toggle "sector over sector". +F3 Toggle mouselook +' BACKSPACE Clear all flags for wall/sprite +' P Paste palette to all selected sectors +; P Paste palette to all selected sectors & sprites +DEL Delete sprite +F6 Toggle automatic Sector Effector help +F7 Toggle automatic sector tag help -, rotate sprite -. rotate sprite -< slowly rotate sprite -> slowly rotate sprite -. search & fix panning of the wall to the right +, Rotate sprite +. Rotate sprite +< Slowly rotate sprite +> Slowly rotate sprite +. Search & fix panning of the wall to the right -' L change the coordinates of the current object -CAPS LOCK cycle zmode -' Z cycle zmode -' M set the extra of the current object -1 toggle one-sided flag of sprite/wall -2 toggle bottom wall swapping -O set top or bottom orientation of wall -O ornament sprite flat onto wall -M toggle masked wall -H toggle hitscan sensitivity -H+SHIFT toggle one side hitscan sensitivity for the wall -' H set hitag of the current object +' L Change the coordinates of the current object +CAPS LOCK Cycle zmode +' Z Cycle zmode +' M Set the extra of the current object +1 Toggle one-sided flag of sprite/wall +2 Toggle bottom wall swapping +O Set top or bottom orientation of wall +O Ornament sprite flat onto wall +M Toggle masked wall +H Toggle hitscan sensitivity +H+SHIFT Toggle one side hitscan sensitivity for the wall +' H Set hitag of the current object -KP_MINUS darkens shade of individual sector/wall/sprite or selected sectors -KP_MINUS+ALT decreases visibility of sector or selected sectors -KP_MINUS+ALT+SHIFT slowly decreases visibility of sector or selected sectors -KP_MINUS+ALT+CTRL decreases global visibility -KP_PLUS lightens shade individual sector/wall/sprite or selected sectors -KP_PLUS+ALT increases visibility of sector or selected sectors -KP_PLUS+ALT+SHIFT slowly increases visibility of sector or selected sectors -KP_PLUS+ALT+CTRL increases global visibility -Note: ALT,CTRL, SHIFT are modifiers so they work with mouse too. +KP_MINUS Darkens shade of individual sector/wall/sprite or selected sectors +KP_MINUS+ALT Decreases visibility of sector or selected sectors +KP_MINUS+ALT+SHIFT Slowly decreases visibility of sector or selected sectors +KP_MINUS+ALT+CTRL Decreases global visibility +KP_PLUS Lightens shade individual sector/wall/sprite or selected sectors +KP_PLUS+ALT Increases visibility of sector or selected sectors +KP_PLUS+ALT+SHIFT Slowly increases visibility of sector or selected sectors +KP_PLUS+ALT+CTRL Increases global visibility +^3Note: ALT, CTRL, SHIFT are modifiers so they work with mouse too. -PLUS/MINUS cycle tile -E toggle sector texture expansion -R toggle sector texture relativity alignment -R cycle sprite aligment between: wall aligned, floor aligned, view aligned -' R toggle framerate -F flip the current object -F+ALT set the first wall of sector ++/- Cycle tile +E Toggle sector texture expansion +R Toggle sector texture relativity alignment +R Cycle sprite aligment between: wall aligned, floor aligned, view aligned +'R Toggle framerate +F Flip the current object +F+ALT Set the first wall of sector -PAGE UP move selected sprites or sectors up -PAGE DN move selected sprites or sectors down -PAGE UP+CTRL move selected sprites to ceiling -PAGE DN+CTRL move selected sprites to floor -+CTRL speed up movement -+END slow down movement -+HOME slow down movement even more -Note: CTRL, HOME, END are modifiers, so they work with the mouse too. +PAGE UP Move selected sprites or sectors up +PAGE DN Move selected sprites or sectors down +PAGE UP+CTRL Move selected sprites to ceiling +PAGE DN+CTRL Move selected sprites to floor ++CTRL Speed up movement ++END Slow down movement ++HOME Slow down movement even more +^3Note: CTRL, HOME, END are modifiers, so they work with the mouse too. -' D cycle skill level -' X toggle sprite shade preview -' W toggle sprite display -' Y toggle purple background -' C copy shade from the clipboard to all objects in the map which are the same -tile as the tile of the object in the clipboard. It works separately for -sectors/walls/sprites depending on the current object. -' T set lotag -' H set hitag -' S set shade -F2 toggle clipboard preview -TAB copy to the clipboard -F1 toggle help -G set picnum -B toggle blocking -B+SHIFT toggle one side blocking for the wall -T cycles translucence for sprites/masked walls +' D Cycle skill level +' X Toggle sprite shade preview +' W Toggle sprite display +' Y Toggle purple background +' C Copy shade from the clipboard to all objects in the map which are the same + tile as the tile of the object in the clipboard. It works separately for + sectors/walls/sprites depending on the current object. +' T Set lotag +' H Set hitag +' S Set shade +F2 Toggle clipboard preview +TAB Copy to the clipboard +F1 Toggle help +G Set picnum +B Toggle blocking +B+SHIFT Toggle one side blocking for the wall +T Cycles translucence for sprites/masked walls -LENTER+CTRL+SHIFT autoshade wall -' LENTER paste picnum only -LENTER+SHIFT paste shade and palette onto the current object -LENTER+CTRL paste picnum, shading, and palette onto the current object -LENTER paste all properties onto the current object +LENTER+CTRL+SHIFT Autoshade wall +' LENTER Paste picnum only +LENTER+SHIFT Paste shade and palette onto the current object +LENTER+CTRL Paste picnum, shading, and palette onto the current object +LENTER Paste all properties onto the current object -' A toggle autosave. The interval is configurable in the .cfg. - (by default: every 3 minutes) +' A Toggle autosave. The interval is configurable in the .cfg. + (by default: every 3 minutes) -' N toggle clipping for the camera -N+CTRL toggle clipping for sprites +' N Toggle clipping for the camera +N+CTRL Toggle clipping for sprites -S+CTRL save map -L+CTRL load map +S+CTRL Save map +L+CTRL Load map -ESC quit -F11 brightness -F12 screenshot -F12+SHIFT inverted screenshot -F9 reload and activate maphacks -F10 disable maphacks +ESC Quit +F11 Brightness +F12 Screenshot +F12+SHIFT Inverted screenshot +F9 Reload and activate maphacks +F10 Disable maphacks -C toggle center sprite (cstat 128) -ALT+C replace all tiles in the map with the clipboard +C Toggle center sprite (cstat 128) +ALT+C Replace all tiles in the map with the clipboard -[ increases slope quickly -[+RSHIFT increases slope with medium speed -[+LSHIFT increases slope slowly -[+ALT align slope to the floor of an adjoining sector -] decreases slope quickly -]+RSHIFT decreases slope with medium speed -]+LSHIFT decreases slope slowly -]+ALT align slope to the ceiling of an adjoining sector +[ Increases slope quickly +[+RSHIFT Increases slope with medium speed +[+LSHIFT Increases slope slowly +[+ALT Align slope to the floor of an adjoining sector +] Decreases slope quickly +]+RSHIFT Decreases slope with medium speed +]+LSHIFT Decreases slope slowly +]+ALT Align slope to the ceiling of an adjoining sector -KP_4 pan floor/ceiling horizontally -KP_6 pan floor/ceiling horizontally -KP_2 pan floor/ceiling vertically -KP_8 pan floor/ceiling vertically -KP_4 scale wall/sprite horizontally -KP_6 scale wall/sprite horizontally -KP_2 scale wall/sprite vertically -KP_8 scale wall/sprite vertically -+SHIFT force panning (for walls) -+KP_5 increase speed +KP_4 Pan floor/ceiling horizontally +KP_6 Pan floor/ceiling horizontally +KP_2 Pan floor/ceiling vertically +KP_8 Pan floor/ceiling vertically +KP_4 Scale wall/sprite horizontally +KP_6 Scale wall/sprite horizontally +KP_2 Scale wall/sprite vertically +KP_8 Scale wall/sprite vertically ++SHIFT Force panning (for walls) ++KP_5 Increase speed -/ Reset panning, size and flags to defaults -/+SHIFT make square - set xrepeat to yrepeat +/ Reset panning, size and flags to defaults +/+SHIFT Make square - set xrepeat to yrepeat -P enable/disable parallax -P+CTRL change parallax type (only in 8-bit classic renderer) -P+ALT change palette of sector/wall/sprite -D+ALT adjust clipping distance of the sprite -T translucence for sprites/masked walls -S insert sprite -KP_ENTER switch to 2D mode +P Enable/disable parallax +P+CTRL Change parallax type (only in 8-bit classic renderer) +P+ALT Change palette of sector/wall/sprite +D+ALT Adjust clipping distance of the sprite +T Translucence for sprites/masked walls +S Insert sprite +KP_ENTER Switch to 2D mode ^P After pressing V in 3D mode, the editor enters tile browsing. -Keys: -KP_/ zoom in -KP_* zoom out +^3Keys: +KP_/ Zoom in +KP_* Zoom out UP/DOWN/LEFT/RIGHT/PAGE UP/PAGE DOWN movements -G go to specified tile -U go to start of user defined art (3584) -A go to start of Atomic edition's art (4096) -E go to start of extended art (6144, 9216) +G Go to specified tile +U Go to start of user defined art (3584) +A Go to start of Atomic edition's art (4096) +E Go to start of extended art (6144, 9216) -V select from all tiles -T select from pre-defined tileset (tiles.cfg) -Z tile zoom -ESC cancel -ENTER accept +V Select from all tiles +T Select from pre-defined tileset (tiles.cfg) +Z Tile zoom +ESC Cancel +ENTER Accept -Mouse: -LEFT select -CTRL+WHEEL zoom -WHEEL scroll -RIGHT smooth scrolling +^3Mouse: +LEFT select +CTRL+WHEEL zoom +WHEEL scroll +RIGHT smooth scrolling ^P 0 : Rotating Sector 1 : Pivot Sprite for SE 0 @@ -391,3 +391,170 @@ RIGHT smooth scrolling 32767 : Secret Room 65534 : End Of Level with Message 65535 : End Of Level +^P +^3SE 0/1: ROTATED SECTOR + SE1: pivot + Ang: up--clockwise, down--counterclockwise + SE0: a sector to rotate + Hi = SE1 Hi + +^3SE 2: EARTHQUAKE + In quake sector, modeled as after the quake, insert additionally: + MASTERSWITCH + Lo=X + In other sector: + TOUCHPLATE + Lo=X + Anywhere: + SE33: scraps + Hi=X + +^3SE 3: RANDOM LIGHTS AFTER SHOT OUT + Light is wall: + 2-way, blockable? + Lo=X + Light is ceiling: + sector Hi=X + SE 3 in affected sector: + Hi=X + Shades: + sectors/walls: when off + SE: when on + +^3SE 4: RANDOM LIGHTS + Hi: random blink num. ^0(research!) + Shades: + sectors/walls: when off + SE: when on + +^3SE 5: ? + +^3SE 6/14: SUBWAY + subway sectors: + Hi=unique per train + SE 6: SUBWAY FRONT CAR + Ang: direction of first movement + SE 14: SUBWAY PULLED CARS + Locators: + starting with Lo=0, ascending + Hi=1: train stops here + +^3SE 7: TRANSPORT + Hi=X link + +^3SE 8: UP OPEN DOOR LIGHTS (with ST 20) + SE 8 also in door sector + Hi=X links with other SE8 sprites + Shades: + sectors/walls: when closed + SE: when open + Walls: + Hi=1 means exclude this wall from changing shade + +^3SE 9: DOWN OPEN DOOR LIGHTS (with ST 21) + analogous SE 8 + +^3SE 10: ? + +^3SE 11: ROTATE SECTOR DOOR + Ang: up--clockwise, down--counterclockwise + Hi: link doors to be opened simulataneously + ST=23 + +^3SE 12: LIGHT SWITCH (preview with 'X) + Hi=X + Shades: + sectors/walls: when off + SE: when on + [switch]: + Lo=X + +^3SEENINE: C-9 BARREL + Hi=X + Lo=delay ^0(>0? game ticks?) + In all sectors with SEENINEs: + MASTERSWITCH Lo=X + [switch]: + Lo=X + +^3SE 13: C-9 EXPLOSIVE/BLASTABLE WALL + CRACKs/SEENINEs: Hi=X + SE 13: Hi=X + other SEENINEs: + Hi=X + Lo=delay + +^3SE 15: SLIDING DOOR (ST=25) + Ang: opposite of direction of first movement + GPSPEED: + 2*Lo: how far (BUILD units) + +^3SE 17: ELEVATOR TRANSPORT + Shade: darker on SE of starting sector + Sectors: + ST=15 + Top floor sector Hi=1 + +^3SE 18: INCREMENTAL SECTOR RISE/FALL + Hi: units moved per activation (min: 1024?) + Ang: + up--floor affected + down--ceiling affected + Pal: + 0: start at floor/ceiling height + not 0: start at SE height + [switch] & ACTIVATOR ^0(in same sector as SE?): + Lo=X + +^3SE 19: SHOT TOUCHPLATE CIELING DOWN + +^3SE 20: BRIDGE/STRETCH SECTOR (ST 27) + Ang: direction + ACTIVATOR + Hi = SE Hi = [switch] Lo + GPSPEED + Lo: how far (BUILD units) + +^3SE 21: DROP FLOOR (ST 28) + Ang: + up: drop ceiling + down: drop floor + z: end z ^0(()) + Sector: + z: start z ^0(()) + GPSPEED + Lo: rate ^0(units?) + ACTIVATOR + Lo = [switch] Lo + +^3SE 24: CONVEYOR BELT + Ang: direction + GPSPEED: + Lo=speed + +^3SE 25: ENGINE PISTON (CRUSHER) + z: starting z + Sector: + piston travels between ceiling z and floor z + +^3SE 27: CAMERA FOR PLAYBACK + Hi: radius (BUILD units?) + +^3SE 28: LIGHTNING + Hi = tile #4890 Hi + +^3^0SE 29: WAVES +^0 (...) +^0 Hi: start height (min. height?) +^0 GPSPEED Lo: start height (?) (phase?) + +^0 Based on MAP EDITING FAQ v1.3 BY JONAH BISHOP and code research +^P +Foreground colors: +^0,15 0 ^1,0 1 ^2 2 ^3 3 ^4 4 ^5 5 ^6 6 ^7 7 +^8 8 ^9 9 ^10 10^11 11^12 12^13 13^14 14^15 15 + +Background colors: +^15,0 0 ^0,1 1 ^0,2 2 ^0,3 3 ^0,4 4 ^0,5 5 ^0,6 6 ^0,7 7 +^0,8 8 ^0,9 9 ^0,10 10^0,11 11^0,12 12^0,13 13^0,14 14^0,15 15 + diff --git a/polymer/eduke32/samples/a.m32 b/polymer/eduke32/samples/a.m32 index 955fa8568..0bcf941b3 100644 --- a/polymer/eduke32/samples/a.m32 +++ b/polymer/eduke32/samples/a.m32 @@ -20,6 +20,9 @@ define MAXSPECULARFACTOR 1000 define SPOWERSTEPS 100 define SFACTORSTEPS 100 +// settings for various drawing enhancements +define PREVIEW_DRAW_COLOR 11 + ////////// END USER SETTINGS ////////// @@ -73,7 +76,11 @@ definequote 25 WALL[%d].NEXTSECTOR=%d out of range: numsectors=%d!!! define PRSCALE 1000 define MAXSPECULAR 100000 -gamearray ar 128 +define TMPARLEN 128 +gamearray ar TMPARLEN +gamearray xx TMPARLEN +gamearray yy TMPARLEN + gamearray parm 8 // prints out maphack light definitions based on SE lights in map @@ -369,6 +376,12 @@ defstate fiddlewithlights } ends +onevent EVENT_PREKEYS3D +// state testkeyavail + state fiddlewithlights +endevent + + // rotate highlighted sprites around selected (closest to mouse) sprite // global parameter: dang defstate rotselspr @@ -408,10 +421,6 @@ onevent EVENT_PREKEYS2D } endevent -onevent EVENT_PREKEYS3D -// state testkeyavail - state fiddlewithlights -endevent defstate setas set j dayx @@ -424,15 +433,14 @@ onevent EVENT_ENTER3DMODE state setas endevent + defstate cmp_by_lotag // comparator subroutine for sorting set RETURN sprite[SV2].lotag sub RETURN sprite[SV1].lotag ends -onevent EVENT_DRAW2DSCREEN - ifl cursectnum 0 return - - // connect LOCATORS in a sector by lines +defstate connectlocators + // connect LOCATORS in a sector with lines getarraysize ar tmp set j 0 for i spritesofsector cursectnum @@ -455,7 +463,9 @@ onevent EVENT_DRAW2DSCREEN set k i, add k 1, set k ar[k] drawline16b sprite[j].x sprite[j].y sprite[k].x sprite[k].y drawcol } +ends +defstate draw_prlightprojections ////////// polymer light 2d projections ////////// var c d h r x2 y2 oldpat @@ -523,8 +533,104 @@ onevent EVENT_DRAW2DSCREEN } } set drawlinepat oldpat +ends + +defstate previewdoors2d + // preview swinging and sliding doors in 2d mode + var valid sect lo + var i j w numw ang trange dx dy + + set valid 0 + set sect searchsector + + ifge sect 0 + { + set lo sector[sect].lotag + ife lo 23 set valid 1 + else ife lo 25 set valid 1 + } + + ife valid 1 + { + set valid 0 + for i spritesofsector sect + ifactor SECTOREFFECTOR + { + ife .lotag 11 ife lo 23 set valid 1 // swinging door + ife .lotag 15 ife lo 25 set valid 1 // slide door + ife valid 1 { set j i, break } + } + + ife valid 1 + seti j + else return + + ife .lotag 15 + { + set trange 256 + for i spritesofsector sect + ifactor GPSPEED { set trange .lotag, break } + mul trange 2 // now equals distance of sliding door to travel + } + + set i 0 + for w loopofwall sector[sect].wallptr + { + ifge i TMPARLEN break + set xx[i] wall[w].x + set yy[i] wall[w].y + add i 1 + } + ifl i TMPARLEN + { + set xx[i] xx[0] + set yy[i] yy[0] + add i 1 + } + set numw i + + ife .lotag 11 + { + ifg .ang 1024 set ang -512 else set ang 512 + for i range numw + rotatepoint .x .y xx[i] yy[i] ang xx[i] yy[i] + } + else // if .lotag 15 + { + set ang .ang, add ang 1024 + a2xy ang dx dy + mulscale dx trange dx 14 + mulscale dy trange dy 14 + + for i range numw + { + add xx[i] dx + add yy[i] dy + } + } + + set drawlinepat 0x33333333 + sub numw 1 + for i range numw + { + set j i, add j 1 + drawline16b xx[i] yy[i] xx[j] yy[j] PREVIEW_DRAW_COLOR + } + set drawlinepat 0xffffffff + } +ends + +onevent EVENT_DRAW2DSCREEN + ifge cursectnum 0 + { + state connectlocators + state draw_prlightprojections + } + + state previewdoors2d endevent + // LOCATORS auto-incrementer onevent EVENT_INSERTSPRITE2D set k I @@ -703,6 +809,7 @@ onevent EVENT_ANALYZESPRITES state tduplin endevent + onevent EVENT_KEYS3D var l m diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 2f7339375..627016755 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -6684,13 +6684,26 @@ static void Keys2d(void) if (keystatus[KEYSC_TAB]) //TAB { - if (cursectornum >= 0) + if (eitherSHIFT || eitherCTRL) + { + if (pointhighlight >= 16384) + { + drawgradient(); + showspritedata(pointhighlight&16383, 0); + } + else if (linehighlight >= 0 && ((bstatus&1) || sectorofwall(linehighlight)==cursectornum)) + { + drawgradient(); + showwalldata(linehighlight, 0); + } + } + else if (cursectornum >= 0) { drawgradient(); - showsectordata((int16_t)i); + showsectordata(cursectornum, 0); } } - else if (!(keystatus[KEYSC_F5]|keystatus[KEYSC_F6]|keystatus[KEYSC_F7]|keystatus[KEYSC_F8])) + else if (!(keystatus[KEYSC_F5]|keystatus[KEYSC_F6]|keystatus[KEYSC_F7]|keystatus[KEYSC_F8]) && !eitherSHIFT) { static int32_t counter = 0; static int32_t omx = 0, omy = 0; @@ -6721,15 +6734,15 @@ static void Keys2d(void) if (pointhighlight >= 16384) { i = pointhighlight-16384; - showspritedata((int16_t)i+16384); + showspritedata(i, 1); if (sprite[i].picnum==SECTOREFFECTOR) _printmessage16("^10%s", SectorEffectorText(i)); } else if (linehighlight >= 0 && ((bstatus&1) || sectorofwall(linehighlight)==cursectornum)) - showwalldata((int16_t)linehighlight+16384); + showwalldata(linehighlight, 1); else if (cursectornum >= 0) - showsectordata((int16_t)cursectornum+16384); + showsectordata(cursectornum, 1); } if (totalclock < lastpm16time + 120*2) @@ -6845,7 +6858,7 @@ static void Keys2d(void) Bsprintf(tempbuf,"Sector %d Extra: ",i); sector[i].extra = getnumber16(tempbuf,sector[i].extra,BTAG_MAX,1); // clearmidstatbar16(); -// showsectordata((int16_t)i); +// showsectordata(i, 0); // break; } } @@ -9864,7 +9877,7 @@ static void EditSectorData(int16_t sectnum) disptext[dispwidth] = 0; - showsectordata(sectnum); + showsectordata(sectnum, 0); begindrawing(); while (keystatus[KEYSC_ESC] == 0) @@ -10096,7 +10109,7 @@ static void EditWallData(int16_t wallnum) disptext[dispwidth] = 0; - showwalldata(wallnum); + showwalldata(wallnum, 0); begindrawing(); while (keystatus[KEYSC_ESC] == 0) { @@ -10201,7 +10214,7 @@ static void EditWallData(int16_t wallnum) if (editval) { editval = 0; - //showwalldata(wallnum); + //showwalldata(wallnum, 0); //// printmessage16(""); } //enddrawing(); @@ -10227,7 +10240,7 @@ static void EditSpriteData(int16_t spritenum) disptext[dispwidth] = 0; // clearmidstatbar16(); - showspritedata(spritenum); + showspritedata(spritenum, 0); while (keystatus[KEYSC_ESC] == 0) { @@ -10633,7 +10646,7 @@ static void GenericSpriteSearch() for (k=0; k<80; k++) disptext[k] = 0; // disptext[dispwidth[col]] = 0; - // showspritedata(spritenum); + // showspritedata(spritenum, 0); wallsprite = 2; while (keystatus[KEYSC_ESC] == 0) diff --git a/polymer/eduke32/source/enet/Makefile b/polymer/eduke32/source/enet/Makefile index 5c2892380..1d103e30b 100644 --- a/polymer/eduke32/source/enet/Makefile +++ b/polymer/eduke32/source/enet/Makefile @@ -11,10 +11,10 @@ INC=include include ../../$(EROOT)/Makefile.shared ifneq (0,$(RELEASE)) - # Debugging disabled + # Debugging disabled debug=-fomit-frame-pointer -funswitch-loops -O$(OPTLEVEL) else - # Debugging enabled + # Debugging enabled debug=-ggdb -O0 -DDEBUGGINGAIDS endif @@ -23,8 +23,8 @@ ifneq (0,$(DEBUGANYWAY)) endif CFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \ - -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \ - -fjump-tables -fno-stack-protector + -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \ + $(F_JUMP_TABLES) $(F_NO_STACK_PROTECTOR) CPPFLAGS=-I$(INC) -I$(SRC) @@ -53,7 +53,7 @@ $(OBJECTS): $(OBJ)/%.o: $(SRC)/%.c $(INC)/enet/*.h -mkdir -p $(OBJ) $(COMPILE_STATUS) if $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi - + ifeq ($(PRETTY_OUTPUT),1) .SILENT: endif diff --git a/polymer/eduke32/source/jaudiolib/Makefile b/polymer/eduke32/source/jaudiolib/Makefile index 5a6aa9103..085cc6d7b 100644 --- a/polymer/eduke32/source/jaudiolib/Makefile +++ b/polymer/eduke32/source/jaudiolib/Makefile @@ -7,13 +7,15 @@ RELEASE?=1 OPTLEVEL?=2 SRC=src +DXROOT ?= c:/sdks/directx/dx8 + include ../../$(EROOT)/Makefile.shared ifneq (0,$(RELEASE)) - # Debugging disabled + # Debugging disabled debug=-fomit-frame-pointer -funswitch-loops -O$(OPTLEVEL) else - # Debugging enabled + # Debugging enabled debug=-ggdb -O0 -DDEBUGGINGAIDS endif @@ -22,8 +24,8 @@ ifneq (0,$(DEBUGANYWAY)) endif CFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \ - -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \ - -fjump-tables -fno-stack-protector + -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \ + $(F_JUMP_TABLES) $(F_NO_STACK_PROTECTOR) CPPFLAGS=-Iinclude -Isrc -DHAVE_VORBIS @@ -37,7 +39,7 @@ OBJECTS=$(OBJ)/drivers.o \ $(OBJ)/driver_nosound.o ifeq ($(PLATFORM),WINDOWS) - CPPFLAGS+= -Ithird-party/mingw32/include + CPPFLAGS+= -I$(DXROOT)/include -Ithird-party/mingw32/include OBJECTS+= $(OBJ)/driver_directsound.o OBJNAME=libjfaudiolib_win32.a OBJ=obj_win @@ -55,7 +57,7 @@ $(OBJECTS): $(OBJ)/%.o: $(SRC)/%.c -mkdir -p $(OBJ) $(COMPILE_STATUS) if $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi - + ifeq ($(PRETTY_OUTPUT),1) .SILENT: endif diff --git a/polymer/eduke32/source/m32def.c b/polymer/eduke32/source/m32def.c index ccd8d2f1e..06e51fa05 100644 --- a/polymer/eduke32/source/m32def.c +++ b/polymer/eduke32/source/m32def.c @@ -246,6 +246,8 @@ const char *keyw[] = "ldist", "getangle", "getincangle", + "a2xy", + "ah2xyz", "sort", "for", // * @@ -1720,18 +1722,17 @@ static int32_t C_ParseCommand(void) return 1; } + + cs.currentStateOfs = (g_scriptPtr-script); + j = hash_find(&h_states, tlabel); if (j>=0) // only redefining { cs.currentStateIdx = j; - cs.currentStateOfs = (g_scriptPtr-script); - - Bsprintf(g_szCurrentBlockName, "%s", statesinfo[j].name); } else // new state definition { cs.currentStateIdx = j = g_stateCount; - cs.currentStateOfs = (g_scriptPtr-script); if (g_stateCount >= statesinfo_allocsize) { @@ -1745,12 +1746,13 @@ static int32_t C_ParseCommand(void) } } - Bmemcpy(statesinfo[j].name, tlabel, MAXLABELLEN); - statesinfo[j].numlocals = 0; - Bsprintf(g_szCurrentBlockName, "%s", tlabel); + Bstrcpy(statesinfo[j].name, tlabel); hash_add(&h_states, tlabel, j, 0); } + statesinfo[j].numlocals = 0; + Bsprintf(g_szCurrentBlockName, "%s", statesinfo[j].name); + return 0; } @@ -1953,6 +1955,7 @@ static int32_t C_ParseCommand(void) aEventNumLocals[j] = 0; cs.parsingEventOfs = g_scriptPtr-script; //Bsprintf(g_szBuf,"Adding Event for %d at %lX",j, g_parsingEventPtr); AddLog(g_szBuf); + if (j<0 || j >= MAXEVENTS) { initprintf("%s:%d: error: invalid event ID.\n",g_szScriptFileName,g_lineNumber); @@ -2523,6 +2526,8 @@ repeatcase: uint16_t *numlocals = (cs.currentStateIdx >= 0) ? &statesinfo[cs.currentStateIdx].numlocals : &aEventNumLocals[cs.currentEvent]; +//OSD_Printf("s%d,e%d: array `%s', numlocals of `%s' is %d.\n", cs.currentStateIdx, cs.currentEvent, +// tlabel, g_szCurrentBlockName, (int32_t)*numlocals); if (((int32_t)(*numlocals))+asize > M32_MAX_LOCALS) C_CUSTOMERROR("too much local storage required (max: %d gamevar equivalents).", M32_MAX_LOCALS); else @@ -2810,6 +2815,16 @@ repeatcase: C_GetManyVars(2); return 0; + case CON_A2XY: + C_GetNextVar(); + C_GetManyVarsType(GV_WRITABLE, 2); + return 0; + + case CON_AH2XYZ: + C_GetManyVars(2); + C_GetManyVarsType(GV_WRITABLE, 3); + return 0; + case CON_FOR: // special-purpose iteration { ofstype offset; diff --git a/polymer/eduke32/source/m32def.h b/polymer/eduke32/source/m32def.h index 4a0ae3b3b..ab56bc196 100644 --- a/polymer/eduke32/source/m32def.h +++ b/polymer/eduke32/source/m32def.h @@ -332,6 +332,8 @@ enum ScriptKeywords_t CON_LDIST, CON_GETANGLE, CON_GETINCANGLE, + CON_A2XY, + CON_AH2XYZ, CON_SORT, CON_FOR, diff --git a/polymer/eduke32/source/m32exec.c b/polymer/eduke32/source/m32exec.c index 4cd0b8712..b7385fa7b 100644 --- a/polymer/eduke32/source/m32exec.c +++ b/polymer/eduke32/source/m32exec.c @@ -248,6 +248,7 @@ static int32_t X_DoSort(const int32_t *lv, const int32_t *rv) return g_iReturnVar; } +// in interactive execution, allow the current sprite index to be the aimed-at sprite (in 3d mode) #define X_ERROR_INVALIDCI() \ if ((vm.g_i < 0 || vm.g_i>=MAXSPRITES) && \ (vm.g_st!=0 || searchstat!=3 || (vm.g_i=searchwall, vm.g_sp=&sprite[vm.g_i], 0))) \ @@ -973,6 +974,40 @@ skip_check: continue; } + case CON_A2XY: + case CON_AH2XYZ: + insptr++; + { + int32_t ang=Gv_GetVarX(*insptr++), horiz=(tw==CON_A2XY)?100:Gv_GetVarX(*insptr++); + int32_t xvar=*insptr++, yvar=*insptr++; + + int32_t x = sintable[(ang+512)&2047]; + int32_t y = sintable[ang&2047]; + + if (tw==CON_AH2XYZ) + { + int32_t zvar=*insptr++, z=0; + + horiz -= 100; + if (horiz) + { + int32_t veclen = ksqrt(200*200 + horiz*horiz); + int32_t dacos = divscale14(200, veclen); + + x = mulscale14(x, dacos); + y = mulscale14(y, dacos); + z = divscale14(horiz, veclen); + } + + Gv_SetVarX(zvar, z); + } + + Gv_SetVarX(xvar, x); + Gv_SetVarX(yvar, y); + + continue; + } + case CON_MULSCALE: insptr++; { @@ -2736,11 +2771,12 @@ dodefault: } continue; + // ifaimingsprite and -wall also work in 2d mode, but you must "and" with 16383 yourself case CON_IFAIMINGSPRITE: - VM_DoConditional(AIMING_AT_SPRITE); + VM_DoConditional(AIMING_AT_SPRITE || pointhighlight>=16384); continue; case CON_IFAIMINGWALL: - VM_DoConditional(AIMING_AT_WALL_OR_MASK); + VM_DoConditional(AIMING_AT_WALL_OR_MASK || linehighlight>=0); continue; case CON_IFAIMINGSECTOR: VM_DoConditional(AIMING_AT_CEILING_OR_FLOOR); diff --git a/polymer/eduke32/source/mapster32.h b/polymer/eduke32/source/mapster32.h index 0fc450404..e1d6a3a13 100644 --- a/polymer/eduke32/source/mapster32.h +++ b/polymer/eduke32/source/mapster32.h @@ -143,9 +143,6 @@ extern intptr_t frameplace; static int32_t acurpalette=0; -extern void showsectordata(int16_t sectnum); -extern void showwalldata(int16_t wallnum); -extern void showspritedata(int16_t spritenum); extern int32_t checksectorpointer(int16_t i, int16_t sectnum); extern double msens; diff --git a/polymer/eduke32/source/sounds_mapster32.c b/polymer/eduke32/source/sounds_mapster32.c index 1f196ec2d..86fe19c57 100644 --- a/polymer/eduke32/source/sounds_mapster32.c +++ b/polymer/eduke32/source/sounds_mapster32.c @@ -51,6 +51,7 @@ static char SM32_havesound = 0; char SoundToggle = 1; int32_t NumVoices = 32; +int32_t MixRate = 44100; int32_t backflag,g_numEnvSoundsPlaying; @@ -75,12 +76,8 @@ int32_t S_SoundStartup(void) void *initdata = 0; // TODO: read config - int32_t FXVolume=220, /*NumVoices=32,*/ NumChannels=2, NumBits=16, MixRate, ReverseStereo=0; -#if defined(_WIN32) - MixRate = 44100; -#else - MixRate = 44100; -#endif + int32_t FXVolume=220, /*NumVoices=32,*/ NumChannels=2, NumBits=16, ReverseStereo=0; + fxdevicetype = ASS_AutoDetect; #ifdef WIN32