Commit Graph

483 Commits

Author SHA1 Message Date
helixhorned caed55e9a4 Lunatic: engine.setupDebugBasePal(), auto-detect 2nd+ shadexfog.translate().
engine.setupDebugBasePal() set up the water base palette such each of the first
15 "ramps" of 16 consecutive colors has a single, "representative" color. For
example, color indices 0-15 and black, 16-31 are dark gray.
In shadexfog.lua, list remappings from LOOKUP.DAT that are expressible as
remappings of 16-tuples.

git-svn-id: https://svn.eduke32.com/eduke32@4337 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-19 19:47:25 +00:00
helixhorned b79fa42903 Lunatic: add engine.saveLookupDat() and document, related tweaks.
- Mapster32: before loading LOOKUP.DAT, set palookup[0][239]=239 to
  make an identity map of the base shade table's shade 0
- Rewrite color index remapping case of makepalookup() for clarity

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4336 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-16 19:16:06 +00:00
helixhorned 37ffae149e Lunatic: rewrite shadexfog.create_128_trans to allow creating fewer tables.
It must be a power of two in [2 .. 128]. Rewrite test/sprite_access.con's
liztroop example to account for that.
Also, add function shadexfog.create_trans() which aceepts a function
(r,g,b,R,G,B) -> blended (r,g,b) and rewrite shadexfog.create_additive_trans()
in terms of it.

git-svn-id: https://svn.eduke32.com/eduke32@4333 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-16 19:16:01 +00:00
helixhorned e68d5a14b3 Lunatic: in shade table 'remap16' method, allow sparse table, document it.
Add shadexfog.createremap() convenience function.

git-svn-id: https://svn.eduke32.com/eduke32@4332 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-16 19:15:59 +00:00
helixhorned 00a6a058ef Lunatic: in engine.savePaletteDat(), open file in binary mode. BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4331 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-13 15:39:28 +00:00
hendricks266 fd3712ab22 Windows: Full library refresh.
git-svn-id: https://svn.eduke32.com/eduke32@4319 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-10 10:58:38 +00:00
helixhorned 0aa7b11dca C-CON: add *actor[].blend as an alias to .detail, *tspr[].tsprblend analogously.
See lunatic/test/sprite_access.con for a LIZTROOP that periodically smoothly
alpha-fades in and out. (Assuming that the 128 alpha blending tables from
shadexfog.create_128_trans(1) are installed.)

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4313 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-09 19:22:36 +00:00
helixhorned 846fcdf31c Extend PALETTE.DAT format to allow carrying additional blending tables.
Lunatic: also, add an additional argument 'moreblends' to
engine.savePaletteDat() and document that function.
See test/shadexfog.lua for a "user-friendly" wrapper shadexfog.save() which
prints success or errors.

git-svn-id: https://svn.eduke32.com/eduke32@4312 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-09 19:22:35 +00:00
helixhorned 075d817ed7 Lunatic: move code in test/shadexfog.lua to engine.savePaletteDat() and complete it.
The function now writes out a full PALETTE.DAT: base balette, shade table and
translucency table.

git-svn-id: https://svn.eduke32.com/eduke32@4311 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-09 19:22:33 +00:00
helixhorned eec27960ea Lunatic: update dynsymlists. Move blendtable[] from build.h to engine.c.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4309 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:59 +00:00
helixhorned a9fb9e6356 Lunatic: add a 'lastokcol' argument to engine.nearcolor() and document it.
On the C side, slightly rewrite (now) getclosestcol_lim() for clarity.

git-svn-id: https://svn.eduke32.com/eduke32@4308 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:58 +00:00
helixhorned 5726a15bb3 Lunatic: document engine.*blendtab() and engine.getrgb() functions.
git-svn-id: https://svn.eduke32.com/eduke32@4307 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:57 +00:00
helixhorned a37c31cab7 Lunatic: rename sprite[].filler member to 'blend' on the Lua side.
From LunaCON, remove 'detail' as alias to that member.

git-svn-id: https://svn.eduke32.com/eduke32@4302 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:51 +00:00
helixhorned 330b744a1b Classic: support for multiple blending tables + Lunatic interfaces.
Currently, sprite[].filler (to be renamed) selects a blending table. If none
is installed with that index, the blending table at index 0 is taken (which is
read from PALETTE.DAT on engine startup). Thus, for now, the non-Lunatic build
will never use a custom blending table because there's no way to register one!
But the functionality is there.

git-svn-id: https://svn.eduke32.com/eduke32@4301 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:49 +00:00
helixhorned bd34885653 LunaCON: add and document -Wnever-used-gamevar and -Wnever-read-gamevar.
git-svn-id: https://svn.eduke32.com/eduke32@4299 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:47 +00:00
helixhorned 21a8788b6b LunaCON: implement 'precache'.
git-svn-id: https://svn.eduke32.com/eduke32@4291 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-02 10:50:40 +00:00
helixhorned 6d8ea48257 LunaCON: add option -ferror-nonlocal-userdef, on by default.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4290 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-01 16:19:59 +00:00
helixhorned 7c26c180cd LunaCON: accept empty square brackets for {g,s}etuserdef optional index part.
git-svn-id: https://svn.eduke32.com/eduke32@4287 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-01 16:19:55 +00:00
helixhorned 842cce37b7 Lunatic: Fix compilation of C++ build, but not starting up yet.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4286 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:13:03 +00:00
helixhorned 60612d07f0 LunaCON: error on userdefs accesses with non-local current player.
Add lunatic/test/getuserdef.con.

git-svn-id: https://svn.eduke32.com/eduke32@4285 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:13:01 +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
helixhorned 1b3046d1c8 Fix respawn operation with monsters off, rewriting G_OperateRespawns().
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4276 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-29 18:32:51 +00:00
helixhorned 63e0de5e3d TROR: when clearing bunch number of c/f with yax_setbunch(), don't reset xpanning.
In the non-Lunatic build naturally, since the Lunatic one uses its own member.

git-svn-id: https://svn.eduke32.com/eduke32@4275 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-28 19:03:47 +00:00
helixhorned 3a85134e31 LunaCON: add codegen option -fbad-getactorvar-use-pli for C-CON compatibility.
Also, improve -Wnumber-conversion warning by printing the resulting number.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4266 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-24 21:39:04 +00:00
helixhorned b6e9c0b409 Lunatic: document engine.*shadetab() functions. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4262 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-19 20:17:25 +00:00
helixhorned 14db86ebb5 Lunatic: make gv.current{Level,Episode} one-based and document them.
Also, in LunaCON, make player .palette member read-only. BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4260 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-15 20:29:10 +00:00
helixhorned 8d47e476c7 LunaCON: for readgamevar, if ud.config.scripthandle < 0, keep value, don't err.
git-svn-id: https://svn.eduke32.com/eduke32@4256 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:54:34 +00:00
helixhorned 9e968b0093 Lunatic: remap16 method for engine.shadetab, 2nd attempt at recreating orig. one.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4242 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-05 14:06:14 +00:00
helixhorned a9fb18b228 Lunatic: document fundamentals of shade tables, but not 'engine' API yet.
git-svn-id: https://svn.eduke32.com/eduke32@4239 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-02 00:08:39 +00:00
helixhorned e71df2b6e3 Lunatic/m32: make Mapster23 actually start stand-alone, oops.
git-svn-id: https://svn.eduke32.com/eduke32@4238 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-02 00:08:36 +00:00
helixhorned 49de6d79b3 Lunatic/m32: include the Lua bytecode into the binary, exit if setup failed.
git-svn-id: https://svn.eduke32.com/eduke32@4237 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:52:01 +00:00
helixhorned 13c125db02 Lunatic: add 'engine' module, currently allowing to create custom shade tables.
Available in the game and editor. Provide test/shadexfog.lua, containing a
function to creating a set of 32 shade tables corresponding to different shades
of the same fog palookup table, together with some tests and convenience
functions.

Also,
- Add gv.LUNATIC_CLIENT{,_EDUKE32,_MAPSTER32}
- Add LUNATIC_FIRST_TIME in the global env for the game
- defs_m32.lua: add reload() convenience function
- Failed attempt at recreating the base shade table. It is NOT a linear ramp
  of the base palette colors to (0,0,0). That is, it's not created by
  build/util/transpal.exe!

git-svn-id: https://svn.eduke32.com/eduke32@4236 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:52:00 +00:00
helixhorned 75f5449e9a build.lua: add a flag toggling multiplication of the color components by 4.
git-svn-id: https://svn.eduke32.com/eduke32@4235 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:51:57 +00:00
helixhorned 2174b17901 Lunatic: fix setup under Mapster32, remove a few obsolete lines in defs_common.lua.
git-svn-id: https://svn.eduke32.com/eduke32@4234 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:51:55 +00:00
helixhorned 70d84cd75b Lunatic: run EVENT_INIT after initial Lua state creation.
git-svn-id: https://svn.eduke32.com/eduke32@4231 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:51:50 +00:00
helixhorned 148badc32a Lunatic: allow access to sprite[].yvel through set_yvel() member, document.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4230 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:39 +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 2442b107f7 Lunatic: add example toggling forcefield wall to test.lua.
git-svn-id: https://svn.eduke32.com/eduke32@4224 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:18 +00:00
helixhorned d26ae58627 Rename 'camsprite' to 'g_curViewscreen', other related cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@4220 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:12 +00:00
helixhorned d3665719d9 Add helper utility lunatic/util/cmpart.lua.
git-svn-id: https://svn.eduke32.com/eduke32@4219 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:09 +00:00
helixhorned 2900144e22 Lunatic: swap con.insetsprite's 4th and 5th positional arguments.
git-svn-id: https://svn.eduke32.com/eduke32@4218 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:06 +00:00
helixhorned 3cef7cccc0 Lunatic: expose player[].gotweapon, document it and *_weapon() methods.
git-svn-id: https://svn.eduke32.com/eduke32@4217 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:03 +00:00
helixhorned a4510e35a1 Lunatic: error on invalid static data read like 'sprite.picnum'.
git-svn-id: https://svn.eduke32.com/eduke32@4209 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-24 09:44:19 +00:00
helixhorned 02e0929ca7 Pass RETURN to EVENT_DAMAGEHPLANE in the 'dist' arg to allow chained callbacks.
git-svn-id: https://svn.eduke32.com/eduke32@4208 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-24 09:44:14 +00:00
helixhorned fa6746867c Lunatic: add ceiling-or-floor method set_picnum(). BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4207 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:35 +00:00
helixhorned 0c69779b98 Scripting: Add EVENT_DAMAGEHPLANE and document it in Lunatic doc Appendix B.
Also add test/damagehplane.lua with these demonstrations:
 - custom breakable ceilings
 - breakable TROR glass

git-svn-id: https://svn.eduke32.com/eduke32@4206 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:33 +00:00
helixhorned 99894812d8 Minor no-functionality-changing tweaks.
- factor out: G_WallSpriteDist()
- factor out: Proj_MaybeDamageCF() and Proj_MaybeDamageCF2()
  in preparation for the next commit
- Make PROJ_DECAYVELOCITY macro take an arg for readability's sake

git-svn-id: https://svn.eduke32.com/eduke32@4204 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:26 +00:00
helixhorned dd52afbf1b Lunatic: fix a couple of spelling mistakes in the doc, found using Emacs ispell.
git-svn-id: https://svn.eduke32.com/eduke32@4202 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:22 +00:00
helixhorned 25108494d1 Lunatic: expose "con.shoot(tilenum, i [, zvel])". Document and add example.
git-svn-id: https://svn.eduke32.com/eduke32@4201 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:20 +00:00