Commit Graph

3923 Commits

Author SHA1 Message Date
helixhorned 7f2175fcec Lunatic: retire per-sprite tsprite access for per-tile animation callback reg.
Don't yet make this official API though, since there are unresolved issues
with newly created tsprites potentially being fed back to the animation loop.
Add xmath.angvec(), xmath.bangvec(), tspr:set_sectnum(), tspr:setpos().

git-svn-id: https://svn.eduke32.com/eduke32@3937 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:10 +00:00
helixhorned c243bab0e7 Remove one instance of duplicate code lines and now unused TSPR_MIRROR.
git-svn-id: https://svn.eduke32.com/eduke32@3936 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:07 +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 76a04c4a3a In Windows and SDL layers, rename *hitick* to *u64tick*.
git-svn-id: https://svn.eduke32.com/eduke32@3934 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:00 +00:00
helixhorned f37d845f02 Lunatic: various unrelated changes and more documentation.
- check map-text version on load
- LunaCON: don't allow (back)slash as identifier char
- LunaCON stand-alone: don't resort to default directory for root file names
- document non-local control flow functions and for LunaCON, ambigious lexical
  elements

git-svn-id: https://svn.eduke32.com/eduke32@3933 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:58:57 +00:00
helixhorned 6e443944c3 Lunatic: partially fix LTO=1 build with GCC.
Having to tag these few variables and functions as ATTRIBUTE((used))
seems sensible, but what follows is just strange. OSD_Printf? headspritesect?

git-svn-id: https://svn.eduke32.com/eduke32@3932 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:53 +00:00
helixhorned baebd63bac Lunatic: make g_playerWeapon an array of a corresponding bcarray type.
git-svn-id: https://svn.eduke32.com/eduke32@3931 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:50 +00:00
helixhorned 4c4cf5eecc Lunatic: document the additions of the preceding commits.
git-svn-id: https://svn.eduke32.com/eduke32@3930 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:48 +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 d580c1e998 Lunatic: many changes, motivated by writing test "helixspawner".
- some renames of functions/methods
- con.actorvar: explicitly allow (for now) boolean and number values
- added gv.gametic, player.holdskey(), player.all(), actor.check*()/hit*(),
  gv.rendmode, gv.REND, <bitint>:mask(), spr:getheightofs()
- make read of nil var in "finalized" (live) module produce error, too
- add test/helixspawner.lua

git-svn-id: https://svn.eduke32.com/eduke32@3928 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:42 +00:00
helixhorned 44f71d313f Lunatic: on palfrom from CON or C, set palsfade{speed,next} and regard prio.
git-svn-id: https://svn.eduke32.com/eduke32@3927 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:39 +00:00
helixhorned 184a7322de Polymodes/Lunatic: don't do y panning "correction" for nonpow2 ysize tiles.
git-svn-id: https://svn.eduke32.com/eduke32@3926 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:37 +00:00
helixhorned e771c7faf3 Lunatic: document con.action/move/ai and actor methods.
Also, in some movement functions, replace e.g. (vel*TICSPERFRAME)>>2 with vel.

git-svn-id: https://svn.eduke32.com/eduke32@3925 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:35 +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 cb2edcf45e Lunatic: in con.action and con.move, allow mixed number/string key tables.
E.g. con.action{0, 4, delay=20}; for convenience, viewtype and incval are
initialized to 1 (not 0) here.

git-svn-id: https://svn.eduke32.com/eduke32@3923 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:54 +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 67db095bd3 Lunatic: require'CON.ACTION' etc. gets composites from CON; add actor.MOVFLAGS.
git-svn-id: https://svn.eduke32.com/eduke32@3917 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:41 +00:00
helixhorned 36f3a8e47c Lunatic: don't register con.action/move/ai by name, make these return a cdata.
git-svn-id: https://svn.eduke32.com/eduke32@3916 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:39 +00:00
helixhorned 16f2f4c475 lunatic/listglobals.sh: allow passing multiple file names.
git-svn-id: https://svn.eduke32.com/eduke32@3915 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:37 +00:00
helixhorned fb0c13f9f2 Lunatic: serialization for cdata types, currently xmath.vec3 and ivec3.
git-svn-id: https://svn.eduke32.com/eduke32@3914 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:35 +00:00
helixhorned dea960d350 Fix loading maps in Mapster32, introduced in r3911.
Also, get rid of the strange filename[len]=255 hack in loadboard()
and make its file name arg const char* at last.

git-svn-id: https://svn.eduke32.com/eduke32@3913 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-29 12:15: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 b2c5e2d807 Mapster32/Lunatic: ask when a <V10 map would be overwritten with a map-text one.
Also, clean up the saving/loading logic a bit:
- On load failure, display message with purple color.
- Take over the current file name ('boardfilename') only on success.
- Check SaveBoard() return values in various places.

git-svn-id: https://svn.eduke32.com/eduke32@3911 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:44 +00:00
helixhorned 5ea2eee072 Lunatic: merge updatesector and ~breadth, making the former accept a flag.
git-svn-id: https://svn.eduke32.com/eduke32@3910 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:43 +00:00
helixhorned 885036a6a3 Lunatic: retire 'geom' module, putting vector types into xmath.
git-svn-id: https://svn.eduke32.com/eduke32@3909 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:41 +00:00
helixhorned 7cb94070e1 Lunatic: allow serialization of tables in more general cases.
git-svn-id: https://svn.eduke32.com/eduke32@3908 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:39 +00:00
helixhorned bb71052cb7 Lunatic: begin writing LunaCON documentation.
git-svn-id: https://svn.eduke32.com/eduke32@3907 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:37 +00:00
helixhorned 89d865b8b1 Lunatic: don't pass 0x80000000 to int32_t arg, document xmath functions.
git-svn-id: https://svn.eduke32.com/eduke32@3906 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:33 +00:00
terminx 2f883eaed1 Apparently VS2013 doesn't like redefining "inline" either
git-svn-id: https://svn.eduke32.com/eduke32@3905 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:05:24 +00:00
terminx 6ed7562f10 Fix USE_OPENGL=0 build
git-svn-id: https://svn.eduke32.com/eduke32@3904 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:05:11 +00:00
terminx e9a773a588 Add a few defined constants for commonly used weapon_pos values
git-svn-id: https://svn.eduke32.com/eduke32@3903 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:57 +00:00
terminx 214baa9475 Rename getinput() to P_GetInput(), add bounds checking for a few arrays used for weapon drawing that use kickback_pic as an index.
git-svn-id: https://svn.eduke32.com/eduke32@3902 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:39 +00:00
terminx 6516a29778 Make P_PalFrom() static inline in player.h as the whole function is just 4 assignments
git-svn-id: https://svn.eduke32.com/eduke32@3901 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:24 +00:00
terminx b1dd4ffc6c MSVC build fix (looks like the compiler version shipped with VS2013 has nearbyintf now...)
git-svn-id: https://svn.eduke32.com/eduke32@3900 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:11 +00:00
terminx 767d123590 Default r_usetileshades to 1 :)
git-svn-id: https://svn.eduke32.com/eduke32@3899 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:03:55 +00:00
helixhorned db7f820404 engine: consider a point inside() a sector in all border cases (literally).
In other words, for a test rectangular sector, a sprite would be inside the
sector in on all 4 edges and all 4 corners. Previously, it would have been
the lower right portion only (*excluding* LL and UR corners), which led to
map editing issues.

git-svn-id: https://svn.eduke32.com/eduke32@3898 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:16 +00:00
helixhorned 8b4a87925b engine.c: apply "usual readability transformations" on inside() and comment it.
The main thing to note is the "half-open" nature of the x/y range checks.

git-svn-id: https://svn.eduke32.com/eduke32@3897 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:15 +00:00
helixhorned a3adf3508e Substitute some symbolic SE_x_* labels for literal SE numbers that were missed.
git-svn-id: https://svn.eduke32.com/eduke32@3896 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:13 +00:00
helixhorned bfd9feb5aa Lunatic: document vector types, add forgotten warning icon.
git-svn-id: https://svn.eduke32.com/eduke32@3895 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:12 +00:00
helixhorned 1febaae767 Lunatic: various minor tweaks and fixes.
- Pass original module name (dot=dirsep) to module via our require()
- geom.lua: fix some operations using the vector type constructor
- geom.lua: provide constructor for ivec3, useable like vec3

git-svn-id: https://svn.eduke32.com/eduke32@3894 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:09 +00:00
helixhorned 5db04f585e Lunatic: player method fadecol(), an improved palfrom.
Also, an external 'minitext' with optional shade and pal. args and
documentation for ps:padecol().

git-svn-id: https://svn.eduke32.com/eduke32@3893 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:50 +00:00
helixhorned e8c9bf044f Don't register "savestate" and "restorestate" OSD commands even in debug builds.
They don't get registered on Windows for some reason, and mapstate debugging is
best carried out using scripting code, anyway.

git-svn-id: https://svn.eduke32.com/eduke32@3892 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:48 +00:00
helixhorned b319ae5613 Lunatic: major overhaul of gamevar serialization for savegames.
- Handle local gamevars.
- Restore gamevars from require('end_gamevars').

git-svn-id: https://svn.eduke32.com/eduke32@3891 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:47 +00:00
helixhorned 10379910c1 Lunatic 'geom': retire tovec2 and tovec3, make vec2 and vec3 accept cdata, too.
git-svn-id: https://svn.eduke32.com/eduke32@3890 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:45 +00:00
helixhorned 4a4f90e5e7 Lunatic: fix random angle movflag, Windows build; write more documentation.
git-svn-id: https://svn.eduke32.com/eduke32@3889 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:42 +00:00
helixhorned 2959f86fbd Classic: prevent a SIGFPE when attempting to draw p'lax with nonexistent tile.
git-svn-id: https://svn.eduke32.com/eduke32@3888 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-15 12:52:08 +00:00