Commit Graph

110 Commits

Author SHA1 Message Date
terminx 008056763a Tweak gamevar struct shortcut error handling
git-svn-id: https://svn.eduke32.com/eduke32@7035 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:22:55 +00:00
terminx 3d9df928a5 Remove unused g_skipKeywordCheck
git-svn-id: https://svn.eduke32.com/eduke32@7034 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:22:51 +00:00
terminx 33f57d4bb6 Fix off-by-one error in CON_DEFINESOUND and null pointer arithmetic in CON_CASE and CON_DEFAULT (!)
git-svn-id: https://svn.eduke32.com/eduke32@7033 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:22:46 +00:00
terminx 220d86a583 Fix savegame crash issue
git-svn-id: https://svn.eduke32.com/eduke32@6983 1a8010ca-5511-0410-912e-c29ae57300e0
2018-09-28 04:27:48 +00:00
terminx 3ba8cb7d05 Xmalloc() -> Xrealloc() in C_AllocProjectile()
git-svn-id: https://svn.eduke32.com/eduke32@6972 1a8010ca-5511-0410-912e-c29ae57300e0
2018-09-01 19:36:05 +00:00
terminx 41ed560c45 Reword error message displayed at startup when game data is missing
git-svn-id: https://svn.eduke32.com/eduke32@6970 1a8010ca-5511-0410-912e-c29ae57300e0
2018-09-01 19:35:55 +00:00
terminx f1cedd03f4 Remove compiled CON script from savegames in favor of storing a simple CRC32 value computed from the uncompiled CON text--this means that savegames can now only be loaded if the currently loaded CONs match what was in use when the game was saved.
git-svn-id: https://svn.eduke32.com/eduke32@6964 1a8010ca-5511-0410-912e-c29ae57300e0
2018-08-09 16:06:49 +00:00
terminx a9db35a808 CON_SWITCH maintenance
git-svn-id: https://svn.eduke32.com/eduke32@6943 1a8010ca-5511-0410-912e-c29ae57300e0
2018-07-21 00:18:08 +00:00
hendricks266 48f86ce594 CON: Add "swaparrays" command, which performs a pointer-swap on arrays of the same storage class.
git-svn-id: https://svn.eduke32.com/eduke32@6902 1a8010ca-5511-0410-912e-c29ae57300e0
2018-05-23 05:58:21 +00:00
hendricks266 2a9c846a49 CON: Factor out the parsing of gamearray names.
git-svn-id: https://svn.eduke32.com/eduke32@6901 1a8010ca-5511-0410-912e-c29ae57300e0
2018-05-23 05:58:17 +00:00
terminx 0340e3cc0f Engine function name cleanup round 2
git-svn-id: https://svn.eduke32.com/eduke32@6828 1a8010ca-5511-0410-912e-c29ae57300e0
2018-04-12 21:02:51 +00:00
terminx ee63d2c070 Beginnings of baselayer.cpp/.h refactor. This is 99.9% renames.
git-svn-id: https://svn.eduke32.com/eduke32@6827 1a8010ca-5511-0410-912e-c29ae57300e0
2018-04-12 21:02:31 +00:00
hendricks266 6eeb14a12f CON: Add spawnceilingglass, spawnwallglass, and spawnwallstainedglass commands.
Patch from Striker.

git-svn-id: https://svn.eduke32.com/eduke32@6824 1a8010ca-5511-0410-912e-c29ae57300e0
2018-04-11 03:33:59 +00:00
terminx bb8ceefa95 Sound cleanup. Eliminates on-demand loading of sounds--all sounds are cached before level load.
git-svn-id: https://svn.eduke32.com/eduke32@6792 1a8010ca-5511-0410-912e-c29ae57300e0
2018-04-02 22:00:11 +00:00
hendricks266 928ce686a6 CON: Add EVENT_DAMAGESPRITE, EVENT_POSTDAMAGESPRITE, EVENT_DAMAGEWALL, EVENT_DAMAGECEILING, and EVENT_DAMAGEFLOOR.
In these events, THISACTOR is the projectile (or source of damage), and RETURN is the sprite/wall/sector affected.
Set RETURN to -1 to cancel any hardcoded effects.
ud.return 1 through 5 are the parameters passed to hitradius if RADIUSEXPLOSION is the source of the damage. ud.return 1 is -1 otherwise.

New tokens "damageeventtile" and "damageeventtilerange" or tiledata[].gameflags & SFLAG_DAMAGEEVENT to enable processing for receivers with corresponding tilenums.

CON commands to replicate hardcoded effects (beyond switching tilenums, such as spawning glass) are forthcoming.

Use of EVENT_DAMAGEHPLANE is hereby discouraged.

Patch from Striker, based on work by Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6771 1a8010ca-5511-0410-912e-c29ae57300e0
2018-03-17 03:26:10 +00:00
hendricks266 ed38f0a75d CON: Add gettiledata/settiledata. Same members as tiledata[] quick access struct. Not all fields writable.
Patch from Striker.

git-svn-id: https://svn.eduke32.com/eduke32@6766 1a8010ca-5511-0410-912e-c29ae57300e0
2018-03-15 01:19:27 +00:00
hendricks266 b80501b2c2 Menus: Add "Save Setup" menu, currently for standalone builds only
git-svn-id: https://svn.eduke32.com/eduke32@6742 1a8010ca-5511-0410-912e-c29ae57300e0
2018-03-08 03:55:12 +00:00
hendricks266 3d8e1afba9 Saves: Add userbyteversion to savegame header and userdef
git-svn-id: https://svn.eduke32.com/eduke32@6741 1a8010ca-5511-0410-912e-c29ae57300e0
2018-03-08 03:55:07 +00:00
hendricks266 4158aa802a Improve r6723. Adds EVENT_LASTWEAPON.
Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6738 1a8010ca-5511-0410-912e-c29ae57300e0
2018-03-08 03:54:54 +00:00
terminx 6e7cc1878a Improve CON perf tracking's ability to determine actor names
git-svn-id: https://svn.eduke32.com/eduke32@6737 1a8010ca-5511-0410-912e-c29ae57300e0
2018-03-08 02:39:21 +00:00
terminx a22394db8d Backport some CON profiling stuff from Lunatic. Use "printtimes" in the console.
git-svn-id: https://svn.eduke32.com/eduke32@6736 1a8010ca-5511-0410-912e-c29ae57300e0
2018-03-08 00:29:41 +00:00
terminx ee37c04623 Remove attempt at being compatible with the original ranges of ang and horiz values, and introduce a q16 version of drawrooms (and showroom)
git-svn-id: https://svn.eduke32.com/eduke32@6735 1a8010ca-5511-0410-912e-c29ae57300e0
2018-03-07 12:02:03 +00:00
terminx 48270bfb9c q16avel/q16horz
git-svn-id: https://svn.eduke32.com/eduke32@6731 1a8010ca-5511-0410-912e-c29ae57300e0
2018-03-07 04:21:52 +00:00
hendricks266 293491644f 1. Fix translucency in the mouse cursor.
2. In "EVENT_DISPLAYCROSSHAIR" and "EVENT_DISPLAYCURSOR", make "userdef[].return" 1 and 2 return the coordinates, and 3 the alpha ("EVENT_DISPLAYCURSOR" only).
3. New event "EVENT_DISPLAYPOINTER"
Similar to "EVENT_DISPLAYCURSOR", it is used to display the pointer that controls the aiming in Wii. "RETURN" / "userdef[].return" work in the same way as "EVENT_DISPLAYCURSOR".

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6714 1a8010ca-5511-0410-912e-c29ae57300e0
2018-03-01 13:46:52 +00:00
hendricks266 3a14b405a2 Clean up order of UserdefsLabels[].
Bump BYTEVERSION.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6707 1a8010ca-5511-0410-912e-c29ae57300e0
2018-02-26 20:20:05 +00:00
hendricks266 4f17a26061 New userdef structure "return"
This works like an extension of the RETURN gamevar and it accepts multiple values. Reading or writing the value of "userdef[].return 0" is the same as reading of writing the RETURN gamevar.

The following userdefs are now aliases:
- m_origin_x = userdef[].return 1
- m_origin_y = userdef[].return 2
- screenarea_x1 = userdef[].return 0
- screenarea_y1 = userdef[].return 1
- screenarea_x1 = userdef[].return 2

Additionally, the API for EVENT_PLAYLEVELMUSICSLOT is hereby redefined to use return 1 and 2 (not 0) _instead of_ ud.m_*_number.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6706 1a8010ca-5511-0410-912e-c29ae57300e0
2018-02-26 20:20:00 +00:00
hendricks266 9878d0c322 Revise the userdef code to accept multiple values.
Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6705 1a8010ca-5511-0410-912e-c29ae57300e0
2018-02-26 20:19:55 +00:00
hendricks266 63d93e8d9f New userdef structures: "menu_scrollbartilenum", "menu_scrollbarz", "menu_scrollcursorz"
Set "menu_scrollbartilenum" to the first tilenum of a series of 4 tiles:

<tilenum> = Middle (tiled to fill the scrollbar height)
<tilenum> + 1 = Top
<tilenum> + 2 = Bottom
<tilenum> + 3 = Cursor
Default value for menu_scrollbartilenum is -1, which will display EDuke32's default scrollbar.

Use "menu_scrollbarz" and "menu_scrollcursorz" to control the scale of the scrollbar. Default values are 65536.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6686 1a8010ca-5511-0410-912e-c29ae57300e0
2018-02-22 13:34:34 +00:00
hendricks266 7a30b3452f CON: Add undefinecheat.
git-svn-id: https://svn.eduke32.com/eduke32@6679 1a8010ca-5511-0410-912e-c29ae57300e0
2018-02-20 11:55:20 +00:00
hendricks266 3ae7cb1de5 Replace bespoke CON/def module and clipmap filename array reallocing with a new class, GrowArray.
git-svn-id: https://svn.eduke32.com/eduke32@6673 1a8010ca-5511-0410-912e-c29ae57300e0
2018-02-17 22:30:39 +00:00
hendricks266 0c9b00e277 CON: Remove GAMEFUNC_* hardcoded labels.
git-svn-id: https://svn.eduke32.com/eduke32@6666 1a8010ca-5511-0410-912e-c29ae57300e0
2018-02-16 08:33:36 +00:00
hendricks266 4cea9ec804 Fix MSVC build breakage.
git-svn-id: https://svn.eduke32.com/eduke32@6642 1a8010ca-5511-0410-912e-c29ae57300e0
2018-02-10 22:58:38 +00:00
hendricks266 f228b68736 CON: Add if statements if(var(var)){a,b}(e).
Inspired by x86 assembly, these stand for "above" and "below", and perform unsigned versions of greater-than and less-than, respectively.

Useful for testing array bounds.

git-svn-id: https://svn.eduke32.com/eduke32@6640 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-31 05:23:48 +00:00
terminx d9a5b4aa13 Restore previous behavior of "allsprites" iterator for CON_FOR and add "allspritesbystat" and "allspritesbysect"
git-svn-id: https://svn.eduke32.com/eduke32@6635 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-31 04:13:31 +00:00
hendricks266 874b7df3aa Remix r5063
git-svn-id: https://svn.eduke32.com/eduke32@6630 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-30 16:02:20 +00:00
hendricks266 b497a6cbde CON: Add STR_USERMAPFILENAME for qgetsysstr.
Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6629 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-30 01:03:50 +00:00
hendricks266 12f1767de2 New userdef structure "shadow_pal"
Sets the black palette used for enemy shadows and for black rectangles in the menu. Default value is 4.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6626 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 11:14:17 +00:00
hendricks266 e7cbf0b1a9 New events EVENT_PLAYLEVELMUSICSLOT and EVENT_CONTINUELEVELMUSICSLOT.
Called when a music track will be started from the beginning, and when the current track is continued after loading a save, etc.

The requested track is passed into PLAYLEVELMUSICSLOT via ud.m_volume_number and ud.m_level_number.

git-svn-id: https://svn.eduke32.com/eduke32@6624 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 11:14:08 +00:00
hendricks266 d41a013a57 CON: Add commands "swaptrackslot" and "preloadtrackslotforswap"
git-svn-id: https://svn.eduke32.com/eduke32@6623 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 11:14:04 +00:00
hendricks266 0d1137be5d Add read-only userdefs music_episode and music_level.
TODO: Exposing whether any music is currently playing at all. (No, it is not ud.musictoggle.)

git-svn-id: https://svn.eduke32.com/eduke32@6622 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 11:13:59 +00:00
hendricks266 0ca09c08da CON: Add user_map and m_user_map read-only userdefs.
git-svn-id: https://svn.eduke32.com/eduke32@6616 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 11:13:30 +00:00
hendricks266 2cdf98f07a Systematize the appearance of the menu fonts using the DOS version as a reference.
New events:
"EVENT_MENUCURSORLEFT"
"EVENT_MENUCURSORRIGHT"
"EVENT_MENUCURSORSHADE"
"EVENT_MENUSHADESELECTED"

New userdef structures:
"menu_shadedeselected"
"menu_shadedisabled"
"menutext_zoom"
"menutext_xspace"
"menutext_pal"
"menutext_palselected"
"menutext_paldeselected"
"menutext_paldisabled"
"menutext_palselected_right"
"menutext_paldeselected_right"
"menutext_paldisabled_right"
"gametext_zoom"
"gametext_xspace"
"gametext_pal"
"gametext_palselected"
"gametext_paldeselected"
"gametext_paldisabled"
"gametext_palselected_right"
"gametext_paldeselected_right"
"gametext_paldisabled_right"
"minitext_zoom"
"minitext_xspace"
"minitext_tracking"
"minitext_pal"
"minitext_palselected"
"minitext_paldeselected"
"minitext_paldisabled"
"minitext_palselected_right"
"minitext_paldeselected_right"
"minitext_paldisabled_right"
"menutitle_pal"
"slidebar_palselected"
"slidebar_paldisabled"

Self-explanatory. Use in conjunction with "menutext_tracking" and "gametext_tracking" ("mgametext_tracking" is now ignored).

The values for disabled shade is added to the selected or deselected shades. The palettes have a disabled > selected > deselected hierarchy, and are applied if not zero.

Patch from Fox

git-svn-id: https://svn.eduke32.com/eduke32@6613 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 02:14:16 +00:00
hendricks266 e1e5e338dc New commands: "divr", "divru", "divrd"
divr <dividend> <divisor>

Divide gamevar <dividend> by <divisor> and round (aka round to nearest) the result. A result of 0.5 will equal 1.

divru <dividend> <divisor>

Divide gamevar <dividend> by <divisor> and round up (aka round away from zero) the result.

Additionally "divrd" can be used to round down (aka round toward zero), which is equivalent to the current div command as tested on x86, ARM, and PowerPC.

Note that "shiftr" rounds up negative values.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6611 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 02:14:04 +00:00
hendricks266 1cbf5e36e1 New command "qstrcmp"
qstrcmp <quote1> <quote2> <var>

Compare two quotes. <var> returns zero if they are identical, -1 if the first quote comes first in alphabetical order, 1 if it comes later.

Note that the lexicographical order is rudimentary, for example "Player 2" is considered greater than "Player 10".

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6609 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-29 02:13:55 +00:00
hendricks266 97fd71c3db Add EVENT_DISPLAYOVERHEADMAPPLAYER.
RETURN is the tilenum to be displayed. It is pre-populated with what the game will display for the current frame.

Set RETURN to -1 to disable.

git-svn-id: https://svn.eduke32.com/eduke32@6608 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-28 04:31:04 +00:00
hendricks266 740cedefbb New userdef structures "default_volume", "default_skill"
Lets you choose which episode or skill should be selected by default in the menus. Default values are 0 and 1, respectively.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6596 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:35:33 +00:00
hendricks266 a96613f496 Add "Alternate Weapon" key similar to Shadow Warrior Classic Redux.
When pressed it switches between pipebomb / detonator or shrinker / expander.

New event "EVENT_ALTWEAPON"

Akin to "EVENT_PREVIOUSWEAPON" and "EVENT_NEXTWEAPON". RETURN is set to 12.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6594 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:35:23 +00:00
hendricks266 67438d0cd2 New userdef structure: "global_r", "global_g", "global_b"
Set the tinting RGB values of textures being rendered. Can be used in DISPLAYROOMS or before rotatesprite (similar to setaspect). Remember to reset the values afterwards.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6591 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:35:11 +00:00
hendricks266 1e04f43240 New userdef structure: "menu_slidebarz", "menu_slidebarmargin", "menu_slidecursorz"
Self-explanatory. Default value for all is 65536.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6589 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:35:02 +00:00
hendricks266 4da012a15f Add an option to move the status bar to the top of the screen in the Android version.
Restores a feature temporarily disabled in r6553.

Currently only supports the modern status bar.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6588 1a8010ca-5511-0410-912e-c29ae57300e0
2018-01-26 04:34:57 +00:00