Commit Graph

3224 Commits

Author SHA1 Message Date
helixhorned 50b6e4acac Guard macros.h by #ifndef/#define, remove two decls of nonexistent functions.
In jmact/mathutil.h: FindDistance3D_HP() and ArcTangentAppx().

git-svn-id: https://svn.eduke32.com/eduke32@3224 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:18:36 +00:00
hendricks266 8d2599cba1 Fix r3221: move the nedmalloc.h include to winbits.c.
git-svn-id: https://svn.eduke32.com/eduke32@3223 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 08:50:16 +00:00
hendricks266 9ebcbc1489 Replace SDL icons, freshly generated using GIMP 2.6.11.
The code has been factored. Additionally, 32x32 is used on Windows with SDL_MAJOR_VERSION==1, while 48x48 is the default.

See: http://www.libsdl.org/cgi/docwiki.cgi/SDL_WM_SetIcon

git-svn-id: https://svn.eduke32.com/eduke32@3222 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 04:27:13 +00:00
hendricks266 5e0ffb93b3 RENDERTYPE=SDL on Windows, part 2.
This introduces winbits.[ch] in the engine, containing layer-independent code migrated from winlayer, including nedmalloc, ebacktrace1, OS version detection, and high-resolution profiling timers.

sdlayer has been expanded to include the code from winbits under _WIN32.

All uses of RENDERTYPEWIN in the source have been examined and changed to _WIN32 (or removed) where the block in question is layer-independent.

git-svn-id: https://svn.eduke32.com/eduke32@3221 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 04:26:37 +00:00
hendricks266 9a75f0b88c Factor G_MultiPskyInit into common.c.
git-svn-id: https://svn.eduke32.com/eduke32@3220 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 04:25:31 +00:00
hendricks266 be899ba3af For novelty, add support for RENDERTYPE=SDL under Windows.
This needs improvements to bring it up to par with winlayer, but it is functional. In particular, a good amount of code from winlayer could be used for both layers, including the profiling timers, the version printing code, and the hInstance and hModule sharing.

Known problems: the mouse cursor is not trapped, and the game starts before the startup window shows options.

git-svn-id: https://svn.eduke32.com/eduke32@3219 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:13:29 +00:00
hendricks266 1f0693eca4 Implement OGG looping support; musicians rejoice!
Loops are controlled by two tags in the Vorbis Comment, both in PCM samples.

LOOP_START holds the beginning of the loop, the position to which playback returns at the end of the loop.

LOOP_END is optional; it holds the end of the loop, after which the game seeks to LOOP_START. If undefined, the end of the OGG is the end of the loop. The primary purpose of LOOP_END is if you want to give your file a proper ending for listening outside the game.

To preview a looped OGG you have assembled, give it a ".logg" extension and play it using the vgmstream plugin for Winamp or foobar2000.

git-svn-id: https://svn.eduke32.com/eduke32@3218 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:12:15 +00:00
hendricks266 6c59071155 Stop all sounds after completion of LOGO.ANM.
git-svn-id: https://svn.eduke32.com/eduke32@3217 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:11:50 +00:00
hendricks266 f8b2b9088c Allow CAMERA1 to have cstat 32768.
git-svn-id: https://svn.eduke32.com/eduke32@3216 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:11:30 +00:00
hendricks266 fd06052a1d Fix ebacktrace1.dll build with MinGW-GCC 4.7.2.
git-svn-id: https://svn.eduke32.com/eduke32@3215 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:11:06 +00:00
terminx 1fb8684bef Factor out duplicate code in CONTROL_BindKey/CONTROL_BindMouse/CONTROL_FreeKeyBind/CONTROL_FreeMouseBind
git-svn-id: https://svn.eduke32.com/eduke32@3214 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-20 01:33:25 +00:00
terminx f9ba5f827c Relocate Bstrncpyz to the bottom of compat.h so we can use our Bstrncpy macro there
git-svn-id: https://svn.eduke32.com/eduke32@3213 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-20 01:33:22 +00:00
helixhorned d5fa8ade49 build.lua: provide simplistic "readdefs()", use in foreachmap.lua.
So that symbolic tile names can be used when searching maps.

git-svn-id: https://svn.eduke32.com/eduke32@3212 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-18 19:01:39 +00:00
helixhorned 1009e0f2ec Remove many redundant (int16_t) casts and one now incorrect one.
The redundant ones are in code like this: s->cstat = (int16_t)32768;
Because the value is eventually converted to the type of "s->cstat", any
casts to integral types having at least as many bits are no-ops, signedness
being irrelevant due to (probably any two's complement arch targeting
compiler's) bit-pattern preserving semantics of these conversions.

The now incorrect one is: if (lotag == (int16_t) 65535),
"int32_t lotag" being read from a wall or sprite struct directly earlier.
Now, with these members being unsigned, and (int16_t)65535 equalling -1,
the check always fails.  The correction fixes normal switches having such
a lotag ending the level immediately.

In short: integer casts before assignments are unnecessary, those in reads
highly relevant!

git-svn-id: https://svn.eduke32.com/eduke32@3211 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-18 19:01:34 +00:00
helixhorned 0153853024 Correct arithmetic comparisons of lo/hitags in actors.c.
Rewriting them in the obvious way, i.e. by casting the expression
to int16_t first.  (That is, this commit is the reverse of r3174,
but with casts applied.)  This fixes at least one regression: a
FIREEXT with a hitag of 0 should not be linked with same-
(that is, zero-) tagged SEENINEs or OOZFILTERs.
Mind the corner cases!

git-svn-id: https://svn.eduke32.com/eduke32@3210 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-18 19:01:29 +00:00
helixhorned d8cd41fa94 Fix bound keys' commands being truncated in settings.cfg, control* cleanup.
- provide functions instead of messing with CONTROL_*Binds directly
- comment out a few more unused functions
- make clear what memory (alloc'd or const char *) 'keybind' members use
- for keys with no name, use "<?>"

git-svn-id: https://svn.eduke32.com/eduke32@3209 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-18 15:44:18 +00:00
terminx 878e41c34b Fix a keyboard scancode oversight I introduced with my changes last night, apparently caused crashes
git-svn-id: https://svn.eduke32.com/eduke32@3208 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-18 00:07:44 +00:00
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 dd424fac70 Mapster32: fix cycling picnum in 3D mode.
Using non-keypad [-]/[+] or LMB + mousewheel, it was broken when a void
tile was in between.

git-svn-id: https://svn.eduke32.com/eduke32@3203 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:33 +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 29a8f245b8 Lunatic: update BUILD types with signed->unsigned changes of *stat.
git-svn-id: https://svn.eduke32.com/eduke32@3201 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:18 +00:00
terminx 83ae3a407a Further minor MACT cleanups
git-svn-id: https://svn.eduke32.com/eduke32@3200 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:48:11 +00:00
terminx bbbeefc6a1 Replace a few one line MACT mouse functions with macros that do the same thing
git-svn-id: https://svn.eduke32.com/eduke32@3199 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:48:05 +00:00
terminx f8a373cb70 Remove useless CONTROL_UserInputCleared. It was useless in the literal sense, e.g not actually used anywhere. :p
git-svn-id: https://svn.eduke32.com/eduke32@3198 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:48:02 +00:00
terminx 992de02101 Change key bindings to use dynamic allocation and remove the previous limit of 128 characters per key bind
git-svn-id: https://svn.eduke32.com/eduke32@3197 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:47:58 +00:00
terminx a5ee23215d Minor cleanups in MACT control.c
git-svn-id: https://svn.eduke32.com/eduke32@3196 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:47:53 +00:00
terminx 11a5000630 Rename a few variables we've added to MACT over the years to be more consistent with the rest of its naming conventions
git-svn-id: https://svn.eduke32.com/eduke32@3195 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:47:47 +00:00
terminx f779b53c0f Remove the xdelta3 files from the VS2010 project, too
git-svn-id: https://svn.eduke32.com/eduke32@3194 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-16 16:41:04 +00:00
terminx 2ab811cd9b Remove xdelta3 since it doesn't fit in with our current networking plans anymore
git-svn-id: https://svn.eduke32.com/eduke32@3193 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-16 15:40:28 +00:00
terminx ed464aaadc Add "ulotag" and "uhitag" to get/setactor/wall/sector, which exposes the tags unsigned, without the typecast to int16_t. This might be useful to someone.
git-svn-id: https://svn.eduke32.com/eduke32@3192 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-16 00:54:04 +00:00
terminx 51382ab19c Remove our old eduke32.vcproj as it hasn't been updated since whenever I switched to VS2010
git-svn-id: https://svn.eduke32.com/eduke32@3191 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 23:37:33 +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 3c651e0a53 CON: make lotag/hitag getters return signed values, as per agreement on IRC.
This means that the internal change done to these sprite members in r3159 is
hidden from CON for backward-compatibility purposes.  Note that .cstat and
.{ceiling,floor}stat aren't touched, and will return unsigned values to CON.

git-svn-id: https://svn.eduke32.com/eduke32@3189 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 21:10:02 +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 b5cead500a foreachmap.lua: add possibility of running code per s/w/s match with ':' shortcut
Also, add a missing "pragma pack(pop)" to build.lua.

git-svn-id: https://svn.eduke32.com/eduke32@3185 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 21:09:48 +00:00
terminx a46844e937 Add nedmalloc.h to the VS2010 project files
git-svn-id: https://svn.eduke32.com/eduke32@3184 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 16:44:15 +00:00
helixhorned 0a999d7a7e Mapster32: Fix clipboard tile display in 3D mode.
git-svn-id: https://svn.eduke32.com/eduke32@3183 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:55 +00:00
helixhorned 225294e8ce demo.c: time G_DoMoveThings() using a double instead of an int32_t.
I think this may fix some negative "non-profiled overhead" that I
have been seeing.

git-svn-id: https://svn.eduke32.com/eduke32@3182 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:53 +00:00
helixhorned 5f76f699b2 Bump BYTEVERSION.
git-svn-id: https://svn.eduke32.com/eduke32@3181 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:50 +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 6b01b43713 Split r3159..r3161, part 9: make CON's 'respawnhitag' unconditional on hitag.
... in the 'default' case (non-FEM* tiles).

git-svn-id: https://svn.eduke32.com/eduke32@3175 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:21 +00:00