Commit Graph

746 Commits

Author SHA1 Message Date
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
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
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 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 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
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 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 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 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 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 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
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 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 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 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 e02843b133 m32script: EVENT_DRAW3DSCREEN, screenshot functonality.
The event is run after drawing the scene, but before the overlays. To
make a screenshot from a script, set DOSCRSHOT to non-zero. It will then
be scheduled to run once after the drawing but before the above-mentioned
event.  The screenshots will be called mcapXXXX.{png,tga}.

git-svn-id: https://svn.eduke32.com/eduke32@2818 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:23 +00:00
helixhorned 6ed9241f0a Classic: fix glitches where stuff would be drawn transiently on sect change.
This was introduced with r2771, which fixed e.g. AMC TC city_si's mirrors,
but instructed the base drawrooms inside yax_drawrooms to not correct the
passed sectnum.  Therefore, stuff would get drawn wrongly when passing
sector boundaries, like from the platform to the rails in trueror1.map.

git-svn-id: https://svn.eduke32.com/eduke32@2810 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-06 15:36:46 +00:00
helixhorned 6c4c4fed15 Classic: add {,m,t}vlineasm1nonpow2, currently unreferenced from high-level drawing.
git-svn-id: https://svn.eduke32.com/eduke32@2806 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-06 11:27:46 +00:00
helixhorned bdedbc6f76 Constify various char* vars, parameters, etc. for more -Wwrite-strings cleanness
-Wwrite-strings is useful to detect code where string literals and e.g. alloc'd
strings are used side-by-side, potentially creating dangerous situations, or to
find uses of old, non-constified APIs.  However, enabling it would still flood
the log with too many warnings.  Also, GCC wrongly warns for initializations of
char arrays.

git-svn-id: https://svn.eduke32.com/eduke32@2796 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:33 +00:00
helixhorned 8a89c07261 editor: const char *scripthist -> char *, since it's alloc'd/freed
git-svn-id: https://svn.eduke32.com/eduke32@2795 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:25 +00:00
helixhorned 54721d7461 Make ksqrt take uint32_t, add helper function uint32_t uhypsq(int32_t,int32_t).
uhypsq calculates the hypotenuse using unsigned multiplication. This is
permissible since for arbitrary int32s a and b, the following holds in
two's complement arithmetic:
  (int32_t)((uint32_t)a * b) == (int32_t)((int64_t)a * b)
("Signed and unsigned multiplication is the same on the bit level.")

This fixes various overflows where wall lengths for walls of length > 46340
are calculated, but does not rid us of other overflows in the same vein
(usually dot products between vectors where one point is a wall vertex and
the other a position in a sector).

git-svn-id: https://svn.eduke32.com/eduke32@2791 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:14 +00:00
helixhorned 13a2f97a72 Relative-aligned non-flipped ceiling/floor texture alignment ([;]+[ENTER])
Flipped reference ceilings/floors aren't handled correctly yet.

git-svn-id: https://svn.eduke32.com/eduke32@2774 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-20 20:55:03 +00:00
helixhorned d8721f743e Factor out r2726' kopen4load checks into testkopen, closing opened files.
git-svn-id: https://svn.eduke32.com/eduke32@2752 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-11 20:35:47 +00:00
hendricks266 d3a3c74112 Massive menu input control revamp/cleanup/factor. (added: input.[ch])
New Wii control defaults for the Wii Remote + Nunchuk and the Classic Controller. This includes new code added just so that the Home key brings up the menu in-game, reducing the need for a USB keyboard.

On the technical side, raw joystick access (comparable to what is available for keyboard and mouse) is now present in jmact, on the game side. (added: joystick.[ch])

Using this new raw joystick access, I replaced tueidj's hack to map A and B to LMB/RMB and D-Pad Up/Down to the scrollwheel.

I made the menus more friendly to mouse and joystick browsing by adding and unifying checks and clears for various buttons and gamefuncs. In fact, the majority of the time spent on this commit was tracking down problems that appeared with the factoring and trying to understand the menu system and the way input checks are precariously executed.

In addition, "Press any key or button to continue" now truly means what it says.

As a result of incorporating proper raw access into control.c instead of it directly accessing the implementaiton, the program *may* no longer be affected by joystick input when it is out of focus. This follows the pattern set by the mouse, and I think this is a positive change.

A small bonus: In the classic/old keyboard preset, the key for Show_Console has been changed from '`' to 'C' because '`' is taken by Quick_Kick.

git-svn-id: https://svn.eduke32.com/eduke32@2728 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:11:22 +00:00
hendricks266 67ed6945fd The handling for grp, con, and def filenames has been massively cleaned up and factored into common.c. A new header, common_game.h, was created because common.h was placed in build/include (see r2542) and we need a common header for things that strictly should not be in the engine. RTS file names were also improved but some of the patterned changes were already made in r2420, and they were not factored because they are strictly part of the game, not the editor.
NAM and Napalm can now share their con, def, and rts files if the one for their respective game is not present because the con and rts files are identical.

Also, decapitalize two string literals missed in r2540.

git-svn-id: https://svn.eduke32.com/eduke32@2726 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:09:33 +00:00
hendricks266 19d9d0a71e Incorporate some use of Bfflush(NULL) in hopes to alleviate Wii configuration saving concerns.
git-svn-id: https://svn.eduke32.com/eduke32@2725 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:08:27 +00:00
helixhorned df105128cb Mapster32: Part 1 of ceiling/floor auto-alignment functionality.
Usage is from 3D mode only.  When a sector (or wall) is committed to the
clipboard, it (or the wall's sector) is saved, and is subsequently used
when auto-aligning [;-ENTER] another sector's ceiling or floor against the
reference one's.  This temp. sector is reset on any structurally modifying
operation except setting first walls; also, aligning extended ceilings or
floors is impossible as they use .*xrepeat internally.

The auto-alignment does not change picnums (this can be accomplished with
the ['+ENTER] combination), but copies the orientation bits 2^{2..6} to the
alignee.  Afterwards, if the reference is relative-aligned, it tweaks them,
so that every case where the two firstwalls are either parallel or perpendi-
cular is handled correctly.

It does not yet calculate the panning values.

git-svn-id: https://svn.eduke32.com/eduke32@2715 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:19 +00:00
helixhorned d1f9cb230c Throw a commented #define DEBUG_TEXTURE_NAMES into glbuild.h.
This is so that people know where to enable it. One day, all these
debugging switches ought to go into the Makefiles in one form or
another.

git-svn-id: https://svn.eduke32.com/eduke32@2714 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:15 +00:00
helixhorned 5b387f7a08 Introduce two convenient sprite iteration macros in build.h, add a few uses.
Defines SPRITES_OF(Statnum, Iter) and SPRITES_OF_SECT(Sectnum, Iter)
[The first is so that STAT_* can be substituted for Iter and it reads nicely.]

Usage should be self-explanatory, but one thing to keep in mind is that
the sprites that are iterated over MUST NOT be deleted.

git-svn-id: https://svn.eduke32.com/eduke32@2707 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-29 20:01:48 +00:00
helixhorned 2fc6e2e6b0 Various cleanup and rewrites.
- make allocatepermanenttile() return intptr_t
- the usual

git-svn-id: https://svn.eduke32.com/eduke32@2697 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-26 21:58:21 +00:00
hendricks266 d015c4acdc Mac OS X: Add correct default values for 'gameexecutable' cfg string so that the Mapster32 test feature works with .app bundles.
Note: You may encounter a crash if you try to test your map and Mapster32 is running fullscreen.

git-svn-id: https://svn.eduke32.com/eduke32@2684 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-20 07:24:28 +00:00
terminx ad2f6a6560 Update QuickLZ to 1.5.1 beta 7
git-svn-id: https://svn.eduke32.com/eduke32@2662 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-17 21:36:50 +00:00
helixhorned 2cef17641a A couple of misc. Wii changes.
- Make MAXXDIM and MAXYDIM macros be 860 and 490, respectively.  tueidj says
  max. screen size is 848x480, but there are oob access bugs in the classic
  renderer when running with the maximum possible resolution
- don't allocate additional sector/wall storage for Mapster (saves ~16k)
- Add ud.config.UseJoystick = 1 in config.c, but make it conditional on Wii
- remove one comment I no longer believe true, add one TODO comment

git-svn-id: https://svn.eduke32.com/eduke32@2645 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-06 20:23:20 +00:00
helixhorned 84e5fcdad8 Accumulated trivia, mostly "the usual".
Among other things, comment out very seldomly (or not at all)
used sprite member macros: SV, ZV, RX, RY, CX, CY, CD, PL.

git-svn-id: https://svn.eduke32.com/eduke32@2639 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-05 22:23:44 +00:00
helixhorned 7cdd9a04da Make the GAMMA_CALC macro use double instead of float and use it in menus.c.
git-svn-id: https://svn.eduke32.com/eduke32@2638 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-05 22:23:17 +00:00
helixhorned 68e6141c32 Patch adding Wii support by tueidj, part 10: sound and endianness changes
This part is a mixture of the original patch and my changes.  It seems like
tueidj had some trouble
 1) getting OGG to work, which is why it's conditionally compiled out
 2) struggling with endianness with the mixing routines?  This may be also
    due to him missing to define two others BIGENDIAN macros (our code is
    in need of cleanup there).  Note the change in jaudiolib/src/mix.c!

Because I added my share to this part, I might have actually broken sound
mixing on big-endian platforms.

git-svn-id: https://svn.eduke32.com/eduke32@2630 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:40:53 +00:00
helixhorned 410ffae3ab Patch adding Wii support by tueidj, part 9: build.h sector/wall/spr/... limits
On the Wii, V7 (i.e. original) map limits are used and the maximum screen size
is 1600x1200.

git-svn-id: https://svn.eduke32.com/eduke32@2629 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:40:24 +00:00
helixhorned 830f73a316 Patch adding Wii support by tueidj, part 6: mutexes
For the Wii, SDL's mutex functionality is used.  The implementation in the
original patch was wrong though, so this part required non-trivial changes.

git-svn-id: https://svn.eduke32.com/eduke32@2626 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:39:20 +00:00
helixhorned bc70806d32 Patch adding Wii support by tueidj, part 3: SDL-level mouse changes
This part adds support for an absolute pointing device.

git-svn-id: https://svn.eduke32.com/eduke32@2623 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:38:14 +00:00
helixhorned 133acaecae Patch adding Wii support by tueidj, part 1: assembly pragmas
The original patch was communicated to me by Hendricks, but since it didn't
apply cleanly (it's based on r2182) I took the liberty of slightly messing
with it for inclusion into EDuke32.

Info: http://wiibrew.org/wiki/User:Tueidj/Duke3D

This first part (which wasn't changed from the original patch) implements
scaling arithmetic and miscellaneous pragmas, some in PPC assembly and a part
of them in C.  Of some interest is the fact that the Wii processor apparently
lacks support for 64-bit integers, so divscale() uses floating-point math.

git-svn-id: https://svn.eduke32.com/eduke32@2621 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:37:32 +00:00
helixhorned 90144e1dcc Polymer: when drawing art sky, temporarily set texcoord s wrapping to clamping.
This properly fixes the unwanted vertical lines.

git-svn-id: https://svn.eduke32.com/eduke32@2606 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-10 20:14:52 +00:00
helixhorned 9a7d1ed1a5 A couple of less interesting changes.
- strip 'inline' from animateoffs() definition, remove declaration in build.h
- one min/max -> clamp
- one malloc/strlen/strcpy -> strdup

git-svn-id: https://svn.eduke32.com/eduke32@2592 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-05 19:49:54 +00:00
helixhorned b7df5ffa5f Big clean up in defs.c and related content. The usual stuff...
- factor out many identical checks in a convenient function; some messages
  may read slightly differently now and tile ranges may be handled more strictly
  (error out if one of the limits is invalid)
- factor out two instances of identical (up to one arg) code into
  tile_from_truecolpic
- factor out setting picsiz[] and stuff into set_picsizanm
- some checks
- Make "undefmodelof" non-functional and warn.
- in "animtilerange", if the tile difference is >= 64, error out since we
  can't store it in picanm[]

git-svn-id: https://svn.eduke32.com/eduke32@2588 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-04 18:58:19 +00:00
helixhorned b3f485a568 Move some debugging stuff out of compat.h into glbuild.h and common.h.
git-svn-id: https://svn.eduke32.com/eduke32@2586 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-04 18:57:42 +00:00
plagman 17d91781c5 Fix OpenGL screenshots with unaligned widths such as 1366
git-svn-id: https://svn.eduke32.com/eduke32@2579 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-01 04:24:57 +00:00
helixhorned 77918caf9c New helper function "char *dup_filename(const char *fn)" in common.h.
It allocates a buffer of size BMAX_PATH and copies the passed string into it.

git-svn-id: https://svn.eduke32.com/eduke32@2560 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:43:39 +00:00
helixhorned a7f6f3bacc Factor out different {clear,get}filenames definitions into fnlist_t + functions.
Don't actually replace the instances in the code now.
Additions in common.h:
 - fnlist_t, which combines CACHE1D_FIND_REC *finddirs, *findfiles and
   int32_t numdirs, numfiles
 - the FNLIST_INITIALIZER macro, which MUST be used for automatic variables
 - fnlist_clearnames, fnlist_getnames functions
 - G_LoadGroupsInDir, G_DoAutoload, two often-occurring uses of these

git-svn-id: https://svn.eduke32.com/eduke32@2555 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:41:57 +00:00
helixhorned d77e388522 Factor out eleven (!) instances of identical code into check_file_exist().
git-svn-id: https://svn.eduke32.com/eduke32@2554 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:41:39 +00:00
helixhorned e350502cd0 Add "static inline" helper function "Bstrncpyz" to compat.h.
git-svn-id: https://svn.eduke32.com/eduke32@2550 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:05:38 +00:00
helixhorned e7f091cd90 Factor out various instances of getatoken() into common.c.
Alongside, these make into into the header:
 - the 'tokenlist' type (a typedef'd struct)
 - the T_EOF and T_ERROR enumeration values

git-svn-id: https://svn.eduke32.com/eduke32@2549 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:05:23 +00:00
helixhorned b7495ef5bd Guard scriptfile.h with an #ifndef sentinel.
git-svn-id: https://svn.eduke32.com/eduke32@2548 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:04:59 +00:00
helixhorned 2cc9f751cd Add Bassert to compatibility macros/functions, currently only an assert wrapper.
git-svn-id: https://svn.eduke32.com/eduke32@2546 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:04:24 +00:00
helixhorned ebaf65951b Change input and return types of inline function clamp() from int to int32_t.
git-svn-id: https://svn.eduke32.com/eduke32@2545 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:04:06 +00:00
helixhorned ee5dd2cf32 Add common.[ch] which should be used for common non-engine types/functions/data.
As inauguration, move G_AddGroup, G_AddPath and struct strllist there.
The header is located in build/include, because in the future, code that resides
closer to (but is not strictly part of) the engine might need to be factored
into here.  The source file, however, is in the source/ directory.

git-svn-id: https://svn.eduke32.com/eduke32@2542 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:03:20 +00:00
hendricks266 fd71c5ef4c Build tools:
- Fix up and add building instructions for kmd2tool, getdxdidf, and makesdlkeytrans.
 - Add kmd2tool to "utils" build job.
 - Fix warning in and cross-platform building of generateicon.
 - Source and text cleanup!

git-svn-id: https://svn.eduke32.com/eduke32@2521 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-23 20:23:46 +00:00
helixhorned 51398ca749 Rename 'numpalookups' to 'numshades' internally.
git-svn-id: https://svn.eduke32.com/eduke32@2504 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-20 18:32:00 +00:00
helixhorned 359614df70 Input validation: guard makepalookup 'pal', 2dcol 'col'. Add one const.
git-svn-id: https://svn.eduke32.com/eduke32@2500 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 23:17:51 +00:00
helixhorned 020c60feec Port tvlineasm2 to C and enable transmaskvline2 code also for all-C builds.
With the same setup as before, a screen-filling translucent wall (with nothing
drawn behind it) renders at about 7 fps faster (from 60-something fps initially)

git-svn-id: https://svn.eduke32.com/eduke32@2498 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 23:17:17 +00:00
helixhorned e191a915f7 Port [m]vlineasm4 to C replacements and enable for solid and masked walls.
These two functions draw a vertical line 4 neighboring pixels at a time.
This gives a significant speed boost for a full screen solid and masked wall
scene for x86_64 (where we have plenty of registers), about 60 --> 76 fps.

git-svn-id: https://svn.eduke32.com/eduke32@2497 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 23:16:57 +00:00
hendricks266 cf2b9ec940 New "-clipmap" command-line switch to specify sector collision clip maps. This switch works in an additive fashion like -mx and -mh. _clipshape0.map through _clipshape9.map remain loaded by default.
Also, a very minor change in the con/def module code. (int --> int32_t)

git-svn-id: https://svn.eduke32.com/eduke32@2495 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 08:50:41 +00:00
hendricks266 3503a42a9a Buildtools: Add "unpackssi" and "Build Customization Suite" [Palette Importer/Extractor] (bsuite), both by JonoF. I have rewritten bsuite to use command-line arguments rather than a 16-bit real mode DOS UI. Both programs have had all warnings fixed and whitespace corrected.
git-svn-id: https://svn.eduke32.com/eduke32@2493 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 08:48:32 +00:00
helixhorned 5e1b3bd44b Re-enable Mapster32's undo/redo functionality.
git-svn-id: https://svn.eduke32.com/eduke32@2486 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-15 18:12:17 +00:00
helixhorned fbf0b9ea4f Include <assert.h> in compat.h.
git-svn-id: https://svn.eduke32.com/eduke32@2481 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 22:31:19 +00:00
helixhorned 4d4221d71f Continuously keep track of the number of sprites in the world.
New engine variable 'int32_t Numsprites', not yet saved into savegames
or mapstates. (The capitalization is to distinguish it from the often-used
'numsprites' locals or structure member names.
In the editor, get rid of updatenumsprites().

git-svn-id: https://svn.eduke32.com/eduke32@2478 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 22:30:24 +00:00
helixhorned 26dfddfaf0 Trivial stuff that got accumulated and not committed.
git-svn-id: https://svn.eduke32.com/eduke32@2471 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-13 20:07:40 +00:00
helixhorned b044502709 When deleting sprites, insert them at the tail (instead of head) of the freelist.
The major outside-visible change is that this fixes the sound cutoff bugs that
happened because newly-spawned sprites took the place of those whose sounds
had not yet finished playing.

Besides, there are these changes:
 - remove deletesprite{sect,stat}
 - we have a new engine variable 'tailspritefree' that keeps track of the
   sprite freelist tail
 - we need to store it in savegames and mapstates, so bump the savegame
   minor version

git-svn-id: https://svn.eduke32.com/eduke32@2470 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-13 20:07:17 +00:00
helixhorned 846214a164 Move insertsprite() and deletesprite() into engine.c instead of being inlined.
These operations aren't executed THAT often to warrant exposing four internal
functions.  Besides, I'll be hacking on them and need everything laid out
cleanly.  Should somebody complain, they can go change them to __fastcall or
something.

git-svn-id: https://svn.eduke32.com/eduke32@2465 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-13 20:05:51 +00:00
helixhorned b359d0dce9 engine cleanup: make pow2char and pow2long const, make voxlock static.
git-svn-id: https://svn.eduke32.com/eduke32@2463 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-13 20:05:20 +00:00
hendricks266 c5519e3fe8 More Build tools improvements:
- JFBuild ports: arttool, givedepth, and mkpalette
 - All viable tools are now built when 'make utils' is invoked, not just some
 - Revert "initprintf" hack of previous commit and replace it with "compat_tools.c"
 - Move Bstrtolower from baselayer.c to compat.c
 - Makefiles: Add start and finish messages for the tools
 - Makefiles: To prevent "-Wimplicit" from being passed to the C++ compiler, create $(*CONLYFLAGS)

git-svn-id: https://svn.eduke32.com/eduke32@2458 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-12 04:48:42 +00:00
hendricks266 858746d081 Fix JonoF's email address.
git-svn-id: https://svn.eduke32.com/eduke32@2456 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-12 04:47:04 +00:00
helixhorned af2f862c85 Remove YES and NO #defines from duke3d.h since they're giving warnings on OS X.
git-svn-id: https://svn.eduke32.com/eduke32@2450 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-11 17:37:25 +00:00
helixhorned 91c13a4ee6 cleanup: remove now unused B_ATTRIBUTE_USED macro.
git-svn-id: https://svn.eduke32.com/eduke32@2428 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-08 19:15:18 +00:00
hendricks266 5b76b7dbba Remove ATTRIBUTE((used)) from gotpic[] because it only served to generate warnings when using LTO.
git-svn-id: https://svn.eduke32.com/eduke32@2418 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-05 07:23:34 +00:00
helixhorned 9eae2b485a ATTRIBUTE((pure)) for Ptile2tile(), add a forgotten comment.
git-svn-id: https://svn.eduke32.com/eduke32@2412 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 20:14:18 +00:00
helixhorned 2dca87b80a Make 'double ghoriz' static in polymost.c.
git-svn-id: https://svn.eduke32.com/eduke32@2409 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 20:13:34 +00:00
helixhorned ef02682c94 Define strtoll to _strtoi64 on MSVC.
Usage of a search machine by Hendricks.

git-svn-id: https://svn.eduke32.com/eduke32@2394 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-01 23:36:11 +00:00
helixhorned fc9609928f Make 'dommxoverlay' and 'beforedrawrooms' static in engine.c.
git-svn-id: https://svn.eduke32.com/eduke32@2391 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-27 19:40:28 +00:00
helixhorned 8b7a4dab9b Define Batoi/Batol to strtol(...) in compat.h and use these when necessary.
That is, everyplace a user input is to be converted.  The only remaining
instance of atoi() is now atoi(s_buildDate).

git-svn-id: https://svn.eduke32.com/eduke32@2374 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-20 21:17:39 +00:00
helixhorned 80bd1bb4e4 engine: make neartag accept a sprite-blacklist function and use it in sector.c.
Internally, the last argument to neartag is now a pointer to a function
  int32_t (*blacklist_sprite_func)(int32_t i),
which is supposed to return 1 if sprite[i] should NOT be considered for hitting.

This is now used in the hard-coded neartag() calls in sector.c, but not in any
way in CON (there's neither a C blacklist function provided, nor is there a
possibility to define one in CON).  There, all sprites with picnums >=1 and <=10
(i.e. the effectors) will be blacklisted.  This remedies problems where such
sprites would get in the way of switches.

Note that a whitelist approach (only consider a predefined set, namely those
picnums which will be checked afterwards) has back-compatibility implications
since people may have used e.g. lotagged window sprites to cover a switch.

Also, the >=1 to <=10 range is [sic] (the static, not dynamic values are used),
since anyone redefining effector picnums is clearly out of their mind.

git-svn-id: https://svn.eduke32.com/eduke32@2373 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-20 19:54:24 +00:00
helixhorned 1ec1e3e45c Make neartag() return void instead of always 0.
git-svn-id: https://svn.eduke32.com/eduke32@2372 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-20 19:53:42 +00:00
helixhorned 165d291a48 Comment out unused dfread and kdfwrite functions in cache1d.c.
git-svn-id: https://svn.eduke32.com/eduke32@2362 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 22:15:04 +00:00
helixhorned 103a6e76f9 constify various cache1d and pragmas functions, some copybuf* -> memcpy/move.
The following functions have const qualifiers attached for the 'destination'
arguments: kdfwrite, dfwrite in cache1d.c and copybuf{byte,reverse,} in the
pragmas source or headers.  A couple uses of the latter ones were replaced
with calls to standard library functions.

git-svn-id: https://svn.eduke32.com/eduke32@2361 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 22:14:45 +00:00
helixhorned 0ef1721955 Mapster32: Fix extended ceiling/floor picnums taking on picnum 0 in Polymer.
The reason was that drawmasks(), which was where the resetting of the fake
RoR textures happened under Polymer, can be called from polymer_displayrooms()
when mirrors are present. I was assuming that drawmasks() was only ever called
after the 'main' drawrooms and that hence the sequence of fake RoR tile tweaking
was set, reset, set, reset, ... which it was not.
Now, do the resetting explicitly after every drawmasks() in the editor.

git-svn-id: https://svn.eduke32.com/eduke32@2350 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:25:42 +00:00
helixhorned 30e16fe7bb When loading a map in-game, clear TROR wall members corresponding to up/down links.
I find this cleaner for two reasons.  First, lotags won't get in the way of
neartag(), so that doors and switches near constrained TROR walls can be
pushed.  Second, this removes the information leak so that CON coders aren't
tempted to read that values directly before a proper API for that comes along.
When writing out a map in-game (e.g. with dndebug), restore the respective
members so that it can be loaded in the editor again.

git-svn-id: https://svn.eduke32.com/eduke32@2349 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:25:18 +00:00
helixhorned 15532fa96a Remove a couple of redundant declarations.
git-svn-id: https://svn.eduke32.com/eduke32@2330 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:45:38 +00:00
helixhorned 103ee7a40b rotatesprite(..., windowx1,windowy1,windowx2,windowy2) --> rotatesprite_win
git-svn-id: https://svn.eduke32.com/eduke32@2318 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 21:35:00 +00:00
helixhorned 1d0cb07167 Factor out four instances of identical code into M32_DrawRoomsAndMasks().
git-svn-id: https://svn.eduke32.com/eduke32@2314 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 21:33:52 +00:00
helixhorned 00b852fe37 EDuke32: When in menus, always draw a black (33%) translucent background.
Internally, there's a new function fade_screen_black() that implements the
fading more efficiently than calling rotatesprite for classic, and uses
tile 0 (assumed to have at least 64x32 size) in the GL modes.

The black background of the user map selector is still done with rotatesprite
and tile BLANK in every renderer.

git-svn-id: https://svn.eduke32.com/eduke32@2312 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 14:30:39 +00:00
helixhorned 99e08bf441 legibility improvements: rotatesprite(..., 0,0,xdim-1,ydim-1) -> rotatesprite_fs
git-svn-id: https://svn.eduke32.com/eduke32@2308 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-02 17:35:05 +00:00
helixhorned a6158ac3f6 Fix building with GCC 4.6 link-time optimization.
It looks like GCC doesn't honor the 'used' attribute with LTO. This is
"fixed" by declaring the variables in question with external linkage
(i.e. removing the 'static').  I consider such behavior a GCC bug, though.

git-svn-id: https://svn.eduke32.com/eduke32@2286 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-27 15:02:45 +00:00
helixhorned 98ffd6f00c Rearrange 'struct hicreplc_t' members so that no padding is inserted on x64.
git-svn-id: https://svn.eduke32.com/eduke32@2282 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:58:25 +00:00
helixhorned d95511ed1d Fix sprite[] access with indices > MAXSPRITES in Polymer model drawing code.
Internally, updateanimation() now takes a third parameter 'lpal'.

git-svn-id: https://svn.eduke32.com/eduke32@2277 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-22 17:18:49 +00:00
helixhorned 7a893b8ec4 minor engine cleanup.
- enclose glbuild.h in #idndef ... sentinels
- engine.c: remove unused variable 'pageoffset', make 'lastx' static
- formatting

git-svn-id: https://svn.eduke32.com/eduke32@2272 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 13:24:15 +00:00
helixhorned d0acd40ff8 Inreased debugging level for catching oob accesses to 'main' arrays.
If enabled, this makes the following arrays be allocated statically:
spriteext, spritesmooth, sector, wall, sprite, tsprite, while
necessarily disabling the clipshape feature (because it relies on
setting sector/wall to different malloc'd block temporarily).

To compile, pass DEBUGANYWAY=1 in addition to RELEASE=0 to 'make',
and it's really only useful with CC=clang, of course.

git-svn-id: https://svn.eduke32.com/eduke32@2270 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 23:17:34 +00:00
helixhorned a61052f807 Double MAXTILES to 30720, reduce EXTRATILES (models w/ custom pal skin) to 3840
I'm decreasing EXTRATILES because I feel that it's way overcommitted. It's the
max number of model-tiles that have their own skin for a certain palette,
like the slimer egg in the HRP.

git-svn-id: https://svn.eduke32.com/eduke32@2267 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:58:06 +00:00
helixhorned cd89fce9aa less trivial stuff
- fix one bound-checking line
- rewrite two lines in astub.c to potentially not overflow an int16
- make tiletovox[] an array of int16's

git-svn-id: https://svn.eduke32.com/eduke32@2266 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:57:46 +00:00
helixhorned 2e1e2345af trivial tweaks: make stuff static, remove unused stuff, formatting...
git-svn-id: https://svn.eduke32.com/eduke32@2265 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:57:22 +00:00
hendricks266 426ef1494e Add the 'yoffset' token to model definitions to allow models to compensate for ART tiles with large yoffsets, such as #603. Under normal circumstances the existing 'zadd' parameter should be used instead. Special thanks to Supertanker.
git-svn-id: https://svn.eduke32.com/eduke32@2264 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-17 04:31:59 +00:00
helixhorned 031da6280d Remove the allocache() allocation type for 'intptr_t *lookups'.
Always malloc that buffer.  This allows us to remove suckcache() from
cache1d.c, which I believe to be buggy (see comments in the source).

git-svn-id: https://svn.eduke32.com/eduke32@2261 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:39:59 +00:00
helixhorned 260bbc1f92 cleanup:
- 'whitecol' was defined in the engine and in build.c, use only the engine one
 - make cachesize, artsize, artversion static in engine.c
 - undo some formatting havoc presumably done by astyle

git-svn-id: https://svn.eduke32.com/eduke32@2260 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:39:38 +00:00
helixhorned 480690aa1d Fix the Polymer hitches first encountered with Parkade.
The cause was a combination of many factors. First, Polymer requires the
start-drawing position to be inside the sector to draw (deviations lead to
incorrect drawing).  This was violated by the game, because it interpolated
the current and next tic position without updating the sectnum, leading to
inconsistencies especially when passing through narrow sectors.  Polymer
worked around it by doing an updatesector() each frame, however this works
poorly for maps with overlapping geometry such as SoS or RoR.

The solution to this is to add a new engine function,
updatesector_onlynextwalls(), which searches the sectors (via nextsector)
in breadth-first fashion instead of from 0 to numsectors-1, like updatesector
does when it fails for the *immediate* nextwall neighbors.

Internally, the breadt-first search helpers are moved into the engine.

git-svn-id: https://svn.eduke32.com/eduke32@2256 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-14 14:48:30 +00:00
helixhorned a57b566c0b Add Makefile option to use the DMALLOC (debug malloc) library.
I didn't have much success in finding bugs using it, but it works
out-of-the-box on my setup, so it may be useful in the future.

git-svn-id: https://svn.eduke32.com/eduke32@2254 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:49:34 +00:00
helixhorned 80949930bd Temporarily disable the 'model thinning-out' feature intended to save memory.
It turns out that with model interpolation, out-of-bounds frame numbers may
be generated with thinned out models, so disable it until I can sort out
what's wrong with it.
Also, minor code cleanup.

git-svn-id: https://svn.eduke32.com/eduke32@2251 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:48:38 +00:00
helixhorned 7e6f712ad1 more internal cleanup...
the only visible change is that polymost_trytexcache (formerly two
instances of nearly duplicate code) now prints a diagnostic after
a cache miss.  The one that one is most likely to encounter is
"r_downsize doesn't match", meaning that this setting likely differs
between Mapster and the game.

git-svn-id: https://svn.eduke32.com/eduke32@2248 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:47:41 +00:00
helixhorned e3150b2801 a couple more trivial tweaks
git-svn-id: https://svn.eduke32.com/eduke32@2247 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:45:34 +00:00
helixhorned fa6f2d9ca2 md4.c/h: add consts to appropriate arguments
git-svn-id: https://svn.eduke32.com/eduke32@2246 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:45:08 +00:00
helixhorned 3095b09773 trivial formatting / removing of old cruft / adding comments
git-svn-id: https://svn.eduke32.com/eduke32@2244 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:44:35 +00:00
helixhorned a86dfe661b maint: make the following static in polymost.c:
- texcacheindex *firstcacheindex, *curcacheindex
 - trytexcache(), gloadtile_cached()
- Factor out duplicated code into clear_cache_internal()

git-svn-id: https://svn.eduke32.com/eduke32@2240 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:43:18 +00:00
helixhorned d5a934f9ba Trivial tweaks of setbrightness. Add an assertion that bits 1 and 4 are clear,
mainly.  Also remove setvgapalette() from source.

git-svn-id: https://svn.eduke32.com/eduke32@2224 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:35:44 +00:00
helixhorned b3474c75b2 Rewrite the savegame format in terms of the generic saving/loading system.
This makes savegames practically the same as the initial snapshot of a demo.
Saves are now named 'dukesavX.esv' (demos: 'edemoX.edm').
Additionally, many changes that couldn't/needn't be cleanly separated are added
with this commit:
 - make spriteext_t have the same size across 32/64 bit platforms (actor_t partially)
 - prevent saving/loading in MP games (it certainly didn't work and still doesn't)
 - it's time we start using assertions! Define NDEBUG for releasse builds.
 - reset savegame major and minor versions (we have a new magic string, so no conflict)

git-svn-id: https://svn.eduke32.com/eduke32@2207 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:34:06 +00:00
helixhorned b7aacd242a Fix shift by values greater than 31 in some voxel loading code.
git-svn-id: https://svn.eduke32.com/eduke32@2165 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:10:21 +00:00
helixhorned 775d652d7d Lunatic: more Makefile tweaks; spriteext
git-svn-id: https://svn.eduke32.com/eduke32@2148 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-04 18:09:50 +00:00
helixhorned bbc6db465e Mapster32: new cfg var 'glusememcache', the same as r_memcache cvar.
git-svn-id: https://svn.eduke32.com/eduke32@2145 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-03 13:13:28 +00:00
helixhorned 45bcc11f46 Batch-insertion of many points at once using line drawing and ENTER.
When having drawn N new points (and having one 'free') and pressing
ENTER, the N line segments between the new points are checked one by
one for intersection with every non-grayed-out wall and a wall vertex
is inserted at every intersecting point.  This may be viewed as a
prerequisite for a 'cutter' style tool.

git-svn-id: https://svn.eduke32.com/eduke32@2125 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:51:53 +00:00
helixhorned 39314586ac Somewhat largish commit with various keyboard tinkering for Mapster.
The main change consist of adding a key press (and release) callback
whose only purpose is to be used from m32script as EVENT_KEYPRESS.
When entering that event, the RETURN variable will be set to the
keystatus code of the key, and whether it was pressed or released can
be checked by looking at keystatus[] at that code (ifholdkey and
ifhitkey do this). The purpose of this, then, is to be able to remap
keys in a more general (and complicated) fashion than is possible with
the mapster32.cfg 'remap' option. Various other additions build around
this central one:

- add an example EVENT_KEYPRESS to a.m32, among other things emulating
  the keypad arrows with Alt-<normal arrows> for notebook convenience;
  disabled initially
- a.m32: set 'owner' with Alt-KP2: now Alt-Shift-KP2, because of
  collision with the above
- new m32script command: setkey <keycode>, setting keystatus[<keycode>]
  to 1 (note: may be restricted to use in EVENT_KEYPRESS only in the
  future)
- fix indexing an m32script array with a defined label, there used to
  be a 'not a gamevar' error instead
- add the following constant labels for some key codes:
  KEY_SCROLL, KEY_F1 .. KEY_F12

git-svn-id: https://svn.eduke32.com/eduke32@2122 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:51:06 +00:00
helixhorned 57e132a044 Remove after_handleevents_hook and its only user, the keystatus-level clearing
of SPACE and C when in side-view mode. Now, this is accomplished by checking
directly in the overheadeditor code.

git-svn-id: https://svn.eduke32.com/eduke32@2119 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:50:07 +00:00
helixhorned 997b3426b5 Remove the -nopause switch of r2108, since it didn't help at all.
git-svn-id: https://svn.eduke32.com/eduke32@2114 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-17 21:09:49 +00:00
helixhorned b2d789731a A couple of Mapster changes related to saving.
- new mapster32.cfg and OSD variable 'fixmaponsave_sprites', telling the
  editor whether to 'fix' the sprite sectnums on saving and entering 3D
  mode. Note that a) sprite sectnums are never fixed when 'script_expertmode'
  is enabled, as before, and b) sprites that have out-of-bounds sectnums
  are still fixed if a proper sector is found
- if saving and some sprite sectnums have thus been tweaked, inform the
  mapper on the status line and print the changes in the OSD
- fix update issue similar to an earlier one: when 'saving as', the astub.c-
  based file name is now updated too, so saving with Ctrl-S now saves into
  the one save with 'save as' (and not the old one)
- don't attempt to recheck wall pointers from scratch (when saving and running
  with -check) if it's a TROR map

git-svn-id: https://svn.eduke32.com/eduke32@2110 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-11 20:05:29 +00:00
helixhorned e18ef2ccc8 Oops. Revert the *alloc wrapping to catch them being called with bad values.
This was meant for debugging only.

git-svn-id: https://svn.eduke32.com/eduke32@2109 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-10 21:47:42 +00:00
helixhorned a67af55153 On Windows, add command-line switch -nopause, disabling the pause key.
Hopefully this fixes the periodic pausing/unpausing that a few people
have been experiencing.
Also fix build with GCC 3.

git-svn-id: https://svn.eduke32.com/eduke32@2108 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-10 21:47:26 +00:00
helixhorned 3690f25944 Fix the 'displayrandvar{var}' CON and m32script commands for environments
with RAND_MAX > 32767 (everything except Windows?). The 'displayrand' command
now returns values from 0 to 32767 inclusive, across all platforms.

git-svn-id: https://svn.eduke32.com/eduke32@2105 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-05 12:13:50 +00:00
plagman 9018359a9e glbuild: tell gl.h not to include the system's glext.h
We pack our own copy of glext.h to avoid build breakages on older environments,
and having gl.h include its own was defeating all that.

git-svn-id: https://svn.eduke32.com/eduke32@2080 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-23 05:02:57 +00:00
helixhorned 9196bdbd81 fix osx build: looks like it doesn't have the GL debugging functions
git-svn-id: https://svn.eduke32.com/eduke32@2073 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-11 16:52:53 +00:00
plagman f08610b6c8 Polymer: support for creating a debugging context in winlayer
This also fixes a warning when building for Windows.

git-svn-id: https://svn.eduke32.com/eduke32@2067 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-03 00:14:56 +00:00
plagman 93b4d6182e Polymer: preliminary support for GL_ARB_debug_output
This won't actually do anything until the a debug bit is added when
creating the context, but that requires support for GLX_create_context
which SDL doesn't support. I'll add support for WGL_create_context to
winlayer in a bit as a stopgap.

Also updates our local copy of glext.h with a fresh one from the
Khronos registry.

git-svn-id: https://svn.eduke32.com/eduke32@2056 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 05:56:35 +00:00
plagman a6d349c90a Polymer: account for model flipping for backface culling.
The winding order of faces is different if only flipping about X or Y,
and we were unconditionally culling CW faces.

git-svn-id: https://svn.eduke32.com/eduke32@2052 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 00:32:00 +00:00
helixhorned bb72f803c4 Two tweaks to make the precaching more efficient/less redundant in the game.
First, if we're in Polymer, don't precache tinted tiles that have a highpal
for that certain pal.  Second, don't precache tiles for palnum 251 (the last
non-reserved one, which is used as a crosshair pal). Assuming that there are
no other tints, this cuts the initial precache time and cache size on disk in
half.

git-svn-id: https://svn.eduke32.com/eduke32@2045 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-28 20:30:24 +00:00
plagman 03429e8f2e Polymer: sanitize backface culling
Keep track of which side is getting culled, swap around mirrors, swap
around model drawing.

git-svn-id: https://svn.eduke32.com/eduke32@2032 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-18 07:18:50 +00:00
helixhorned 9b1d384723 Three-way clipping in Mapster32 (still toggled with 'N): on and off as
before, and additionally a mode that doesn't clip against masked walls
and sprites.

git-svn-id: https://svn.eduke32.com/eduke32@2028 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-16 19:17:48 +00:00
helixhorned 7582b86237 Add high-resolution timers C API for profiling. The functions are called
uint64_t gethiticks() and gethitickspersec().  For SDL 1.2, the timer
has the same resolution as getticks (1000 Hz). For Windows and SDL 1.3,
the resolution of the underlying perf-timers is used.  The only user of
these functions right now is some TROR on-screen debugging code.

Revert an earlier change regarding r_preview_mouseaim.  We can't do the
check because editstatus is set later.

git-svn-id: https://svn.eduke32.com/eduke32@2026 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:05:00 +00:00
helixhorned 2415b03c79 Support for drawing 'island sectors' for TROR/classic (and with limited
functionality, Polymost).

The new feature can be enabled/disabled with the 'r_tror_nomaskpass' cvar.

The basic idea is that when drawing lower or upper levels, a first pass
is performed that ignores all red walls for which the TROR nextwall link
'towards' the viewer arrives at a red wall.  Thus, in the worst case, there
can be up to twice as many rendering passes now (when it is discovered that
the no-mask-pass isn't different that what would be drawn with the ordinary
one, the latter is skipped, since we've already drawn all needed geometry).

Hovever, this kind of multi-pass splitting is only suitable for simple scenes,
like the upper subway in the TROR test map.  In particular, multiple islands
shouldn't 'see' each other.

Two issues are worth mentioning: first, care needs to be taken for translucent
ceilings or floors, since drawing them twice isn't the same as drawing them
once. This is done for classic, but not for Polymost.  Second, sprites (which
are always drawn _after_ the geometry for a given pass) are still clipped to
the geometry of the ordinary pass, resulting in their disappearance from
certain angles.
--

Additionaly, a change made it into this commit that fixes redundant collection
of sprites in TROR:classic/Polymost.

git-svn-id: https://svn.eduke32.com/eduke32@2024 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:04:14 +00:00
helixhorned 701c69fecc misc. cleanup:
- remove 'imageSize' global which was always yres*bytesperline and only used once
- some clearbuf() -> Bmemset() because I find the latter easier to read
- remove some clearbufs to 0 of some global arrays on init

git-svn-id: https://svn.eduke32.com/eduke32@2023 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:03:50 +00:00
helixhorned 7f1133a493 Engine: add funtion 'yax_vnextsec(wall, cf)' to C API. It's often useful when
dealing with sectors on the two sides of a bunch.  Make yax_globallev and
yax_globalbunch variables non-static.
Rewrite a TROR-related bit in the engine code using the new function.

git-svn-id: https://svn.eduke32.com/eduke32@2018 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:02:12 +00:00
helixhorned 01676d7431 A couple of trivial/cleanup changes. setvgapalette() is removed from the
engine, since it had no users.

git-svn-id: https://svn.eduke32.com/eduke32@2014 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-10 15:44:53 +00:00
helixhorned 727be94eb5 Tweak the source so that it can be built by clang. The only necessary change
is to remove a couple of 'inline's for functions with external linkage, which
seems to be a GCC convenience.

git-svn-id: https://svn.eduke32.com/eduke32@2008 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-06 17:46:00 +00:00
helixhorned a145cc93bc Make Polymer declare a callback function G_Polymer_UnInit() that is called
whenever we change to another renderer etc. and define it for the game and
editor.  The purpose of the function is to clean up references to Polymer
resources like lights.
This fixes 1) all lights becoming spot lights in the game and 2)
an issue with maphack lights in the editor (can't recall which exactly).

git-svn-id: https://svn.eduke32.com/eduke32@2006 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-06 17:45:21 +00:00
helixhorned b3d3fd9a39 Better handling of tsprites that are duplicated through TROR portals.
Specifically, now also consider the sprite tile's yoffset, and fix an
issue when a tsprite got duplicated 'toward' the viewer. Also add a
couple of tests in trueror1.map.

git-svn-id: https://svn.eduke32.com/eduke32@2004 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-04 19:44:51 +00:00
helixhorned 962910ce32 Move the fixspritesectors call and the start sector updating into ExtPreSaveMap().
This makes the latter also correct when testing a map from the editor.

git-svn-id: https://svn.eduke32.com/eduke32@2001 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-04 19:43:48 +00:00
plagman 8250e5f3e8 Polymer: add preliminary support for sector masks.
When walking the sectors in displayrooms, detect floor/sector masks to
place them in a mask queue. The queues are allocated on the heap, but
a stack pointer is maintained by the displayrooms to allow it to play
nice with mirror recursion.

Right now the masks are drawn after all of drawmasks is finished; that
means you can see sprites and wall masks through sector masks, but not
the opposite. There is a slight attempt at blending far to near, but
nothing too conclusive yet; that means that in some cases some sector
masks won't be visible through other sector masks, but it should work
for trivial cases.

The next step would be to copy all the drawmasks logic into Polymer
and have it (attempt to) properly interleave sector masks where they
belong in the blending order.

git-svn-id: https://svn.eduke32.com/eduke32@1980 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-20 21:05:38 +00:00
plagman 6de59ef085 Polymer skeleton cleanup.
Reorganize polymer.c a bit to match the order of prototypes from the
header, move macros from the middle into the header.

git-svn-id: https://svn.eduke32.com/eduke32@1974 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-20 21:04:28 +00:00
helixhorned c8bf3682e0 disable undo/redo editor feature until I can debug the disappearing sprites
git-svn-id: https://svn.eduke32.com/eduke32@1973 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-20 11:54:16 +00:00
helixhorned 5262a0f24c Various cleanup work:
- fix an earlier 'oops': make highpals load correctly again
 - maphack lights shouldn't be double-loaded now
 - slight tweak to the loading screen fadein/out timing
 - two bound checks
 - make some variables static in engine.c

git-svn-id: https://svn.eduke32.com/eduke32@1969 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-17 18:52:54 +00:00
helixhorned 5d79003e60 Take a stab at hidden model switch handling. There are at least two ways by
which switches have been hidden in the original and user maps. One is to make
it face a wall, and another is to 'embed' it in e.g. the floor, like the
monitor with the burning fuse in E4L1. Both kinds show up when the switches
are rendered as models, revealing the secrets that the mapper sought to hide.
My proposal, implemented in this commit, is to apply a heuristic for such
switches at premap and make them invisible (set cstat bit 32768). The
conditions are re-checked during the game in case there is a switch coming
out of the floor, for example. A new spriteext bit is used for this feature.

git-svn-id: https://svn.eduke32.com/eduke32@1968 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-17 18:52:16 +00:00
helixhorned 13dde60ccd More fog/visibility tweaking. This makes Polymost's not depend on the screen width.
git-svn-id: https://svn.eduke32.com/eduke32@1944 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-24 18:40:10 +00:00
helixhorned 7e9b2eae0f * Clean up after myself. It seems that Polymost isn't very clean with handling texture IDs sometimes, so switching between the two GL renderers could mess them up with the last revision. This is fixed now by always uninitializing Polymer when changing from it to another renderer.
* New shade/visibility calculation code, which is activated with 'r_usenewshading' (on by default), and is closer to the classic look. Also tweak the FOGSCALE macro to have approximately the same fog distance with all renderers.

* Mapster32: END modifier to RShift. If it's pressed when RShift is released, sprites which are in grayed out sectors are also selected;  Make changing shade affect all highlighted sprites in 3D mode (when aiming at one of them).

* some debug code to watch out for suspicious glGenTexture/glDeleteTextures calls, not active.


git-svn-id: https://svn.eduke32.com/eduke32@1943 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-24 15:15:57 +00:00
helixhorned 793aadebc5 Janitorial work part 2, perfect for a rainy day. This fixes a lot of leaks, both on the client side as well as for memory allocated by OpenGL. If you had crashes after a few times of restartvid'ing in Polymer, this should fix it.
git-svn-id: https://svn.eduke32.com/eduke32@1942 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-22 22:00:53 +00:00
hendricks266 8b5761c14d My first commit!
The main feature is the addition of -mx and -mh command-line parameters to EDuke32 and Mapster32. These parameters include a con and def "module" respectively. This translates into essentially including the file from the bottom of the compiled script.

I fixed the classic buggy behavior of the BROKEHYDROPLANT and REACTOR2 sprites.

I also fixed a small, long-standing bug where FRAMEEFFECT1 blurs are not affected by sector floorpal. You can see one example of this by shrinking the Enforcer on the upper inside of the toppled building in E3L11: Freeway.

I tweaked the Makefile so that it would automatically regenerate the keep.me files in the $(OBJ) and $(EOBJ) directories after they are deleted for cleaning.

One final change is a slight positioning cleanup of both programs' --help dialog boxes.

git-svn-id: https://svn.eduke32.com/eduke32@1937 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-21 22:39:29 +00:00
helixhorned 563d42856e Build fix for OSX/PowerPC
git-svn-id: https://svn.eduke32.com/eduke32@1935 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-20 23:04:20 +00:00
helixhorned a15d8bfb98 * new editor cfg options: corruptcheck_noalreadyrefd (silinces 'already referenced warning'), r_usenewaspect, r_screenxy
* Read-only CON access to sector bunchnums by adding the labels '.ceilingbunch' and '.floorbunch' to the CON sector structure

git-svn-id: https://svn.eduke32.com/eduke32@1931 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-10 15:39:21 +00:00
helixhorned 57379654a7 Addresses posts #180 and #181 of the TROR thread. Specifically,
* it is now possible to paste (and have an outer red wall automatically) highlighted sectors into a sector that is extended on one side and non-sloped on the other. For this, the highlighted sectors must be in one connected component.
* Make it possible to not display inner gray walls, toggled with Ctrl-Alt-A, but only when no manual grayout (Ctrl-R) is in effect.

* bugfix: don't clear original TROR-nextwall link when duplicating extended highlighted sector
* m32script: protect wall members relevant to TROR
* save autogray (Ctrl-A) and showinnergray (see above) to mapster32.cfg


git-svn-id: https://svn.eduke32.com/eduke32@1928 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-04 21:20:59 +00:00
helixhorned ee4d060b1f * New m32script commands:
- sethighlightsector <sectnum> <on?>
 - updatehighlightsector
 - collectsectors <<array_to_collect_sectnums>> <initial_sector> <<num_collected_sectors>> <sector_filtering_state>

The latter does a breadth-first search starting from an initial sector and collects nextsectors only when the filtering state, given a sectnum as RETURN input, writes a nonzero value into RETURN. As a usage example, a.m32 includes the state 'collect_teleporting_sectors', that collects all sectors containing an SE7 and highlights them afterwards. This way, it should be possible to retrofit old maps with TROR by distributing small scripts that do most of the work (right now, joining has to be done by hand, though).


* corruption checker: for the 'nextwall inconsistent with nextsector' corruption, suggest an alternative fix by searching fitting nextwalls and changing the nextwall of the corrupt wall (as opposed to the nextsector). It will display with a leading '?' in the listing, and can be demanded by suffixing 'corruptcheck tryfix' with it. For example,

corruptcheck tryfix 9-21 ?

would fix some corruptions in Billy Boy's cranium.map without introducing drawing errors.


* fix demo playback (tueidj figured this out)


git-svn-id: https://svn.eduke32.com/eduke32@1927 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-03 22:51:28 +00:00
helixhorned 51fb860650 * Thin out models in memory by removing unused frames. This saves 200MB with DNE on Polymer.
* fix memory corruption when loading a Polymer savegame using another renderer and then change to Polymer
* fix possible crash in OSD_Exec() and uninitialized mem access in game config reader
* move makeasmwriteable() to baselayer.c


git-svn-id: https://svn.eduke32.com/eduke32@1910 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-19 18:30:32 +00:00
terminx ef61e48c25 Patch from Hendricks266 and whatever changes happened to be in my tree. I hope they work ;)
"The most noticeable change is the addition of the "includedefault" CON and DEF command, which will attempt to include eduke.con (or nam.con, or ww2gi.con), then game.con, or duke3d.def, or nam.def, or ww2gi.def. This is useful for TCs like my add-ons, where for my pseudo-mutators I currently say "include EDUKE.CON", but I also have to juggle this terrible order of paths, so that I can have an EDUKE.CON file in my HRP which says "include GAME.CON" to allow the mainline game to actually run, but also allow DukePlus to load its EDUKE.CON file (since it uses that and not an -x switch), and also allow any custom EDUKE.CON files in the root to be used."


git-svn-id: https://svn.eduke32.com/eduke32@1909 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-19 00:11:52 +00:00
helixhorned fdcfd8db0f also fix eduke32 on x86 and include a script for compiling all four versions, packing each into a fat binary and zipping the whole pack.
git-svn-id: https://svn.eduke32.com/eduke32@1907 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-17 13:11:19 +00:00
helixhorned 043c756676 A couple more OSX tweaks: pull in 'nibless' SDLMain.m into tree for future hacking, fix backspace ('delete') key in OSD, almost everything to make x86 binaries actually run.
git-svn-id: https://svn.eduke32.com/eduke32@1905 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-17 11:53:41 +00:00
helixhorned 116ab2ed99 Fix mapster's command-line parsing and copy over some of the 'custom mod dir' logic, currently used in the sound board to also find files outside of GRPs.
git-svn-id: https://svn.eduke32.com/eduke32@1904 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-16 19:39:22 +00:00
helixhorned e1d868dc20 A couple of tweaks for easier work with TROR:
* When TROR-joining and sectors reachable through former red walls could need displacement, ask the user; if something is wrong with the walls of the two components to join, jump to that place and print coordinates of offending wall and its point2 in the OSD
 * Ctrl-TAB in 2D mode now toggles filling of the currently aimed-at sector; it's not very in sync with the rest of the controls though (e.g. some commands will potentially affect each sector that contains the crosshair)
 * Fill sectors slightly different so that highlighted sectors above each other are easier to distinguish
 * In the editor, always clear the screen to a 'rainbow' of the palette before each frame. This makes no-draw ('HOM') and accidental translucency glitches stand out more clearly
 * a few misc. tweaks, consistency checks, and fixes


git-svn-id: https://svn.eduke32.com/eduke32@1901 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-04 00:06:08 +00:00
helixhorned d3a9dec77c -- TROR:
* Mapster32 now makes sandwiches, too: select all floors of a bunch and 'extend them below'. This will put a new sector between the highlighted ones and the their lower neighbors and displace the z's accordingly. Make sure you have enough headroom.
 * To facilitate the above, RAlt now has two more modifier keys (checked at release time, as usual): for every sector that would be selected, END will select all sectors whose floor bunchnum equals the first (this is useful for sandwiching), and HOME will select all sectors whose ceiling bunchnum equals it (not very useful, but provided for completeness).
 * Sloping extended sectors is now checked more rigorously

-- misc:
 * When deleting highlighted sectors with DEL, pressing LShift will now always delete them irrespective whether the mouse pointer is over one of them. This is useful for the cleanup of corrupted maps.
 * 2D drawing is slightly tweaked so that active walls always display over inactive ones


git-svn-id: https://svn.eduke32.com/eduke32@1900 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-29 23:10:51 +00:00
helixhorned 95a33b72bd editor: tweak RShift so that unnecessary gray walls aren't selected; fix ugly bug with TROR joining
game: when entering/leaving water or slime, delay changing palette by one game tic to make it look right


git-svn-id: https://svn.eduke32.com/eduke32@1899 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-29 12:30:38 +00:00
helixhorned 68dff06533 TROR: join sectors to a new bunch. For this, highlight exactly two connected components having the same outline and being TROR-consistent (same height etc.) and press Ctrl-J. Any ambiguity (connect c/f with f/c?, move which component?) is resolved by asking the user. Warning: hot off the keyboard and likely buggy
git-svn-id: https://svn.eduke32.com/eduke32@1895 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-23 22:42:39 +00:00
helixhorned 4fb043483d Increase default tile cache size to 24M in Mapster32 and add a command-line parameter '-cachesize <kilobytes>'
git-svn-id: https://svn.eduke32.com/eduke32@1894 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-23 18:07:45 +00:00
helixhorned e92099b2f7 Polymost:
* rudimentary TROR support
 * free mixing of multi- and single-tile pskies
 * Don't cull models behind you. That is, treat them like floor sprites in that respect. This way large models like corpses don't disappear from the view unexpectedly.

Classic:
 * tweak the last row and column of the translucency table so that e.g. a transparent sprite against a FANSPRITE wall doesn't show up purple (only if Duke3D table is found)

Misc.:
 * fixes TROR-nextwall corruption when deleting sectors
 * tile selector 'goto' now has also completion
 * I forgot a file for the non-OpenGL build last time


git-svn-id: https://svn.eduke32.com/eduke32@1892 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-22 21:52:22 +00:00
helixhorned 0c190bfa55 * Auto-grayout for plain old sectors toggled with Ctrl-A. When it is in effect, _all_ sectors which fall outside the [min ceiling z, max floor z] bounds of all active extended sectors are deactivated.
* make it possible to duplicate from extended sectors; all extensions are cleared from them
* lazy hightile loading in tile selector can now be disabled in mapster32.cfg
* fixes USE_OPENGL=0 build


git-svn-id: https://svn.eduke32.com/eduke32@1890 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-18 22:44:09 +00:00
helixhorned 137cb06bd6 ~-_-~-_-~ lift the curtain for... ~-_-~-_-~
True  Room
            over
            Room
    (also known as PROR)
  (or YAX)

 ~-_-~-_-~ ~~~~~~~~~~~~~~~~~~~~~~~ ~-_-~-_-~


git-svn-id: https://svn.eduke32.com/eduke32@1887 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-15 23:16:37 +00:00
helixhorned 873375025f * Include file cleanup by dragging most declarations into editor.h
* more useful auto-red wall feature: if no structure-changing operations have been applied after highlighting and duplicating, now also paste 'visual' fields of outer walls (this is one example of the use of a system that temporarily keeps track of nextwalls for former red lines)
* multi-pkies now have individual parallaxyscale


git-svn-id: https://svn.eduke32.com/eduke32@1886 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-15 22:37:24 +00:00
helixhorned 98456aefe3 -- engine:
* support for free mixing of multi- and single-tile parallaxed skies in classic
* make visibility independent of yxaspect and viewingrange in OpenGL modes

-- editor:
* when dragging walls, restore pixel width after that (only for the left and right walls of pointhighlight, and its nextwalls, if any)
* pasting on walls and auto-aligning them now carries over a few more fields

-- fixes:
* visibility in OpenGL modes wasn't incremented gradually (regression due to making 'clamp' an inline function instead of a macro)
* memory corruption due to calling qlz_compress with less than the recommended surplus storage of 400 bytes
* decorative sprites in the mirror showing non-flipped
* make the subway SE message (much) more helpful by showing which sector the game considers to be the track sector


git-svn-id: https://svn.eduke32.com/eduke32@1882 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-12 23:31:13 +00:00
helixhorned 203cf0b7b1 A crapload of random stuff.
* Polymer light access to m32script (light[<lightidx>].<field>). As an application, provide a state 'insertlights' that takes the currently active lights and puts them into the map as SEs (e.g. for maphack recovery).
* Prototype of a mechanism to gray out certain portion of a map, making them inactive to various, but not all, editing operations. Highlighting a set of sectors and pressing Ctrl-R will make the Z bounds be [(least ceiling z), (greatest floor z)] of all selected ones, pressing Ctrl-R when no sectors are highlighted will reset them. Not sure if it's for production use at this stage...
* The 'align walls' feature [.] now has three independently toggleable behaviours: recurse nextwalls (toggled when Ctrl is pressed), iterate point2s (disabled when Shift is pressed), and also copy pixel width (toggled when Alt is pressed).
* Make shades clamp instead of overflowing in the editor

Fixes:
* crash when carrying out certain operations on walls with xrepeat 0
* the Pause key on linux. Also make demo recording start on Shift-ScrollLock because ScrollLock alone is too easily pressed when pausing


git-svn-id: https://svn.eduke32.com/eduke32@1877 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-07 18:23:34 +00:00
helixhorned 9c3889e59b Fix more overheadmap crashes, this time with 'Last Pissed Time'. Mapster32 now asks to jump to a sector, wall, sprite, or coordinates with 'J. Also fix crash when pressing '-' (not KP-) when aiming at something with tile 0.
git-svn-id: https://svn.eduke32.com/eduke32@1874 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-28 21:28:33 +00:00
helixhorned 9a0aa6f81e ahem...
git-svn-id: https://svn.eduke32.com/eduke32@1870 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-22 22:51:03 +00:00
helixhorned 243e50db4b Insert two divide-by-zero checks that seem to fix the overhead map crash, but only with NOASM=1. Fix a couple of Mapster32 bugs and prettify some code there. Fix EDuke32 bug where the demo system overwrote boardname[] while using the file picker, making navigation between directories impossible.
git-svn-id: https://svn.eduke32.com/eduke32@1869 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-22 22:48:06 +00:00
helixhorned 64e22b9c6f * Support for entering names instead of numbers in various contexts (TAB-autocompletion included): first, when querying for a tile number, and second:
* Tag labeling system for 'link'-type tags, including saving and restoring the tag labels to a separate file '<mapname>.maptags'.  Whether a tag is eligible for linking, is determined by a hardcoded (but extensible via m32script) function.


git-svn-id: https://svn.eduke32.com/eduke32@1867 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-17 17:01:20 +00:00
helixhorned a2b3b6006c * Correctly draw floor-aligned sprites with non-power-of-two textures in classic renderer.
* Sprite cstat 2048 ('use own shade', [N]) now works more or less. (Issues may arise when combined with sector light effects.)
* Begin work on 'smart' tag labeling system for Mapster32.  Right now, it only displays a '+' after tags with linking semantics.
* 


git-svn-id: https://svn.eduke32.com/eduke32@1866 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-14 20:48:08 +00:00
helixhorned 1e937bb5aa slightly better linehighlight handling in 2d side-view mode
git-svn-id: https://svn.eduke32.com/eduke32@1865 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-11 22:28:58 +00:00
helixhorned 76a7799d7c Revise shade preview; fix PGUP/PGDN with selected sectors; allow INS/DEL in 2D side-view mode; 64-bit printf cleanup
git-svn-id: https://svn.eduke32.com/eduke32@1860 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-09 13:27:08 +00:00
terminx 1fdafcdad6 Cleaning out my tree... mostly internal changes. Adds workaround to disable texture compression with the crappy fglrx driver on Linux, fixes FIRE sprites so that they don't render at their sector's floorz all the time, changes CON compiler around a bit to use a loop instead of calling C_ParseCommand() 10 million times.
git-svn-id: https://svn.eduke32.com/eduke32@1857 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-07 01:16:29 +00:00
helixhorned 46964b322b * Lazy hightile loading in Mapster32 tile selector (first display all as lowtiles, then load each one while allowing movement)
* Consolidate the various, slightly different, methods of bounding a sprite between a sector's ceiling and floor into one common function
* Fixes for accumulated bugs: shade preview, r_shadescale_unbounded, and a couple of unreported ones
* Yaks, gnus, and bisons...


git-svn-id: https://svn.eduke32.com/eduke32@1854 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-23 17:41:01 +00:00
helixhorned 06afc4dcc5 * Comment out some practically dead code (rendmode 1 and 2, pcx screenshots), cutting some 8k from the release binary.
* Refactor two nearly identical chunks in polymost.c into one function in the hope of getting some more, but interestingly that did nothing at all. At least it's more readable this way...
* Commit, but don't enable, code for writing PNG screenshots (I'm tired of converting them every time). Requires libpng which in turn requires zlib.

git-svn-id: https://svn.eduke32.com/eduke32@1852 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-19 18:07:12 +00:00
helixhorned 4dba12a5d3 Tweakery in various places.
Engine stuff:
 * Add 'r_shadescale_unbounded' cvar. When set to 0, OpenGL renderers should never
   draw completely black objects (currently only implemented for Polymost)

Mapster32:
 * Add 'r_shadescale' to config
 * In 3D mode, make SPACE behave the same as holding down a mose button: the
   currently pointed-at object is locked. Required some modification of a.m32
   to play well (i.e. not reset SPACE). This is useful by itself but more so
   in conjunction with the next point
 * make Alt behave as a modifier with PGUP/PGDN: when aiming at a 2-sided wall,
   move the other side's sector's ceiling or floor (only this is new).
 * Auto-alignment of walls can be controlled in a finer grained fashion now:
   When pressing '.', only the immediate neighbors get aligned. Use Ctrl-. for
   the old behaviour.
 * When inserting a point in 2D mode, auto-align the neighboring wall


git-svn-id: https://svn.eduke32.com/eduke32@1848 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-17 23:37:38 +00:00
helixhorned 16557ff1bb fixes: various ones accumulated in the forum (falling into infinity, stuck in doors), crash in polymer mouse picker when in void space, creation of surplus loops on sector split when sector has weird geometry.
addition: disable sprite sectnum checking with m32script expert mode enabled.

git-svn-id: https://svn.eduke32.com/eduke32@1843 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-13 11:59:32 +00:00
helixhorned b158521449 Besides catching a few more corner cases, there's better mouselook handling and a warning (but no fix) for a rare and bad corruption when splitting a sector in this revision.
git-svn-id: https://svn.eduke32.com/eduke32@1836 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-08 23:02:38 +00:00
helixhorned 148f3cadef mapster32: new command-line switch '-namesfile <filename>' for overriding NAMES.H; new 'drawlabel <quotenum> <x> <y> <z> <col> <backcol>' m32script command for drawing small labels, see end of a.m32 for an example; some special handling for sprites whose tile yoffset is greater or equal their pixel height.
git-svn-id: https://svn.eduke32.com/eduke32@1832 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-07 16:30:06 +00:00
helixhorned e782dbca61 Make RShift/RAlt-selection and various sector operations available in side-view mode. Adds yet another modifier, this time to RShift: if RCtrl is pressed at release time, select only sprites. (If no box drawn, old behaviour of selecting wall-points of line-highlighted wall's loop.)
git-svn-id: https://svn.eduke32.com/eduke32@1830 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-05 12:59:27 +00:00
terminx ec88a5269f Add the svn revision to the version string in Mapster32
git-svn-id: https://svn.eduke32.com/eduke32@1824 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-04 18:47:06 +00:00
terminx 323008432a Consolidate POLYMOST preprocessor define into USE_OPENGL, remove SUPERBUILD preprocessor define, add additional mode to neartag() to skip sprite searches and speed up processing (and enable for CON_OPERATE), fix issue with nearby single instance sounds not playing due to out of range sounds blocking their playback, fix issue with settings.cfg being reset to default bindings when running a mod that specifies its own cfg base name, improve CON structure member interface read/write performance, fix a bug with CON "move" pointer validation
git-svn-id: https://svn.eduke32.com/eduke32@1820 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-04 08:50:58 +00:00
plagman 012b620cae Move hardcoded windowed resolution list to baselayer (based off winlayer ones + 1366x768).
git-svn-id: https://svn.eduke32.com/eduke32@1819 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-04 07:04:42 +00:00
plagman b4f5da1141 Adds r_pr_overridemodelscale to help with getting models in-game, also works with HUD models.
git-svn-id: https://svn.eduke32.com/eduke32@1818 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-04 05:33:35 +00:00
helixhorned 0fbd035e54 New sector selection mode in 2d mode: if RCtrl is pressed when releasing RAlt, then instead of the sector having to be contained in the rectangle, the mouse pointer must be inside a sector to be selected. This way it's easy to select sectors with arbitrary shapes. Set ops work independently of it, too. Also some annoyance fixes with sprite movement.
git-svn-id: https://svn.eduke32.com/eduke32@1816 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-02 21:21:47 +00:00
plagman 4430b3ca3f Add custom FOV support for HUD model definitions with the 'fov' DEF token (in build angles). Also adds an r_pr_overridehud cvar in order to preview DEF token changes in-game using the r_pr_hud* cvars.
git-svn-id: https://svn.eduke32.com/eduke32@1814 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-01 05:52:33 +00:00
plagman 423263330c Add Polymer support to rotatesprite, which hooks up highpal amongst other things.
git-svn-id: https://svn.eduke32.com/eduke32@1812 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-28 03:56:37 +00:00
helixhorned bf01b5b474 Allocate some extra space after static wall[] and sector[] for the editor.
git-svn-id: https://svn.eduke32.com/eduke32@1804 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-25 22:49:56 +00:00
helixhorned 73d6ad1d04 Oops, r1801 crashed Mapster in the undo system. Also less/better automatic wall[].xrepeat resizing on things like attaching a wall to another.
git-svn-id: https://svn.eduke32.com/eduke32@1803 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-25 22:10:25 +00:00
helixhorned 48d15c23c6 Mapster32 cleanup. The biggest visible change should be the more robust editing near the limits (still not perfect though).
git-svn-id: https://svn.eduke32.com/eduke32@1801 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-24 20:40:27 +00:00
helixhorned 71d5dc5e59 Selective auto-correction option for the corruption checker. 'corruptcheck now' will print numbered tags for each warning, which can then be used like this: 'corruptcheck tryfix 20 34-64'. General cleanup; make mapster32 not depend on enet objects.
git-svn-id: https://svn.eduke32.com/eduke32@1799 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-21 23:08:21 +00:00
helixhorned 348474dd14 Mundane Mapster Maintenance Melee, Part 2
git-svn-id: https://svn.eduke32.com/eduke32@1797 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-15 21:02:43 +00:00
plagman 65ad201c39 Fix shade updating for swapped bottomwalls.
git-svn-id: https://svn.eduke32.com/eduke32@1796 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-13 23:37:35 +00:00
helixhorned 8e4def18ba use sprite's cstat bit 2048 for approximately the same effect as spritenoshade; some side-view and other editor tweaks
git-svn-id: https://svn.eduke32.com/eduke32@1793 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-13 21:48:22 +00:00
helixhorned 86eaeaa727 temporarily bump the additional space after wall[] to 1024 walltypes in the editor; display map corruption status in upper left corner in the corrupt case.
git-svn-id: https://svn.eduke32.com/eduke32@1792 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-13 15:15:37 +00:00
helixhorned cf9e3fd3f6 * Fix a serious logic mistake with checksectorpointer. Previously, a white wall could 'connect' to a red one, leaving the reverse link intact and creating a situation like this: w_new <-> w <-- w_old.
* Have the corruption checker catch this case among a few other new ones. Rename OSD command 'autocorruptcheck' to simply 'corruptcheck' with options 'corruptcheck <seconds>', 'corruptcheck now' and 'corruptcheck tryfix'.
* When pasting sector selection into valid player space (releasing AltGr), ask whether a surrounding outer loop should be created since this is probably not always desired.

git-svn-id: https://svn.eduke32.com/eduke32@1790 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-10 23:15:02 +00:00
plagman 32d58b3839 Change highpal maps to 6-bit and add corresponding scale and bias to bypass linear interpolation around the borders.
git-svn-id: https://svn.eduke32.com/eduke32@1783 1a8010ca-5511-0410-912e-c29ae57300e0
2011-01-27 07:57:52 +00:00
plagman 87b71fd3da Hook basepal up to highpal.
git-svn-id: https://svn.eduke32.com/eduke32@1782 1a8010ca-5511-0410-912e-c29ae57300e0
2011-01-27 07:05:12 +00:00
plagman b6dce8a559 Move the new basepal table one step further so that the engine is now aware of it.
git-svn-id: https://svn.eduke32.com/eduke32@1781 1a8010ca-5511-0410-912e-c29ae57300e0
2011-01-27 06:35:52 +00:00
plagman 658c3b66f1 Fix the lighting model so that lights don't get the modulated diffuse (defeats the purpose if they do, since you wouldn't be able to light a fully shaded room). That means the highpal lookup has to be performed twice now, once with the modulated diffuse to apply to the result and once with no modulation to make a diffuse that the lighting code can use. That means that lighting isn't 100% accurate with respect to the highpal result, but that's the best approach I could think of.
git-svn-id: https://svn.eduke32.com/eduke32@1773 1a8010ca-5511-0410-912e-c29ae57300e0
2011-01-18 01:34:39 +00:00
terminx 7cef706c7c Add "Bstrstr" to compat header
git-svn-id: https://svn.eduke32.com/eduke32@1763 1a8010ca-5511-0410-912e-c29ae57300e0
2011-01-16 02:51:22 +00:00
helixhorned 51eb2c7cd3 Too much stuff for one commit.
engine:
* sector-like sprite clipping now works with x- xor y-flipped actual sprites

mapster32:
* corruption checker has been hooked up to loading/saving routines to inform/warn the user
* also warn if mouse pointer is over corrupt wall which is shown in pink then: you should not move such a wall!
* faster map loading by deferring polymer_loadboard to 3d mode entrance (also removes some 'glGetTexLevelParameteriv returned GL_FALSE' warnings)
* more logical maphack light handling, the logic is still a bit dodgy though
* some menu and misc. function fixup
* redundancy elimination...

API:
* added consts various for 'char *filename' parameters
* loadboard() now accepts bit 4 for flags (formerly 'fromwhere')

git-svn-id: https://svn.eduke32.com/eduke32@1760 1a8010ca-5511-0410-912e-c29ae57300e0
2011-01-16 00:23:39 +00:00
plagman 1ececc94ea Perform the highpal lookup after the diffuse modulation and detail to hit more range in the highpalookup map. This shuffles a fair bit of lighting model around, so I wouldn't be surprised if I broke something.
git-svn-id: https://svn.eduke32.com/eduke32@1757 1a8010ca-5511-0410-912e-c29ae57300e0
2011-01-12 02:31:50 +00:00
helixhorned e745f3abf9 A bunch of mutually unrelated updates.
First, there's a new script for the generation of highpalookup images. Python 2.6, NumPy and PIL are required.
Next, the map corruption checker has been ported to C. This is so that Mapster32 will be able to take decisions more cleverly based on the corruptness of the map. It also catches a few more issues like inconsistent nextwall/nextsector tags now.
Finally, link the executables with --large-address-aware on Windows. This gives a gig more private virtual memory on XP when booting with /3GB. YMMV, but I can play IW2 with Polymer now.

git-svn-id: https://svn.eduke32.com/eduke32@1751 1a8010ca-5511-0410-912e-c29ae57300e0
2011-01-03 22:04:20 +00:00
plagman 3d2bcbfba8 Highpalookup support is more or less ready, also checked in sample script to
generate the highpalookup maps offline (only with a few incomplete pals right
now).

New DEF token: highpalookup [pal] [filename]
New cvar: r_pr_highpalookups



git-svn-id: https://svn.eduke32.com/eduke32@1748 1a8010ca-5511-0410-912e-c29ae57300e0
2010-12-30 08:13:37 +00:00
plagman 1467c7b0b6 Fix release builds.
git-svn-id: https://svn.eduke32.com/eduke32@1746 1a8010ca-5511-0410-912e-c29ae57300e0
2010-12-29 09:17:48 +00:00
plagman 5582d41553 Highpalookup maps implementation on the renderer side. Currently set to a hardcoded highpalookup of 6:6:6->RGB and causes a noticeable quality drop. Use the debug1 cvar to toggle ingame.
git-svn-id: https://svn.eduke32.com/eduke32@1745 1a8010ca-5511-0410-912e-c29ae57300e0
2010-12-29 06:23:49 +00:00
helixhorned d3a17f62a2 Split MD3 model post-processing into common and Polymer parts and defer the latter if the game is started with a different renderer. This has the benefit of faster startup times and much less memory consumption in that case. When the user switches to Polymer later in-game, all processing is done in one run. I've observed crashes due to the music system if it takes too long, so the it may be unreliable. Also some calloc->malloc where the clearing is unnecessary.
git-svn-id: https://svn.eduke32.com/eduke32@1744 1a8010ca-5511-0410-912e-c29ae57300e0
2010-12-24 15:44:37 +00:00
helixhorned b3194b18cd d'oh
git-svn-id: https://svn.eduke32.com/eduke32@1743 1a8010ca-5511-0410-912e-c29ae57300e0
2010-12-20 16:55:37 +00:00
plagman c2768ccf98 Fix the build for everything else; it looks like the macro definition for
ATTRIBUTE was just missing from helixhorned's change.



git-svn-id: https://svn.eduke32.com/eduke32@1742 1a8010ca-5511-0410-912e-c29ae57300e0
2010-12-20 03:34:18 +00:00
terminx b75261d41b fix r1740 msvc build breakage
git-svn-id: https://svn.eduke32.com/eduke32@1741 1a8010ca-5511-0410-912e-c29ae57300e0
2010-12-19 23:00:11 +00:00
helixhorned 92223c2c85 Atrributify various function declarations. Right now the attributes used are noreturn, nonnull and format, the latter allowing us to catch silly printf errors. Again, these range from relatively benign to disastrous.
git-svn-id: https://svn.eduke32.com/eduke32@1740 1a8010ca-5511-0410-912e-c29ae57300e0
2010-12-19 22:47:10 +00:00
helixhorned 7bd0e9709a More sensible dragging in side view mode. When pasting walls in 3D mode, match the actual pixel width of the source wall.
git-svn-id: https://svn.eduke32.com/eduke32@1733 1a8010ca-5511-0410-912e-c29ae57300e0
2010-12-05 17:39:52 +00:00
helixhorned 639cabc0e6 A week worth of Mapster hacking: first, there is an experimental side view mode toggled with [F3]. Nav keys are {QWAZ}, MMB and RMB. Use with care because it is still in construction. The sector selection routines have been rewritten -- it is now possible to paste the selection into a room and a new inner loop will be added automatically (MickyC's idea). Adds m32script commands drawline16z and drawcircle16z.
git-svn-id: https://svn.eduke32.com/eduke32@1730 1a8010ca-5511-0410-912e-c29ae57300e0
2010-11-27 22:12:24 +00:00
terminx c0fd65345e remove obsolete CON compile warnings about affecting multiplayer sync, add -nodinput compatibility parameter to work around DirectInput crash issues on certain systems, fix http://forums.duke4.net/index.php?s=&showtopic=2961&view=findpost&p=60752
git-svn-id: https://svn.eduke32.com/eduke32@1729 1a8010ca-5511-0410-912e-c29ae57300e0
2010-11-23 22:30:27 +00:00
helixhorned 07ecd3eede Set union ['] and difference [;] for sector selection in Mapster32; probably fix for crash on clipshape-init; replace tabs in doc/build*.txt with three spaces.
git-svn-id: https://svn.eduke32.com/eduke32@1728 1a8010ca-5511-0410-912e-c29ae57300e0
2010-11-20 16:47:18 +00:00
helixhorned a38307a54f Fixes quite a few nasty bugs with the new clipping code, including the crash. Clip shapes are now loaded from _clipshape0.map through _clipshape9.map (no break like when loading tiles, just see if each is present). Mapster32: insert some safety code for sprites with sectnum<0. Because this is still a bad thing, have the m32script corruption checker catch this and run it periodically from EVENT_DRAW2DSCREEN. Also draw such sprites in 2D mode with a blood-red color, and make them draggable. Remove set[sector,wall,sprite] commands.
git-svn-id: https://svn.eduke32.com/eduke32@1722 1a8010ca-5511-0410-912e-c29ae57300e0
2010-10-31 19:54:03 +00:00
helixhorned 4fa07ed4af New sprite clipping for hitscan; crude debugging code for tracing down the crash that Commander is getting and I can reproduce only in real Windows with the synthesis build.
git-svn-id: https://svn.eduke32.com/eduke32@1721 1a8010ca-5511-0410-912e-c29ae57300e0
2010-10-30 20:32:06 +00:00
helixhorned f1caa980d0 Sector-like sprite clipping. Check samples/spriteclip.txt.
git-svn-id: https://svn.eduke32.com/eduke32@1719 1a8010ca-5511-0410-912e-c29ae57300e0
2010-10-28 20:17:22 +00:00
helixhorned e0874390ff New aspect determination code for classic/Polymost, controlled with r_usenewaspect and r_screenaspect cvars; print stack traces with SDL/GCC; change signature of app_main in game.c to match declarations found in other places and return different positive values on init error.
git-svn-id: https://svn.eduke32.com/eduke32@1712 1a8010ca-5511-0410-912e-c29ae57300e0
2010-10-17 14:49:39 +00:00
helixhorned cb321a9d76 New CON command 'clipmovenoslide', doing the same as clipmove but stopping at collisions before sliding calculations. Fixes a problem with Mapster32 where names.h was tried to be read before setting up the search path.
git-svn-id: https://svn.eduke32.com/eduke32@1711 1a8010ca-5511-0410-912e-c29ae57300e0
2010-10-09 22:59:17 +00:00
helixhorned 036a88736c Mapster32: make sector keep old firstwall when adding inner loop, rewrite setfirstwall to use malloc'ed memory for temp storage instead of end of sector[], reintroduce correct searchwall determination in Polymer mouse picker (intersection of xy projection of aiming ray with wall); added commands to m32script: shiftvarvar[lr], ifhighlighted, ifin3dmode, updatehighlight, sethighlight; coded prototype terrain helper based on isolines and triangle strips.
git-svn-id: https://svn.eduke32.com/eduke32@1710 1a8010ca-5511-0410-912e-c29ae57300e0
2010-09-30 23:05:40 +00:00
helixhorned 91250f081c New CON commands:
* sectsetinterpolation <sector>
 * sectclearinterpolation <sector>
 * clipmove <<ret>> <<x>> <<y>> <z> <<sectnum>> <xvect> <yvect> <walldist> <floordist> <ceildist> <clipmask>
 * lineintersect  <x1> <y1> <z1>  <x2> <y2> <z2>  <x3> <y3>  <x4> <y4>  <<intx>> <<inty>> <<intz>> <<ret>>
 * rayintersect <x1> <y1> <z1>  <xv> <yv> <zv>  <x3> <y3>  <x4> <y4>  <<intx>> <<inty>> <<intz>> <<ret>>
 * calchypotenuse <<ret>> <x> <y>
(all except *interpolation also in m32script). Also fixes Sect_ClearInterpolation to be symmetrical to its Set counterpart (shouldnt change anything since it was unused). Added "-conversion YYYYMMDD" switch for keyword-compatibility with old mods.
Mapster32: invisible sprite preview with Quote-i.

git-svn-id: https://svn.eduke32.com/eduke32@1708 1a8010ca-5511-0410-912e-c29ae57300e0
2010-09-27 21:52:04 +00:00
helixhorned fec84e6dbb mapster32 fixes: aiming crash in polymer, more accurate aiming in polymost + calibration/replacement crosshair via "r_preview_mouseaim", 2 other crashes; fix "S" in tile selector, make read-only variable overridable with "script_expertmode", misc. beautifying.
git-svn-id: https://svn.eduke32.com/eduke32@1706 1a8010ca-5511-0410-912e-c29ae57300e0
2010-09-06 23:08:35 +00:00
terminx a7c95286c2 msvc compile fix
git-svn-id: https://svn.eduke32.com/eduke32@1705 1a8010ca-5511-0410-912e-c29ae57300e0
2010-09-01 02:35:36 +00:00
plagman 3d31f645fb Add a few debug cvars for development purposes.
git-svn-id: https://svn.eduke32.com/eduke32@1702 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-26 15:24:12 +00:00
plagman 99415a625f Polymost-style HUD model support for Polymer. It properly displays all HRP HUD models as far as I can tell.
git-svn-id: https://svn.eduke32.com/eduke32@1699 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-21 07:39:12 +00:00
helixhorned 917b924a0d Fixes crash in 2d map drawing where sector[-1] was accessed; added commands a2xy and ah2xyz to m32script, coded 2d preview of swinging and sliding doors; added "samprate" setting to configuration, useful if the default one gives jittering/echoey audio
git-svn-id: https://svn.eduke32.com/eduke32@1697 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-17 20:00:44 +00:00
helixhorned b2988abb54 Search for named tile in tile selector ('S'); various bugfixes (among other things with PR-override vars)
git-svn-id: https://svn.eduke32.com/eduke32@1696 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-16 13:56:49 +00:00
helixhorned c354695d60 bugfixes; mark tiles in tile selector for later grouping (press SPACE on a tile); a.m32: convert to CRLF and add [xyz]vel query in 3d mode (Alt-KP1), also different keys for Polymer override var tweaking; some CRLF->LF in LF-only files.
git-svn-id: https://svn.eduke32.com/eduke32@1695 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-14 21:32:28 +00:00
helixhorned 5e3d6ca527 Makefile cleanups: fixed building with GCC 3, made tabs into spaces where outside command context; Windows: make startup window stay 3 seconds if there was an error -- this way you won't mistake yourself forgetting to copy game data for a crash *d'oh*
git-svn-id: https://svn.eduke32.com/eduke32@1693 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-12 21:06:51 +00:00
helixhorned 6185aedded Fixes compilation for now. Now if my executable would start...
git-svn-id: https://svn.eduke32.com/eduke32@1692 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-12 13:38:37 +00:00
helixhorned 71e59a5502 A bunch of m32script additions, fixes and general stuff, among them: local vars/arrays, inline quotes and prettier error messages.
git-svn-id: https://svn.eduke32.com/eduke32@1691 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-11 22:37:45 +00:00
helixhorned a1a5f9cb5a Partially fixes bug #3034382 and a few other ones.
git-svn-id: https://svn.eduke32.com/eduke32@1679 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-02 18:59:59 +00:00
terminx a7eb0418d1 Global thermonuclear code rape
git-svn-id: https://svn.eduke32.com/eduke32@1677 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-02 08:13:51 +00:00
terminx e1649ec722 Polymer performance improvement and some game related bug fixes. Improves Polymer framerate by about 25% in most cases and fixes problems causing Duke Caribbean doors to malfunction.
git-svn-id: https://svn.eduke32.com/eduke32@1676 1a8010ca-5511-0410-912e-c29ae57300e0
2010-07-26 22:36:45 +00:00
plagman abbe41e97d Reorganize a little code so that lightmaps can be used when a spotlight isn't currently casting a shadow. This fixes the problem where the window lights in the E1L1 apartment secret would jump between square and circle-shaped depending on the shadowcount and the view angle.
git-svn-id: https://svn.eduke32.com/eduke32@1674 1a8010ca-5511-0410-912e-c29ae57300e0
2010-07-25 02:16:22 +00:00
terminx 7be36ebcd4 fix some crap
git-svn-id: https://svn.eduke32.com/eduke32@1666 1a8010ca-5511-0410-912e-c29ae57300e0
2010-07-05 01:45:29 +00:00
terminx 013ac85e2d Emit RPG_EXPLODE, PIPEBOMB_EXPODE and LASERTRIP_EXPLODE from the actual EXPLOSION2 sprite instead of whatever spawned EXPLOSION2, to prevent the sound from being owned by whatever sprite happens to spawn with the ID the RPG/pipebomb/whatever had before it was removed
Add brightness/gamma/contrast cvars to Mapster32

Fix bug with WEAPON_SEMIAUTO flag for custom weapons

Fix VM error with starttrack when specifying an invalid music track

Fix detection of 0x1a EOF characters in CON files

Fix a couple of additional sound issues

Fix crash in pushmove()

Fix Mapster32 textured 2D mode display being a few pixels off from the actual lines drawn

Fix crash when clicking "cancel" in Mapster32 startup window

Add Makefile detection to build with -march=pentium3 -mtune=generic on i686


git-svn-id: https://svn.eduke32.com/eduke32@1665 1a8010ca-5511-0410-912e-c29ae57300e0
2010-07-03 08:53:57 +00:00
plagman a346acfccb Make the "Start" button of the GTK start-up window the default button of the window, which means pressing Enter now works at you'd expect.
git-svn-id: https://svn.eduke32.com/eduke32@1664 1a8010ca-5511-0410-912e-c29ae57300e0
2010-07-02 01:26:56 +00:00
helixhorned 1905a1cf02 m32script: infinite loop safety halt (send a SIGINT), saved input history, states can be invoked without "state" keyword when in OSD
git-svn-id: https://svn.eduke32.com/eduke32@1661 1a8010ca-5511-0410-912e-c29ae57300e0
2010-06-25 23:01:54 +00:00
terminx 068d3c0e52 This is mostly just build fixes for USE_OPENGL=0, POLYMOST=0 and POLYMER=0. Also updated the precompiled libogg/libvorbis/libvorbisfile that are supplied for MinGW.
git-svn-id: https://svn.eduke32.com/eduke32@1660 1a8010ca-5511-0410-912e-c29ae57300e0
2010-06-23 04:20:46 +00:00
terminx 9143833fc8 rotatesprite and multivoc have a rape baby
No, seriously.  Adds widescreen aware rotatesprite and works out half a dozen huge problems in the sound system, among other things.


git-svn-id: https://svn.eduke32.com/eduke32@1658 1a8010ca-5511-0410-912e-c29ae57300e0
2010-06-22 21:50:01 +00:00
terminx 4c3c64286a shading changes and fixes for a few crashes
git-svn-id: https://svn.eduke32.com/eduke32@1657 1a8010ca-5511-0410-912e-c29ae57300e0
2010-06-07 09:03:16 +00:00
terminx ac7767986a Updated synthesis script, moved some non-essential files around, updated license headers on all non-BUILDLIC files, added memory cache on top of texcache to improve load times, moved some duplicated keyboard handling stuff from winlayer/sdlayer to baselayer, fixed keypad / in Mapster32 tile selector, fixed bug where p->rotscrnang and p->look_ang never reset to 0, added support for reloading maphack based polymer lights after mode changes/savegame loads, other minor changes
git-svn-id: https://svn.eduke32.com/eduke32@1652 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-25 10:56:00 +00:00
helixhorned 011a3ba327 forgot a file
git-svn-id: https://svn.eduke32.com/eduke32@1650 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-22 23:42:37 +00:00
helixhorned 02379ee1d2 More of them. Includes the possiblity of typing m32script commands directly into the OSD (without "do", see osdtryscript in mapster32.cfg) and improved diagnostics.
git-svn-id: https://svn.eduke32.com/eduke32@1649 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-22 23:41:18 +00:00
helixhorned 30877e925a more polymer-override variable twiddling in m32script, fixes and beautifying.
git-svn-id: https://svn.eduke32.com/eduke32@1648 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-22 14:04:47 +00:00
terminx 8120821f8d fix some breakage with the "load last game" screen that pops up when you die
git-svn-id: https://svn.eduke32.com/eduke32@1647 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-21 05:53:21 +00:00
terminx 45052b8273 minor changes from my tree that I'm committing to test automated synthesis builds
git-svn-id: https://svn.eduke32.com/eduke32@1645 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-19 10:02:35 +00:00
helixhorned 8077dcd633 Mapster32 maintenance pack #1
The bulk of this commit is "code rape"--or rather, caressing, rewritten for readability.
Actual changes/fixes:
  - fixed "walking" in 2d mode
  - fixed DELETE key in OSD in SDL build
  - main loop in general (timeout for event wait after 200 ms so that highlights blink)
  - access to some pr_override* variables in m32script (suggested by Roma Loom)
  - API cleanup (added statics and consts here and there)

git-svn-id: https://svn.eduke32.com/eduke32@1644 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-18 05:14:17 +00:00
terminx 21192dfb48 Make nedmalloc a compile time option and add support for loading an external nedmalloc.dll at run time if it isn't compiled in
git-svn-id: https://svn.eduke32.com/eduke32@1643 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-18 00:30:30 +00:00
terminx 65b29ab092 win32 stuck input fix among other minor changes
git-svn-id: https://svn.eduke32.com/eduke32@1642 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-16 22:53:08 +00:00
terminx e1649b9d0b git-svn-id: https://svn.eduke32.com/eduke32@1631 1a8010ca-5511-0410-912e-c29ae57300e0 2010-05-05 07:31:38 +00:00
terminx e665b96d1b MinGW build fix
git-svn-id: https://svn.eduke32.com/eduke32@1627 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-03 08:30:25 +00:00
terminx 45d93544a6 Source code "cleanup," herein referred to as "rape"
git-svn-id: https://svn.eduke32.com/eduke32@1625 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-02 23:27:30 +00:00
plagman 4ba108994c %esi gets modified by swapchar2 but isn't listed as an output operand for the GCC extended assembly version. This causes the compiler to fail to restore it after swapchar2 executes, causing crashes if used in a loop. This change fixes the security camera crash when using GCC 4.4.x or 4.5.0.
git-svn-id: https://svn.eduke32.com/eduke32@1624 1a8010ca-5511-0410-912e-c29ae57300e0
2010-04-26 04:55:42 +00:00
plagman 386a93c366 This is an attempt to fix r1595.
- pr_resetlights() was exported but polymer.c wasn't changed to reflect that. This also broke the gcc build so I'm not sure how this was missed.
 - commented code was laying around in the middle of polymer.h
 - savegame.c using a bunch of C99 non-constant initializers. Please keep in mind that MSVC is one of the supported compilers and doesn't know C99.
 - savegame.c using localtime_r, which doesn't exist on Win32.
 - demo playback calling resetlights and drawrooms without ever calling pr_loadboard().
 - this change makes the game run very choppy here.

git-svn-id: https://svn.eduke32.com/eduke32@1596 1a8010ca-5511-0410-912e-c29ae57300e0
2010-01-25 01:11:34 +00:00
helixhorned eb5f59ca7f Improved demo system. Kick ass and watch :)\
Features:  * start recording in mid-game (ScrollLock)
           * saves interleaved diffs for later sync correction
           * supports fast-forward/rewind

Some work still needed to trace down remaining sync problems. Also be sure to check the demo* cvars.

git-svn-id: https://svn.eduke32.com/eduke32@1595 1a8010ca-5511-0410-912e-c29ae57300e0
2010-01-24 23:33:17 +00:00
plagman 0d6dc3a531 Model normal mapping support. This calculates the averaged texture-tangent basis for every face of every model when loading them, so this change will make startup times a lot worse until we implement a way to cache the computed models to disk.
git-svn-id: https://svn.eduke32.com/eduke32@1594 1a8010ca-5511-0410-912e-c29ae57300e0
2010-01-24 05:57:43 +00:00
terminx e65891aad6 Very few actual changes... mostly formatting fixes from astyle
git-svn-id: https://svn.eduke32.com/eduke32@1593 1a8010ca-5511-0410-912e-c29ae57300e0
2010-01-23 22:12:02 +00:00
terminx addf597188 More nedmalloc updates, possibly fix win32 mouse death at ~10 fps or less, fix dummytile crash, more untested multiplayer changes... different enet channels for different types of traffic in order to eliminate latency due to the occasional reliable packet getting dropped, therefore causing a hitch in the flow of unreliable movement packets on the same channel, remove mmulti API from engine in favor of having everything in game land
git-svn-id: https://svn.eduke32.com/eduke32@1592 1a8010ca-5511-0410-912e-c29ae57300e0
2010-01-21 10:02:04 +00:00
plagman f3802b7897 Properly invert the tangent space matrix instead of transposing it (after all, model tangent space isn't guaranteed to be orthogonal) and do so offline. This removes a little strain from the GPU.
git-svn-id: https://svn.eduke32.com/eduke32@1591 1a8010ca-5511-0410-912e-c29ae57300e0
2010-01-21 05:52:19 +00:00
terminx 15b9665dc6 Update nedmalloc, fix loading tiles from .art files contained in a .zip, workaround GCC 4.4.x squarerotatetile() miscompilation issue
git-svn-id: https://svn.eduke32.com/eduke32@1586 1a8010ca-5511-0410-912e-c29ae57300e0
2010-01-16 20:17:33 +00:00
terminx 4917be2439 more semi-tested multiplayer changes and sound callback fix
git-svn-id: https://svn.eduke32.com/eduke32@1582 1a8010ca-5511-0410-912e-c29ae57300e0
2010-01-05 21:53:14 +00:00
terminx 2bb322377e more multiplayer crap
git-svn-id: https://svn.eduke32.com/eduke32@1572 1a8010ca-5511-0410-912e-c29ae57300e0
2009-12-15 05:53:15 +00:00
terminx b46bd5fa19 A bunch of multiplayer improvements
git-svn-id: https://svn.eduke32.com/eduke32@1567 1a8010ca-5511-0410-912e-c29ae57300e0
2009-12-14 05:23:29 +00:00
plagman ce20870e21 Fix the build with POLYMER=0 or USE_OPENGL=0.
git-svn-id: https://svn.eduke32.com/eduke32@1564 1a8010ca-5511-0410-912e-c29ae57300e0
2009-12-13 01:23:44 +00:00
plagman 905abc3091 Proper editor picking code for Polymer. Also fixes a bunch of tabs that MSVC snuck in polymer.c.
git-svn-id: https://svn.eduke32.com/eduke32@1554 1a8010ca-5511-0410-912e-c29ae57300e0
2009-12-07 07:01:44 +00:00
terminx 44575d7e2c Ball-busting true client-server multiplayer prototype/alpha/whatever
git-svn-id: https://svn.eduke32.com/eduke32@1552 1a8010ca-5511-0410-912e-c29ae57300e0
2009-12-05 09:22:43 +00:00
terminx 1770c60af6 Second gtk startup window patch from bioman, other random fixes I can't be bothered to remember
git-svn-id: https://svn.eduke32.com/eduke32@1544 1a8010ca-5511-0410-912e-c29ae57300e0
2009-11-18 01:17:56 +00:00
terminx 2c9aeac2d5 A bunch of crap I meant to commit days ago... gtk startup window patch from bioman, nedmalloc REPLACE_SYSTEM_ALLOCATOR fix (related code uses #ifdef REPLACE_SYSTEM_ALLOCATOR so defining it to 0 was still satisfying the condition), slightly lower CPU usage in Mapster 2D mode, fix an ancient bug causing the player to not make vent footstep sounds on sprite based vents, fix map save state cvars, add "skill" cvar to console, fix saving the game while CON_SHOWVIEW is in use
git-svn-id: https://svn.eduke32.com/eduke32@1540 1a8010ca-5511-0410-912e-c29ae57300e0
2009-11-14 02:30:47 +00:00
terminx 784e919941 Change multiplayer random ID generation scheme and remove some dead code
git-svn-id: https://svn.eduke32.com/eduke32@1537 1a8010ca-5511-0410-912e-c29ae57300e0
2009-10-29 22:22:44 +00:00
terminx 4e4ef98ae6 clean up "renderer setup" menu a bit so we can put polymer shit in it later
git-svn-id: https://svn.eduke32.com/eduke32@1534 1a8010ca-5511-0410-912e-c29ae57300e0
2009-10-17 09:33:32 +00:00
plagman cfc8b8d3da Don't override the system allocator with nedmalloc and remove the unused nedmalloc code from polymer.c. This should fix a few crashes caused by ALSA and Mesa picking up memory allocator symbols from eduke32.
git-svn-id: https://svn.eduke32.com/eduke32@1533 1a8010ca-5511-0410-912e-c29ae57300e0
2009-10-17 06:27:46 +00:00
terminx a6dec44579 Fixes mouse on win32 and some other relatively minor issues, drops win9x support, adds BUILD_NOLARGEPAGES and BUILD_WIN9X environment var support to disable large page support and force 9x to pass OS version check, fixes issue with crosshair turning white during the next run after starting the game with a new cfg but quitting at the menu instead of entering a level
git-svn-id: https://svn.eduke32.com/eduke32@1532 1a8010ca-5511-0410-912e-c29ae57300e0
2009-10-15 23:08:47 +00:00
helixhorned 256c729910 relocated some key events
git-svn-id: https://svn.eduke32.com/eduke32@1530 1a8010ca-5511-0410-912e-c29ae57300e0
2009-10-11 20:13:16 +00:00
terminx 20c028b2e9 Memory cleanups, use Bm/c/realloc/free everywhere (configured as nedmalloc version in compat.h), add large page support for Vista/7, tweak nedmalloc settings, add support for projecting textures from SE50 spotlights placed in maps via sprite owner member (manipulated through CONs via sprite htpicnum member), fix building Mapster32 with MSVC, increase PR_MAXLIGHTS to 1024
git-svn-id: https://svn.eduke32.com/eduke32@1527 1a8010ca-5511-0410-912e-c29ae57300e0
2009-10-07 06:47:35 +00:00
helixhorned 40d655100c m32script: stuff for fiddling with polymer lights
git-svn-id: https://svn.eduke32.com/eduke32@1521 1a8010ca-5511-0410-912e-c29ae57300e0
2009-10-03 13:20:31 +00:00
terminx dcd7c3c9fe update nedmalloc to r1116
git-svn-id: https://svn.eduke32.com/eduke32@1509 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-30 22:19:57 +00:00
plagman dee579c030 Custom aspect ratio support for Polymer: r_pr_customaspect. Implements bug 2799107.
git-svn-id: https://svn.eduke32.com/eduke32@1507 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-30 14:32:11 +00:00
plagman 13873b985c Checks for required GPU/OpenGL functionality when initializing Polymer and fallbacks to Polymost if appropriate. This should prevent crashes when trying to run Polymer on older GPUs/drivers.
git-svn-id: https://svn.eduke32.com/eduke32@1506 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-30 01:26:13 +00:00
helixhorned 1d6058ecef small additions and fixes
git-svn-id: https://svn.eduke32.com/eduke32@1501 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-20 15:43:09 +00:00
helixhorned 293367e844 mapster-script stuff
git-svn-id: https://svn.eduke32.com/eduke32@1500 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-18 21:44:46 +00:00
helixhorned e7acafc9e7 some more functions for m32-script
git-svn-id: https://svn.eduke32.com/eduke32@1499 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-17 22:08:37 +00:00
helixhorned 198ac24152 drawing functions and key access for m32-script; misc. fixes
git-svn-id: https://svn.eduke32.com/eduke32@1497 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-16 22:24:24 +00:00
helixhorned 3be58d63d0 indirect constants for m32-script alongside with other changes
git-svn-id: https://svn.eduke32.com/eduke32@1496 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-14 22:11:37 +00:00
helixhorned ea0e088da5 Initial checkin of m32-script.
git-svn-id: https://svn.eduke32.com/eduke32@1493 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-12 23:03:15 +00:00
terminx fe6e27e819 Use C versions of divscale##() instead of asm to work around an overflow with drawmapview(), get rid of leftover custom 'int64' type in favor of int64_t, other minor fixes
git-svn-id: https://svn.eduke32.com/eduke32@1492 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-09 07:19:14 +00:00
terminx a9c8d071a6 Couple weeks worth of random bs changes
git-svn-id: https://svn.eduke32.com/eduke32@1490 1a8010ca-5511-0410-912e-c29ae57300e0
2009-08-28 23:08:00 +00:00
terminx dbd9e63d00 Fix a couple of minor issues
git-svn-id: https://svn.eduke32.com/eduke32@1488 1a8010ca-5511-0410-912e-c29ae57300e0
2009-08-09 05:32:17 +00:00
terminx 0358aee38e git-svn-id: https://svn.eduke32.com/eduke32@1487 1a8010ca-5511-0410-912e-c29ae57300e0 2009-08-06 10:12:13 +00:00
helixhorned b2e2ba8868 make mapster slightly less cpu-hungry under linux. Also a (temporary?) fix for a crash
git-svn-id: https://svn.eduke32.com/eduke32@1486 1a8010ca-5511-0410-912e-c29ae57300e0
2009-08-05 22:37:48 +00:00
helixhorned da8e401298 mapster32: more logical "bottom walls swapped"-bit handling; misc. cleanups
git-svn-id: https://svn.eduke32.com/eduke32@1466 1a8010ca-5511-0410-912e-c29ae57300e0
2009-07-25 20:16:22 +00:00
terminx 98a359f3e1 Clean out tree... misc changes
git-svn-id: https://svn.eduke32.com/eduke32@1465 1a8010ca-5511-0410-912e-c29ae57300e0
2009-07-24 02:31:34 +00:00
terminx 1538f39289 fix building with MSVC after Helixhorned's commit
fix FastLZ mipmap corruption issue
fix Polymer MSVC warnings
rewrote qsprintf to take up to 32 parameters, either quotes or gamevars
added qstrncat to concatenate n characters of one quote to another
exposed internal sectorofwall() function to CON
changed CON parser to count ( ) ; and , as whitespace so people can make their code more readable
added ACTIVATOR and ACTIVATORLOCKED support to SE49 and SE50
added SPRITE_USEACTIVATOR flag to allow actor execution based on whether a sector is "locked" or not
rearranged a few structures for faster array lookups
fixed EVENT_HOLSTER


git-svn-id: https://svn.eduke32.com/eduke32@1457 1a8010ca-5511-0410-912e-c29ae57300e0
2009-07-12 01:55:34 +00:00
helixhorned a3c0bee4a3 Improved mouse aiming for Mapster32 (not yet in action)
git-svn-id: https://svn.eduke32.com/eduke32@1456 1a8010ca-5511-0410-912e-c29ae57300e0
2009-07-11 22:20:15 +00:00
terminx 402221cad3 Replace LibLZF with FastLZ (http://www.fastlz.org/lzf.htm)
git-svn-id: https://svn.eduke32.com/eduke32@1455 1a8010ca-5511-0410-912e-c29ae57300e0
2009-07-09 03:54:18 +00:00
terminx 3aaab4b63d Remove dead copy protection and watcom support code, fix structure alignment and packing issues preventing Polymer from working with MSVC, enable link time code generation (whole program optimization) for MSVC builds, fix most warnings showing up in MSVC with /w2, add pulsating dynamic lights when holding the shrinker or expander
git-svn-id: https://svn.eduke32.com/eduke32@1454 1a8010ca-5511-0410-912e-c29ae57300e0
2009-07-09 02:29:48 +00:00
terminx ad0179da42 Fixes a couple of gameplay bugs introduced with ROR, fixes a MSVC compile issue with the newer version of kplib.c and updates nedmalloc with changes from the latest version in their svn
git-svn-id: https://svn.eduke32.com/eduke32@1452 1a8010ca-5511-0410-912e-c29ae57300e0
2009-07-07 00:42:06 +00:00
plagman 5cdc55591b Adds r_pr_ati_nodepthoffset and the proper detection code to winlayer and sdlayer to make polymer run properly on R520-class Radeon chips. A bug needs to be filed to AMD.
git-svn-id: https://svn.eduke32.com/eduke32@1446 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-28 21:16:11 +00:00
plagman 9556762493 Changes r_pr_atiworkaround to r_pr_ati_fboworkaround and ports the detection code to SDLayer.
git-svn-id: https://svn.eduke32.com/eduke32@1445 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-28 21:03:50 +00:00
terminx 5fcbdf3dd1 Fix r1438 crash on win32
git-svn-id: https://svn.eduke32.com/eduke32@1439 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-22 20:48:56 +00:00
terminx 64f4c975c2 CON stuff
git-svn-id: https://svn.eduke32.com/eduke32@1436 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-19 01:10:10 +00:00
terminx cc58eafd29 Fix for stupid con programmers making stupid con errors and a couple of other extremely minor changes
git-svn-id: https://svn.eduke32.com/eduke32@1435 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-18 05:57:10 +00:00
plagman fb5811855d Adds cstat 8192 for sprites that do not cast shadows and documents it in build.h.
git-svn-id: https://svn.eduke32.com/eduke32@1433 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-14 13:35:19 +00:00
plagman 0f01a72fae Sanitizes cstat 16384 and documents it in build.h.
git-svn-id: https://svn.eduke32.com/eduke32@1432 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-14 13:02:10 +00:00
terminx 47a9332a16 More memory pool crap, startup window log update fixes, gameland light changes and minor polymer fixes
git-svn-id: https://svn.eduke32.com/eduke32@1430 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-13 21:06:45 +00:00
plagman 8982670fbc Sanitizes prsector and prwall flags, fixes a mempool crash when exiting the game before the engine gets initialized, and adds polymer_texinvalidate() to fix water/nightvision global palette change. SwissCM is still an asshole.
git-svn-id: https://svn.eduke32.com/eduke32@1428 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-09 09:32:23 +00:00
terminx 7c1950f9d2 Fix building on linux
git-svn-id: https://svn.eduke32.com/eduke32@1426 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-09 06:43:10 +00:00
terminx 2f86c2a20f Cleaning out tree... some light changes, polymer memory pools, some meaningless optimizations, etc
git-svn-id: https://svn.eduke32.com/eduke32@1425 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-09 06:19:58 +00:00
terminx fab4638ca8 nedmalloc, from http://www.nedprod.com/programs/portable/nedmalloc/
greatly speeds up memory allocations


git-svn-id: https://svn.eduke32.com/eduke32@1424 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-09 02:12:35 +00:00
terminx 9973478a9d Fix rendmode != 4 SE light crashes
git-svn-id: https://svn.eduke32.com/eduke32@1423 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-08 00:31:53 +00:00
plagman e8cbecf935 This adds support for animated, palettized and shaded skies.
git-svn-id: https://svn.eduke32.com/eduke32@1418 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-07 18:38:13 +00:00
plagman a8cd07d692 Fixes light culling.
git-svn-id: https://svn.eduke32.com/eduke32@1413 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-07 12:51:00 +00:00
terminx 0744452216 More light stuff... most gameland lights should be working again now
git-svn-id: https://svn.eduke32.com/eduke32@1409 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-06 22:30:53 +00:00
plagman 0688522507 Adds r_pr_shadowfiltering and r_pr_atiworkaround cvars.
git-svn-id: https://svn.eduke32.com/eduke32@1408 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-06 16:00:48 +00:00
plagman dbb84c7ee8 Reverts the priority change and removes applylights.
git-svn-id: https://svn.eduke32.com/eduke32@1404 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-06 13:12:29 +00:00
terminx d4bca26bd9 Light stuff
git-svn-id: https://svn.eduke32.com/eduke32@1402 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-06 10:20:00 +00:00
terminx af5128bcdd MSVC fixes + clean out tree
git-svn-id: https://svn.eduke32.com/eduke32@1399 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-05 20:09:13 +00:00
plagman a23c9c23ba This overhauls the light culling/management code. Note: this renders the current gameland dynamic light code useless, to it'll have to be ported before they're back. Please don't complain on the forums.
git-svn-id: https://svn.eduke32.com/eduke32@1397 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-01 20:55:36 +00:00
plagman 2997d1e0f5 Light pathing tweak.
git-svn-id: https://svn.eduke32.com/eduke32@1394 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-31 18:10:09 +00:00
terminx 8474211c95 Misc small fixes
git-svn-id: https://svn.eduke32.com/eduke32@1390 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-22 23:49:25 +00:00
plagman 5eae5cdc50 Moves editorselect and clearmapdata to non-external function categories, makes them static and prototypes them in the header.
git-svn-id: https://svn.eduke32.com/eduke32@1387 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-17 16:12:53 +00:00
qbix79 77703ce68a Fix a warning. Nobody seems to use this field though?
git-svn-id: https://svn.eduke32.com/eduke32@1379 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-14 12:35:13 +00:00
plagman a5f8978a9f Spotlightmaps.
git-svn-id: https://svn.eduke32.com/eduke32@1377 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-12 20:08:38 +00:00
helixhorned ca81a4e40b mapster32: fixes crash in linux
git-svn-id: https://svn.eduke32.com/eduke32@1372 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-08 23:13:12 +00:00
terminx f3d93e8406 Undo/redo support for Mapster32 and some other minor changes
git-svn-id: https://svn.eduke32.com/eduke32@1361 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-05 16:21:33 +00:00
terminx c585380de6 Mapster fixes
git-svn-id: https://svn.eduke32.com/eduke32@1360 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-01 19:28:57 +00:00
terminx 0ee75ced2a Widescreen-friendly Mapster32 2D mode
git-svn-id: https://svn.eduke32.com/eduke32@1359 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-01 06:35:27 +00:00
terminx f3fbf8d9a3 Add support for cvars of type 'double', fix vid_gamma/brightness/contrast cvars, save cvars to eduke32_binds.cfg at shutdown, better method for drawing the floor textures in Mapster32 2D mode, slightly more yellow/orange lights on fire/rockets/lasers/etc
git-svn-id: https://svn.eduke32.com/eduke32@1358 1a8010ca-5511-0410-912e-c29ae57300e0
2009-04-30 21:09:44 +00:00
terminx 493d621eb0 More cvar shit
git-svn-id: https://svn.eduke32.com/eduke32@1357 1a8010ca-5511-0410-912e-c29ae57300e0
2009-04-30 01:07:08 +00:00