Commit Graph

3344 Commits

Author SHA1 Message Date
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
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
terminx 88e0bfd7d3 More twalltype
git-svn-id: https://svn.eduke32.com/eduke32@4981 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:21:38 +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 929b04d473 CON: Add undefinevolume, undefineskill, and undefinelevel.
git-svn-id: https://svn.eduke32.com/eduke32@4977 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-09 05:50:33 +00:00
hendricks266 81b09a9ff5 Rename "Polymost.f" string back to "Polymost" because it only confused users.
git-svn-id: https://svn.eduke32.com/eduke32@4976 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-09 05:50:08 +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
helixhorned 7cc1067a3d actors.c: style-cleanup A_MoveSpriteClipdist(). DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4974 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 18:48:31 +00:00
helixhorned 70dc2f7376 CON: Amend retrieval of STR_*TIME for qgetsysstr, fixing LunaCON and possible oob.
- Add declarations of C functions to defs.ilua, names to dynsymlist,
  fix typo in con_lang.lua, ffi.string() calls in control.lua
- Assert that G_LastMapInfoIndex() is always called with ud.last_level >= 1.
  (A stricter requirement than necessary to prevent follow-up oob accesses, but
  logically the most meaningful.)
- In G_PrintParTime() and G_PrintDesignerTime(), return "<invalid>" if the above
  does not hold. This can happen from EVENT_NEWGAME, for example. Add a test to
  lunatic/test/qgetsysstr.con.  DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4972 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 18:48:28 +00:00
hendricks266 e8f842ac28 CON: Add read-only access to ud.config.MusicToggle through the "musictoggle" member.
git-svn-id: https://svn.eduke32.com/eduke32@4970 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 08:04:09 +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
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 c5b3cfa445 Correct the special behavior to select the pipebomb detonator when you have no pipebombs in your inventory but you have some thrown in the environment so that it animates properly and also applies with the next/previous weapon functions.
git-svn-id: https://svn.eduke32.com/eduke32@4967 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 08:03:06 +00:00
hendricks266 2cbd80ad90 Move EVENT_DISPLAYMENU to after the black translucent background is drawn when in-game.
git-svn-id: https://svn.eduke32.com/eduke32@4966 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-08 08:02:51 +00:00
helixhorned a7bea4f6bc Classic: fix underallocation of TILE_TILT and tilting at very small resolutions.
Since TILE_TILT is only allocated once, it must be done with the maximum
possible size.

git-svn-id: https://svn.eduke32.com/eduke32@4965 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-07 17:29:15 +00:00
helixhorned de2a14290f LunaCON: make -fbad-getactorvar-use-pli enabled by default. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4962 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-07 17:29:12 +00:00
helixhorned 952a723229 Make g_player a +1 offset pointer into 'static g_player_s[1 + MAXPLAYER]'.
This fixes the out-of-bounds read of former g_player[] in VM_EventCommon_().

git-svn-id: https://svn.eduke32.com/eduke32@4961 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-07 17:29:11 +00:00
helixhorned 0190983067 Lunatic: fix typos in control.lua (get/setmusicposition).
git-svn-id: https://svn.eduke32.com/eduke32@4957 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-05 16:30:15 +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
helixhorned a0a4006d85 menus.c: fix C build. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4951 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-04 21:32:53 +00:00
hendricks266 9f910ff10c Fix next/previous weapon when the pipebomb detonator is active.
git-svn-id: https://svn.eduke32.com/eduke32@4950 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:27:52 +00:00
hendricks266 7c800f6631 Don't allow Ogg Vorbis or FLAC files to be defined from def if the binary was built without the proper libraries.
git-svn-id: https://svn.eduke32.com/eduke32@4949 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:18:11 +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
hendricks266 ef4a19bb50 Fix a bug where FLAC sound effects would loop when they were not supposed to.
git-svn-id: https://svn.eduke32.com/eduke32@4947 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:17:25 +00:00
hendricks266 3018dee77c Menus: Mouse, touch, and pointer controls now take the origin into account.
git-svn-id: https://svn.eduke32.com/eduke32@4946 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:17:10 +00:00
hendricks266 93a3ff34e8 Add events EVENT_DISPLAYINACTIVEMENU and EVENT_DISPLAYINACTIVEMENUREST and userdef members m_origin_x and m_origin_y.
This allows for CON screen display code to use menu animations. The following is an example of how to adapt screen features that should animate.

before:

onevent EVENT_DISPLAYMENUREST
    ifvare current_menu 0 // main menu
    {
        setvar x 1
        setvar y 1
        rotatesprite x y zoom ang tilenum shade pal orientation 0 0 xdim ydim
    }
endevent

after:

state DisplayMenuCommon
    ifvare RETURN 0 // main menu
    {
        getuserdef[THISACTOR].m_origin_x x
        getuserdef[THISACTOR].m_origin_y y
        addvar x 65536
        addvar y 65536
        rotatesprite16 x y zoom ang tilenum shade pal orientation 0 0 xdim ydim
    }
ends

onevent EVENT_DISPLAYMENUREST state DisplayMenuCommon endevent
onevent EVENT_DISPLAYINACTIVEMENUREST state DisplayMenuCommon endevent

git-svn-id: https://svn.eduke32.com/eduke32@4945 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:16:58 +00:00
hendricks266 7fb76291ee Make my menu animation code a little bit more modular.
git-svn-id: https://svn.eduke32.com/eduke32@4944 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:16:34 +00:00
hendricks266 74bb822804 Revise r4707 to fix some remaining issues with next/previous weapon.
git-svn-id: https://svn.eduke32.com/eduke32@4943 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:16:22 +00:00
hendricks266 6048f9d766 Simplify the macros used for distinguishing between OS X and iOS.
git-svn-id: https://svn.eduke32.com/eduke32@4942 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:16:10 +00:00
hendricks266 36291f2e30 Fix "rv may be used uninitialized".
git-svn-id: https://svn.eduke32.com/eduke32@4941 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:15:50 +00:00
hendricks266 3c8b06c688 Fix "textsize.x may be used uninitialized".
git-svn-id: https://svn.eduke32.com/eduke32@4940 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-25 12:15:37 +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
helixhorned 621b52aec5 osdfuncs.c: get rid of a warning with GCC. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4936 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-19 00:03:00 +00:00
helixhorned ace6087f7b Classic: fix "windowed" modes (r_size >= 12) by reverting r4920; adapt.
In setview(), we now assert windowx2 < xdim. The only calling places where its
non-violation is non-trivial to ascertain are (1) showview from CON and
(2) draw-to-tile for look-sideways in game.c. AFAICS case 1 should be fine.
Case 2 is adapted; see comments there.


git-svn-id: https://svn.eduke32.com/eduke32@4935 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-18 23:16:37 +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
hendricks266 b8783d0448 Fix warning in previous commit. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4929 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-17 05:40:42 +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
hendricks266 86e7a97ef7 Fix a crash exposed by animating the menu back button.
git-svn-id: https://svn.eduke32.com/eduke32@4927 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-17 00:27:46 +00:00
hendricks266 e7b7a9fcf1 Clean up duplicate and strangely-formed cases in C_ParseCommand().
git-svn-id: https://svn.eduke32.com/eduke32@4926 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-17 00:27:19 +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 4c883f81b6 MSVC build fix... guess it was upset about the macro expansion
git-svn-id: https://svn.eduke32.com/eduke32@4921 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-15 06:45:24 +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
hendricks266 2d161b1bf7 Menus: Implement better back button.
git-svn-id: https://svn.eduke32.com/eduke32@4918 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-13 12:57:29 +00:00
hendricks266 c42faee32e Menus: Make black background boxes translucent again.
git-svn-id: https://svn.eduke32.com/eduke32@4917 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-13 12:57:11 +00:00
hendricks266 c1c672032b Menus: Add proper edging for the tops and bottoms of scrolling lists.
git-svn-id: https://svn.eduke32.com/eduke32@4916 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-13 12:56:54 +00:00