Commit Graph

570 Commits

Author SHA1 Message Date
helixhorned 40fd4968bb In three missed places, use AC_MOVFLAGS instead of sp->hitag.
git-svn-id: https://svn.eduke32.com/eduke32@4377 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-16 14:37:50 +00:00
helixhorned 689a8aef1d Propagate 'blend' to rotatesprite_(), but don't hook it up to scripting yet.
git-svn-id: https://svn.eduke32.com/eduke32@4360 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-05 21:12:54 +00:00
helixhorned b8bd2069ea Rename SPRITE_* flag enum constants to SFLAG_*, for consistency with CON.
git-svn-id: https://svn.eduke32.com/eduke32@4351 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 19:38:52 +00:00
helixhorned 6d4f56c643 Get rid of neartag* global variables. LunaCON: fix 'operate'.
git-svn-id: https://svn.eduke32.com/eduke32@4284 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:13:00 +00:00
hendricks266 3ed90ca4f2 Block off hacks for the primitive splitscreen CON mod with SPLITSCREEN_MOD_HACKS so they are no longer compiled.
These hacks could no longer be allowed to co-opt the fake multiplayer mode, used for local testing and mod development.

I have half a mind to remove the hacks outright because they could be likened to drilling bolts directly into your car engine just so you could mount a bowling ball as a hood ornament. However, I don't want to take away the splitscreen hack mod from anyone who uses it, and the work done on these hacks should be useful if proper splitscreen were implemented internally using per-player input and multiple renderer/audio passes.

git-svn-id: https://svn.eduke32.com/eduke32@4249 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:04:51 +00:00
helixhorned 21d8e52f0a Remaining sanitizing of .yvel usage plus minor cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@4229 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:36 +00:00
helixhorned 9b045deb4b Make a couple of player functions take player indices instead of DukePlayer_t *.
git-svn-id: https://svn.eduke32.com/eduke32@4227 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:31 +00:00
helixhorned efdd31d5a9 Guard retrieval of player index (.yvel) from APLAYER sprite.
It is unacceptable that yvel is on one hand modifiable without restriction from
scripting, but can be used as an array index without prior bound check in the C
code. Because that member has an overloaded meaning and is also used for
innocuous purposes such as the green color intensity of an SE light, it's
infeasible to restrict access from scripting. Consequently, we must add bound
checks on the C side. This is the first part of the effort to make .yvel safe,
adding two functions P_Get() and P_GetP(). There are a couple of other uses as
some kind of index.

git-svn-id: https://svn.eduke32.com/eduke32@4226 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:27 +00:00
helixhorned 380aa880dc Consolidate P_AddWeaponNoSwitch into an additional P_AddWeapon argument.
git-svn-id: https://svn.eduke32.com/eduke32@4216 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:00 +00:00
helixhorned c45ca57eb0 Minor stylistic tweaks of code related to weapon switching.
git-svn-id: https://svn.eduke32.com/eduke32@4215 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:44:56 +00:00
helixhorned 4cb24de24e In exprs like "Bmemcpy(&p->pos.x, &sprite[i].x, sizeof(vec3_t))", drop the ".x".
git-svn-id: https://svn.eduke32.com/eduke32@4132 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 18:21:07 +00:00
helixhorned b6475100d7 In G_SaveMapState, fix 1024-byte write beyond array bound on 64-bit platforms.
This was caused by mismatched for types mapstate_t's animateptr[] and the global
one (int32_t vs. int32_t *).

Bump BYTEVERSION.

git-svn-id: https://svn.eduke32.com/eduke32@4125 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-28 21:26:32 +00:00
helixhorned 25edec9c0a LunaCON: very primitive gamevar handling logic for {save,load}mapstate.
git-svn-id: https://svn.eduke32.com/eduke32@4119 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-27 21:12:22 +00:00
helixhorned 6c88824792 LunaCON: in {save,load}mapstate, warn that saving/restoring gamevars is NYI.
git-svn-id: https://svn.eduke32.com/eduke32@4118 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-27 21:12:20 +00:00
helixhorned ab7d3679df At end of G_RestoreMapState(), update g_player[].ps->i from STAT_PLAYER sprites.
This fixes a potential crash caused by violating the expected invariant
 sprite[g_player[player_index].ps->i].yvel == player_index
otherwise.

git-svn-id: https://svn.eduke32.com/eduke32@4114 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-25 21:57:09 +00:00
terminx 67d786f48f Factor some duplicate code into Net_SpawnPlayer(), adjust Net_ExtractPlayerUpdate() a bit.
git-svn-id: https://svn.eduke32.com/eduke32@3994 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:54:09 +00:00
terminx 6ae675347b Fix http://forums.duke4.net/topic/2961-paper-cuts-minor-bugs-and-annoyances/page__view__findpost__p__164747 (mikesnd error)
git-svn-id: https://svn.eduke32.com/eduke32@3986 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:27 +00:00
terminx c34410b7ed Fix up a couple of functions to adhere better to unwritten code formatting standards. Should be zero functional changes in terms of what the functions actually do.
git-svn-id: https://svn.eduke32.com/eduke32@3983 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:51 +00:00
helixhorned a374a401be Clean up parallaxed sky functionality, part 2.
- Rename sky_t members: yscale -> horizfrac, bits -> lognumtiles.
- Add default sky (8 tiles, horizfrac=32768 (i.e. 1/2 the scene horiz), offsets
  all zero) and CLOUDYOCEAN sky (8 tiles, horizfrac=65536, offsets all zero)
  to multipsky[].
- Get rid of "psky_t g_psky", merely maintaining a g_pskyidx instead. Set it up
  at map load time so as to keep the behavior of the legacy per-map psky:
  the last sector index with a matching psky ceiling wins.
- In mapstate_t, save g_pskyidx too, not (former) pskybits and pskyoffs[].
- Make on-map-load global psky setup consistent for the game and editor by
  factoring it out into common.c: G_SetupGlobalPsky().
- Remove a couple of useless initializations, add some static assertions.

This commit is more likely to introduce subtle differences in behavior.
Specifically, getpsky() now always returns the default sky properties instead of
the global sky ones (but with all-zero offsets) when no match for a suiting
multi-psky is found. This is only likely to affect the yscale/horizfrac of
non-multi-pskies when a global non-default multi-psky has been set up.
Bump BYTEVERSION again.

git-svn-id: https://svn.eduke32.com/eduke32@3976 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:48 +00:00
helixhorned 46e8549b5e Clean up parallaxed sky functionality, part 1.
- Consolidate psky* arrays into a "typedef struct psky_t" "g_psky" and
  "multipsky[]".
- Factor out getting parallaxed sky properties into getpsky().
- Condense initial multi-psky setup by memcpy'ing from multipsky[].
- New function: MultiPsky_TileToIdx().
- Add new define PSKYOFF_MAX and related consistency-checking assertions.
- Lower MAXPSKYTILES to 8 to reflect current usage (was 256).
- Game: make multi-pskies consider dynamically-remapped MOONSKY1, BIGORBIT1
  and LA. (Not very useful as the editor will still only act for the static
  values -- 80, 84 and 89, respectively.)

An attempt has been made to preserve behavior even in strange cases, so this
commit is unlikely to introduce regressions. Because of point 6, BYTEVERSION
had to be bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3975 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:45 +00:00
hendricks266 e58035b51c Force orientation bit 2 for screentext in addition to qstrdim, to match all other screen drawing commands.
git-svn-id: https://svn.eduke32.com/eduke32@3971 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-20 03:36:28 +00:00
helixhorned 4f88aaf4d2 Retire global 'lastvisinc'.
It was only ever used as upper bound to the time that a visibility change
decays, but since it does that in an exponential fashion, there's really
no point.

git-svn-id: https://svn.eduke32.com/eduke32@3961 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:13 +00:00
helixhorned b243264d6b Lunatic: output timing results to CSV file, don't time unreg'd events/actors.
The base name is taken from the environment variable LUNATIC_TIMING_BASEFN,
which is suffixed with .actors.csv and .events.csv.

git-svn-id: https://svn.eduke32.com/eduke32@3946 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:45 +00:00
helixhorned b70779ba6f CON: Add predefined labels MAXSPRITES, MAXSTATUS and MAX_WEAPONS.
git-svn-id: https://svn.eduke32.com/eduke32@3944 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:41 +00:00
helixhorned f506e0f570 Rename the external 'gethitickms()' to 'gethiticks()'.
git-svn-id: https://svn.eduke32.com/eduke32@3935 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:05 +00:00
helixhorned 7c3f7909cc Lunatic: various changes.
- swap 2d and 3rd args in xmath.rotate() -- now rotate(point, ang, pivot)
- add vec3 method 'rotate', calling xmath.rotate
- store game tic count in savegames

git-svn-id: https://svn.eduke32.com/eduke32@3929 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:46 +00:00
helixhorned 253a13ed29 Lunatic: various tweaks and fixes.
- fix getv movflags handling in VM_Move()
- add actor.fall()
- LunaCON: sanity-check some action members

git-svn-id: https://svn.eduke32.com/eduke32@3924 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:32 +00:00
helixhorned cad7d49bd1 Lunatic: retire an actor's sprite[].hitag/lotag for new actor[] members.
git-svn-id: https://svn.eduke32.com/eduke32@3922 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:52 +00:00
helixhorned 73b5d064da Retire actor[].shootzvel, as it was only ever used in local scope.
That is, its value was only referenced during the duration of a function call
that had previously set it. It was also never accessible from CON.

git-svn-id: https://svn.eduke32.com/eduke32@3921 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:50 +00:00
helixhorned e164bd7f1e Actor-related code cleanup part 2: give actor t_data[] indexes names.
Using macros like AC_COUNT(t). Clean up related code:
 - comment out the dead condition noted in the previous commit
 - Lunatic: use get_count() instead of get_t_data(0) in one place,
   rename to _get_t_data(), i.e. make that method internal

git-svn-id: https://svn.eduke32.com/eduke32@3920 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:48 +00:00
helixhorned 90ddee2296 Actor-related code cleanup part 1: rename some locals, expose one dead condition
... due to making hi/lotag unsigned in r3174. This commit keeps the compiler
warning, the next one will remove it.

git-svn-id: https://svn.eduke32.com/eduke32@3919 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:45 +00:00
helixhorned ebe0ecaded Lunatic: add actor methods allowing overriding action delay and move hvel/vvel.
Add testing code for an example actor 1275 (newspaper) to test.elua.

git-svn-id: https://svn.eduke32.com/eduke32@3918 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:44 +00:00
helixhorned 6a33c2eec1 CON: New command 'screensound', unconditionally playing a session-wide sound.
git-svn-id: https://svn.eduke32.com/eduke32@3912 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:46 +00:00
helixhorned 16b3cb6a42 LunaCON: showview and showviewunbiased.
git-svn-id: https://svn.eduke32.com/eduke32@3861 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:32 +00:00
hendricks266 e74ac19cd2 Fix display of level stats by fixing G_ScreenText() handling of (orientation & 2).
git-svn-id: https://svn.eduke32.com/eduke32@3849 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-03 05:26:24 +00:00
hendricks266 ced47cf9fc Add qstrdim and screentext, powerful new functions for HUD text.
git-svn-id: https://svn.eduke32.com/eduke32@3833 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:55:00 +00:00
helixhorned d0f538b283 Engine: don't extern 'clipmovetraceboxnum', add a new func. clipmovex() instead.
The 'x' is for "extended", since its last arg is a switch of whether to disable
sliding. Use that from gameexec.c.

git-svn-id: https://svn.eduke32.com/eduke32@3811 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:36 +00:00
helixhorned f051e1e229 C-CON: fix 'copy' on 64-bit archs.
git-svn-id: https://svn.eduke32.com/eduke32@3810 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:34 +00:00
terminx 85cf8de0f3 Add support for shareware 0.99/1.0/1.1, for shits and giggles.
git-svn-id: https://svn.eduke32.com/eduke32@3803 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-23 18:28:04 +00:00
terminx 6a2ffa9e47 MSVC build fix
git-svn-id: https://svn.eduke32.com/eduke32@3802 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-23 18:27:36 +00:00
helixhorned d1b1fe52d8 Make G_{Save,Restore}MapState() take no input arguments.
Instead, MapInfo[ud.volume_number*MAXLEVELS+ud.level_number] is accessed
inside these functions.

git-svn-id: https://svn.eduke32.com/eduke32@3792 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-19 19:29:26 +00:00
helixhorned 4a6fc2b94f Remove redundant checks for some map state function uses.
Also, prettify G_FreeMapState(), remove some duplicate function decls and
resurrect 'savestate' and 'restorestate' OSD commands for the debug build.

git-svn-id: https://svn.eduke32.com/eduke32@3791 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-19 19:29:23 +00:00
helixhorned 086ef3f901 Remove 'cl_angleinterpolation' cvar because it had no effect for a while.
Also remove the two instances of commented out code, but not the respective
CON structure access code.

git-svn-id: https://svn.eduke32.com/eduke32@3702 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-22 10:35:44 +00:00
helixhorned bac1a3ff63 gameexec.c: in VM_Fall(), comment out dead code, small indentation change.
git-svn-id: https://svn.eduke32.com/eduke32@3684 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:22 +00:00
helixhorned 73eb1c4def Improve on the code that handles changing sectors of projectiles.
- In the A_MoveSprite() code that transports projectiles due to an SE7
  (introduced in r1450 / legacy ROR), only report "success" if the
  transportation succeeded.
- Clear newly introduced internal SPRITE_DIDNOSE7WATER flag after
  checking it.

git-svn-id: https://svn.eduke32.com/eduke32@3682 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:18 +00:00
helixhorned 3b39a87bd1 Fix a couple of issues identified in the preceding commit.
- In S_PlaySound(), move the sound index bound check above an indexing.
- For A_CheckHitSprite(), and A_FindPlayer(), allow NULL second arg.
- In A_ShootWithZvel(), make some one-letter vars be int32_t, making
  storing safeldist() results in them meaningful.
- In MaybeTrainKillEnemies(), remove two redundant checks and move another
  one further up.
- Comment that SIDEBOLT1 will never be translucent as was probably intended.
- In G_MoveFX(), fix an always-true comparison.

git-svn-id: https://svn.eduke32.com/eduke32@3680 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:13 +00:00
helixhorned 8064bd2f30 Clean up of mostly actors.c, but some other files along the way too.
- Rewrite some sprites-of-{stat,sector} loops using the SPRITES_OF,
  SPRITES_OF_SECT and new SPRITES_OF_SECT_SAFE macros.
- In passing, identify some problems and mark them with 'XXX', but don't
  attempt to fix them yet.
- The usual readability improvements...

git-svn-id: https://svn.eduke32.com/eduke32@3679 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:09 +00:00
helixhorned a25cd24dd5 In upward moving enemy code of VM_Move(), consider TROR boundaries.
This fixes liztroops not passing TROR layers when on the jetpack, as well as
other enemies capable of moving upward, and also COMMANDER and DRONE (for which
the code is special-cased).

git-svn-id: https://svn.eduke32.com/eduke32@3666 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-12 11:59:35 +00:00
helixhorned 985c3d8428 Mostly engine and some gameexec.c stylistic changes.
git-svn-id: https://svn.eduke32.com/eduke32@3663 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-12 11:59:26 +00:00
helixhorned 7b6bf4dda2 Lunatic: new-generation map format, in-memory representation ("map-int VX").
The Lunatic build compiles with new structures for sector and wall types.
They have separate members for TROR {up,down}{bunch,nextwall}, so there are
no conflicts with other uses of members into which they were previously
shoehorned.  Also, the maximum bunch limit is bumped to 512 in that build.

Currently, loading from V7/8/9 and saving to V7 and V8 are supported.

git-svn-id: https://svn.eduke32.com/eduke32@3658 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-09 17:35:11 +00:00
helixhorned 512b9286fe LunaCON: ifsquished.
git-svn-id: https://svn.eduke32.com/eduke32@3640 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:52:59 +00:00
hendricks266 30f510d521 Add "rotatespritea" to CON and M32script.
I hope I didn't bruise Lunatic too much.

git-svn-id: https://svn.eduke32.com/eduke32@3610 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:33:03 +00:00
hendricks266 c5044b3ecd Add orientation bit 2048, enumerated as ROTATESPRITE_FULL16, which is a courtesy provided by the engine for the purpose of the game to internally force use of full 32-bit coordinates. With this bit set, all CON screen drawing commands can use rotatesprite16-like coordinates.
While the functionality was already internally in place for gametext as one of two hacks using ROTATESPRITE_MAX (the other still used by minitext_() to align with the statusbar) we must codify a bit in the engine for safe external use. (Otherwise, ROTATESPRITE_MAX could/would theoretically increase and leave modders high and dry.)

(Dev note: In G_DrawTXDigiNumZ(), ROTATESPRITE_MAX was used to bitshift the value used to calculate digit spacing for no reason I can ascertain other than to introduce rounding errors into the zoom/textscale calculations. It was never used anywhere, so I removed it.)

Bonus: The scaling code for digitalnumberz and gametextz has been modified so that the spacing is no longer affected by rounding errors. Try animating the zoom value and compare how the text used to jump but now does not.

git-svn-id: https://svn.eduke32.com/eduke32@3608 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:31:58 +00:00
helixhorned b7ea1cb205 Lunatic: in readgamearray support code, use engine file functions.
This is so that files residing in GRPs (or anywhere the engine looks for them)
can be read, too.

git-svn-id: https://svn.eduke32.com/eduke32@3594 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:52:52 +00:00
helixhorned 3b3bc6bc01 Lunatic: also save min, max actor times; fix release build.
git-svn-id: https://svn.eduke32.com/eduke32@3557 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-13 10:48:19 +00:00
helixhorned 2d01a81435 Fix starttrack crashing when a "null music" is selected.
Introduced with the refactoring in r3490.

git-svn-id: https://svn.eduke32.com/eduke32@3542 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:40 +00:00
helixhorned c5c1aa2331 Lunatic translator: handle RETURN across events.
git-svn-id: https://svn.eduke32.com/eduke32@3526 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-25 15:31:19 +00:00
helixhorned c66b891a38 Lunatic: export C functions that may call into CON events using the Lua C API.
We must not call these functions using the FFI, since the Lua state is
considered locked across such calls.

git-svn-id: https://svn.eduke32.com/eduke32@3520 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:47 +00:00
helixhorned 6682313e87 gameexec.c: factor out 2x used code into VM_KillIt.
Also, for Lunatic, handle killit from events.

git-svn-id: https://svn.eduke32.com/eduke32@3514 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-21 18:54:07 +00:00
helixhorned 9f843fb445 CON qstrcpy: don't call strcpy() with identical source and destination quotes.
Thus making the identical source and destination quote number case into the
expected no-op instead of being undefined behavior.

git-svn-id: https://svn.eduke32.com/eduke32@3510 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-21 18:53:42 +00:00
helixhorned 740c8d021b CON qsprintf: fix specifying more than one "%s" conversion.
Also, slightly better, though still inadequate checking.

git-svn-id: https://svn.eduke32.com/eduke32@3506 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:56 +00:00
helixhorned 4c57413da6 Fix derailing CON instruction pointer when gametextz is passed null quote.
git-svn-id: https://svn.eduke32.com/eduke32@3500 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:38 +00:00
helixhorned 9617861b8a CON digitalnumber*: move orientation &= (ROTATESPRITE_MAX-1) to G_DrawTXDigiNumZ
git-svn-id: https://svn.eduke32.com/eduke32@3499 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:36 +00:00
helixhorned 801662c3e7 gameexec.c: refactor 'starttrack' for proper bound checking.
git-svn-id: https://svn.eduke32.com/eduke32@3490 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:18 +00:00
helixhorned 6816afe07e Refactor C code related to gettimedate and sect*interpolation CON commands.
No functional changes.

git-svn-id: https://svn.eduke32.com/eduke32@3486 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:00 +00:00
helixhorned 5e84185d6e Factor out setting baslayer timer from game into G_InitTimer().
git-svn-id: https://svn.eduke32.com/eduke32@3485 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:52:56 +00:00
helixhorned cba053bbcf CON myosx*: move masking orientation with user-bits-mask to G_DrawTileGeneric().
git-svn-id: https://svn.eduke32.com/eduke32@3479 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-11 17:16:54 +00:00
helixhorned 200cd75275 Make g_earthquakeTime into a uint16_t, remove DukePlayer_t's name[] member.
Bump BYTEVERSION.

git-svn-id: https://svn.eduke32.com/eduke32@3478 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-11 17:16:50 +00:00
helixhorned 7c861cac42 Rework how the z velocity is passed from *zshoot to A_Shoot().
Previously, actor[].shootzvel (implementation detail, not available to CON)
was checked, and if it was !=0, that was the overridden velocity. The value
0 meant "hardcoded, projectile-dependent velocity". But that neccesiated a
hack where if zvel 0 was passed and really meant, it needed to be set to
1 instead.  Now we have A_ShootWithZvel() taking an additional last argument
plus a macro SHOOT_HARDCODED_ZVEL permissible for that argument.

git-svn-id: https://svn.eduke32.com/eduke32@3465 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:12 +00:00
helixhorned 46fc753f6a gameexec: for VM_Fall and VM_ResetPlayer, pass VM sprite/player etc. as args.
Simplifying VM_FallSprite and VM_ResetPlayer2 used from Lunatic.

git-svn-id: https://svn.eduke32.com/eduke32@3460 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:00:52 +00:00
helixhorned 8e0c7b133e Move around some #ifdef LUNATIC to compile out more code, minor cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@3459 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:00:48 +00:00
helixhorned d82b198799 Lunatic: conditionally compile out more legacy code, remove old mixed mode code.
git-svn-id: https://svn.eduke32.com/eduke32@3456 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-03 12:48:17 +00:00
helixhorned cef99818bb NULL spriteext[].tpsr after each running EVENT_ANIMATESPRITES for a tsprite.
Meaning that only *ettsprite[THISACTOR] makes sense from CON. It did before
too, because .tspr was set before each event run (and not before all runs),
only that it was never nulled, which was kind of untidy.

git-svn-id: https://svn.eduke32.com/eduke32@3450 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 13:05:13 +00:00
helixhorned 142e36d6f4 Lunatic: cmdline switch to run test script, compile out more code, 2 more GVs.
git-svn-id: https://svn.eduke32.com/eduke32@3415 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:06 +00:00
helixhorned 2b0b8d34cc Remove mixed Lunatic/legacy build option.
git-svn-id: https://svn.eduke32.com/eduke32@3410 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:29:00 +00:00
helixhorned c9190e79ae Wrap some ud.camera* and g_camera{Distance,Clock} into CAMERA* macros.
In Lunatic, make it a struct type "camera_t" instead.

git-svn-id: https://svn.eduke32.com/eduke32@3405 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:28:32 +00:00
helixhorned 8fb886b14a Replace dragpoint()'s "dragpoint_noreset" global with a "flags" argument.
Also, add another flag, signifying that from the editor, also the
"lastwall"s (i.e. the CCW-linked points) should get collected. This is
to signal the editor that their wall lengths should be displayed, too.

git-svn-id: https://svn.eduke32.com/eduke32@3394 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-16 20:38:41 +00:00
helixhorned 67cdd9d883 gameexec.c: factor code for "ifnosounds" into sounds.c: A_CheckAnySoundPlaying.
git-svn-id: https://svn.eduke32.com/eduke32@3365 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-02 22:33:32 +00:00
helixhorned fd390efe2a Lunatic: compile out more code with LUNATIC_ONLY.
git-svn-id: https://svn.eduke32.com/eduke32@3354 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:18 +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 5fc9bb9779 Lunatic: more glue, fixes, backtrace for code called back from C.
git-svn-id: https://svn.eduke32.com/eduke32@3345 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:32 +00:00
helixhorned 80f3e132b0 Replace "if (g_tile[..].execPtr)" -> "if (G_HaveActor(...))".
git-svn-id: https://svn.eduke32.com/eduke32@3344 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:28 +00:00
helixhorned 48c47af5dc Pack actor_t's bposx/bposy/bposz members into a vec3_t named "bpos".
git-svn-id: https://svn.eduke32.com/eduke32@3314 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 14:00:08 +00:00
hendricks266 6f2fa332dd Port system gamearray access from M32Script to CON. Expose tilesizx and tilesizy.
Also, fix deficient logic in Gv_Free and Gv_Clear (both M32 and CON) so that gamevar and gamearray erasure results are (closer to) correct, and so that the game does not crash when system arrays are accessed from CON because they all have been nulled.

git-svn-id: https://svn.eduke32.com/eduke32@3274 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:33:53 +00:00
helixhorned fc048658dc Experimental NETCODE Makefile variable, enabled by default.
Disabling netcode compilation can be interesting on memory-constrained
systems, or those that have no means of accessing the network anyway.
Note: I'm OK with maintaining this myself, i.e. it's fine if netcode dev
breaks compilation with NETCODE=0.

git-svn-id: https://svn.eduke32.com/eduke32@3260 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:44 +00:00
helixhorned 99c67c0190 Lunatic: submerging in code.
git-svn-id: https://svn.eduke32.com/eduke32@3254 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-03 18:24:30 +00:00
helixhorned b062d5f572 Lunatic: knee-deep in code.
- more codegen
- make more members const, some char unsigned
- fix some "geom" metamethods
- '^' operator

git-svn-id: https://svn.eduke32.com/eduke32@3253 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-03 18:24:25 +00:00
helixhorned 2bcf8aa8ec gameexec.c: rip out some inline code into VM_Fall() and VM_ResetPlayer().
git-svn-id: https://svn.eduke32.com/eduke32@3252 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-03 18:24:20 +00:00
helixhorned 76b970e547 Lunatic: implement the non-local control flow needed for some commands.
git-svn-id: https://svn.eduke32.com/eduke32@3250 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-30 18:57:59 +00:00
helixhorned 5b07f67627 Lunatic: player stuff (protect some members etc.)
git-svn-id: https://svn.eduke32.com/eduke32@3249 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-30 18:57:55 +00:00
helixhorned 375d164138 Move enum vmflags_t to gameexec.c since it's an implementation detail.
git-svn-id: https://svn.eduke32.com/eduke32@3242 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-29 12:49:34 +00:00
hendricks266 890aba88eb Fix warnings involving printf() requiring explicit casts on tracked types.
git-svn-id: https://svn.eduke32.com/eduke32@3238 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-26 08:26:04 +00:00
terminx 83ae3a407a Further minor MACT cleanups
git-svn-id: https://svn.eduke32.com/eduke32@3200 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:48:11 +00:00
helixhorned 5ad385c043 Split r3159..r3161, part 10: add explicit casts to *alloc return values.
NOTE: changes such as these are best viewed with something like
git diff (...) --color-words='[a-zA-Z0-9_]+|[^[:space:]]'

git-svn-id: https://svn.eduke32.com/eduke32@3176 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:29 +00:00
helixhorned 6b01b43713 Split r3159..r3161, part 9: make CON's 'respawnhitag' unconditional on hitag.
... in the 'default' case (non-FEM* tiles).

git-svn-id: https://svn.eduke32.com/eduke32@3175 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:21 +00:00
helixhorned 274726be9b Split r3159..r3161, part 5: "nowarn" wrapping of printing functions.
git-svn-id: https://svn.eduke32.com/eduke32@3170 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:04 +00:00
helixhorned 1cd11d06ef Revert "Fix the warnings when building with C++, add MSVC C++ build support."
This reverts r3159..r3161.

Conflicts:
	eduke32/build/include/compat.h
(Handled so that r3163's changes are kept applied.)

git-svn-id: https://svn.eduke32.com/eduke32@3165 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:45 +00:00
terminx 3ff46c02b2 Fix the warnings when building with C++, add MSVC C++ build support. This also changes the internal type of lotags, hitags and cstat type fields to uint16_t instead of int16_t to clean up some dubious behavior wherein the code was using a value of 32768 as a flag in these fields for certain types of things, like invisible sprites (using the value as if it was uint16_t) where it was elsewhere checking if the value was < 0 (using the value as if it was int16_t). This change may break a few specific effects if any part of the relevant code was missed when looking for areas that needed to be addressed.
I think there's also a fix for the CON precache system breakage in here (lost it in my local tree when I started getting the C++ build working in MSVC, sorry!)


git-svn-id: https://svn.eduke32.com/eduke32@3159 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-14 23:32:43 +00:00
helixhorned 3bcdc5acb8 Lunatic reorganization part 2: split into engine and editor/game parts.
On the engine side (functions starting with L_), there are now the basic
parts like state creation and running code from strings and files.
The game and editor can add to that by e.g. loading whatever they please
into the state. Their functions start with El_ and Em_, respectively.
The Lua scripts still reside in source/lunatic, even for the common ones.
This is because they will be embedded into the binaries as bytecode or
compressed source eventually, so their location on disk will be irrelevant.

git-svn-id: https://svn.eduke32.com/eduke32@3148 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 20:59:00 +00:00
terminx 5cca0d4ffe Add some compile time defined names for p->inven_icon values. Too bad these values aren't in the same order as the inventory items themselves... (dukeinv_t and dukeinvicon_t values do not match).
git-svn-id: https://svn.eduke32.com/eduke32@3115 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-04 23:41:05 +00:00