Commit graph

1240 commits

Author SHA1 Message Date
helixhorned
1d11b6fdd6 Free alloc'd anims in h_dukeanim. Adds a function hash_loop().
git-svn-id: https://svn.eduke32.com/eduke32@5234 1a8010ca-5511-0410-912e-c29ae57300e0
2015-05-25 12:57:49 +00:00
hendricks266
e9655f8469 Add SW to our build system and make relevant changes to avoid fatal build errors.
git-svn-id: https://svn.eduke32.com/eduke32@5197 1a8010ca-5511-0410-912e-c29ae57300e0
2015-05-19 21:56:03 +00:00
hendricks266
b3639ae8e7 Replace most instances of casting byte arrays to wider integral types with the B_(UN)BUF functions in compat.h that were previously used only in the netcode.
I have commented out the versions of these functions that perform bitmasks and shifts and replaced them with versions that cast to and from integral types, pending performance and compatibility research across platforms.

git-svn-id: https://svn.eduke32.com/eduke32@5174 1a8010ca-5511-0410-912e-c29ae57300e0
2015-05-03 07:03:48 +00:00
hendricks266
bbc7e21f2d Fix typo "maxtileallocsiz" --> "maxtiltallocsiz" for MAXYDIM < 640.
git-svn-id: https://svn.eduke32.com/eduke32@5171 1a8010ca-5511-0410-912e-c29ae57300e0
2015-05-03 07:02:40 +00:00
hendricks266
ce55b4a6fb Add game-side def "globalgameflags" that takes a single value. Flag 1 disables hardcoded pinning of HUD weapons to the side of the screen in widescreen.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@5161 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-24 00:08:46 +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
0d5b933bb3 Fix omission of modules when parsing game-side defs.
git-svn-id: https://svn.eduke32.com/eduke32@5141 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-12 08:07:59 +00:00
hendricks266
896ae2894c Implement "renamefile" during game-side def parsing (normally for "loadgrp" et al.) in addition to engine-side def parsing.
git-svn-id: https://svn.eduke32.com/eduke32@5140 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-12 08:07:45 +00:00
hendricks266
e6f429e2ab Clear the player's quote timer for each MAIN_LOOP_RESTART.
git-svn-id: https://svn.eduke32.com/eduke32@5126 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-09 07:52:14 +00:00
hendricks266
5c69ae7d11 Allow alpha fade-out for quotes and the menu mouse cursor in 8-bit when the supplied PALETTE.DAT has enough alpha tables to fully display each effect.
git-svn-id: https://svn.eduke32.com/eduke32@5124 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-09 07:51:48 +00:00
hendricks266
48358dae19 Replace the use of an "snum" parameter in the screen display functions with screenpeek because we need to keep screenpeek accurate for CON anyway.
git-svn-id: https://svn.eduke32.com/eduke32@5116 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-30 05:56:52 +00:00
hendricks266
f68829c08a Don't print quotes when not in-game.
This is required after a change in the cheat menu commit that allows the cheat quotes to trigger from the in-game menu. However, a side-effect was that pressing F12 in the main menu would cause "SCREEN SAVED" to display indefinitely.

git-svn-id: https://svn.eduke32.com/eduke32@5114 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-30 05:56:20 +00:00
hendricks266
fe17d41b14 Restructure the GRP scanning functionality. Outwardly, this allows GRP selections with special handling (the add-ons and NAM) to function properly when the Windows or GTK startup windows do not run, namely with the OS X startup window, and using the -gamegrp command line parameter on any other platform, or on all of the both under dedicated server mode,
git-svn-id: https://svn.eduke32.com/eduke32@5103 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-27 12:30:35 +00:00
hendricks266
ab58a33ec6 Menus: Add a Cheats menu to options.
It's old-school.

git-svn-id: https://svn.eduke32.com/eduke32@5084 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-24 10:49:03 +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
terminx
61f35b827a Remove WeaponChoice* from eduke32.cfg and transition setting to "wchoice" cvar. This commit also removes an Android hack and changes the order of some of the in-game "F" key handling, just because it bugged me that some of them were out of order.
git-svn-id: https://svn.eduke32.com/eduke32@5065 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-24 00:39:52 +00:00
hendricks266
a81be01914 Modify the modern mini-HUD so that:
1. Instead of the Mighty Foot using the Protective Boots inventory item as its icon, display no icon at all.
2. Adjust the ammo icon so that it is drawn at one-quarter size if its y-size is >=50 instead of >50. This fixes the display of Water Pistol Ammo in Duke Caribbean.

git-svn-id: https://svn.eduke32.com/eduke32@5057 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-23 06:26:59 +00:00
hendricks266
92afedcb11 Replace the drawing code for the level stats with nearly equivalent code that can be much more easily reproduced in CON.
git-svn-id: https://svn.eduke32.com/eduke32@5054 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-09 07:37:38 +00:00
hendricks266
f2a2e1d8b3 Amend r5048 to also reset ototalclock and lockclock, and to reset all three at the top of G_PlaybackDemo.
git-svn-id: https://svn.eduke32.com/eduke32@5052 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-08 23:40:08 +00:00
hendricks266
9403200a07 Reset totalclock to zero for each MAIN_LOOP_RESTART.
git-svn-id: https://svn.eduke32.com/eduke32@5048 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-08 07:58:36 +00:00
hendricks266
f821434195 CON: Add EVENT_DISPLAYROOMSCAMERA and EVENT_DISPLAYSTART.
EVENT_DISPLAYROOMSCAMERA functions exactly like EVENT_DISPLAYROOMS, including RETURN values, but for the ud.camerasprite >= 0 case.
EVENT_DISPLAYSTART is executed immediately after the screen background is cleared and drawn. Ensure its RETURN value is zero, because it is currently not being used.

WARNING: Consult the devs before using EVENT_DISPLAYSTART. Its position in the display code sequence is not finalized.

git-svn-id: https://svn.eduke32.com/eduke32@5047 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-08 07:58:24 +00:00
hendricks266
ef28cac919 CON: Add EVENT_DISPLAYCAMERAOSD. Set RETURN to -1 to disable it.
From this event, if "getactor[THISACTOR].htg_t 0" is zero, then the camera is functional. Nonzero values indicate the camera has been destroyed, which is only possible when the CAMERASDESTRUCTABLE parameter of gamestartup has been enabled.

git-svn-id: https://svn.eduke32.com/eduke32@5046 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-08 07:58:06 +00:00
hendricks266
35bee70ee6 CON: Add EVENT_DISPLAYLEVELSTATS. Set RETURN to -1 to disable them.
git-svn-id: https://svn.eduke32.com/eduke32@5045 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-08 07:57:47 +00:00
hendricks266
d5ed8aa728 Restore the shade of a tiled MENUTILE to 8, rather than 16.
git-svn-id: https://svn.eduke32.com/eduke32@5042 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-08 07:56:57 +00:00
helixhorned
850206ef62 Stick update of 'totalclocklock' at beginning of G_DrawRooms() instead of drawrooms().
This fixes engine-side sprite animation in the following scenario: CON code
wants to draw a scene from EVENT_DISPLAYREST, but since it covers the whole
screen, disables the drawing of the 3D scene beforehand (RETURN set to 1 from
EVENT_DISPLAYROOMS). DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@5020 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-19 22:19:05 +00:00
hendricks266
59fa70cc58 Amend previous commit. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5007 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-14 12:18:39 +00:00
hendricks266
75f2028dcc Fix an assertion failure with NETCODE=0. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5006 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-14 11:50:48 +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
31b557ef61 More Android changes. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4989 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:22:19 +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
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
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
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
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
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
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
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
7bcb05f7f0 Fix aligned screentext with newlines.
git-svn-id: https://svn.eduke32.com/eduke32@4913 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-13 12:55:56 +00:00
terminx
4911b9a949 Revise C++ structure trackers for performance and introduce "tspritetype", for temporary sprites or other usages where using the trackers would be invalid or undesired. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4898 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:55:07 +00:00
helixhorned
a9cb38dbcf game.c: revert changes of r4861 ("consult g_mirrorCount instead of gotpic[]").
git-svn-id: https://svn.eduke32.com/eduke32@4879 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-05 21:54:31 +00:00
helixhorned
17fab4d8ac Cleanup of various engine functions.
- factor out calculation of player-relative and screen+clipped-player-relative
  coordinates into get_rel_coords() and get_screen_coords(), respectively
- the usual beautification stuff, especially since we're now on C99

git-svn-id: https://svn.eduke32.com/eduke32@4875 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-04 18:45:00 +00:00
helixhorned
d7b88df6af actors.c: replace hard-coded list with missing check for SFLAG_NODAMAGEPUSH.
In A_RadiusDamage(). The code snippet that is disabled for such actors
increases the damaged actor's .xvel by (4 times the) damage amount and
is responsible for the strange effect of enemies becoming faster TOWARDS
the player on being hit with an RPG frontally.

Thanks to Fox for a keen eye.

git-svn-id: https://svn.eduke32.com/eduke32@4863 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-28 20:57:13 +00:00
helixhorned
1734e0db53 In G_HandleMirror(), consult g_mirrorCount instead of gotpic[] w/ MIRROR.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4861 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-28 15:40:06 +00:00
hendricks266
7a1e94440a Menus: Implement mouse/touch/pointer controls for all widgets.
git-svn-id: https://svn.eduke32.com/eduke32@4856 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-27 18:37:27 +00:00
hendricks266
598e33319c Add the necessary plumbing to sdlayer to detect mousedown, mouseup, and dragging.
git-svn-id: https://svn.eduke32.com/eduke32@4853 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-27 18:36:43 +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
2494c56768 Propagate 'smoothratio' to scenes drawn from the position of a camera.
That is, make interpolation work properly there -- both when 'using' a
VIEWSCREEN and when rendering the scene onto a TILE_VIEWSCR. This makes
a difference only if the camera is in a moving sector.

git-svn-id: https://svn.eduke32.com/eduke32@4847 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-27 17:17:52 +00:00