Commit Graph

1152 Commits

Author SHA1 Message Date
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
hendricks266 574f83dc76 The Build tools no longer link with SDL or SDL_mixer because they don't need to.
Fix for: http://forums.duke4.net/topic/5392-mkpalette-fails-to-build/page__view__findpost__p__132791

git-svn-id: https://svn.eduke32.com/eduke32@2974 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-27 03:51:17 +00:00
helixhorned 41f2535e91 engine.c: rewrite nextsectorneighborz() for clarity.
git-svn-id: https://svn.eduke32.com/eduke32@2969 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-26 22:15:02 +00:00
helixhorned 948a716229 Mapster32: for c&p-ing map portions w/o TROR, fix wrongly resetting wall lotag/extra
git-svn-id: https://svn.eduke32.com/eduke32@2965 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-26 22:10:40 +00:00
helixhorned acdb7c139c Mapster32: for copy-pasting map portions without TROR, fix wrongly resetting xpanning.
This is really an artifact of overloading the sector fields for different uses.
For copy-pasting TROR'd portions, the bug still persists.

git-svn-id: https://svn.eduke32.com/eduke32@2963 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-26 22:08:27 +00:00
helixhorned 1f5971a4db If r_screenaspect is 0 (or any other invalid value), assume square pixel aspect.
git-svn-id: https://svn.eduke32.com/eduke32@2959 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-24 18:51:49 +00:00
helixhorned a53e9b60d8 Keep full-screen tints through palette changes again.
A debug macro to test tints being stuck at the least intense non-zero value
is provided in engine.c.

git-svn-id: https://svn.eduke32.com/eduke32@2952 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-22 22:46:09 +00:00