This reverts/corrects two semantic changes of r4639 as far as what is now
voxmodel.c (formerly part of mdsprite.c) is concerned. One correction ends
up having no effect (m->bscale is always 1.f for voxel models, as far as I
can see), but is the proper rewrite.
Also, in osdcmds.c:registerosdcommands(), tweak two help strings.
git-svn-id: https://svn.eduke32.com/eduke32@4800 1a8010ca-5511-0410-912e-c29ae57300e0
- Needed to rip out enum GameEvent_t into own header file to prevent what
would be a circular #include otherwise
- Added some forgotten #ifdef LUNATIC
- updated structure and function declarations on the Lua FFI side
git-svn-id: https://svn.eduke32.com/eduke32@4710 1a8010ca-5511-0410-912e-c29ae57300e0
The additional space was there all the time, so it's not understandable why
another array was necessary.
CON: for 'music', error if volume number is outside [0 .. MAXVOLUMES+1], and
in LunaCON, additionally warn if it's MAXVOLUMES+1 (0 is preferred for that).
git-svn-id: https://svn.eduke32.com/eduke32@4588 1a8010ca-5511-0410-912e-c29ae57300e0
In C-CON's qsubstr, error if <start> is not in [0 .. MAXQUOTELEN-1]
or <length> is negative.
git-svn-id: https://svn.eduke32.com/eduke32@4583 1a8010ca-5511-0410-912e-c29ae57300e0
1 compiler error.
2 compiler warnings.
1 runtime warning.
Note that at this time, CPLUSPLUS=1 LUNATIC=1 fails to build due to C++ function mangling, and Win64 Lunatic crashes.
DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4540 1a8010ca-5511-0410-912e-c29ae57300e0
That is, the reverse of what is returned with the first outarg. Use that in
lunatic/util/foreachmap.lua. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4499 1a8010ca-5511-0410-912e-c29ae57300e0
... and cull code that is dead with the X*alloc() versions since they never
return NULL on requesting memory.
Use something like
git grep '[^Xx]\(m\|c\|re\)alloc *('
and
git grep '[^Xx]strdup *('
to see places where I left the B*alloc() calls intact.
BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4491 1a8010ca-5511-0410-912e-c29ae57300e0
Concretely, for all 1 <= i <= 255, make graypalookup[31][i] := graypalookup[31][0].
Also document 'fogpal' in the Lunatic doc.
git-svn-id: https://svn.eduke32.com/eduke32@4456 1a8010ca-5511-0410-912e-c29ae57300e0
For convenience, orientation gets bit 1 (translucency) set automatically.
Again, test/screentext.con is updated to show off this functionality (the
code there assumes that additive blending tables are loaded at blend
numbers 101 -- 132).
BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4428 1a8010ca-5511-0410-912e-c29ae57300e0
The extended PALETTE.DAT format can now carry a trailing byte, called
'lognumalphatables'. If it is present, the engine assumes that alpha blending
tables are loaded at blend indices 1 to 1<<lognumalphatables and handles
rotatesprite's alpha and spriteext[].alpha accordingly.
The ability to save this new byte is added to engine.lua:savePaletteDat()
and the corresponding convenience functions in shadexfog.lua.
Examples test/screentext.con and test/sprite_access.con are updated for
demonstration purposes.
git-svn-id: https://svn.eduke32.com/eduke32@4426 1a8010ca-5511-0410-912e-c29ae57300e0
Hook up those from test/shadexfog.lua and some debugging ones from engine.lua.
git-svn-id: https://svn.eduke32.com/eduke32@4419 1a8010ca-5511-0410-912e-c29ae57300e0
The overall situation is thus as follows:
- in C and from Lua, that member is called 'fogpal'
- In CON (both C-CON and LunaCON), it's 'fogpal' with 'alignto' being an alias;
'filler' wasn't available before, either.
- In m32script, it's 'fogpal' or 'alignto' ('filler' is not available any more)
git-svn-id: https://svn.eduke32.com/eduke32@4416 1a8010ca-5511-0410-912e-c29ae57300e0
The state quries the user for four values: ref. picnum, target picnum, max.
ldist and a lotag. Then, for all sprites i (of ref. picnum), for all sprites j
(of target picnum), if ldist(i,j)<=maxldist, sprite j's lotag is changed to the
provided one.
Also add lunatic/test/maputil.lua, containing a similar function but allowing
to customize the selection predicates of the ref. and target sprites, as well
as the action to carry out.
git-svn-id: https://svn.eduke32.com/eduke32@4414 1a8010ca-5511-0410-912e-c29ae57300e0
In C and Lunatic, split 'jumptoplayer' of enum amoveflags_t / action.MOVFLAGS
into 'jumptoplayer_bits' and 'jumptoplayer_only' (see updated Lunatic doc).
git-svn-id: https://svn.eduke32.com/eduke32@4378 1a8010ca-5511-0410-912e-c29ae57300e0
That is, always bitwise-OR the per-tile actor flags with the existing ones.
git-svn-id: https://svn.eduke32.com/eduke32@4374 1a8010ca-5511-0410-912e-c29ae57300e0
Reserved bits are those that have no predefined SFLAG_* label in CON.
git-svn-id: https://svn.eduke32.com/eduke32@4372 1a8010ca-5511-0410-912e-c29ae57300e0
This flag is set from C for some enemies that should not be pushed back when
damaged, such as TANK. Both the tile flag and the per-sprite flag are used
(i.e. the ultimate flag value is the XOR of the two).
Add currently non-functional example to test.lua that attempts to set this bit
for NEWBEAST.
git-svn-id: https://svn.eduke32.com/eduke32@4371 1a8010ca-5511-0410-912e-c29ae57300e0
Unlike in C-CON, it only tries an exact match with the given and uppercased
label, not "full" case-insensitive search.
git-svn-id: https://svn.eduke32.com/eduke32@4370 1a8010ca-5511-0410-912e-c29ae57300e0
Make Mapster32 save as map-text if there is a wall with non-zero 'blend'.
git-svn-id: https://svn.eduke32.com/eduke32@4368 1a8010ca-5511-0410-912e-c29ae57300e0
It now accepts a number of tables to create as 3rd arg. The function that
create_trans() takes as the 2nd argument is now being passed
(r,g,b, R,G,B, tablei, numtables).
Rewrite create_additive_trans() in terms of it.
Rename create_128_trans() -> create_alpha_trans().
git-svn-id: https://svn.eduke32.com/eduke32@4347 1a8010ca-5511-0410-912e-c29ae57300e0
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
- 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
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
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
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
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
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
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
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
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
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
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