Commit Graph

1575 Commits

Author SHA1 Message Date
helixhorned a04e15082b EDuke32: Various menu tweaks and one fix.
- make PGUP/PGDN and HOME/END behave as expected across all menus
- in keyboard/mouse button mapping menu, draw function names that have been given
  custom names via CON with pal 8 for easier recognition
- fix tinting of function names in mouse button mapping menu

git-svn-id: https://svn.eduke32.com/eduke32@2313 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 14:30:54 +00:00
helixhorned 00b852fe37 EDuke32: When in menus, always draw a black (33%) translucent background.
Internally, there's a new function fade_screen_black() that implements the
fading more efficiently than calling rotatesprite for classic, and uses
tile 0 (assumed to have at least 64x32 size) in the GL modes.

The black background of the user map selector is still done with rotatesprite
and tile BLANK in every renderer.

git-svn-id: https://svn.eduke32.com/eduke32@2312 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 14:30:39 +00:00
helixhorned 7b09accdce Check 'bpp' parameter to vidmode OSD command in EDuke32.
So that the game won't exit if you write 'vidmode 4' when intending
'setrendermode 4'.

git-svn-id: https://svn.eduke32.com/eduke32@2311 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 14:30:17 +00:00
helixhorned e59e7f0f3c Lunatic: fix interface when compiled with 'pointered' main arrays. Argh!
git-svn-id: https://svn.eduke32.com/eduke32@2310 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 14:29:59 +00:00
helixhorned 6ca24a0543 Fix not-initialized variable warning in 'soundanims' CON token parser.
git-svn-id: https://svn.eduke32.com/eduke32@2309 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 14:29:41 +00:00
helixhorned 99e08bf441 legibility improvements: rotatesprite(..., 0,0,xdim-1,ydim-1) -> rotatesprite_fs
git-svn-id: https://svn.eduke32.com/eduke32@2308 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-02 17:35:05 +00:00
helixhorned 55699e1240 Fix an update issue with the recent screen tint retaining on palette change.
git-svn-id: https://svn.eduke32.com/eduke32@2307 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-02 17:34:30 +00:00
helixhorned 15c7460059 When loading a map and in a few other places, reset screen tinting.
git-svn-id: https://svn.eduke32.com/eduke32@2306 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-02 17:34:16 +00:00
helixhorned 39509680b6 Fix demo progress bar in OpenGL modes by adding bit 1024 to rotatesprite calls.
The problems still remains that rotatesprite behaves differently in classic and
OpenGL modes with clipping boundaries specified (and maybe in some other cases)

git-svn-id: https://svn.eduke32.com/eduke32@2304 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-30 21:19:13 +00:00
helixhorned 04e19dd942 Don't wait for pain tinting to subside when changing a base palette.
This means that when e.g. emerging from water hurt will change the
palette instantly, but because bit 16 is added to the P_SetGamePalette
call, the tinting is retained.

git-svn-id: https://svn.eduke32.com/eduke32@2303 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-30 21:18:59 +00:00
helixhorned e0163fcbcd Make savegames between dynamicremap-enabled and -disabled builds compatible.
Of course, only when the mod/TC in question doesn't use that feature.

git-svn-id: https://svn.eduke32.com/eduke32@2301 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-29 21:46:44 +00:00
terminx 5bc595ab89 Dynamic tile remapping shouldn't actually be disabled in synthesis builds, whether the source allows it to be compi
led out or not. Removing features that certain mods may depend on to operate correctly without throwing any kind of
 error or warning at startup other than a logged message is bad.


git-svn-id: https://svn.eduke32.com/eduke32@2300 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 15:16:14 +00:00
helixhorned 75538bc8e1 add one line forgotten with dynamictileremap disabling
git-svn-id: https://svn.eduke32.com/eduke32@2299 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 14:38:54 +00:00
helixhorned d3c67a8192 Lunatic: sectorsofbunch iterator, error(..., 2), temp 'ud' access
git-svn-id: https://svn.eduke32.com/eduke32@2298 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 14:38:41 +00:00
helixhorned 283e8d053f Conditionally compile out the dynamic-to-static tile remapping feature.
git-svn-id: https://svn.eduke32.com/eduke32@2297 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 14:38:23 +00:00
helixhorned 99f1fcb6c2 Move inithashnames() and freehashnames() declarations into namesdyn.h.
git-svn-id: https://svn.eduke32.com/eduke32@2296 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 14:37:56 +00:00
helixhorned d2ffed7b6b Fix and clean up dynamic-to-static tile remapping source.
git-svn-id: https://svn.eduke32.com/eduke32@2295 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 14:37:39 +00:00
helixhorned 289476e7bd Lunatic: prohibit initial assigns creating new globals, add some must-fail tests
git-svn-id: https://svn.eduke32.com/eduke32@2294 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 14:37:24 +00:00
helixhorned 3a0734a7b0 Lunatic: fix for running with static main engine arrays.
git-svn-id: https://svn.eduke32.com/eduke32@2291 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 14:36:34 +00:00
helixhorned 48ec616480 Remove a couple of nested externs and #include some headers directly
... instead of relying on indirect inclusion via duke3d.h.

git-svn-id: https://svn.eduke32.com/eduke32@2290 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-27 15:03:55 +00:00
helixhorned d6530a862f Route the 5th mouse button to the game; bump savegame version.
The "double-click button4" had to make way for MOUSE5 in the button binds menu,
but I don't think anyone cares.  Savegame compatibility was actually silently
broken with the MAXTILES update earlier, but I forgot updating the version...

git-svn-id: https://svn.eduke32.com/eduke32@2284 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:58:55 +00:00
helixhorned da218f7e65 small correction of a memory-clearing line in namesdyn.c
git-svn-id: https://svn.eduke32.com/eduke32@2283 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:58:39 +00:00
helixhorned 5f12ab7f53 Fix sprite[-1] access when aborting playing a sound in Mapster's Sound Index.
Also a couple of other cleanup lines... might need more though, I'm not sure
it's all good there.

git-svn-id: https://svn.eduke32.com/eduke32@2278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-23 19:13:00 +00:00
helixhorned 7a4c9253c5 astub.c: remove some tabs in the code
git-svn-id: https://svn.eduke32.com/eduke32@2275 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 22:11:55 +00:00
helixhorned d0acd40ff8 Inreased debugging level for catching oob accesses to 'main' arrays.
If enabled, this makes the following arrays be allocated statically:
spriteext, spritesmooth, sector, wall, sprite, tsprite, while
necessarily disabling the clipshape feature (because it relies on
setting sector/wall to different malloc'd block temporarily).

To compile, pass DEBUGANYWAY=1 in addition to RELEASE=0 to 'make',
and it's really only useful with CC=clang, of course.

git-svn-id: https://svn.eduke32.com/eduke32@2270 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 23:17:34 +00:00
helixhorned ba25d9a678 Fix a problem in G_DrawRooms where an sectnum updated to -1 may be used as index.
git-svn-id: https://svn.eduke32.com/eduke32@2269 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 23:17:03 +00:00
helixhorned ca2d612976 Fix oob accesses when e.g. shooting tile -1. (can propagate via WEAPONx_SHOOTS)
Ideally, we would also warn when setting WEAPONx_SHOOTS to negative values, but
we'd have to intercept CON's setvar's and it wouldn't be pretty.

git-svn-id: https://svn.eduke32.com/eduke32@2268 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:58:23 +00:00
helixhorned cd89fce9aa less trivial stuff
- fix one bound-checking line
- rewrite two lines in astub.c to potentially not overflow an int16
- make tiletovox[] an array of int16's

git-svn-id: https://svn.eduke32.com/eduke32@2266 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:57:46 +00:00
helixhorned 2e1e2345af trivial tweaks: make stuff static, remove unused stuff, formatting...
git-svn-id: https://svn.eduke32.com/eduke32@2265 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:57:22 +00:00
helixhorned ebb3d0a378 gamedef.c: make some variables static and remove some #if 0'ed code.
git-svn-id: https://svn.eduke32.com/eduke32@2262 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:40:16 +00:00
helixhorned 260bbc1f92 cleanup:
- 'whitecol' was defined in the engine and in build.c, use only the engine one
 - make cachesize, artsize, artversion static in engine.c
 - undo some formatting havoc presumably done by astyle

git-svn-id: https://svn.eduke32.com/eduke32@2260 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:39:38 +00:00
helixhorned 6aec1d1f26 Add a hack to the animsounds DEF token parsing to not wrongly emit an error.
git-svn-id: https://svn.eduke32.com/eduke32@2258 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:38:54 +00:00
helixhorned e30ed58aa0 Fix parallaxed sector display in Mapster32 on Polymer.
git-svn-id: https://svn.eduke32.com/eduke32@2257 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-14 14:48:45 +00:00
helixhorned 7a5a19a874 Fix actor[].dispicnum becoming negative.
Since the original source code release of Duke3D, there was a potentially
dangerous hack where actor[].dispicnum was set to -4 to signal "this actor
should not have a floor shadow for this moment" (it doesn't really work,
if you ask me).
Now, use another bit of actor[].flags for that purpose because setting
any picnum members to negative values asks for trouble.

git-svn-id: https://svn.eduke32.com/eduke32@2249 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:48:00 +00:00
helixhorned e3150b2801 a couple more trivial tweaks
git-svn-id: https://svn.eduke32.com/eduke32@2247 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:45:34 +00:00
helixhorned d83ff63607 sounds.c: check the sound number before accessing arrays with it; always do
this in "(unsigned)i < bound" fashion.

git-svn-id: https://svn.eduke32.com/eduke32@2245 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:44:49 +00:00
helixhorned 3095b09773 trivial formatting / removing of old cruft / adding comments
git-svn-id: https://svn.eduke32.com/eduke32@2244 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:44:35 +00:00
helixhorned a0d27ee702 animvpx sound: fix the 'may have many sounds per frame' requirement
E.g. this should work correctly now:
// FLY_BY, PIPEBOMB_EXPLODE, OCTA_DYING
animsounds logo { 1 244  64 14  64 144 }

git-svn-id: https://svn.eduke32.com/eduke32@2243 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:44:09 +00:00
helixhorned 6a37636bb0 Possibility of specifying sounds for a VPX anim-replacement via DEF.
The syntax is as follows:
  animsounds <anim> { frame1 sound1  frame2 sound2 ... }

<anim> has to be one of the tokens: cineov2, cineov3, RADLOGO, DUKETEAM,
logo, vol41a, vol42a, vol4e1, vol43a, vol4e2, or vol4e3, corresponding
to hard-coded Duke3D anims.

The frameN's (1-based frame numbers) have to be in ascending order (but not
necessarily strictly ascending, so that a frame may have more than one sound).

Example: for Duke3D's XBLA nuke logo animation (IVF extracted from nuke.webm),
the following definition overlays the video with a sound sequence similar
(identical save for timing) to the original nuke animation:

// frame 1: FLY_BY, frame 64: PIPEBOMB_EXPLODE
animsounds logo { 1 244  64 14 }

git-svn-id: https://svn.eduke32.com/eduke32@2242 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:43:54 +00:00
helixhorned f826ffb4d0 In VPX 3 planed --> packed conversion code, pull constant expressions out of
the loop.  For the release build and the test animation, this lowers the time
to 3-4 ms per conversion of one frame on my desktop machine.

git-svn-id: https://svn.eduke32.com/eduke32@2241 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:43:33 +00:00
helixhorned b926e2a496 - When saving game, clear all polymer lights before. Not doing this makes
the SE ones douple, triple, ... after each save.  Maphack lights are reloaded
with polymer_resetlights() (though I've had them disappearing after load, I
couldn't reproduce it afterwards).
- in debugging builds, print a message when polymer_resetlight is called on a
nonexistent one.  The problem is not so much the call itself (it's guarded),
but the fact that resources on the caller side may not have been freed if it
thinks that those lights do in fact exist. Right now, it's not the case though.
- add 'loaded map hack' messages after some other successful loadmaphack calls

git-svn-id: https://svn.eduke32.com/eduke32@2236 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-05 21:58:23 +00:00
helixhorned 146e1f1c09 When loading a game, DON'T restore 'adult' TV tiles. This fixes the recent
crashes.

Usually, after loading a game, some wall tiles are tweaked depending on whether
adult mode is enabled or not.  If it's not, those wall picnums are replaced
with blank or broken screens.  If it is, they are restored from the wall's
.extra member.  Apparently though, Mapster32 leaves some .extra members
floating around even after deleting a TROR nextwall link (it's used as the
'lower wall index').  Because MAXWALLS is greater than MAXTILES, this may
produce out-of-bounds accesses and corrupt memory (besides setting wall
tilenums to nonsensical values) later in the game.

Other than that, the change only affects loading savegames created with adult
mode OFF. Kinky TV screenies simply won't be restored then.

git-svn-id: https://svn.eduke32.com/eduke32@2235 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-05 20:48:37 +00:00
helixhorned b5f2955895 savegame.c: some const void **ptr -> void **ptr, since they're certainly not const
git-svn-id: https://svn.eduke32.com/eduke32@2234 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-05 20:48:20 +00:00
helixhorned 74b823d6dc trivial tweaks: some NULLing pointer after freeing them; move the 'too much mirrors'
check one 'if' down since mirrors are only created when the condition holds

git-svn-id: https://svn.eduke32.com/eduke32@2233 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-05 20:48:05 +00:00
helixhorned bb17cff9b7 Pass bit 16 to P_SetGamePalette from CON's setgamepalette (forgotten from earlier commit)
git-svn-id: https://svn.eduke32.com/eduke32@2232 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-03 19:56:10 +00:00
helixhorned f87c0db3ce In G_NewGame(), call Gv_RefreshPointers after Gv_ResetVars.
Resetting the gamevars might produce inconsistencies between an earlier loaded
game (for example, if it was saved with different/earlier CON code), and worst
of all, the gamevars that reference C variables might be overwritten (i.e. the
addresses to those variable, which is very bad!).

git-svn-id: https://svn.eduke32.com/eduke32@2230 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-03 19:55:38 +00:00
hendricks266 13c399f612 - Format CON crash output in VM_ScriptInfo() much more nicely.
- Execute VM_ScriptInfo() when DNDEBUG is used.

git-svn-id: https://svn.eduke32.com/eduke32@2229 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-01 04:14:06 +00:00
helixhorned afbffe5c4a CON: make the 'palette' player member actually return the player's palette ID
instead of -1. Setting is still only through 'setgamepalette'.

git-svn-id: https://svn.eduke32.com/eduke32@2226 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-29 14:26:30 +00:00
helixhorned 65deeda53a The earlier changes introduced bugs when palettes were not set correctly in
certain situations (mostly cutscenes etc). This commit removes bit 1 from all
flags that make it to setbrightness, the meaning of which is "don't actually
update the palette". I have no idea what it was for and since the corresponding
P_SetGamePalette() calls were from places like the mentioned cutscenes, I don't
think it matters performance-wise.

git-svn-id: https://svn.eduke32.com/eduke32@2223 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:35:23 +00:00
helixhorned d1d94e083f savegame.c: fix compilation warnings with release build, add timing for debug
git-svn-id: https://svn.eduke32.com/eduke32@2218 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:33:54 +00:00