Commit Graph

584 Commits

Author SHA1 Message Date
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
terminx 53d2e0939e Revert "vec2_t rotatepoint()."
This reverts commit b0eeef385aecf9cea3ec2bd0ee82f59982942ce0.

git-svn-id: https://svn.eduke32.com/eduke32@5154 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-18 21:49:36 +00:00
terminx ce5260e235 vec2_t rotatepoint().
git-svn-id: https://svn.eduke32.com/eduke32@5150 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-18 21:37:01 +00:00
hendricks266 27e83829c9 Correct the month used in automatic names of savegames created by the "save" CON command.
git-svn-id: https://svn.eduke32.com/eduke32@5135 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-12 08:06:20 +00:00
hendricks266 47ddef2521 Restore an insptr++ when executing "endswitch".
git-svn-id: https://svn.eduke32.com/eduke32@5109 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-29 02:39:49 +00:00
hendricks266 257e271162 C-CON: Really fix get/setprojectile.
git-svn-id: https://svn.eduke32.com/eduke32@5105 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-28 09:48:37 +00:00
hendricks266 df7a257ce5 C-CON: Fix a mistake in r5086 that broke get/setprojectile.
git-svn-id: https://svn.eduke32.com/eduke32@5100 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-27 12:29:37 +00:00
hendricks266 c784fdb21c C-CON: Redefine "break" within events to mean "skip the remainder of this event block", not "skip the remainder of execution of this event, through all chained blocks". The latter behavior is still available through the "return" keyword.
git-svn-id: https://svn.eduke32.com/eduke32@5097 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-27 12:28:45 +00:00
hendricks266 0805a0ed45 CON: Add token "appendevent", which functions identically to "onevent" except that the event's code is chained to the end of any previous events, instead of the beginning.
git-svn-id: https://svn.eduke32.com/eduke32@5093 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-25 21:31:11 +00:00
hendricks266 a90f47c1ea C-CON: Fix processing the bytecode in an incorrect order when executing setplayer on a member with a second parameter, a missed instance of a consideration from r5086.
git-svn-id: https://svn.eduke32.com/eduke32@5092 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-25 21:30:52 +00:00
hendricks266 bd0f05a706 C-CON: Implement tilesizx/y gamearrays in a fashion similar to M32Script's solution: a STRIDE2 flag.
git-svn-id: https://svn.eduke32.com/eduke32@5090 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-25 21:30:25 +00:00
hendricks266 5c8a2e3ea6 C-CON: Enumify quick structure access.
git-svn-id: https://svn.eduke32.com/eduke32@5087 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-25 06:27:42 +00:00
hendricks266 4682da7a22 C-CON: Factor fast struct access and get<struct> out into single functions.
git-svn-id: https://svn.eduke32.com/eduke32@5086 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-25 06:27:25 +00:00
terminx c9ce545ab8 A lot of CON rewrites/optimizations. Converts projectile system to dynamic allocation, saving a bunch of memory (something like sizeof(projectile_t) * MAXTILES * 2). This commit also contains changes that reduce overhead for CON commands that take a lot of parameters, by way of adding a Gv_GetManyVars() to replace long strings of subsequent calls to Gv_GetVarX().
Savegame version has been bumped due to the projectile changes. There is no way this commit doesn't cause at least one bug, so DONT_BUILD. ;)

git-svn-id: https://svn.eduke32.com/eduke32@5080 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-24 00:40:55 +00:00
hendricks266 b61908cbf3 CON: Add "resetplayerflags". Flag 1 means "don't ask the user if they want to load".
git-svn-id: https://svn.eduke32.com/eduke32@5039 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-04 02:15:15 +00:00
hendricks266 31c9d21b06 CON: Rename "cutscene" command to "startcutscene".
git-svn-id: https://svn.eduke32.com/eduke32@5031 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-22 22:14:39 +00:00
helixhorned 326ba366e9 Add lunatic/test/thisactor_getzrange.con, providing 'state thisactor_getzrange'.
Also, note a place that is the real cause for "what makes the player slide off
enemies", as far as I can see.

git-svn-id: https://svn.eduke32.com/eduke32@5016 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-18 20:46:54 +00:00
helixhorned b367d57845 gameexec.c: factor out 2x occuring pattern into VM_GetZRange(), clean up 3 funcs.
- VM_GetZRange(), which updates actor[].{floor,ceiling}z, is called from
  A_GetZLimits() and A_Fall().
- Style-cleanup the following: A_Dodge(), A_GetFurthestAngle(),
  A_FurthestVisiblePoint(). DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@5015 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-18 20:46:53 +00:00
helixhorned 120746322b Revert "gameexec.c: in VM_Move(), update actor[].{floor,ceiling}z for enemies."
This reverts r4975. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@5014 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-18 20:46:49 +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 40956094d5 More Android work. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5000 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:22:59 +00:00
terminx 22ac21598b C-CON changes
git-svn-id: https://svn.eduke32.com/eduke32@4988 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:22:11 +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
helixhorned c18ae15dc5 gameexec.c: in VM_Move(), update actor[].{floor,ceiling}z for enemies.
Previously, that was the case only with DRONE and COMMANDER. This makes
non-falling enemies pass properly through TROR bunches.

git-svn-id: https://svn.eduke32.com/eduke32@4975 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 18:48:31 +00:00
hendricks266 b355d75ab3 CON: Add STR_YOURTIME, STR_PARTIME, STR_DESIGNERTIME, and STR_BESTTIME to qgetsysstr.
git-svn-id: https://svn.eduke32.com/eduke32@4969 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 08:03:50 +00:00
helixhorned 57079dfee1 Add SFLAG_NOWATERDIP, unconditionally preventing actors from dipping into ST1 water.
By default, the following enemies have this flag set: OCTABRAIN, COMMANDER, DRONE.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4956 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-05 16:30:14 +00:00
helixhorned f022631fa8 Actor ST1 handling: use A_GetWaterZOffset() with VM_Move(), too. DONT_BUILD.
This is where things are changed at last. This fixes lizmen walking on water.

git-svn-id: https://svn.eduke32.com/eduke32@4955 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-05 16:30:13 +00:00
helixhorned c0d45ef1ec Actor ST1 handling: cleanup part 2. DONT_BUILD.
Factor out condition for whether a z offset is added or not
("fix for flying/jumping monsters getting stuck in water", etc.) into
a function A_GetWaterZOffset() (and a helper A_GetVerticalVel()).

git-svn-id: https://svn.eduke32.com/eduke32@4954 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-05 16:30:12 +00:00
helixhorned 36c3fd9216 Actor ST1 handling: clean up code a bit. (Preparation for real changes.)
In VM_Fall(), keep a temp preliminary new z position of the actor and
assign only when we return. This is to each ease watching its value in GDB.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4953 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-05 16:30:12 +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 038a9f8eb6 Lunatic: fix build and linking. DONT_BUILD.
- t{sector,wall}type are simply typedef'd to the non-t versions
- make FORCE_INLINE unconditional of DISABLE_INLINING (otherwise there are
  multiple definitions of these functions)
- update lunatic/doc/lpeg-lunatic.patch to apply against the LPeg 0.12 I just
  downloaded


git-svn-id: https://svn.eduke32.com/eduke32@4937 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-19 00:11:25 +00:00
hendricks266 011fd40dda CON: Add new commands "getmusicposition" and "setmusicposition" that operate on the playback position of the current music track.
// Example: Switch between tracks like radio stations.
 getmusicposition temp
 starttrackvar next_music_track
 setmusicposition temp

Only implemented for Ogg Vorbis, FLAC, and XA. Consult the devs before using these commands.

git-svn-id: https://svn.eduke32.com/eduke32@4928 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-17 00:28:49 +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 cdaa25ef07 Implement better fade-out for quotes and for the mouse cursor in the menu.
git-svn-id: https://svn.eduke32.com/eduke32@4919 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-15 06:45:14 +00:00
terminx 107bb7a3fa Introduce "twalltype" for temporary uses of walltype where using wall_tracker_hook() would be invalid. This is similar to "tspritetype" and fixes a bunch of problems in the editor that cropped up when changing the tracker sanity checks to an assert that only exists in debug builds (branching upon any write to a sprite, sector or wall had an unacceptable impact on performance).
git-svn-id: https://svn.eduke32.com/eduke32@4903 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:56:38 +00:00
terminx 364cf15c4f Questionable CON changes and optimizations. <3
git-svn-id: https://svn.eduke32.com/eduke32@4902 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:56:10 +00:00
helixhorned f3532f8a34 C-CON: fix 'writearraytofile' for 64-bit platforms.
git-svn-id: https://svn.eduke32.com/eduke32@4844 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-26 17:30:01 +00:00
hendricks266 4e034e1331 Eliminate the printf_nowarn stuff that has long since been supplanted by TrackerCast. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4763 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-25 21:08:58 +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
helixhorned 205b8a7677 C-CON: fix 'readgamearray' and 'resizearray' on Windows.
We must not use Xrealloc(), since gamearrays are now allocated with
Xaligned_alloc().
NOTE: I did not check all potential problematic cases, only those to get
LNGA3 up and running.

git-svn-id: https://svn.eduke32.com/eduke32@4735 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-07 22:07:12 +00:00
helixhorned 108a4022fa C-CON: fix 'readgamearray' on 64-bit platforms.
Also prettify P_DisplaySpit().

git-svn-id: https://svn.eduke32.com/eduke32@4734 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-07 22:07:12 +00:00
helixhorned e278842ce4 gameexec.c: In VM_OnEvent_, don't form address like &sprite[-1].
The practical rationale: Clang-sanitize catches this, so this is bad.
The real rationale: I *think* it is undefined behavior to even form such a
pointer in C99. However, I would be hard pressed to provide a nice formal
argument in terms of the Standard wording right now. It looks like
6.5.3.2#4 is to blame.

git-svn-id: https://svn.eduke32.com/eduke32@4727 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-06 23:43:51 +00:00
terminx 764f77d1cd Sometimes I wonder why MSVC neglects to provide useful warnings. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4722 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-02 05:38:57 +00:00
terminx 4186c89aed Minor tweaks to VM_OnEvent_(). DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4721 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-02 05:36:53 +00:00
helixhorned ae63745eb3 C-CON: fix possible crash when a CON error is raised due to access of invalid sprite.
For example, in
    CON_ERRPRINTF("invalid target sprite (%d) %d %d\n", iActor, vm.g_i, TrackerCast(vm.g_sp->picnum));
vm.g_i can be -1 and vm.g_sp can be NULL then. (Not anymore.)

DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4709 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-30 21:44:21 +00:00
terminx 183b34f48e More EDUKE32_PREDICT_FALSE, mostly in OSD_Printf(OSD_ERROR...) cases
git-svn-id: https://svn.eduke32.com/eduke32@4699 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-29 17:05:46 +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 62f13fad76 Rename VM_OnEvent to VM_OnEvent_ and add move the checks for whether the event is actually defined or not to a wrapper declared static inline
git-svn-id: https://svn.eduke32.com/eduke32@4673 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:33:53 +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