Commit Graph

1258 Commits

Author SHA1 Message Date
helixhorned 72492df63e Engine cleanup: factor out code getting bounds of sprites.
git-svn-id: https://svn.eduke32.com/eduke32@3207 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:50 +00:00
helixhorned e9009bfdd4 Clean up base engine functions: tighten scope of locals declarations.
git-svn-id: https://svn.eduke32.com/eduke32@3206 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:47 +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 6abb63670c A couple of meaning-preserving rewrites of picanm[]-touching code.
git-svn-id: https://svn.eduke32.com/eduke32@3204 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:37 +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
terminx 626180dd3f Make GCC *printf_nowarn behavior conditional on compiling as C++
git-svn-id: https://svn.eduke32.com/eduke32@3190 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 23:35:40 +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 9434025e6d Minor loadpics() cleanups, don't expose filegrp[] from cache1d.c.
git-svn-id: https://svn.eduke32.com/eduke32@3187 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 21:09:56 +00:00
helixhorned 826be655db picanm[]-cleanup pt1: hide code using animateoffs() behind macro DO_TILE_ANIM.
git-svn-id: https://svn.eduke32.com/eduke32@3186 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 21:09:53 +00:00
helixhorned 6547495cac Split r3159..r3161, part 14: The rest.
git-svn-id: https://svn.eduke32.com/eduke32@3180 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:47 +00:00
helixhorned 6144a2e18c Split r3159..r3161, part 13: Poly{mer,most}, engine changes.
git-svn-id: https://svn.eduke32.com/eduke32@3179 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:44 +00:00
helixhorned 107fa9cc39 Split r3159..r3161, part 12: Add explicit casts, non-pointer types.
Notes:
 - Atomic Edition (Censored) -> Plutonium Pak in grpscan.c
 - "scale" in astub.c:drawtileinfo() is incorrect, I think.
 - in demo.c, the gethitickms() value should be returned to a double.

git-svn-id: https://svn.eduke32.com/eduke32@3178 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:41 +00:00
helixhorned 61d038f217 Split r3159..r3161, part 11: Add explicit casts, pointer types.
git-svn-id: https://svn.eduke32.com/eduke32@3177 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:36 +00:00
helixhorned 5ad385c043 Split r3159..r3161, part 10: add explicit casts to *alloc return values.
NOTE: changes such as these are best viewed with something like
git diff (...) --color-words='[a-zA-Z0-9_]+|[^[:space:]]'

git-svn-id: https://svn.eduke32.com/eduke32@3176 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:29 +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 274726be9b Split r3159..r3161, part 5: "nowarn" wrapping of printing functions.
git-svn-id: https://svn.eduke32.com/eduke32@3170 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:04 +00:00
helixhorned 9dd3748b03 Split r3159..r3161, part 3: MSVC, nedmalloc, *layer, startup windows.
git-svn-id: https://svn.eduke32.com/eduke32@3168 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:57 +00:00
helixhorned d37278ec58 Split r3159..r3161, part 2: C++ tracker headers.
git-svn-id: https://svn.eduke32.com/eduke32@3167 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:51 +00:00
helixhorned f20a001618 Split r3159..r3161, part 1: Makefile and MSVC project file changes.
git-svn-id: https://svn.eduke32.com/eduke32@3166 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:49 +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 9b57e0ea51 Address crash when model skins have invalid file names. Affected surfaces will not be drawn, but FPS will plummet as mdloadskin() is called repeatedly. A more optimal solution would either flag the surface as invalid (so the renderers skip it) or reject the entire model when defs are loaded.
http://forums.duke4.net/topic/6031-eduke32-crashes-if-hrp-model-skin-not-available/

git-svn-id: https://svn.eduke32.com/eduke32@3164 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 06:42:57 +00:00
hendricks266 a418bec8c2 Tools updates:
- Eliminate use of the C++ standard library from arttool. I improved some of the program's workings but it continues to corrupt my art files in certain circumstances. (Note: Not a regression; it happens with previous revisions.)
- Construct "make utils" for the game side following the pattern of the engine.
- Move ivfrate to this new distinction.
- Minor Makefile cleanup and tweaks, mainly to facilitate CLANG=1 and to formalize text output in special cases.

git-svn-id: https://svn.eduke32.com/eduke32@3163 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 06:42:37 +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 c9cd191bce MinGW C build fix
git-svn-id: https://svn.eduke32.com/eduke32@3161 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 01:30:31 +00:00
terminx 89c9a201b5 Add a couple of #ifdef __cplusplus I missed
git-svn-id: https://svn.eduke32.com/eduke32@3160 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 00:23:10 +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 74c46a7b3d Mapster32: set first walls more conveniently on split in one special case.
Specifically, if the first wall of the sector-to-split is to the left or right
of the *start* of the splitting line AND the sector has no TROR extensions,
make these two the new nextwalls of the respective split sectors.

git-svn-id: https://svn.eduke32.com/eduke32@3157 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-13 10:50:13 +00:00
helixhorned ea5829f36c Make it possible to build a standalone libcache1d.so.
Exporting only (de)compression functions. Also, different reader/writer
functions can be set.

git-svn-id: https://svn.eduke32.com/eduke32@3153 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 17:57:13 +00:00
helixhorned 3bcdc5acb8 Lunatic reorganization part 2: split into engine and editor/game parts.
On the engine side (functions starting with L_), there are now the basic
parts like state creation and running code from strings and files.
The game and editor can add to that by e.g. loading whatever they please
into the state. Their functions start with El_ and Em_, respectively.
The Lua scripts still reside in source/lunatic, even for the common ones.
This is because they will be embedded into the binaries as bytecode or
compressed source eventually, so their location on disk will be irrelevant.

git-svn-id: https://svn.eduke32.com/eduke32@3148 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 20:59:00 +00:00
helixhorned 03454c8c3c Clean up texture loading code etc. in polymost.c, no functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@3146 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 14:11:20 +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
helixhorned c71b3d529c Classic: fix rotatesprite with no screen scaling and non-widescreen aspects.
Also, enable showing sprites in Mapster32's overhead view again, since that
was one (the only?) use of that code path.  The uninitialized read was
introduced in r2927.

git-svn-id: https://svn.eduke32.com/eduke32@3144 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 14:11:13 +00:00
Plagman 861eea9b16 Make glbuild C++-safe.
git-svn-id: https://svn.eduke32.com/eduke32@3141 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 06:09:51 +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
Plagman a0dd0c85a5 Add automatic tracking to the sector[], wall[], sprite[] and tsprite[]
arrays; any write access to them will run the corresponding hook and write
to the [sector/wall/sprite/tsprite]clean array.

Note: tsprite and sprite use the same hook and require running a few more
instructions per access in order to disambiguiate; this could be made more
optimal (like the other arrays) by clearly separating the types in the game
code.

Note #2: taking a member's address currently marks it dirty because of tons
of helper functions across the editor code. I don't know how many read-only
accesses we have after taking a member address, but it could also be fixed
with some finessing of the code.

git-svn-id: https://svn.eduke32.com/eduke32@3138 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-09 22:31:02 +00:00
Plagman abc3fa4e8d Fix the C++ build on Linux with LTO.
git-svn-id: https://svn.eduke32.com/eduke32@3137 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-09 18:05:21 +00:00
Plagman 27a39f1982 Fix the Linux mapster32 build with LTO enabled.
git-svn-id: https://svn.eduke32.com/eduke32@3136 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-09 17:35:58 +00:00
helixhorned 2b0bbf4a1c Fix USE_OPENGL=0 build.
git-svn-id: https://svn.eduke32.com/eduke32@3129 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-08 20:17:15 +00:00
helixhorned d6fe35a7d0 Fix one key <--> multiple gamefuncs dispatching.
git-svn-id: https://svn.eduke32.com/eduke32@3123 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-06 23:06:31 +00:00
hendricks266 a0c6fb9805 Fix linking with CLANG=1 by separating $(INVOCATION) into $(COMPILER) and $(LINKER) and removing "-x" from clang as a linker in Makefile.common. Additionally, the Build tools are now affected by CPLUSPLUS=1, for which small corrections have been made.
git-svn-id: https://svn.eduke32.com/eduke32@3122 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-06 07:49:44 +00:00
helixhorned 2b583ebf4c Fix building with SDL 1.2.
git-svn-id: https://svn.eduke32.com/eduke32@3120 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-05 20:04:02 +00:00
Plagman 548f939df5 Add horrible tracking template; for each structure you'll want to create a
separate tracker type by #defining __TRACKER_NAME and __TRACKER_GLOBAL_OFFSET.

eg.:

Then if you have a tracked value and a value of the same type at the given offset:

Tracker_1<int32_t> trackedInt;
int32_t trackedIntDirty = 0; // 4 bytes after

trackedIntDirty will become 1 everytime trackedInt changes.

git-svn-id: https://svn.eduke32.com/eduke32@3119 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-05 04:34:23 +00:00
hendricks266 10c7206d1c Tweak r3116.
git-svn-id: https://svn.eduke32.com/eduke32@3118 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-05 03:48:03 +00:00
hendricks266 fcf9beae6a Work-in-progress adjustment to the C code to compile under C++. It builds for me without errors using Win32 MinGW-GCC, but it still generates warning soup. No guarantees about MSVC or anything using SDL. Enable C++ by building with CPLUSPLUS=1. C remains the default and should compile with no change in setup.
Credit to Plagman for the idea and doing the work on the game side, which is included in this commit.

(Building as C++ will give us features with which we can make improvements and optimizations on the multiplayer code and Polymer.)

git-svn-id: https://svn.eduke32.com/eduke32@3116 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-05 02:49:08 +00:00
helixhorned 20f0f21986 engine.c: add bound-check assert failing for sprites in m32's textured 2D mode.
Also, disable drawing sprites in that mode for now.

git-svn-id: https://svn.eduke32.com/eduke32@3114 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-04 23:03:26 +00:00
helixhorned 65a7ed04f7 Mapster32: functionality to rotate or scale RShift-highlighted stuff smoothly.
This is done by pressing LShift and
 - holding down the left mouse button for scaling, or
 - the right mouse button for rotating the highlighted walls/sprites
with respect to a pivot point determined as the center of the bounding box of
all highlighted points.

Note that scaling sectors isn't that easy and the current functionality is very
rudimentary: there's no z scaling, no xrepeat correction, and sprites aren't
touched expect for their position.  The user is responsible to maintain map
consistency, for example to prevent wall-lines of the same sector crossing
each other.

git-svn-id: https://svn.eduke32.com/eduke32@3113 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-04 23:03:22 +00:00
helixhorned 737e6e6a17 Mapster32: when looking for matching wall in 2nd pt. ins., don't skip gray nextwalls.
This fixes a bug where it's not possible to split a sector under certain
circumstances, reported by Micky C here:
http://forums.duke4.net/topic/1348-mapster32-problems-and-bugs/page__view__findpost__p__138380

Also, don't allow zero in various 'F functions: Resize selection and
Global {shade, visibility} divide.

git-svn-id: https://svn.eduke32.com/eduke32@3112 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-04 23:03:16 +00:00
helixhorned 0bd8516806 Work around the transparent line with on-screen chaingun and linear filtering.
We do this by messing with the GL texture that gets uploaded for CHAINGUN.
Since this is implemented on the engine side, the static value for CHAINGUN
(2536) is used, and the tile dimensions are compared to 211x55 to have a
little confidence that the tile wasn't overridden by a mod.  Hack indeed.

git-svn-id: https://svn.eduke32.com/eduke32@3111 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-03 19:32:48 +00:00
helixhorned e6fdb25d6d Mapster32: draw lines to linking sprites with LShift, jump to them with +[ or +]
When LShift is pressed and the mouse is over a linking sprite (as determined by
the tag labeling system), lines are drawn to all other sprites, and pressing
[ or ] will cycle these then. False positives and missed sprites are possible.

Additional changes:
 - consider SE 31 and 32's lotag to NOT be linking, since the ACTIVATOR is what
   matters.  The original maps are inconsistent there.
 - When pressing Alt+[ or Alt+] and there are no corruptions, say so instead of
   doing [ or ].

git-svn-id: https://svn.eduke32.com/eduke32@3108 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-03 19:32:39 +00:00
helixhorned d42c28c344 Mapster32: when punching loop, fade screen; tweak two messages.
git-svn-id: https://svn.eduke32.com/eduke32@3106 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-03 19:32:32 +00:00
terminx 7bd6d504c7 Move win32 "Initialized nedmalloc" message out of the function that prints the Windows version since it doesn't really belong there.
git-svn-id: https://svn.eduke32.com/eduke32@3104 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-30 16:06:18 +00:00
terminx 8b02800260 A pretty useless fix from a newer version of kplib than we forked from. I'm just tired of seeing it in my tree. ;)
git-svn-id: https://svn.eduke32.com/eduke32@3103 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-30 16:04:37 +00:00
hendricks266 7e4e760e9c Fix harmless warnings in the Build tools.
git-svn-id: https://svn.eduke32.com/eduke32@3097 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:28:10 +00:00
hendricks266 f51bdc2faa Slight makefile reorganization and cleanup.
* Centralize optimization strategies in Makefile.common. This required moving detection of $(PLATFORM), which makes sense if we work on the paradigm that Makefile.common is for generic compiler setup and Makefile.shared works with libraries and things closer to the engine and game code itself.
* New Makefile variables OPTOPT (Optimization Options) and CUSTOMOPT (Custom Optimizations). OPTOPT by default contains -march, -mtune, etc. Setting this variable from Make invocation will blank these. CUSTOMOPT (Custom Optimizations) works the same but in an additive fashion, overwriting nothing. Technically CUSTOMOPT could stand for (Custom Options) and include any additional parameters sent to both linker and compiler.
* Factor out literal names of the main executables.
* The build process now prints assembler (if NOASM=0) and linker settings in addition to compiler settings.

git-svn-id: https://svn.eduke32.com/eduke32@3096 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:26:25 +00:00
Plagman 67c7d67166 polymer: only let emitshadow affect shadows, not lightmaps.
Lightmaps are already opt-in anyway.

git-svn-id: https://svn.eduke32.com/eduke32@3093 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-21 18:41:09 +00:00
Plagman e726484ccc polymer: add support for negative lights
And hook them up to cstat 128 (half-submerged, 'c' in mapster).

git-svn-id: https://svn.eduke32.com/eduke32@3092 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-21 04:52:43 +00:00
Plagman 9d10b0b087 polymer: add a prlight flag to make shadow-less spotlights
And hook it up to SE cstat 64 ('1' in mapster32). This disables both lightmaps
and shadow maps for the spotlight; please let me know if you have a usecase
where you want lightmaps but no shadow maps for specific lights.

git-svn-id: https://svn.eduke32.com/eduke32@3091 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-21 03:41:13 +00:00
terminx c04bae8c13 Oops! Fix MinGW build issue caused by ripping out nedmalloc
git-svn-id: https://svn.eduke32.com/eduke32@3087 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-15 00:38:41 +00:00
terminx a5f479787f Remove built-in copy of nedmalloc and update nedmalloc.dll. Note that the built-in copy of nedmalloc hasn't been updated or enabled in a really long time as modern system allocators (Windows 7 and Linux 3.x at least) are no longer consistently beat by nedmalloc (but nor are they consistently faster). So, the dll remains for users of Windows XP because it may still improve performance there (while not likely degrading it on Vista/7).
git-svn-id: https://svn.eduke32.com/eduke32@3086 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-15 00:17:30 +00:00
terminx ca46dc76ec Move the Windows screen size based aspect ratio determination code down farther into the initialization and change the printed message to only appear when the calculation fails
git-svn-id: https://svn.eduke32.com/eduke32@3085 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 22:22:03 +00:00
helixhorned d5f7e5becf Texel-granular hitscan() for wall-aligned sprites.
The attribute is set per tile from DEF: either
    texhitscanrange <begintile> <endtile>
or
    tilefromtexture <tile> { ... texhitscan ... }
(As a special case, the list may only contain "texhitscan", in which case the
texture is not changed.)

In passing, do some cleanup for "tilefromtexture" DEF parsing: the list tokens
should now be accepted in any order, and errors don't appear in the middle of
the list parsing.

git-svn-id: https://svn.eduke32.com/eduke32@3078 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:34 +00:00
terminx 521ee43173 Fix setting r_pr_maxlightpasses from .cfg at startup
git-svn-id: https://svn.eduke32.com/eduke32@3070 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 14:51:29 +00:00
terminx f7ed6f47de Prevent Windows "case mismatch" spam when loading files from disk with the Windows Explorer "hide extensions for known file types" option enabled. This simply changes the relevant Bstrcmp() calls to Bstrncmp() calls instead, using the length of the string returned by SHGetFileInfo() as the number of bytes to compare.
git-svn-id: https://svn.eduke32.com/eduke32@3068 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-13 14:53:26 +00:00
helixhorned 5b311f98cc Clean up redundant/local function declarations in build.c.
git-svn-id: https://svn.eduke32.com/eduke32@3061 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:17 +00:00
helixhorned 36687ab986 Lunatic-m32: take over load path.
git-svn-id: https://svn.eduke32.com/eduke32@3059 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:09 +00:00
helixhorned 04a542f1b3 On non-{Windows, OS X}, don't link to libpng when PNG support is not requested.
git-svn-id: https://svn.eduke32.com/eduke32@3050 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-03 15:29:07 +00:00
helixhorned 9d0bffebde Mapster32: factor out some code (3x) into GetSaveBoardFilename().
git-svn-id: https://svn.eduke32.com/eduke32@3046 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:44 +00:00
helixhorned 54167d4c7e Factor out prepare/finish parts from load{old,}board(), misc. cleanup.
This means that loadoldboard() now should also initialize Polymer map
info after loading a v5/v6 map.  Make the variables holding a file descriptor
an int32_t instead of int16_t.

git-svn-id: https://svn.eduke32.com/eduke32@3044 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:37 +00:00
helixhorned 7efc08a919 Rip out v5/v6 map definitions and routines into src/engine_oldmap.h.
git-svn-id: https://svn.eduke32.com/eduke32@3043 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:34 +00:00
helixhorned 9128e8af04 For loadboard() and friends, pass a vec3_t position instead of separate x/y/z.
git-svn-id: https://svn.eduke32.com/eduke32@3042 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:30 +00:00
helixhorned f10bfb6774 A bit stylistic Polymost code cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@3041 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:25 +00:00
helixhorned b3daea46d6 Add compilation switch MODEL_OCCLUSION_CHECKING to polymost.h, leave it enabled.
git-svn-id: https://svn.eduke32.com/eduke32@3040 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:22 +00:00
helixhorned 735d1ed77e Remove last argument from yax_getneighborsect(), make radarang[] engine.c-local.
git-svn-id: https://svn.eduke32.com/eduke32@3039 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:18 +00:00
helixhorned 2ab247b68a A couple of inside()-related cleanups.
- make inside_editor() static in build.c
- replace comparisons of inside()'s return values with 0 by ones with 1
  (since a returned 0 can mean -1 or 1, i.e. oob sector or is really inside)
- prevent a theoretically possible oob access in correct_ornamented_sprite()

git-svn-id: https://svn.eduke32.com/eduke32@3038 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:13 +00:00
helixhorned d4ff4c4595 Clean up updatesector* family, no functional changes.
- factor out the "is inside" predicates
- rename updatesector_onlynextwalls() -> updatesectorbreadth()
- add ATTRIBUTE((nonnull(4))) to the bitmap arg of updatesectorexclude().

git-svn-id: https://svn.eduke32.com/eduke32@3037 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:09 +00:00
terminx ead8204e1e Fix a.masm changes so MSVC builds work again. The relevant functionality seems to work (non-power of 2 textures drawn without error), even with CLASSIC_NONPOW2_YSIZE_WALLS defined in engine.c, but I'm not familiar with any corner or edge cases that need to be watched out for with this.
Note: CLASSIC_NONPOW2_YSIZE_WALLS is still not enabled in svn.


git-svn-id: https://svn.eduke32.com/eduke32@3035 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-30 14:40:42 +00:00
helixhorned ede713af62 engine.c: Split CLASSIC_NONPOW2_YSIZE into _WALLS and _SPRITES, enable the second
git-svn-id: https://svn.eduke32.com/eduke32@3034 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-28 15:20:13 +00:00
helixhorned beb47f47b5 Port non-pow2 ysize texture mapping routines to MASM, untested.
It's mostly taking over the NASM code, with a couple of changes:
- declarations for externals and globals are slightly different
- the masm seems to have e.g. "dword ptr [...]" where the nasm has only
  "dword [...]", though the masm also has a couple of the latter. The "ptr"
  modifier seems kinda redundant to me, but I added it to every indirection
  anyway.

git-svn-id: https://svn.eduke32.com/eduke32@3033 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-28 15:20:10 +00:00
helixhorned ddc22ee395 a.nasm: add 'dword' to some stores in the nonpow2 routines for consistency.
git-svn-id: https://svn.eduke32.com/eduke32@3032 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-28 15:20:07 +00:00
helixhorned 52ed3e1a66 engine.c: add compilation switches for non-pow2 ysize functions, disable for now.
Previously, we used them in our builds for sprites, but MSVC builds don't have
the ASM ported to MASM, and thus the workaround of ignoring the linking errors
was not safe.

git-svn-id: https://svn.eduke32.com/eduke32@3031 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-28 15:20:03 +00:00
helixhorned 5957e0f143 Revert "Abyss crash prevention code", but make the overflow explicit.
git-svn-id: https://svn.eduke32.com/eduke32@3028 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-26 22:53:53 +00:00
helixhorned aba1ce9e7f Disable spot lights on ATI cards, fixing the recent crashes with Catalyst 12.8.
git-svn-id: https://svn.eduke32.com/eduke32@3027 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-24 21:09:37 +00:00
helixhorned 94ebe8211b Revert r2223's removing of bit 1 making it to setbrightness(), now a noop.
Hendricks found a bug caused by that commit, so this one enables exprimentation
with setbrightness() bit 1 behavior.

git-svn-id: https://svn.eduke32.com/eduke32@3025 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-24 21:09:31 +00:00
helixhorned 7e05f5884c With SDL 1.2 builds, make the profiling be cancelable by pressing any key.
git-svn-id: https://svn.eduke32.com/eduke32@3022 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-15 15:28:30 +00:00
helixhorned 95d11b9703 Add a profiling option to the 'demo' OSD command.
See the comment in source/osdcmds.c for instructions on its usage.

git-svn-id: https://svn.eduke32.com/eduke32@3021 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-15 15:28:26 +00:00
helixhorned 6389874b5d Fix aspect determination from showview in fullscreen mode.
This makes the splitscreen mod not have a ridiculous view distortion.
Such scenes will have no correction for non-square pixels, though.

git-svn-id: https://svn.eduke32.com/eduke32@3020 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-15 15:28:21 +00:00
hendricks266 8990017700 Add detection of Windows 8 and Server 2012 to win_printversion().
git-svn-id: https://svn.eduke32.com/eduke32@3018 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-13 07:07:54 +00:00
helixhorned 22a4eaaf3d __fastcall int32_t getangle -> int32_t fastcall getangle. Might fix MSVC build.
git-svn-id: https://svn.eduke32.com/eduke32@3012 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-12 09:47:26 +00:00
helixhorned 06a64b8dd4 OSD command 'map': entering a name with a '*' wildcard lists those that match.
A new function maybe_append_ext() is added to common.c and used in the handling
of the -d<demo.edm> cmdline parameter and the 'map' OSD command with one
non-wildcard arg.  (It's slightly different from the way the extension was
maybe-appended previously.)

git-svn-id: https://svn.eduke32.com/eduke32@3004 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:31 +00:00
helixhorned 9311432cbf Fix crash when recording demo, stooping it, going to title screen, and exiting.
A macro MAYBE_FCLOSE_AND_NULL(fileptr) is introduced in compat.h that does
what it says.

git-svn-id: https://svn.eduke32.com/eduke32@2995 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:31 +00:00
helixhorned 202d544f14 compat.h: tweak indentation of some preprocessing directives.
git-svn-id: https://svn.eduke32.com/eduke32@2992 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:13:06 +00:00
helixhorned 72b73f6356 Make getangle() a __fastcall function instead of static inline.
This trims four 4k pages of code from the release EDuke32 build and
one page from Mapster32.

git-svn-id: https://svn.eduke32.com/eduke32@2991 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:12:01 +00:00
helixhorned 1fdc464568 In dosetaspect(), bail out calculating radarang2[] instead of failing assertion.
When this happens, parallaxmodes other than 0 will be unavailable and silently
draw as parallaxmode 0.  This usually happens with extremely wide resolutions.

git-svn-id: https://svn.eduke32.com/eduke32@2990 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:10:55 +00:00
helixhorned ee39d713e8 Calculate sine and arctan tables, getting rid of TABLES.DAT dependency.
We're pulling stuff from math.h even in non-GL builds right now, so
adding libc's sin() and atan() doesn't seem like a big deal.  In the
unlikely event that their accuracy is so bad that the calculated tables
don't match the original ones, a warning is issued on little-endian
platforms.

git-svn-id: https://svn.eduke32.com/eduke32@2988 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:08:43 +00:00
helixhorned 5bca5f59ad Move #define PI from to build.h, add bound-checking assertion in dosetaspect().
git-svn-id: https://svn.eduke32.com/eduke32@2987 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:07:36 +00:00
helixhorned 52bb35361b Some [U]INT_MAX --> [U]INT32_MAX.
git-svn-id: https://svn.eduke32.com/eduke32@2986 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:06:30 +00:00
helixhorned 7f74880c96 Move #include <math.h> from polymer.h to polymer.c.
git-svn-id: https://svn.eduke32.com/eduke32@2985 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:05:23 +00:00
helixhorned b8ed142c6b Remove some #if 0 blocks that are probably of no interest any more.
For reference, they are the following:
 - cache1d.c: suckcache()
 - build.c: compare_wall_coords()
 - make switch-invisible heuristic
 - Mapster32: old sprite search
 - Mapster32: manual z range
 - m32script: read/writearray, qgetsysstr
 - menus.c: savetemp()

git-svn-id: https://svn.eduke32.com/eduke32@2981 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:00:58 +00:00
helixhorned 8efcc81096 Remove some unneeded NULL checks.
Found by http://coccinelle.lip6.fr/rules/notnull.cocci

git-svn-id: https://svn.eduke32.com/eduke32@2978 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 13:57:39 +00:00