Commit Graph

1119 Commits

Author SHA1 Message Date
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
helixhorned 13178b7cda Mapster32: properly reset highlights in undo/redo.
git-svn-id: https://svn.eduke32.com/eduke32@2943 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:27:42 +00:00
helixhorned eba4a3b722 Mapster32: with highlighted sectors, print rot. angle; Alt + [,]: manual angle.
Because rotating sectors "smoothly" by 1 BUILD ang will quickly accumulate
roundoff error, this lets the user first do that as a preview and then use the
manual angle rotation do carry it out for real.

git-svn-id: https://svn.eduke32.com/eduke32@2942 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:26:36 +00:00
helixhorned 6ed50e7170 Mapster32: use the rotatepoint code for both smooth and 90-degree sect. rotation.
git-svn-id: https://svn.eduke32.com/eduke32@2941 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:26:00 +00:00
helixhorned 28cc08a65f Fix two "may be used uninitialized" warnings (they can't, as far as I can see).
git-svn-id: https://svn.eduke32.com/eduke32@2937 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 13:02:47 +00:00
helixhorned dc3a523eed Fake multi: fix display of item percentage and on/off states.
git-svn-id: https://svn.eduke32.com/eduke32@2935 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 13:02:37 +00:00
helixhorned 99160ede88 Introduce additional rotatesprite bit for internal use and mask ext. ones from CON.
ROTATESPRITE_MAX is moved to build.h and all orientation bits from CON commands
using rotatesprite are ANDed with (ROTATESPRITE_MAX-1).  Some of the functions
use ROTATESPRITE_MAX for different internal purposes, which will not be exposed
to CON now (a good thing).  Also, dorotspr_handle_bit2 is made clearer.

git-svn-id: https://svn.eduke32.com/eduke32@2929 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:57:57 +00:00
helixhorned 88eb1fac78 Clean up a couple of rotatesprite uses.
The black translucent background underneath the user map list will now
be drawn with a shade 32 tile 0 instead of tile BLANK, since I've seen
the latter being replaced in some mod. Also, it will look the same
regardless of screen aspect.

git-svn-id: https://svn.eduke32.com/eduke32@2928 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:56:51 +00:00
helixhorned b07b540c0b Restucture dorotspr_handle_bit2().
This also fixes the OSD with aspects < 4/3. I broke that, too.

git-svn-id: https://svn.eduke32.com/eduke32@2927 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:55:45 +00:00
helixhorned df591aba1c mdsprite.c: factor out two instances of identical code.
git-svn-id: https://svn.eduke32.com/eduke32@2922 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:52:10 +00:00
helixhorned 60a03c2fb3 Clean up handling of widescreen bits in dorotatesprite functions.
Don't call setaspect from them, because the only thing that's needed is
(in classic) yxaspect and xyaspect.  Pass these from the helper function
defined earlier instead.

git-svn-id: https://svn.eduke32.com/eduke32@2921 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:51:04 +00:00
helixhorned 020f261015 Clean up polymost_dorotatesprite a little (triv. changes only)
git-svn-id: https://svn.eduke32.com/eduke32@2919 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:49:37 +00:00
helixhorned aadfd49435 In polymost_dorotatesprite, don't set [xy]dimen to [xy]dim temporarily.
This fixes stuff like the HUD chaingun with widescreen and small "screen sizes"
(in-game viewport). It also makes rotatesprite behave more like classic overall.
I have no idea why it was there in the first place.

git-svn-id: https://svn.eduke32.com/eduke32@2918 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:48:31 +00:00
terminx 71fc24c0f7 OpenBSD build fix from Brad Smith (plus a couple of irrelevant changes to the same file from my local tree)
git-svn-id: https://svn.eduke32.com/eduke32@2916 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 04:01:04 +00:00
helixhorned 786df72c6d In setaspect_new, determine the aspect with {x,y}dim again except for showview.
setaspect(), which is called by setaspect_new, already uses the *dimen variables,
so it's the same thing done twice.  Now, a change from the original full status
bar to the original mini status bar keeps the horizontal FOV again and only
bumps the view a little higher, as with the classic aspect determination.

git-svn-id: https://svn.eduke32.com/eduke32@2913 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:56 +00:00
helixhorned ecf277c70e Factor out Polymost's widescreen bit handling code and use it in classic, too.
This means that classic and the GL modes now look the same as far as e.g.
hud_bgstretch or HUD weapons are concerned.

git-svn-id: https://svn.eduke32.com/eduke32@2911 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:50 +00:00
helixhorned 08260dbf25 polymost.c: rewite widescreen bit code, part 2.
Use integer math; both args to setaspect are constant.

git-svn-id: https://svn.eduke32.com/eduke32@2910 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:46 +00:00
helixhorned 20ccab9022 Clean up classic's and Polymost's dorotatesprite functions (triv. changes only)
git-svn-id: https://svn.eduke32.com/eduke32@2909 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:44 +00:00
helixhorned 8ac85eef54 polymost.c: rewrite dorotatesprite's widescreen bit handling (256,512,1024).
Instead of setting and resetting the [xy]dim globals, use them as locals
in a block (shadowing the globals).  Also, do some common subexpression
elimination for clarity.

git-svn-id: https://svn.eduke32.com/eduke32@2908 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:41 +00:00
helixhorned 2913ee5211 Clean up build.h and status bar drawing code in game.c.
git-svn-id: https://svn.eduke32.com/eduke32@2896 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:08 +00:00
helixhorned d6e0009ec0 engine: in setaspect_new, determine the aspect with {x,y}dimen instead of {x,y}dim.
That is, use the view boundries instead of the whole screen.

git-svn-id: https://svn.eduke32.com/eduke32@2894 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:26:16 +00:00
helixhorned 2b2be071d4 High-level TROR drawing: clean up how things are passed around.
git-svn-id: https://svn.eduke32.com/eduke32@2880 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:37 +00:00
helixhorned 4dca439d8f Text-repl.: hitinfo variables -> hit, hit{sprite,sect,wall} members -> no "hit"
This makes the code rather more readable in some places.  Unlike the two
preceding commits, this one is actually purely textual replacement.

git-svn-id: https://svn.eduke32.com/eduke32@2877 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-10 19:12:01 +00:00
helixhorned 8f61b72ca2 Mapster32: add "extend all highlighted sectors" func to 'F menu via a.m32.
git-svn-id: https://svn.eduke32.com/eduke32@2866 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-06 20:00:35 +00:00
helixhorned 569f0dbe7c sdlayer.c: Add high-resolution timer for OS X, using mach_absolute_time().
git-svn-id: https://svn.eduke32.com/eduke32@2861 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:41 +00:00
helixhorned b7cfd2fe2c Lunatic: fix build on OS X, pass LUNATIC define to build/ sources.
git-svn-id: https://svn.eduke32.com/eduke32@2860 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:38 +00:00
helixhorned e7d3dcba78 gethitickms(): replace division by multiplication.
git-svn-id: https://svn.eduke32.com/eduke32@2856 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:25 +00:00
helixhorned 19d426ba02 OSX build: mighty tweak osxbuild.sh and link to LibPNG from Fink on x86_64.
The build script now has two more presets: helix and installtools
(which was previously attempted after the build; untested). Also,
 - when detecting git, run commands such that the SVN repo isn't accessed
 - package kextract, kgroup and arttool into tools/ in the zip
 - try to exit on failure in some places, though that doesn't seem to work

git-svn-id: https://svn.eduke32.com/eduke32@2852 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-29 23:35:12 +00:00
helixhorned 109457994e Classic: on x86 GCC asm builds, fix crash with floor sprites of (x or y) size 2.
The idiv instruction also signals an FPE when the resulting *signed* quotient
overflows, so we simply use div instead.

git-svn-id: https://svn.eduke32.com/eduke32@2850 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-29 12:46:56 +00:00
helixhorned 568f213de8 Add gethitickms() to the Windows layer.
git-svn-id: https://svn.eduke32.com/eduke32@2848 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-25 18:56:15 +00:00
helixhorned 49ab0eb6e9 PNG screenshots: fix oob read of malloc'd mem on Windows.
These could manifest themselves as garbage lines on the bottom and
happened because of the ydim vs. bytesperline discrepancy again.

git-svn-id: https://svn.eduke32.com/eduke32@2844 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:56 +00:00
helixhorned 2a2f56f510 Add custom-built lean zlib and libpng and enable PNG screenshots on Windows.
Instructions on how I built the libs are in Windows/src/minipng.dfa.

git-svn-id: https://svn.eduke32.com/eduke32@2843 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:53 +00:00
helixhorned b47c18518f Lunatic: time every event and actor call and print summary at game exit.
git-svn-id: https://svn.eduke32.com/eduke32@2842 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:44 +00:00
helixhorned a17cdd9d95 Polymer: fix underwalls being not animated (introduced in r2823).
git-svn-id: https://svn.eduke32.com/eduke32@2835 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-15 09:23:58 +00:00