Commit Graph

2447 Commits

Author SHA1 Message Date
helixhorned b4f63547c4 Fix non-asm build, I forgot a line with the preceding change.
git-svn-id: https://svn.eduke32.com/eduke32@2355 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 17:55:59 +00:00
helixhorned c965d9d70a engine.c: more formatting, removing of textually duplicate code.
git-svn-id: https://svn.eduke32.com/eduke32@2354 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 17:55:43 +00:00
helixhorned 72cc7cebec engine.c: formatting changes
The bulk are whitespace changes; the only exception is a
"if (expr) { stmt; }" --> "if (expr) stmt;"

git-svn-id: https://svn.eduke32.com/eduke32@2353 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 17:55:27 +00:00
helixhorned a534cb19bd osxbuild.sh: detect whether we're keeping the source in SVN or git.
git-svn-id: https://svn.eduke32.com/eduke32@2352 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 20:29:51 +00:00
helixhorned 63b868cdde Update samples/trueror1.map with some tests of sprites lying on TROR floors.
Also, there's a "ladder" that passes through a TROR portal, and the mirror
in that map has been fixed for the classic renderer.

git-svn-id: https://svn.eduke32.com/eduke32@2351 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:25:56 +00:00
helixhorned 0ef1721955 Mapster32: Fix extended ceiling/floor picnums taking on picnum 0 in Polymer.
The reason was that drawmasks(), which was where the resetting of the fake
RoR textures happened under Polymer, can be called from polymer_displayrooms()
when mirrors are present. I was assuming that drawmasks() was only ever called
after the 'main' drawrooms and that hence the sequence of fake RoR tile tweaking
was set, reset, set, reset, ... which it was not.
Now, do the resetting explicitly after every drawmasks() in the editor.

git-svn-id: https://svn.eduke32.com/eduke32@2350 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:25:42 +00:00
helixhorned 30e16fe7bb When loading a map in-game, clear TROR wall members corresponding to up/down links.
I find this cleaner for two reasons.  First, lotags won't get in the way of
neartag(), so that doors and switches near constrained TROR walls can be
pushed.  Second, this removes the information leak so that CON coders aren't
tempted to read that values directly before a proper API for that comes along.
When writing out a map in-game (e.g. with dndebug), restore the respective
members so that it can be loaded in the editor again.

git-svn-id: https://svn.eduke32.com/eduke32@2349 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:25:18 +00:00
helixhorned 0538c70242 engine.c: Rewrite tslopevlin (translucent slope vline texmapping) for clarity.
git-svn-id: https://svn.eduke32.com/eduke32@2348 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:24:59 +00:00
helixhorned c900e4ef87 Fix player being not blocked by sprites lying on an extended floor.
getzrange() returns the floor rather than the sprite if their heights are
equal.  Now, make an exception for extended floors (analogously, ceilings).

git-svn-id: https://svn.eduke32.com/eduke32@2347 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:24:44 +00:00
helixhorned ebbf4d79ce Clean up VOC in-memory block type parsing.
- Maintain a position relative to the start of the data. VOC doesn't
  mandate an EOF marker (blocktype 0). If we go over the end, fake
  that marker, so as to restart a looping sound or stop a one-shot one.
  This fixes an uninitialized mem access with the corrupt SNAKRM.VOC.
- When encountering the EOF marker, don't read the 3 bytes of block size,
  since they may not be there.
- Read blocksize by ORing and shifting the 3 bytes, not with *(int32_t *)...

git-svn-id: https://svn.eduke32.com/eduke32@2346 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:24:28 +00:00
helixhorned 17ba2664f9 Mapster32: don't use lazy tile loading with r_hightile=0.
git-svn-id: https://svn.eduke32.com/eduke32@2345 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:24:09 +00:00
helixhorned b04e743236 Fix use of an uninitialized variable in P_FindWall->FindDistance2D with noclip.
git-svn-id: https://svn.eduke32.com/eduke32@2344 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-14 23:14:07 +00:00
helixhorned 967a3ec697 engine.c: replace 0xXXXXXXXX literals with INT32_MIN/MAX; whitespace changes.
git-svn-id: https://svn.eduke32.com/eduke32@2343 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-14 23:13:53 +00:00
helixhorned 53d9264f92 Fix a couple of out-of-bounds accesses when roaming around with noclip.
- guard cansee() against negative sectnums (return 0 immediately), since
  it's often called with the player sectnum as one argument
- in resetpspritevars(), don't inset APLAYER sprite if sectnum < 0, which
  can happen if a map is started in void space accidentally (e.g. from
  the editor)
- two checks before accessing sector[] with a player sectnum

git-svn-id: https://svn.eduke32.com/eduke32@2342 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-14 23:13:38 +00:00
helixhorned 5f506ec0f6 Fix sprite rendering glitches with r_usenewaspect=1 in 8-bit mode.
git-svn-id: https://svn.eduke32.com/eduke32@2341 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-14 23:13:16 +00:00
helixhorned 1e2125ce29 Make 5th mouse button functional in Windows.
git-svn-id: https://svn.eduke32.com/eduke32@2340 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-13 21:38:16 +00:00
helixhorned f89d73504d Draw HANDHOLDINGLASER and ~ACCESS with guniqhud=200 and 201, respectively.
This fixes updateanimation picking up foreign (and thus potentially oob)
frame numbers at "3: c > n".

git-svn-id: https://svn.eduke32.com/eduke32@2339 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-13 21:38:00 +00:00
helixhorned 747cb925db Remix mdsprite.c's updateanimation() to look prettier and clearer.
Specifically,
 - rearrange conditionals
 - factor out constant expressions
 - add a couple of debugging printfs for extraordinary events (oob frames)
 - add VERIFY comments for implicit assertions I'd like to verify sometime

Also, one calloc -> malloc.

git-svn-id: https://svn.eduke32.com/eduke32@2338 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-13 21:37:46 +00:00
helixhorned 5f23cb6bcd Debugging helper disabling a.nasm calls with OpenGL renderers.
Uncomment #define DEBUG_VALGRIND_NO_SMC in duke3d.h to be able to
 valgrind --smc-check=none (or the default stack-only)
with Polymost and Polymer renderers.

git-svn-id: https://svn.eduke32.com/eduke32@2337 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-12 13:47:33 +00:00
helixhorned 8ab0fbf7f4 Patch up out-of-bounds access (r/w) when mixing 16-bit stereo *source* data.
... by allocating two bytes more for the mixing buffers.

git-svn-id: https://svn.eduke32.com/eduke32@2336 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-12 13:47:15 +00:00
helixhorned 0843ef2e93 Fix uninitialized mem access in dorotatesprite with thin tiles (e.g. 3085).
git-svn-id: https://svn.eduke32.com/eduke32@2335 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-12 13:46:57 +00:00
helixhorned 09addc955c jmact/control.c: rewrite strange looking loop.
git-svn-id: https://svn.eduke32.com/eduke32@2334 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-11 11:52:33 +00:00
helixhorned f872d556d8 Draw translucent black background only when playing (back a demo or oneself).
git-svn-id: https://svn.eduke32.com/eduke32@2333 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-11 11:52:19 +00:00
helixhorned ca30952b21 Fix menu text not drawing when not playing (back), introduced in r2326.
git-svn-id: https://svn.eduke32.com/eduke32@2332 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-11 11:51:48 +00:00
helixhorned f5ed4014df Fix zero-size calloc when enumerating a joystick with no hats in SDL.
git-svn-id: https://svn.eduke32.com/eduke32@2331 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-11 11:51:34 +00:00
helixhorned 15532fa96a Remove a couple of redundant declarations.
git-svn-id: https://svn.eduke32.com/eduke32@2330 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:45:38 +00:00
helixhorned ebd7fc402b Lunatic: interface to events.
git-svn-id: https://svn.eduke32.com/eduke32@2329 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:45:18 +00:00
helixhorned 4a00423c89 Add some #includes to gameexec.h and sector.h so that they can be included directly
git-svn-id: https://svn.eduke32.com/eduke32@2328 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:44:45 +00:00
helixhorned aee01a4958 Use a tokenlist for the event names and add tokenlist typedef to gamedef.h.
git-svn-id: https://svn.eduke32.com/eduke32@2327 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:44:26 +00:00
helixhorned 1ada6d0529 Make r_maxfps functional in demo playback.
git-svn-id: https://svn.eduke32.com/eduke32@2326 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:44:09 +00:00
helixhorned 968a999356 Coalescle codes for dnkroz and dncgs cheats.
git-svn-id: https://svn.eduke32.com/eduke32@2325 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:43:55 +00:00
helixhorned 3f2c54d9e8 Factor out identical (except for params) pieces of code of G_CheatGetInv().
git-svn-id: https://svn.eduke32.com/eduke32@2324 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:43:40 +00:00
helixhorned dbada3c947 Fix zero-size calloc when enumerating a joystick with no hats in Windows.
git-svn-id: https://svn.eduke32.com/eduke32@2323 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:43:21 +00:00
helixhorned 75436815c3 Revert r2303 functionality ("Don't wait for pain tinting to subside...")
It was causing update issues when many tints were applied simultaneously,
like being shot and spit at by enforcers while being on rails barefeet.
Also, the GL modes were calling gltexinvalidate8() when picking up goodies
or being hurt with that change, so it needs much more thought.

git-svn-id: https://svn.eduke32.com/eduke32@2322 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:43:06 +00:00
helixhorned 34000a9ed0 Factor out two pieces of identical code in actors.c into A_HandleBeingSpitOn().
This fixes a bug in passing: 'int32_t j' was assigned to as a temporary inside
one instance of the code, but used as if it were the previous sprite index
further on.  Would only happen with projectiles that "work like" both SPIT
and RPG_IMPACT.

git-svn-id: https://svn.eduke32.com/eduke32@2321 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:42:51 +00:00
helixhorned 5846d73d30 Probably fix crash when reaching light count limit in G_MoveEffectors SE50 code.
git-svn-id: https://svn.eduke32.com/eduke32@2320 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-08 11:01:03 +00:00
helixhorned 997375bd20 Lunatic: use enum constants
git-svn-id: https://svn.eduke32.com/eduke32@2319 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-08 11:00:48 +00:00
helixhorned 103ee7a40b rotatesprite(..., windowx1,windowy1,windowx2,windowy2) --> rotatesprite_win
git-svn-id: https://svn.eduke32.com/eduke32@2318 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 21:35:00 +00:00
helixhorned 43c5fc2f34 Lunatic: a bit rearrangement, getbunch.
git-svn-id: https://svn.eduke32.com/eduke32@2317 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 21:34:39 +00:00
helixhorned 00b4dadd98 game.c: trivial tweaks to reduce code duplication (which is hard on the eyes)
git-svn-id: https://svn.eduke32.com/eduke32@2316 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 21:34:22 +00:00
helixhorned b8c2d13f23 Mapster32: fix crash with 'vidmode <bpp>' introduced in r2311.
git-svn-id: https://svn.eduke32.com/eduke32@2315 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 21:34:08 +00:00
helixhorned 1d0cb07167 Factor out four instances of identical code into M32_DrawRoomsAndMasks().
git-svn-id: https://svn.eduke32.com/eduke32@2314 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 21:33:52 +00:00
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 20741efd3b Fix a sector[-1] access when starting to draw a wall in an empty map.
git-svn-id: https://svn.eduke32.com/eduke32@2305 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-01 21:51:26 +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 021126045f Mapster32: tweak dragging a single sprite so that they can be dragged 'uphill'.
The implementation uses the recently introduced updatesector_onlynextwall when
setspritez fails.

git-svn-id: https://svn.eduke32.com/eduke32@2302 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-30 18:25:13 +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 a32872276d kplib.c without asm: I see an uninitialized access here, valgrind does not?
git-svn-id: https://svn.eduke32.com/eduke32@2293 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 14:37:08 +00:00
helixhorned 0f36ef92ee A couple of Makefile tweaks for clang 3.1 from SVN, and a workaround
for an assertion failure with clang. Really ought to file a bug report instead.

git-svn-id: https://svn.eduke32.com/eduke32@2292 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 14:36:52 +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 95e5d1e29d In Mapster32, register the 'vidmode' OSD command in non-GL builds.
git-svn-id: https://svn.eduke32.com/eduke32@2289 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-27 15:03:34 +00:00
helixhorned 2c2adee5e9 Two tweaks for USE_OPENGL=0 builds.
- Always parse 'animsounds' defs
- don't print "ignored frame/animation definition" warnings

git-svn-id: https://svn.eduke32.com/eduke32@2288 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-27 15:03:18 +00:00
helixhorned de2cbbfb47 Fix USE_OPENGL=0 build; squelch one warning.
git-svn-id: https://svn.eduke32.com/eduke32@2287 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-27 15:03:02 +00:00
helixhorned a6158ac3f6 Fix building with GCC 4.6 link-time optimization.
It looks like GCC doesn't honor the 'used' attribute with LTO. This is
"fixed" by declaring the variables in question with external linkage
(i.e. removing the 'static').  I consider such behavior a GCC bug, though.

git-svn-id: https://svn.eduke32.com/eduke32@2286 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-27 15:02:45 +00:00
helixhorned 6c405100ac Make sdlayer.c's timerticspersec an 'int32_t' to match the declaration.
git-svn-id: https://svn.eduke32.com/eduke32@2285 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-27 15:02:25 +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 98ffd6f00c Rearrange 'struct hicreplc_t' members so that no padding is inserted on x64.
git-svn-id: https://svn.eduke32.com/eduke32@2282 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:58:25 +00:00
helixhorned 143ec24cb4 engine.c cleanup, making some variables static mostly
git-svn-id: https://svn.eduke32.com/eduke32@2281 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:58:08 +00:00
helixhorned c657588658 Fix a potential sector[-1] access when drawing a masked wall in Polymost.
git-svn-id: https://svn.eduke32.com/eduke32@2280 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:57:51 +00:00
helixhorned f96cc343a2 Fix the insert cicle wall-points bug reported by Norvak.
git-svn-id: https://svn.eduke32.com/eduke32@2279 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-24 18:07:36 +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 d95511ed1d Fix sprite[] access with indices > MAXSPRITES in Polymer model drawing code.
Internally, updateanimation() now takes a third parameter 'lpal'.

git-svn-id: https://svn.eduke32.com/eduke32@2277 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-22 17:18:49 +00:00
helixhorned 775eff0344 Mapster32: make sector flipping (X/Y) work properly with TROR.
git-svn-id: https://svn.eduke32.com/eduke32@2276 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 22:12:11 +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 661e85155b Mapster32: always show highlighted sprites in 2D mode, even in a gray sector.
git-svn-id: https://svn.eduke32.com/eduke32@2274 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 22:11:40 +00:00
helixhorned bb1070b795 Fix a potential wall[-1] access in Mapster32.
git-svn-id: https://svn.eduke32.com/eduke32@2273 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 15:48:03 +00:00
helixhorned 7a893b8ec4 minor engine cleanup.
- enclose glbuild.h in #idndef ... sentinels
- engine.c: remove unused variable 'pageoffset', make 'lastx' static
- formatting

git-svn-id: https://svn.eduke32.com/eduke32@2272 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 13:24:15 +00:00
helixhorned db94366657 Use ATTRIBUTE((used)) for symbols used only in inline asm.
This may fix compilation for optimized builds with GCC or clang where
the compiler would otherwise decide that those symbols are unused.

git-svn-id: https://svn.eduke32.com/eduke32@2271 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 13:23:53 +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 a61052f807 Double MAXTILES to 30720, reduce EXTRATILES (models w/ custom pal skin) to 3840
I'm decreasing EXTRATILES because I feel that it's way overcommitted. It's the
max number of model-tiles that have their own skin for a certain palette,
like the slimer egg in the HRP.

git-svn-id: https://svn.eduke32.com/eduke32@2267 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:58:06 +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
hendricks266 426ef1494e Add the 'yoffset' token to model definitions to allow models to compensate for ART tiles with large yoffsets, such as #603. Under normal circumstances the existing 'zadd' parameter should be used instead. Special thanks to Supertanker.
git-svn-id: https://svn.eduke32.com/eduke32@2264 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-17 04:31:59 +00:00
hendricks266 ff94311f13 weapons.con.sample:
- hud_orientation now uses proper bitwise operations
 - clean up whitespace

git-svn-id: https://svn.eduke32.com/eduke32@2263 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-17 04:31:23 +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 031da6280d Remove the allocache() allocation type for 'intptr_t *lookups'.
Always malloc that buffer.  This allows us to remove suckcache() from
cache1d.c, which I believe to be buggy (see comments in the source).

git-svn-id: https://svn.eduke32.com/eduke32@2261 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:39:59 +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 340b2f7647 Increase the number of maximum art files from 64 to 256 and tweak loadpics().
It is likely that this is the value it used to have at some point, because
the MAXTILEFILES macro equals 256 and is as old as the Duke3D source.
loadpics() now refuses to load an ART file with localtilestart or localtileend
out of bounds, or if localtileend<=localtilestart (i.e. no tiles in ART file, or
nonsense). Also, on 'invalid art file version', continue instead of returning.

Note: this does not increase the maximum number of tiles, which is still 15360,
it only gives a bit more freedom to arrange them (well, into more art files).
Also, I don't see what anyone keeps off from packing any number of tiles (from
1 to 15360) into an art file. Old EDITART limits?

git-svn-id: https://svn.eduke32.com/eduke32@2259 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:39:10 +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 480690aa1d Fix the Polymer hitches first encountered with Parkade.
The cause was a combination of many factors. First, Polymer requires the
start-drawing position to be inside the sector to draw (deviations lead to
incorrect drawing).  This was violated by the game, because it interpolated
the current and next tic position without updating the sectnum, leading to
inconsistencies especially when passing through narrow sectors.  Polymer
worked around it by doing an updatesector() each frame, however this works
poorly for maps with overlapping geometry such as SoS or RoR.

The solution to this is to add a new engine function,
updatesector_onlynextwalls(), which searches the sectors (via nextsector)
in breadth-first fashion instead of from 0 to numsectors-1, like updatesector
does when it fails for the *immediate* nextwall neighbors.

Internally, the breadt-first search helpers are moved into the engine.

git-svn-id: https://svn.eduke32.com/eduke32@2256 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-14 14:48:30 +00:00
helixhorned 87ac6b8406 winlayer.c: in WM_PALETTECHANGED handling code ("someone stole the palette
so try and steal it back"), prevent calling IDirectDrawSurface_SetPalette()
with NULL arguments, causing a crash.  It's happened for me on Vista, when
initially changing from 8-bit to 32-bit mode.

git-svn-id: https://svn.eduke32.com/eduke32@2255 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:49:50 +00:00
helixhorned a57b566c0b Add Makefile option to use the DMALLOC (debug malloc) library.
I didn't have much success in finding bugs using it, but it works
out-of-the-box on my setup, so it may be useful in the future.

git-svn-id: https://svn.eduke32.com/eduke32@2254 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:49:34 +00:00
helixhorned 300fee62da sdlayer.c: formatting of preprocessor lines
git-svn-id: https://svn.eduke32.com/eduke32@2253 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:49:15 +00:00
helixhorned 9617227a87 Support for the first "thumb" mouse button, called MOUSE4 in the menu.
The second one is passed to the 'mouseb' variable, but the game currently
can't map it since ud.config.MouseFunctions[] would have to be enlarged,
breaking savegame compatibility.
Works both for the Windows and SDL layers. For the latter, instead of using
the SDL_BUTTON_X1/X2 macro constants, I'm using 8 and 9, since that is what
SDL (and incidentally or not, xev) gives me for those buttons.

git-svn-id: https://svn.eduke32.com/eduke32@2252 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:48:57 +00:00
helixhorned 80949930bd Temporarily disable the 'model thinning-out' feature intended to save memory.
It turns out that with model interpolation, out-of-bounds frame numbers may
be generated with thinned out models, so disable it until I can sort out
what's wrong with it.
Also, minor code cleanup.

git-svn-id: https://svn.eduke32.com/eduke32@2251 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:48:38 +00:00
helixhorned 5f50c30ac2 polymer.c: "Compiling GPU program with bits (octal) %o" for easier reading.
Also, for debugging builds, show this message from verbosity level 1 on.

git-svn-id: https://svn.eduke32.com/eduke32@2250 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:48:17 +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 7e6f712ad1 more internal cleanup...
the only visible change is that polymost_trytexcache (formerly two
instances of nearly duplicate code) now prints a diagnostic after
a cache miss.  The one that one is most likely to encounter is
"r_downsize doesn't match", meaning that this setting likely differs
between Mapster and the game.

git-svn-id: https://svn.eduke32.com/eduke32@2248 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:47:41 +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 fa6f2d9ca2 md4.c/h: add consts to appropriate arguments
git-svn-id: https://svn.eduke32.com/eduke32@2246 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:45:08 +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 a86dfe661b maint: make the following static in polymost.c:
- texcacheindex *firstcacheindex, *curcacheindex
 - trytexcache(), gloadtile_cached()
- Factor out duplicated code into clear_cache_internal()

git-svn-id: https://svn.eduke32.com/eduke32@2240 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:43:18 +00:00
helixhorned 3e103e435a Makefile.common: oops, -DNEBUG was in the debug build, not the release one
git-svn-id: https://svn.eduke32.com/eduke32@2239 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-07 20:37:48 +00:00
helixhorned a0f19e66be osxbuild.sh: don't build for ppc
git-svn-id: https://svn.eduke32.com/eduke32@2238 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-07 20:37:36 +00:00
helixhorned 114d8e4a36 When defining a model with the 'model' token and there were errors, don't
let it hang around causing trouble later on; delete it right now and inform
the user.
Add a couple of 'static's to some functions and file scope data in mdsprite.c

git-svn-id: https://svn.eduke32.com/eduke32@2237 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-07 17:48:55 +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 76d210c4b8 Patch up access of malloc'd buffer one byte beyond its size in kplib's
JPEG decoder (unearthed by valgrind).

git-svn-id: https://svn.eduke32.com/eduke32@2231 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-03 19:55:55 +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
hendricks266 e9aec2a65b Comment ldcty[12] array from kpegrend() to remove last of set-but-unused warnings. I don't see any reason to leave this alone.
git-svn-id: https://svn.eduke32.com/eduke32@2228 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-01 04:12:37 +00:00
helixhorned 9a7bdfa76c a.m32 light hotkeys: clamp hitag (range) to 0..32767 instead of 0..16000
git-svn-id: https://svn.eduke32.com/eduke32@2227 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-30 22:17:29 +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 8ec15480c0 Besides the performance issues, there's another reason why changing the palette
'frequently' isn't such a good idea.  Assume an actor constantly changes the
palette to some value and you're attacked by a newbeast at the same time. Then
the pain tinting would be reset each time the actor's code is run.  This commit
adds a new flag 16 to setbrightness(), meaning "don't reset the fade tinting".
Its only use right now is from CON's setgamepalette command (and there, always).
The change is done in the engine and thus affects all platforms.

git-svn-id: https://svn.eduke32.com/eduke32@2225 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:36:01 +00:00
helixhorned d5a934f9ba Trivial tweaks of setbrightness. Add an assertion that bits 1 and 4 are clear,
mainly.  Also remove setvgapalette() from source.

git-svn-id: https://svn.eduke32.com/eduke32@2224 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:35:44 +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 92e5d8214d SDL layer: don't call SDL_SetGammaRamp() if there would be no change.
This is in the similar vein as the set-palette deferring and it's this
that fixes the low FPS in the radioactively contaminated area in AMC TC:
Megabase (since setgamma() is called from setbrightness()).

Again, update issues might be expected, but changing focus between EDuke32
and the desktop and back seems to restore the gamma settings properly on
Kubuntu. Looks like X (or whatever above handles this stuff) maintains it
on a per-application basis.

git-svn-id: https://svn.eduke32.com/eduke32@2222 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:34:57 +00:00
helixhorned 4ae50ef22a SDL layer: in 8-bit mode, defer setting the palette until showing the next frame.
CON code sometimes uses 'setgamepalette' from withing actors, which is a bit too
frequent.  Deferring the actual palette updating means that multiple requests in
between two screen redraws are coalesced into one, which is desirable for
performance reasons and for the reduction of 'tearing' artefacts (but not
prevention, since the drawing isn't synced to the screen refresh rate with
vsync off).

(Did-not-)update issues might be introduced.

Windows isn't touched because
 - I expect it to be more brittle, especially in light of the ATI HW gamma
   problems.
 - I haven't tested whether the particular performance penalty that lead to this
   change ('gas' in AMC TC) exists there too

git-svn-id: https://svn.eduke32.com/eduke32@2221 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:34:41 +00:00
helixhorned 9e1399ec14 screenshots: remove the old inversion and PCX code from the source
git-svn-id: https://svn.eduke32.com/eduke32@2220 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:34:26 +00:00
helixhorned 98bcc0e60c screenshots: if compiled with USE_LIBPNG, always use PNG, even for
color-inversed shots. For both PNG and TGA, change the way they're
done in 8-bit mode: instead of XORing every byte with 15, save the
inverse palette (each component taken 255-x).

git-svn-id: https://svn.eduke32.com/eduke32@2219 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:34:10 +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
helixhorned 8007da7190 Factor out two nearly identical pieces of code in game.c and gameexec.c
into G_HandleMirror().

git-svn-id: https://svn.eduke32.com/eduke32@2217 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:33:40 +00:00
helixhorned 7c245875cb engine: make smoststart[] (which saves starting "smostcnt"s) an array of int32's
instead of shorts. This fixes their values' overflow in AMC TC megabase and
probably a couple of other large maps.

git-svn-id: https://svn.eduke32.com/eduke32@2216 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-27 14:22:45 +00:00
helixhorned 51e3bc0148 net: fix bug in Net_ParseServerPacket introduced with SAMESIZE_ACTOR_T.
git-svn-id: https://svn.eduke32.com/eduke32@2215 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-27 14:22:28 +00:00
helixhorned 489605ee0d Fix sintable access with raw angle value (which might be outside [0..2047])
in overhead map drawing code.

git-svn-id: https://svn.eduke32.com/eduke32@2214 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-26 15:44:23 +00:00
helixhorned b30711586b patch up another out-of-bounds access in the voxel drawing code, though
I'm not sure whether the increased array size is enough.

git-svn-id: https://svn.eduke32.com/eduke32@2213 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-26 15:44:09 +00:00
helixhorned 7baaa44e28 savegame.c: fix initial setting of compression threshold on savegame load;
64-bit fixes

git-svn-id: https://svn.eduke32.com/eduke32@2212 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-26 14:37:34 +00:00
helixhorned 0bf329e70d start CON code at script[3] instead of script[1]. The 'move' command permits
the constants 0 and 1, and moveptrs may reference the script up to index 2
then (though I'm not sure whether the code is reachable with moveofs either
0 or 1), so make sure it's nulled instead of whatever happened to compile at
the first two positions.  Move 1 is only used once in the original cons,
when frozen and being shattered.

git-svn-id: https://svn.eduke32.com/eduke32@2211 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:35:06 +00:00
helixhorned 5ef480ad7a fix displaying the screenshot even for old-version savegames.
git-svn-id: https://svn.eduke32.com/eduke32@2210 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:34:52 +00:00
helixhorned a3a80467a7 net: send BYTEVERSION as two bytes, high byte first.
Now we don't need to worry about the numbers running out soon.
Bump BYTEVERSION by three to celebrate this, too.

git-svn-id: https://svn.eduke32.com/eduke32@2209 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:34:37 +00:00
helixhorned ff6284ea8c Enable SAMESIZE_ACTOR_T described earlier.
git-svn-id: https://svn.eduke32.com/eduke32@2208 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:34:22 +00:00
helixhorned b3474c75b2 Rewrite the savegame format in terms of the generic saving/loading system.
This makes savegames practically the same as the initial snapshot of a demo.
Saves are now named 'dukesavX.esv' (demos: 'edemoX.edm').
Additionally, many changes that couldn't/needn't be cleanly separated are added
with this commit:
 - make spriteext_t have the same size across 32/64 bit platforms (actor_t partially)
 - prevent saving/loading in MP games (it certainly didn't work and still doesn't)
 - it's time we start using assertions! Define NDEBUG for releasse builds.
 - reset savegame major and minor versions (we have a new magic string, so no conflict)

git-svn-id: https://svn.eduke32.com/eduke32@2207 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:34:06 +00:00
helixhorned 61257b0f6b Rewrite a couple of lines in clearfrags() to look more idiomatic.
git-svn-id: https://svn.eduke32.com/eduke32@2206 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:33:37 +00:00