Commit Graph

63 Commits

Author SHA1 Message Date
terminx 8cc7f240d8 Remove animvpx's dependency on GLSL; adds in-place YUV420 to RGB888 conversion.
git-svn-id: https://svn.eduke32.com/eduke32@4998 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:22:52 +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
hendricks266 ec3a73efd2 Fix playing end-of-episode ANMs.
git-svn-id: https://svn.eduke32.com/eduke32@4859 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-27 20:39:43 +00:00
terminx 36e2aa01cd if 0 the input check at the beginning of animation playback as it seems to cause some cutscenes to be skipped.
git-svn-id: https://svn.eduke32.com/eduke32@4662 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:30:51 +00:00
terminx 9839802457 Optimize .anm playback; update frames on screen at the .anm's framerate instead of blindly looping as fast as possible
git-svn-id: https://svn.eduke32.com/eduke32@4626 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:15:17 +00:00
terminx 144a4798ce More Polymost cleanup, also consolidate tilesizx and tilesizy into a single tilesiz vec2_t to ensure both x and y are always in the same cache line. I may add a new vec2_16t later. Still need to take care of emulating the old flat array for the sake of CON access.
git-svn-id: https://svn.eduke32.com/eduke32@4623 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:14:21 +00:00
hendricks266 c1c01f0e0b Replace the funkily-formatted GNU.TXT with the FSF's official gpl-2.0.txt. Also, update the FSF's address in all source files that contain it.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4541 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-20 08:55:56 +00:00
hendricks266 beec5ec512 Keep track of allocated cache space for ANM files so they aren't allocated multiple times. Also, unlock the handles after playback is done so they can be freed if necessary.
git-svn-id: https://svn.eduke32.com/eduke32@4524 1a8010ca-5511-0410-912e-c29ae57300e0
2014-06-23 02:25:07 +00:00
hendricks266 1014af812f Allow the episode 4 cutscenes to be skipped in their entirety with one keypress, as in the original DOS game, instead of requiring input for each ANM file.
git-svn-id: https://svn.eduke32.com/eduke32@4243 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:02:30 +00:00
helixhorned fe69ee5476 Add rudimentary sanity checks when playing ANM files.
- Don't attempt to play an ANM file if it is empty (warn) or too short (error).
- If failing to read IVF file header or initializing VPX codec, don't play ANM.
- Return early from gltexapplyprops() if not in GL modes.

git-svn-id: https://svn.eduke32.com/eduke32@3628 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 18:57:59 +00:00
terminx 79e45c23d5 Add predefined REND_CLASSIC, REND_POLYMOST and REND_POLYMER constants and use them everywhere getrendermode() is called.
git-svn-id: https://svn.eduke32.com/eduke32@3346 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-30 20:34:34 +00:00
helixhorned e417274c1e Move G_HandleAsync() into game.h as 'static inline' and use everywhere else.
git-svn-id: https://svn.eduke32.com/eduke32@2996 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:34 +00:00
helixhorned 9caf442177 In places where fullscreen tiles are drawn (logo etc.), use clearallviews().
This really fixes clearing the borders to the left and right with widescreen
and hud_bgstretch=0.  Also, it seems to fix glitches when the "screen size"
is small (ud.screen_size is large).

git-svn-id: https://svn.eduke32.com/eduke32@2924 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:53:24 +00:00
helixhorned 008c93636c Clear the screen first in some non-in-game places, also in classic.
Compare with revision 2584.

git-svn-id: https://svn.eduke32.com/eduke32@2912 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:52 +00:00
helixhorned f42ab0044f VP8: don't call I_ClearAllInput() before idle loop.
If input is cleared before, it can become impossible to cancel the video
when decoding and displaying a frame takes longer than a frame.

git-svn-id: https://svn.eduke32.com/eduke32@2833 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:58 +00:00
helixhorned 5802857eb7 VP8: collect times while playing the video and print a summary to the log afterwards.
git-svn-id: https://svn.eduke32.com/eduke32@2832 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:55 +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
helixhorned f8796d1a1b When in GL modes, clear the screen first in some non-in-game places.
This is so that when hud_bgstretch is disabled (i.e. background pictures are
not stretched to the whole screen), the frame buffer has no leftover contents
from previous frames on the sides of the screen. This was particularly noticable
when using the console.
The "places" are the following:
 - before drawing an anim frame
 - before drawing a "full-screen" background
 - while displaying logo, titlescreen, loadscreen
(this leaves a couple others which I didn't test, and didn't tweak)

git-svn-id: https://svn.eduke32.com/eduke32@2584 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-04 18:57:06 +00:00
helixhorned 0e3adea64e Replace various occurences of "Bstrncpy(buf, src, sz); buf[sz-1]=0;" with Bstrncpyz
git-svn-id: https://svn.eduke32.com/eduke32@2559 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:43:21 +00:00
helixhorned 85ab7d2e39 Remove global 'uint8_t *anim_pal' which was only used once as a temporary.
git-svn-id: https://svn.eduke32.com/eduke32@2516 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-22 22:47:13 +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 a0d27ee702 animvpx sound: fix the 'may have many sounds per frame' requirement
E.g. this should work correctly now:
// FLY_BY, PIPEBOMB_EXPLODE, OCTA_DYING
animsounds logo { 1 244  64 14  64 144 }

git-svn-id: https://svn.eduke32.com/eduke32@2243 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:44:09 +00:00
helixhorned 6a37636bb0 Possibility of specifying sounds for a VPX anim-replacement via DEF.
The syntax is as follows:
  animsounds <anim> { frame1 sound1  frame2 sound2 ... }

<anim> has to be one of the tokens: cineov2, cineov3, RADLOGO, DUKETEAM,
logo, vol41a, vol42a, vol4e1, vol43a, vol4e2, or vol4e3, corresponding
to hard-coded Duke3D anims.

The frameN's (1-based frame numbers) have to be in ascending order (but not
necessarily strictly ascending, so that a frame may have more than one sound).

Example: for Duke3D's XBLA nuke logo animation (IVF extracted from nuke.webm),
the following definition overlays the video with a sound sequence similar
(identical save for timing) to the original nuke animation:

// frame 1: FLY_BY, frame 64: PIPEBOMB_EXPLODE
animsounds logo { 1 244  64 14 }

git-svn-id: https://svn.eduke32.com/eduke32@2242 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:43:54 +00:00
helixhorned 7f34c33bbc animvpx loop: do at least on input device poll each frame (i.e. even if we're
lagging) to be able to cancel the movie in any case.

git-svn-id: https://svn.eduke32.com/eduke32@2186 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:41:03 +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 8b6857b360 VP8 video playback as (side-by-side) replacement of ANM moving pictures.
Usage: For an ANM file <somefile>.anm/ANM, EDuke32 looks for <somefile>.ivf, which is the VP8 stream transported by an IVF container. It can be extracted from a WebM file with e.g.

  mkvextract tracks <filename>.webm 1:<filename>.ivf
  (part of Mkvtoolnix, the Matroska toolset)

Libvpx is required, and the 'YUV'-->RGB conversion is implemented using a fragment shader, so it's for OpenGL modes only. Also, this commit doesn't enable the code.

Unfinished: sound, aspect correction for fullscreen w/ non-square pixels, ... ?
---

Make MAXNODESPERLINE in engine_priv.h actually a macro that depends on MAXYSAVES and MAXDIM instead of using the obsolete precomputed value. I think this might have been the cause for the latest patched-up overhead view crash.


git-svn-id: https://svn.eduke32.com/eduke32@1933 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-18 19:06:29 +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 4a2fd12f4b Manage base palette as IDs instead of passing pointers around ($10 says I broke something). Corresponding engine change will be coming up; this is in prevision of highpal handling of game palettes.
git-svn-id: https://svn.eduke32.com/eduke32@1772 1a8010ca-5511-0410-912e-c29ae57300e0
2011-01-17 03:49:34 +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 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
terminx bb21e1c05f Fixes anim playback, mouse lag with low fps, keyboard setup menu
git-svn-id: https://svn.eduke32.com/eduke32@1632 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-07 20:45:40 +00:00
terminx 3515f603af git-svn-id: https://svn.eduke32.com/eduke32@1615 1a8010ca-5511-0410-912e-c29ae57300e0 2010-03-14 11:42:13 +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 7c036eb073 Remove jmact/types.h in favor of standardized inttypes.h stuff
git-svn-id: https://svn.eduke32.com/eduke32@1346 1a8010ca-5511-0410-912e-c29ae57300e0
2009-04-26 05:57:42 +00:00
terminx ec71eebecb git-svn-id: https://svn.eduke32.com/eduke32@1312 1a8010ca-5511-0410-912e-c29ae57300e0 2009-04-12 21:52:49 +00:00
terminx 151189efab new version of astyle
git-svn-id: https://svn.eduke32.com/eduke32@1229 1a8010ca-5511-0410-912e-c29ae57300e0
2009-02-19 16:47:54 +00:00
terminx 8f0b228f1a clean out tree
git-svn-id: https://svn.eduke32.com/eduke32@1220 1a8010ca-5511-0410-912e-c29ae57300e0
2009-01-31 00:02:14 +00:00
terminx d6914ed108 ass rape
git-svn-id: https://svn.eduke32.com/eduke32@1205 1a8010ca-5511-0410-912e-c29ae57300e0
2009-01-09 09:29:17 +00:00
terminx a34a4901a9 git-svn-id: https://svn.eduke32.com/eduke32@1144 1a8010ca-5511-0410-912e-c29ae57300e0 2008-11-21 12:14:05 +00:00
terminx 4910928877 source code rape
git-svn-id: https://svn.eduke32.com/eduke32@1143 1a8010ca-5511-0410-912e-c29ae57300e0
2008-11-20 14:06:36 +00:00
terminx ca8f8d21ae git-svn-id: https://svn.eduke32.com/eduke32@1080 1a8010ca-5511-0410-912e-c29ae57300e0 2008-09-28 11:00:59 +00:00
terminx fad541b377 Part 1 of 64-bit patch from Stephen Anthony
git-svn-id: https://svn.eduke32.com/eduke32@618 1a8010ca-5511-0410-912e-c29ae57300e0
2008-02-16 22:27:08 +00:00
terminx 31a901b7eb git-svn-id: https://svn.eduke32.com/eduke32@584 1a8010ca-5511-0410-912e-c29ae57300e0 2007-12-12 17:42:14 +00:00
terminx 19c34b09ef dynamically allocated player structs
git-svn-id: https://svn.eduke32.com/eduke32@564 1a8010ca-5511-0410-912e-c29ae57300e0
2007-08-27 06:46:31 +00:00
terminx a2f4bdb2c8 Wanna buy some crack?
git-svn-id: https://svn.eduke32.com/eduke32@563 1a8010ca-5511-0410-912e-c29ae57300e0
2007-08-27 00:20:15 +00:00
terminx b5a81483f2 git-svn-id: https://svn.eduke32.com/eduke32@559 1a8010ca-5511-0410-912e-c29ae57300e0 2007-08-25 01:05:00 +00:00
terminx 67efe33c18 Small things
git-svn-id: https://svn.eduke32.com/eduke32@514 1a8010ca-5511-0410-912e-c29ae57300e0
2007-03-04 19:52:57 +00:00
terminx fd4dfeb6a5 Update the headers of all source files, add CON_SHOWVIEW based on a patch from CONAN, other minor fixes
git-svn-id: https://svn.eduke32.com/eduke32@484 1a8010ca-5511-0410-912e-c29ae57300e0
2007-02-08 04:19:39 +00:00
terminx d2566913bb git-svn-id: https://svn.eduke32.com/eduke32@437 1a8010ca-5511-0410-912e-c29ae57300e0 2006-12-23 02:38:47 +00:00
terminx 991d785e73 Add an extra noapply flag to setbrightness() so we can invalidate just the 8 bit textures.
git-svn-id: https://svn.eduke32.com/eduke32@415 1a8010ca-5511-0410-912e-c29ae57300e0
2006-12-12 09:28:37 +00:00