Commit Graph

301 Commits

Author SHA1 Message Date
terminx 4911b9a949 Revise C++ structure trackers for performance and introduce "tspritetype", for temporary sprites or other usages where using the trackers would be invalid or undesired. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4898 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:55:07 +00:00
hendricks266 589c993c39 Implement UserMapHacks.
git-svn-id: https://svn.eduke32.com/eduke32@4884 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-08 15:14:00 +00:00
hendricks266 598e33319c Add the necessary plumbing to sdlayer to detect mousedown, mouseup, and dragging.
git-svn-id: https://svn.eduke32.com/eduke32@4853 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-27 18:36:43 +00:00
helixhorned 50a5e38cb6 Pull setting g_noFloorPal[] further down, into makepalookup().
Now passed as last arg 'noFloorPal' to makepalookup(). Used as follows:
- from loadlookups(): *false*, i.e. do take over floor pal.
- from generatefogpals() [default fog pals] and fillemptylookups(): *true*,
  i.e. don't take over floor pal
- from DEF 'fogpal': true
- from DEF 'makepalookup': take over flag from pal from which we are remapping,
  or set to true if remapping from pal 0
- (CROSSHAIR_PAL: true)

This should make the issue reported in
 http://forums.duke4.net/topic/775-eduke32-20-and-polymer/page__view__findpost__p__197583
resolve in a natural manner.

git-svn-id: https://svn.eduke32.com/eduke32@4812 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-13 22:33:05 +00:00
helixhorned 70cbde87eb Move g_noFloorPal[] to the engine side and adapt other stuff accordingly.
- 'nofloorpalrange' DEF token: now handled for both game and editor (for the
  latter, it's effective only for "shade preview" mode, [']+[X]).
- in generatefogpals(), assign g_noFloorPal[] = 1 for every generated (default)
  fog pal; get rid of its return value / g_firstFogPal

git-svn-id: https://svn.eduke32.com/eduke32@4811 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-13 22:33:04 +00:00
hendricks266 9268b9f0b6 Make a bunch of things extern "C". This should fix C++ builds on OS X and with Lunatic. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4766 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-26 04:39:23 +00:00
helixhorned cb606b0a11 In Lunatic build, make krand() a proper function again, called from Lua/FFI.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4759 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-22 18:37:24 +00:00
terminx 2330c61519 WIP refactor of SDL interface. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4749 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-22 12:33:47 +00:00
terminx 99e21ffa94 Part 1 of attempting to adhere to C standard section 7.1.3. It turns out it's illegal to use identifiers that begin with _ or have __ anywhere in them. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4747 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-22 12:32:56 +00:00
terminx 9b91aac48c Inline krand() when not using KRANDDEBUG. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4744 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-22 12:28:52 +00:00
helixhorned e8553b5398 baselayer.c: fix an oob write to ylookup[] intoduced in r4695.
On Linux, it started manifesting itself since r4719 as crashes whose
backtraces pointed to malloc() and were not helpful. Valgrind finally
uncovered this.

git-svn-id: https://svn.eduke32.com/eduke32@4724 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-06 23:43:47 +00:00
terminx 91e2556ad2 Inline yax_getbunches with old map format. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4700 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-29 17:06:05 +00:00
terminx 021d1241eb Get rid of all the static arrays with sizes based on MAXXDIM and MAXYDIM
git-svn-id: https://svn.eduke32.com/eduke32@4695 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-29 17:04:28 +00:00
terminx 8934226bb2 Another 5000 lines of pain and tears. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4680 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:36:34 +00:00
terminx cbe91be9ff Additional engine cleanups and optimizations. About as generic as it sounds. Also changes internal dummytile/tilefromtexture behavior so that the LZ4 compressed version of a texture is kept and the cache1d entries associated with the tiles can expire, like any other tile.
git-svn-id: https://svn.eduke32.com/eduke32@4661 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:30:38 +00:00
terminx 4263626f97 Misc additional optimizations, mostly to polymost/mdsprite. Also separate voxmodel into its own source file and object. This commit is pretty large because I was hitting the limit of what could realistically be carved up into smaller patches. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4639 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:18:43 +00:00
terminx 144a4798ce More Polymost cleanup, also consolidate tilesizx and tilesizy into a single tilesiz vec2_t to ensure both x and y are always in the same cache line. I may add a new vec2_16t later. Still need to take care of emulating the old flat array for the sake of CON access.
git-svn-id: https://svn.eduke32.com/eduke32@4623 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:14:21 +00:00
terminx 598876e411 Extra files for previous commits
git-svn-id: https://svn.eduke32.com/eduke32@4607 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:06:57 +00:00
helixhorned ceaa661304 Properly consider sprites with a clipshape as bridge (p->spritebridge).
git-svn-id: https://svn.eduke32.com/eduke32@4574 1a8010ca-5511-0410-912e-c29ae57300e0
2014-08-17 19:42:01 +00:00
hendricks266 b0e82d4264 Split parts of loadlookups() into generatefogpals() and fillemptylookups(), and move Duke-specific LOOKUP.DAT behavior to G_LoadLookups() in source/common.c, which contains the call to loadlookups() as factored out from astub.c and game.c.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4564 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-28 06:45:53 +00:00
hendricks266 b48f3b44e3 Progress towards KenBuild Editor, part 1.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4558 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-28 06:43:16 +00:00
hendricks266 4f67f8f969 KenBuild.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4555 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-24 14:01:44 +00:00
hendricks266 b332189ae5 Ball-busting Makefile restructure.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4543 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-22 07:25:54 +00:00
hendricks266 a755e95c2c Replace some constants with preprocessor macros.
git-svn-id: https://svn.eduke32.com/eduke32@4472 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-17 12:36:40 +00:00
helixhorned 66b789376b In G_SavePlayer(), save timers at beginning and restore when finished.
This makes the game not process as many ticks as have elapsed during the saving
afterwards.

git-svn-id: https://svn.eduke32.com/eduke32@4450 1a8010ca-5511-0410-912e-c29ae57300e0
2014-04-19 22:42:21 +00:00
helixhorned 7603f432df Rename sector[].filler member to '.fogpal'. From CON, keep the '.alignto' alias.
The overall situation is thus as follows:
 - in C and from Lua, that member is called 'fogpal'
 - In CON (both C-CON and LunaCON), it's 'fogpal' with 'alignto' being an alias;
   'filler' wasn't available before, either.
 - In m32script, it's 'fogpal' or 'alignto' ('filler' is not available any more)

git-svn-id: https://svn.eduke32.com/eduke32@4416 1a8010ca-5511-0410-912e-c29ae57300e0
2014-04-05 11:28:10 +00:00
helixhorned e304f3a518 Really minor accumulated readability tweaks.
git-svn-id: https://svn.eduke32.com/eduke32@4395 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-25 21:04:33 +00:00
helixhorned 21de8bb53a Factor out approaching val. to target val by half-difference steps into logapproach().
Fix a case in G_MovePlayers(), where the player sprite's shade is approached
toward the ceiling/floor's shade. Before, it could stop at one above or below!

git-svn-id: https://svn.eduke32.com/eduke32@4392 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-23 14:29:09 +00:00
helixhorned 802650048d Lunatic: extend map-VX walltype by 'blend' member. BUILD_LUNATIC.
Make Mapster32 save as map-text if there is a wall with non-zero 'blend'.

git-svn-id: https://svn.eduke32.com/eduke32@4368 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-10 20:08:27 +00:00
helixhorned 689a8aef1d Propagate 'blend' to rotatesprite_(), but don't hook it up to scripting yet.
git-svn-id: https://svn.eduke32.com/eduke32@4360 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-05 21:12:54 +00:00
helixhorned 6f34193bb6 Give sprite cstat bit 2048 (NOSHADE, Mapster32 key [N]) a macro name.
git-svn-id: https://svn.eduke32.com/eduke32@4350 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 19:38:51 +00:00
helixhorned 7e7507746d Factor out common parts of loading LOOKUP.DAT into engine.c:loadlookups().
Also, error if didn't read enough data and account for TITLE and REALMS
swap between basepal number and on-disk order (sigh).

git-svn-id: https://svn.eduke32.com/eduke32@4334 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-16 19:16:03 +00:00
helixhorned eec27960ea Lunatic: update dynsymlists. Move blendtable[] from build.h to engine.c.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4309 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:59 +00:00
helixhorned a9fb9e6356 Lunatic: add a 'lastokcol' argument to engine.nearcolor() and document it.
On the C side, slightly rewrite (now) getclosestcol_lim() for clarity.

git-svn-id: https://svn.eduke32.com/eduke32@4308 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:58 +00:00
helixhorned ad8d6795e2 In the C code, rename sprite[].filler to 'blend'.
Also, fix a missed .filler -> g_ambiencePlaying[] rewrite in the editor.
In C-CON, 'detail' is kept as alias to C-side (former) .filler / now .blend,
but that name is *deprecated*.

git-svn-id: https://svn.eduke32.com/eduke32@4305 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:55 +00:00
helixhorned 330b744a1b Classic: support for multiple blending tables + Lunatic interfaces.
Currently, sprite[].filler (to be renamed) selects a blending table. If none
is installed with that index, the blending table at index 0 is taken (which is
read from PALETTE.DAT on engine startup). Thus, for now, the non-Lunatic build
will never use a custom blending table because there's no way to register one!
But the functionality is there.

git-svn-id: https://svn.eduke32.com/eduke32@4301 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:49 +00:00
helixhorned ab5c89430c sector.c and related cleanup, round 2.
- use SPRITES_OF* iterator macros
- new function: E_SpriteIsValid(); add some safety checks
  (e.g. hitag used as sprite index)
- the rest is mostly "the usual code transformations"

git-svn-id: https://svn.eduke32.com/eduke32@4281 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:12:56 +00:00
helixhorned 4881a13f99 Engine-side per-map ART file support.
When a map named <filename>.map is loaded (<filename> may also contain directory
separators), the engine checks for existence of <filename>_XX.art in the virtual
file system, where XX is a 0-padded number from 00 to 19. It loads a consecutive
sequence of these ART files, i.e. aborts whenever a number in the sequence isn't
found (in contrast to normal ART loading).

Restrictions:
 - the per-map ART files must not reside in ZIP files
 - if a tile number is attempted to be overridden that has a dummytile or is
   cache1d-locked, per-map ART loading fails
On failure, the map is still loaded, but a diagnostic message is output to the
log/OSD.

Loaded per-map ART data are cleared whenever the map is "left". In particular:
 - whenever another map is loaded
 - in the editor: when a new map is started
 - in the game: after the bonus ending screen of a finished level, after going
   to the title screen via the menu

A final note: file names are supposed to be looked up and compared
case-sensitively. That is, <filename> must match EXACTLY between the map's and
per-map ART one; 'art' must be lowercase. Otherwise, the cookie monster will
come and eat you!

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4257 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:54:36 +00:00
helixhorned 8a4c5259a8 In the no-netcode build, don't expose four internal engine functions.
Also don't compile three multiplayer related OSD commands there.

git-svn-id: https://svn.eduke32.com/eduke32@4233 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:51:54 +00:00
helixhorned 8a2d786e23 Reserve 16 tiles from the end of MAXTILES, don't allow as user tiles from ART/DEF.
git-svn-id: https://svn.eduke32.com/eduke32@4225 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:22 +00:00
helixhorned 198ba2d697 Give rotatesprite 'orientation' bits enum names, too.
git-svn-id: https://svn.eduke32.com/eduke32@4175 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:52 +00:00
helixhorned 7182f0a7f2 A couple of trivial changes.
git-svn-id: https://svn.eduke32.com/eduke32@4171 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:44 +00:00
hendricks266 401a73862a Wii: Fix build and add custom headers and libs to SVN. (It's helpful to set up a build system from scratch.)
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4102 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-13 09:08:31 +00:00
helixhorned 7543ba7226 premap.c: delete GPSPEED/CYCLERs only after the loop with EVENT_LOADACTOR events
git-svn-id: https://svn.eduke32.com/eduke32@4045 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:38 +00:00
helixhorned ff05fb9b5c Retire MultiPsky_TileToIdx() in favor of engine-side getpskyidx().
DONT_BUILD, because there have been no significant changes of the non-Lua build.

git-svn-id: https://svn.eduke32.com/eduke32@4006 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:51 +00:00
helixhorned a374a401be Clean up parallaxed sky functionality, part 2.
- Rename sky_t members: yscale -> horizfrac, bits -> lognumtiles.
- Add default sky (8 tiles, horizfrac=32768 (i.e. 1/2 the scene horiz), offsets
  all zero) and CLOUDYOCEAN sky (8 tiles, horizfrac=65536, offsets all zero)
  to multipsky[].
- Get rid of "psky_t g_psky", merely maintaining a g_pskyidx instead. Set it up
  at map load time so as to keep the behavior of the legacy per-map psky:
  the last sector index with a matching psky ceiling wins.
- In mapstate_t, save g_pskyidx too, not (former) pskybits and pskyoffs[].
- Make on-map-load global psky setup consistent for the game and editor by
  factoring it out into common.c: G_SetupGlobalPsky().
- Remove a couple of useless initializations, add some static assertions.

This commit is more likely to introduce subtle differences in behavior.
Specifically, getpsky() now always returns the default sky properties instead of
the global sky ones (but with all-zero offsets) when no match for a suiting
multi-psky is found. This is only likely to affect the yscale/horizfrac of
non-multi-pskies when a global non-default multi-psky has been set up.
Bump BYTEVERSION again.

git-svn-id: https://svn.eduke32.com/eduke32@3976 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:48 +00:00
helixhorned 46e8549b5e Clean up parallaxed sky functionality, part 1.
- Consolidate psky* arrays into a "typedef struct psky_t" "g_psky" and
  "multipsky[]".
- Factor out getting parallaxed sky properties into getpsky().
- Condense initial multi-psky setup by memcpy'ing from multipsky[].
- New function: MultiPsky_TileToIdx().
- Add new define PSKYOFF_MAX and related consistency-checking assertions.
- Lower MAXPSKYTILES to 8 to reflect current usage (was 256).
- Game: make multi-pskies consider dynamically-remapped MOONSKY1, BIGORBIT1
  and LA. (Not very useful as the editor will still only act for the static
  values -- 80, 84 and 89, respectively.)

An attempt has been made to preserve behavior even in strange cases, so this
commit is unlikely to introduce regressions. Because of point 6, BYTEVERSION
had to be bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3975 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:45 +00:00
helixhorned c243bab0e7 Remove one instance of duplicate code lines and now unused TSPR_MIRROR.
git-svn-id: https://svn.eduke32.com/eduke32@3936 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:07 +00:00
helixhorned 6e443944c3 Lunatic: partially fix LTO=1 build with GCC.
Having to tag these few variables and functions as ATTRIBUTE((used))
seems sensible, but what follows is just strange. OSD_Printf? headspritesect?

git-svn-id: https://svn.eduke32.com/eduke32@3932 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:53 +00:00
helixhorned 184a7322de Polymodes/Lunatic: don't do y panning "correction" for nonpow2 ysize tiles.
git-svn-id: https://svn.eduke32.com/eduke32@3926 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:37 +00:00
helixhorned dea960d350 Fix loading maps in Mapster32, introduced in r3911.
Also, get rid of the strange filename[len]=255 hack in loadboard()
and make its file name arg const char* at last.

git-svn-id: https://svn.eduke32.com/eduke32@3913 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-29 12:15:44 +00:00
helixhorned d0f538b283 Engine: don't extern 'clipmovetraceboxnum', add a new func. clipmovex() instead.
The 'x' is for "extended", since its last arg is a switch of whether to disable
sliding. Use that from gameexec.c.

git-svn-id: https://svn.eduke32.com/eduke32@3811 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:36 +00:00
helixhorned 0d79372216 Lunatic: prototypical gamevar serialization, currently very CON-centric.
git-svn-id: https://svn.eduke32.com/eduke32@3796 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-20 19:31:42 +00:00
terminx f8cc394fa3 Sanitize hard coded render mode numbers... replace all references to rendmode 0, 3, 4, etc with proper REND_CLASSIC, REND_POLYMOST, REND_POLYMER labels.
git-svn-id: https://svn.eduke32.com/eduke32@3784 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-17 03:44:09 +00:00
helixhorned 99d7f1e964 Polymer: rewrite sprite x/y flipping so that data flow is explicit.
Also, add some defines for sprite cstats to build.h (SPR_*) and use them.

git-svn-id: https://svn.eduke32.com/eduke32@3775 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-16 21:54:52 +00:00
terminx c717f9a7b5 Get rid of that old model occlusion checking hack I wrote for Polymost years ago. I actually didn't know this was still in EDuke32... it's one of the worst things I've ever written. :p
git-svn-id: https://svn.eduke32.com/eduke32@3764 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:19:41 +00:00
terminx 08444cb825 WIP texture cache refactoring
git-svn-id: https://svn.eduke32.com/eduke32@3758 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:17:17 +00:00
helixhorned 258e28bafb Map-int VX: rearrange members so that ceiling* and floor* are contiguous.
git-svn-id: https://svn.eduke32.com/eduke32@3731 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:28 +00:00
Plagman 6dac6ac1c0 New Polymer feature: shitty mode.
git-svn-id: https://svn.eduke32.com/eduke32@3729 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 03:12:38 +00:00
helixhorned bc78ff27ed Classic: clean up mirror drawing code.
No functional changes, but a (commented out) debug line for an oob read of the
frame buffer when the mirror covers the whole screen is inserted.

git-svn-id: https://svn.eduke32.com/eduke32@3719 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-01 17:41:59 +00:00
helixhorned a628cbdd13 Lunatic (map-int VX) build: implement loading <V7 maps.
git-svn-id: https://svn.eduke32.com/eduke32@3710 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-25 21:10:22 +00:00
helixhorned e2c05cbbae Fix A_MoveSprite() wrongly reporting sector hit without z change after r3678.
git-svn-id: https://svn.eduke32.com/eduke32@3686 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-16 20:08:45 +00:00
helixhorned 6be448c534 Fix SPRITES_OF_SECT_SAFE macro. Oops!
git-svn-id: https://svn.eduke32.com/eduke32@3685 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 18:50:21 +00:00
helixhorned 8064bd2f30 Clean up of mostly actors.c, but some other files along the way too.
- Rewrite some sprites-of-{stat,sector} loops using the SPRITES_OF,
  SPRITES_OF_SECT and new SPRITES_OF_SECT_SAFE macros.
- In passing, identify some problems and mark them with 'XXX', but don't
  attempt to fix them yet.
- The usual readability improvements...

git-svn-id: https://svn.eduke32.com/eduke32@3679 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:09 +00:00
helixhorned 7b6bf4dda2 Lunatic: new-generation map format, in-memory representation ("map-int VX").
The Lunatic build compiles with new structures for sector and wall types.
They have separate members for TROR {up,down}{bunch,nextwall}, so there are
no conflicts with other uses of members into which they were previously
shoehorned.  Also, the maximum bunch limit is bumped to 512 in that build.

Currently, loading from V7/8/9 and saving to V7 and V8 are supported.

git-svn-id: https://svn.eduke32.com/eduke32@3658 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-09 17:35:11 +00:00
helixhorned 1e21ea3aae LunaCON: fix rotatesprite coordinate check, gen. events to chain at beginning.
git-svn-id: https://svn.eduke32.com/eduke32@3639 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:52:50 +00:00
helixhorned 48406e744b Mapster32: factor out 3x computing "alwaysshowgray", but don't change anything.
git-svn-id: https://svn.eduke32.com/eduke32@3623 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-29 15:59:14 +00:00
hendricks266 3d46bc1551 Implement alpha into rotatesprite (rotatesprite_) on the engine side.
git-svn-id: https://svn.eduke32.com/eduke32@3609 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:32:24 +00:00
hendricks266 c5044b3ecd Add orientation bit 2048, enumerated as ROTATESPRITE_FULL16, which is a courtesy provided by the engine for the purpose of the game to internally force use of full 32-bit coordinates. With this bit set, all CON screen drawing commands can use rotatesprite16-like coordinates.
While the functionality was already internally in place for gametext as one of two hacks using ROTATESPRITE_MAX (the other still used by minitext_() to align with the statusbar) we must codify a bit in the engine for safe external use. (Otherwise, ROTATESPRITE_MAX could/would theoretically increase and leave modders high and dry.)

(Dev note: In G_DrawTXDigiNumZ(), ROTATESPRITE_MAX was used to bitshift the value used to calculate digit spacing for no reason I can ascertain other than to introduce rounding errors into the zoom/textscale calculations. It was never used anywhere, so I removed it.)

Bonus: The scaling code for digitalnumberz and gametextz has been modified so that the spacing is no longer affected by rounding errors. Try animating the zoom value and compare how the text used to jump but now does not.

git-svn-id: https://svn.eduke32.com/eduke32@3608 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:31:58 +00:00
hendricks266 d7e30a65dd Relax CAPITALIZATION restrictions.
git-svn-id: https://svn.eduke32.com/eduke32@3606 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:31:09 +00:00
helixhorned 182121a0aa engine: give sprite cstat 1024 a marco name, CSTAT_SPRITE_MDHACK.
git-svn-id: https://svn.eduke32.com/eduke32@3584 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:19:32 +00:00
helixhorned 1dd52a4d6e Fix POLYMER=0 build, cleaning up #include discipline on the way.
Also taking care that the USE_OPENGL=0 build builds.

git-svn-id: https://svn.eduke32.com/eduke32@3467 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:24 +00:00
helixhorned 4e5cdba646 Lose the 'packed' attribute for types declared in build.h.
Most of them are already aligned to their natural boundaries, so lowering
the alignment to 1 byte can only worsen things by making the C compiler
generate poorer (unaligned access) code for some platforms.

The layout of structures is not specified by the C Standard, but is rather
given by a particular platform + toolchain's ABI (application binary interface).
Most ABIs follow the expected pattern "alignment of scalars is their size,
alignment of arrays is that of its element type, alignment of structs is the
maximum alignment of its members". A couple of links to particular ABIs are
given in build.h.

Problems are expected with archs that care about unaligned access when a pointer
to a non-packed struct is taken that resides in a packed aggregate, but these
uses should be weeded out (I'm not sure if there are any in our codebase).

The following types are affected, only hitdata_t changes its size:
sectortype, walltype, spritetype, spriteext_t, spritesmooth_t,
struct validmode_t, picanm_t, palette_t, vec2_t, vec3_t, hitdata_t.

git-svn-id: https://svn.eduke32.com/eduke32@3455 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-03 12:48:11 +00:00
terminx 8d64c001a0 Additional networking patch from Jasper Foreman, sadly sitting untested for almost a month because everyone here has been too sick to do anything with it. :(
git-svn-id: https://svn.eduke32.com/eduke32@3443 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-28 22:00:37 +00:00
helixhorned 0796c0e66e Don't apply GL fogging to wall lines drawn in game's "light" overhead view.
git-svn-id: https://svn.eduke32.com/eduke32@3438 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-26 17:07:58 +00:00
helixhorned 8fb886b14a Replace dragpoint()'s "dragpoint_noreset" global with a "flags" argument.
Also, add another flag, signifying that from the editor, also the
"lastwall"s (i.e. the CCW-linked points) should get collected. This is
to signal the editor that their wall lengths should be displayed, too.

git-svn-id: https://svn.eduke32.com/eduke32@3394 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-16 20:38:41 +00:00
helixhorned 7d2dd223bb Mapster32: don't apply GL fogging to crosshair.
git-svn-id: https://svn.eduke32.com/eduke32@3389 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:14 +00:00
helixhorned 2528fd3bf5 player.c: factoring continued.
New local functions:
Proj_DoRandDecalSize, SectorContainsSE13, HandleHitWall, Proj_CheckBlood,
Proj_HandleKnee.

git-svn-id: https://svn.eduke32.com/eduke32@3362 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:42 +00:00
terminx 5c74bc6f56 Surround "debug1" and "debug2" with #ifdef DEBUGGINGAIDS
git-svn-id: https://svn.eduke32.com/eduke32@3349 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-31 01:50:45 +00:00
terminx cbf9d2cff3 Clean up a couple of other getrendermode() related bits that the previous commit missed
git-svn-id: https://svn.eduke32.com/eduke32@3347 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-30 20:34:55 +00:00
terminx 79e45c23d5 Add predefined REND_CLASSIC, REND_POLYMOST and REND_POLYMER constants and use them everywhere getrendermode() is called.
git-svn-id: https://svn.eduke32.com/eduke32@3346 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-30 20:34:34 +00:00
helixhorned 4ad4f9ebb7 Remove commented code using former engine variable "automapping".
git-svn-id: https://svn.eduke32.com/eduke32@3342 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:20 +00:00
helixhorned b30d00dd91 Replace initialize_engine_globals() with array initialization.
git-svn-id: https://svn.eduke32.com/eduke32@3326 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:18:09 +00:00
helixhorned d7cfde9d3d Make get{zs,ceilz,florz}ofslope (now ...ptr) accept sectortype pointer.
And rewrite the original functions as wrappers around these.

git-svn-id: https://svn.eduke32.com/eduke32@3323 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:17:58 +00:00
helixhorned 0dd78fb029 Cleanup of console/on-screen-display (OSD) functionality.
- Rewrite the "clear background" routine in a no-brainer way instead of
  juggling around with rotatesprite(). Make it common to game+editor.
  Expose glRectd to glbuild.
- Don't stop OSD text line drawing when encountering a non-printable char.
  Instead, treat it as space.
- In OSD_SetTextMode(), don't use swaplong (which really swaps 32-bit ints)
  to swap pointers. Write an analogous "swapptr" instead.
- When changing from/to OSD, don't inject a pause key. This *might* have been
  the cause of the reported pausing problems.
- clean up the code...
(Yes, this commit throws together too much stuff. I suck sometimes. :P)

git-svn-id: https://svn.eduke32.com/eduke32@3321 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-25 16:13:50 +00:00
helixhorned 92dabb3694 Rename global visibility to g_visibility, remove useless casts & old fog code.
git-svn-id: https://svn.eduke32.com/eduke32@3287 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:28:05 +00:00
helixhorned 65e5ebcdbc Add command line option "-rotatesprite-no-widescreen".
This global option will set bit 1024 and clear bits 256 and 512 for all
rotatesprite calls, fixing complex HUD drawing code relying on precise
alignment of individual elements (widescreen rotatesprite is entirely
unsuitable for this purpose).

git-svn-id: https://svn.eduke32.com/eduke32@3284 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:27:55 +00:00
hendricks266 890aba88eb Fix warnings involving printf() requiring explicit casts on tracked types.
git-svn-id: https://svn.eduke32.com/eduke32@3238 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-26 08:26:04 +00:00
Plagman 36f80e9078 Move the tracking from a dirty state to a change count.
git-svn-id: https://svn.eduke32.com/eduke32@3234 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 16:24:41 +00:00
helixhorned ca4ef47f0b engine.c: factor out 2 pract. ident. pieces of code into try_facespr_intersect.
The two uses are from hitscan and neartag.  The functionality is reproduced
exactly (assuming I made no mistake), down to different distance checking
(<= vs. <).

git-svn-id: https://svn.eduke32.com/eduke32@3228 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:18:57 +00:00
helixhorned 0316868c75 Clean up engine code by factoring repeated 3-liners into spriteheightofs().
This function also changed: it doesn't handle floor-aligned sprites now,
and the z offset is returned instead of set by pointer.

git-svn-id: https://svn.eduke32.com/eduke32@3205 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:43 +00:00
helixhorned 44904b12be Clean up picanm[] by making its elements values of struct type picanm_t.
The size of that struct is currently 4, and its layout almost the same as
what is read in with loadpics().  The number of tiles in an animation is
bumped to 256, so that the max. tile difference in DEF's animtilerange is
255. (There's no way to have such animations from ART.)

git-svn-id: https://svn.eduke32.com/eduke32@3202 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:28 +00:00
helixhorned 5e049afa5d Probably fix the zoom crash encountered with Mapster32 and CBP8.
Described here:
http://forums.duke4.net/topic/3857-the-crash-thread/page__view__findpost__p__141202

git-svn-id: https://svn.eduke32.com/eduke32@3188 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 21:10:00 +00:00
helixhorned 2cb3734f85 Split r3159..r3161, part 8: make some members of base types unsigned.
NOTE: This will need very thorough review.

git-svn-id: https://svn.eduke32.com/eduke32@3174 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:18 +00:00
helixhorned 6d5d415ea5 Split r3159..r3161, part 6: code conditional on __cplusplus.
Note the type change of vplce[] in engine.c: int32_t -> uint32_t.

git-svn-id: https://svn.eduke32.com/eduke32@3172 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:11 +00:00
helixhorned 1cd11d06ef Revert "Fix the warnings when building with C++, add MSVC C++ build support."
This reverts r3159..r3161.

Conflicts:
	eduke32/build/include/compat.h
(Handled so that r3163's changes are kept applied.)

git-svn-id: https://svn.eduke32.com/eduke32@3165 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:45 +00:00
hendricks266 c6bbb0547b Fix CPLUSPLUS=1 CLANG=1 building, and fix the "gotpic used attribute ignored" warning produced by clang.
git-svn-id: https://svn.eduke32.com/eduke32@3162 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 06:42:00 +00:00
terminx 3ff46c02b2 Fix the warnings when building with C++, add MSVC C++ build support. This also changes the internal type of lotags, hitags and cstat type fields to uint16_t instead of int16_t to clean up some dubious behavior wherein the code was using a value of 32768 as a flag in these fields for certain types of things, like invisible sprites (using the value as if it was uint16_t) where it was elsewhere checking if the value was < 0 (using the value as if it was int16_t). This change may break a few specific effects if any part of the relevant code was missed when looking for areas that needed to be addressed.
I think there's also a fix for the CON precache system breakage in here (lost it in my local tree when I started getting the C++ build working in MSVC, sorry!)


git-svn-id: https://svn.eduke32.com/eduke32@3159 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-14 23:32:43 +00:00
helixhorned d85f529b74 Introduce a per-tile bit preventing fullbrights in GL modes, use for LOADSCREEN.
git-svn-id: https://svn.eduke32.com/eduke32@3145 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 14:11:17 +00:00
Plagman a1b82232fd Fix warnings from pointer math with the trackers.
git-svn-id: https://svn.eduke32.com/eduke32@3139 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 01:53:50 +00:00