Commit Graph

385 Commits

Author SHA1 Message Date
terminx d7d6623364 More readability cleanup. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5835 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:42:01 +00:00
terminx 4575148c02 Use size_t or ssize_t in for loops where possible
git-svn-id: https://svn.eduke32.com/eduke32@5829 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:41:21 +00:00
terminx 34453f5090 Continued cleanup. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5827 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:40:56 +00:00
terminx 5c6d8c96ad The great cleanup continues. This one also adds a new feature, SFLAG_WAKEUPBADGUYS. When awoken (changed to an active actor), any sprite with this flag set will wake up any enemy it has line of sight with.
git-svn-id: https://svn.eduke32.com/eduke32@5826 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:40:46 +00:00
terminx 52f678a743 Massive readability cleanup of game code part 1. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5825 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:40:35 +00:00
terminx ae5f941ad0 You're just going to have to trust me that this is 10000 lines worth of formatting and variable name cleanup, and not 10000 lines of functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@5821 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:40:06 +00:00
terminx 5800cd588c tsectortype -> usectortype
twalltype -> uwalltype
tspritetype -> uspritetype

No other changes.

git-svn-id: https://svn.eduke32.com/eduke32@5796 1a8010ca-5511-0410-912e-c29ae57300e0
2016-06-21 00:33:58 +00:00
terminx 0562de125f More changes similar to the previous commit
git-svn-id: https://svn.eduke32.com/eduke32@5795 1a8010ca-5511-0410-912e-c29ae57300e0
2016-06-21 00:33:45 +00:00
hendricks266 0434a87e3a Remove trailing whitespace from anything we don't need to rebase from an upstream.
git-svn-id: https://svn.eduke32.com/eduke32@5768 1a8010ca-5511-0410-912e-c29ae57300e0
2016-06-05 04:46:28 +00:00
terminx 69c928aa33 Better names for anim playback functions
git-svn-id: https://svn.eduke32.com/eduke32@5615 1a8010ca-5511-0410-912e-c29ae57300e0
2016-02-07 02:38:28 +00:00
terminx 51bc13a9d7 Break cheat code stuff out of game.c and into cheats.c/h. Remove unnecessary header includes from several modules (all relevant headers are already pulled in by duke3d.h).
git-svn-id: https://svn.eduke32.com/eduke32@5611 1a8010ca-5511-0410-912e-c29ae57300e0
2016-02-07 02:38:03 +00:00
terminx 8ac3e86da3 Add SFLAG_REALCLIPDIST to bypass hard-coded clipdist fuckery based on xrepeat and picnum. This also changes some bad uses of A_CheckSpriteTileFlags() into A_CheckSpriteFlags() instead.
git-svn-id: https://svn.eduke32.com/eduke32@5602 1a8010ca-5511-0410-912e-c29ae57300e0
2016-02-02 00:21:17 +00:00
terminx db8b4a00b6 Enable -Wwrite-strings and fix all instances where string constants were passed to functions accepting a char ptr.
git-svn-id: https://svn.eduke32.com/eduke32@5547 1a8010ca-5511-0410-912e-c29ae57300e0
2016-01-11 05:06:10 +00:00
hendricks266 e00115c043 Introduce USE_GLEXT macro and use it to conditionally compile out all GL ARB function calls when compiling for GL ES platforms.
This replaces the previous hack where we kept the dynamic pointers null and simply never tried calling any of them by a conspiracy of default runtime settings and disabled menu options.

Code affected: VBO support for models, VPX GLSL decoding, texture compression (texture cache), and multitexturing (glow/detail maps).

This commit also replaces EDUKE32_GLES conditionals with USE_GLEXT where appropriate.

I didn't touch polymer.c because it depends too heavily on extensions for conditionally compiling them to make sense.

git-svn-id: https://svn.eduke32.com/eduke32@5526 1a8010ca-5511-0410-912e-c29ae57300e0
2016-01-08 01:33:20 +00:00
terminx b0cb97acb6 Draw frame at level start after EVENT_LOADPLAYER instead of before.
git-svn-id: https://svn.eduke32.com/eduke32@5487 1a8010ca-5511-0410-912e-c29ae57300e0
2015-12-23 04:06:13 +00:00
hendricks266 1ea0796b43 Name map best time entries in the cfg by MD4 checksum instead of filename.
Existing filename-demarcated personal bests are still read as a fallback if an MD4 is not found, but only MD4 entries are written.

Fans of both Lunar Apocalypse and Nuclear Winter should sort out the MapTimes section of their cfg file manually.

git-svn-id: https://svn.eduke32.com/eduke32@5470 1a8010ca-5511-0410-912e-c29ae57300e0
2015-12-20 05:18:59 +00:00
hendricks266 6cb925a95d Duke3D/Sound: Add a hack to the previous commit so that Megaton's grabbag.voc will still upgrade to music/grabbag_voc.ogg, but its subway.voc will no longer upgrade to music/subway.ogg.
git-svn-id: https://svn.eduke32.com/eduke32@5446 1a8010ca-5511-0410-912e-c29ae57300e0
2015-11-25 12:08:10 +00:00
hendricks266 fcd7b2e0b1 Duke3D/Sound: Make kopen4loadfrommod a tail-call from S_UpgradeFormat, rename the function to S_OpenAudio, and replace 4x calls to one and then the other. No functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@5444 1a8010ca-5511-0410-912e-c29ae57300e0
2015-11-25 12:08:04 +00:00
helixhorned d204b6df99 premap.c: on prelevel(), clear bits 16 and 32 of effector sprites.
git-svn-id: https://svn.eduke32.com/eduke32@5422 1a8010ca-5511-0410-912e-c29ae57300e0
2015-11-14 17:21:14 +00:00
hendricks266 a557eedf7e Remove NULL checks before calling free(): they are unnecessary as per the C standard. Other cleanup includes factoring code into DO_FREE_AND_NULL() macros.
git-svn-id: https://svn.eduke32.com/eduke32@5352 1a8010ca-5511-0410-912e-c29ae57300e0
2015-09-23 17:55:31 +00:00
hendricks266 064461a06f Internally, work with 24-bit palettes instead of 18-bit.
git-svn-id: https://svn.eduke32.com/eduke32@5349 1a8010ca-5511-0410-912e-c29ae57300e0
2015-09-23 17:55:11 +00:00
helixhorned 29dca07f0b CON: check EVENT_ENTERLEVEL for nonzero RETURN, run w/ other players then.
Background: AMC TC initializes per-player variables from this event.

git-svn-id: https://svn.eduke32.com/eduke32@5235 1a8010ca-5511-0410-912e-c29ae57300e0
2015-05-25 12:57:50 +00:00
helixhorned 474efef336 Double the size of clouds[] (holding sectors with CLOUDYSKIES ceilings).
Also, make cloudx[] and cloudy[] scalars, as the per-sector values were always
identical. In prelevel(), warn if some CLOUDYSKIES-ceiling sectors could not
be set up due to reaching the new 256 sector limit.

git-svn-id: https://svn.eduke32.com/eduke32@5156 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-18 21:59:18 +00:00
hendricks266 8a9fb41d5f CON: Add EVENT_WORLD, EVENT_PREWORLD, and EVENT_PRELEVEL, which respectively function as EVENT_GAME, EVENT_PREGAME, and EVENT_LOADACTOR, but only running once instead of per-actor.
git-svn-id: https://svn.eduke32.com/eduke32@5098 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-27 12:29:05 +00:00
helixhorned 4f54c7cf88 Fix swapbufreverse(), adding precondition of count >= 4.
Also, in premap.c:G_CacheMapData(), comment out what was supposedly
intended as a debugging message ("percentage ...").

git-svn-id: https://svn.eduke32.com/eduke32@5009 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-17 16:23:04 +00:00
hendricks266 894407e58b Apple: Update Xcode project and build system. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5005 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-14 07:26:10 +00:00
terminx a035d32e71 Smooth out the loading bar so that all percentage increments are displayed for at least a couple of frames each, and remove the "loaded x/x textures" message on Android.
git-svn-id: https://svn.eduke32.com/eduke32@4999 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:22:55 +00:00
terminx 27e8fcbe57 A whole bunch of mostly insignificant changes that didn't deserve separate commits. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4997 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:22:48 +00:00
terminx c577948e94 Remove errant call to G_FadePalette() which caused a frame of corruption at map load under GL renderers, and invalidate all GL textures at map load time (just textures generated from .art on desktop, everything on mobile). This also makes Grabbag keep playing through the loading screen on Android (if no loadscreen music has been defined by a mod). DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4991 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:22:26 +00:00
terminx 50c30ab790 Animation system overhaul part 1. This allows for an unlimited number of .anm/.ivf files to be defined via duke3d.def and played back at any time with the new CON commands. Syntax is currently as follows, but may change:
cutscene "somefile.anm" { delay 10 } // defines somefile.anm with a delay of 10 120Hz tics between frames. a more typical framerate method may come later, but this is how the originals worked.

Once defined, they can be played through CON with the new playback command, also called "cutscene". It works like this:

definequote 12345 somefile.anm
define ANIM_SOMEFILE 12345

...

cutscene ANIM_SOMEFILE // halts game execution and immediately plays cutscene, resuming execution when finished

...

Sounds can be played during animations (and tiles can be overlaid, etc) like this:

onevent EVENT_CUTSCENE
    ifcutscene ANIM_SOMEFILE
    {
        ifvare RETURN 12 // frame 12
            sound FLY_BY
        rotatesprite ...
    }
endevent

The value of the RETURN var at the end of EVENT_CUTSCENE determines the next frame to play. This can be used for looping, etc. Attempting to play animations backwards outright is not advised as animations only seek in one direction (so rewinding requires running it through from frame 0 again). This is will WIP and hasn't been heavily tested at all, so please try it out.

git-svn-id: https://svn.eduke32.com/eduke32@4987 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:22:07 +00:00
terminx cc4ddf9ce7 Minor sound cleanup... clean up crappy old code, remove obsolete "FXDevice" and "MusicDevice" variables, etc.
git-svn-id: https://svn.eduke32.com/eduke32@4986 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:22:00 +00:00
terminx 5595d41ccd Macro for handling ud.bgstretch. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4982 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:21:46 +00:00
hendricks266 529d43f116 Provide a RETURN value of -2 to EVENT_DISPLAYLOADINGSCREEN after G_CacheMapData().
git-svn-id: https://svn.eduke32.com/eduke32@4978 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-09 05:50:47 +00:00
hendricks266 d7f846d0b6 Factor out generation of strings for time values in the bonus screen. This involves the creation of ud.playerbest.
git-svn-id: https://svn.eduke32.com/eduke32@4968 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 08:03:30 +00:00
hendricks266 b6d625b202 Modularize .mid --> .ogg --> .flac code to apply to sounds as well, and various cleanup in music/sound filename-handling code.
git-svn-id: https://svn.eduke32.com/eduke32@4948 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:17:59 +00:00
helixhorned 3a433130bb Fix bsearch() call for user G_LoadMapHack(): don't access nonexistent storage. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4933 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-18 20:31:37 +00:00
terminx bd27267b6b Fix savemapstate/loadmapstate (fixes a crash at shutdown, among other things)
git-svn-id: https://svn.eduke32.com/eduke32@4923 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-16 06:30:42 +00:00
terminx 64943543a4 Place the current loading percentage into RETURN for EVENT_DISPLAYLOADINGSCREEN.
git-svn-id: https://svn.eduke32.com/eduke32@4900 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:55:36 +00:00
hendricks266 589c993c39 Implement UserMapHacks.
git-svn-id: https://svn.eduke32.com/eduke32@4884 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-08 15:14:00 +00:00
hendricks266 bfb3614b92 Introduce preprocessor token EDUKE32_TOUCH_DEVICES that covers both Android and iOS, and replace selected instances of __ANDROID__ with it.
git-svn-id: https://svn.eduke32.com/eduke32@4852 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-27 18:36:14 +00:00
helixhorned 8b7c10892c Minor cleanup around security cameras / viewscreens. DONT_BUILD.
The only semantic change is that an out-of-sync instance of a distance to
check (viewscreen sprite <-> player sprite) is changed in
actors.c:G_MoveStandables(), from 2048 (as in Duke3D 1.5) to 8192, now
represented by the define VIEWSCREEN_ACTIVE_DISTANCE. I have not yet observed
any change in behavior regarding this change (but there ought to be one).

Also, in DNCOORDS display, print 'totalclock' count, too.

git-svn-id: https://svn.eduke32.com/eduke32@4831 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-21 15:51:48 +00:00
hendricks266 f2fc1a6f15 Make sure the mouse is captured when the main menu transitions into MODE_GAME. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4776 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-29 03:43:11 +00:00
terminx bf3c0de73a Mainly misc cleanups (and a fix for the C++ build), but there are a few important changes in here.
VM_OnEvent() has become VM_OnEvent(), VM_OnEventWithReturn(), VM_OnEventWithDist(), and VM_OnEventWithBoth() (the latter of which is only ever used once...). Of course, this required every call to VM_OnEvent() be changed.

memberlabel_t and vmstate_t have been changed to use the regular "int" type versus explicitly specifying int32_t as they did previously. The rationale for this change is simply that it looks cleaner, and I think we should move toward just using "int" in most cases where there's no particular reason to specify an explicit data type.

Also changes CON_KILLIT to just "return" instead of "continue". DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4745 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-22 12:29:25 +00:00
hendricks266 164d9ccb41 Set up mouse cursor display in menus, with idle timeout fully implemented. No functionality yet. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4738 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-17 07:39:12 +00:00
terminx 633cb8764b Default map zoom to something a bit more useful on Android. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4706 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-29 17:07:47 +00:00
terminx ce210a9fd7 Clean up some player code a bit... make bobposx/bobposy a vec2_t, make fricxv/fricyv a per-player vec2_t (TODO: CON access), promote angvel in input_t to int16_t and allow for player angle changes that result in odd numbered angles (we were effectively artificially limiting the angle to 1024 values before), fix some HUD model ID stuff that should help with the weapons in the HRP, clean up a bunch of random functions (P_FireWeapon(), P_DisplayTip(), P_DisplayAccess(), P_DisplayWeapon(), P_GetInput(), etc). Also clean up G_SetupFilenameBasedMusic() to loop through flac/ogg/mid when searching for usermap music replacements. Some of this really needs a BYTEVERSION bump, but these commits aren't for synthesis to build so we're not doing it yet. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4703 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-29 17:07:11 +00:00
terminx 8934226bb2 Another 5000 lines of pain and tears. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4680 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:36:34 +00:00
terminx 1c68e84e5a Hi-res security viewscreens
git-svn-id: https://svn.eduke32.com/eduke32@4679 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:35:21 +00:00
terminx 6c6b68d534 Various additional optimizations: add CLASSIC_SLICE_BY_4 mode to unroll some of the loops in a-c, replace integer divisions by a divisor unknown at compile time with usage of libdivide, clean up pragmas further by removing more old stuff that wasn't used anywhere. This is another one of those nasty commits that make people cry. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4658 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:29:21 +00:00
terminx 06a0350af0 Fix a bug where if you had a savegame with an active viewscreen, the tile in the world wouldn't update until totalclock > what totalclock was when the game was saved.
git-svn-id: https://svn.eduke32.com/eduke32@4655 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:27:13 +00:00