And 0 otherwise. Before accessing a sprite that is not not known to be
definitely valid (e.g. a loop over all sprites from 0 to MAXSPRITES-1),
one should check for validity before accessing it in any other fashion.
git-svn-id: https://svn.eduke32.com/eduke32@4146 1a8010ca-5511-0410-912e-c29ae57300e0
Factor out a block of code into C_SetCfgName() and use that from lunacon.lua.
git-svn-id: https://svn.eduke32.com/eduke32@4143 1a8010ca-5511-0410-912e-c29ae57300e0
Also, shorten "FAILED STARTING DEMO RECORDING." message so that it fits on
the screen. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4133 1a8010ca-5511-0410-912e-c29ae57300e0
I updated the help windows to prefer these variants because they are superior to the -xSquished versions.
Also, factor out the command-line processing code for the above, plus con/def modules and clipmaps.
git-svn-id: https://svn.eduke32.com/eduke32@4128 1a8010ca-5511-0410-912e-c29ae57300e0
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
So that there are no error messages like "M32 file `a.m32.m32' not found."
Also, in build.c's 'save as' code, add a bound check that would probably
always pass in practice, but looks a bit safer and may fail in very cornerly
cases.
git-svn-id: https://svn.eduke32.com/eduke32@4124 1a8010ca-5511-0410-912e-c29ae57300e0
Instead of directly in build.c:app_main(). Previously, it was possible that an
argument to an option, e.g. "WGR2" with "-game_dir WGR2", would get interpreted
as the initial map to load. This in turn would attempt to execute WGR2.cfg as
sequence of OSD commands -- where that file is an EDuke32 config file instead!
Now: maps are passed without any options, e.g. "mapster32 [opts...] debug.map".
The map file name is not added to the "additional parameters" for map testing.
git-svn-id: https://svn.eduke32.com/eduke32@4121 1a8010ca-5511-0410-912e-c29ae57300e0
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
Each scene is disabled in its entirety, there's no way to disable only a
particular part. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4109 1a8010ca-5511-0410-912e-c29ae57300e0
That is, now it's not necessary to write e.g. "io. write" -- .xxx is
translated to <what>[i].xxx only if it's a matching member name.
git-svn-id: https://svn.eduke32.com/eduke32@4105 1a8010ca-5511-0410-912e-c29ae57300e0
Variables at global scope which share a name tend to actually be the same variable. Not good when you pass such a variable to function that immediately returns if the passed parameter (the variable) equals said variable (itself).
git-svn-id: https://svn.eduke32.com/eduke32@4090 1a8010ca-5511-0410-912e-c29ae57300e0
- Don't print osd.szCSDVersion when it is empty, preventing an extra space between the OS name and version number. (An example of what this field holds is "Service Pack 1".)
- Under SDL, allow the "console" edit field to repaint after "OK" is clicked. Important when a long def file is loading.
git-svn-id: https://svn.eduke32.com/eduke32@4086 1a8010ca-5511-0410-912e-c29ae57300e0
Unfortunately, SDL2 does not (yet?) provide a Yes/No box for wm_ynbox().
git-svn-id: https://svn.eduke32.com/eduke32@4085 1a8010ca-5511-0410-912e-c29ae57300e0
Cognitively, so much time has passed that these unused variables would offer little help indicating the roadmap for networking. In any case, I have taken care only to comment rather than remove anything that is more than just a throwaway loop counter.
If this commit inconveniences anyone in any way, please contact me personally and I will make it right.
git-svn-id: https://svn.eduke32.com/eduke32@4079 1a8010ca-5511-0410-912e-c29ae57300e0
This also exposes an actual issue. The sound definitions may be dynamically
remapped, in which case they are not necessarily <=255 any more.
BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4069 1a8010ca-5511-0410-912e-c29ae57300e0
Most often, this had happened when casting comparison functions for qsort()
like these: "int yax_cmpbunches(const int16_t *b1, const int16_t *b2)"
to a function pointer type expecting "const void *". Alas, this is undefined
behavior: see
http://blog.frama-c.com/index.php?post/2013/08/24/Function-pointers-in-C
and posts linked from it.
At least two cases have not been fixed:
- The savegame system maintains pointers which are either to data or a function in
the generic "void *". This ought to be made into a union.
- Probably also:
#define OSD_ALIAS (int32_t (*)(const osdfuncparm_t*))0x1337
git-svn-id: https://svn.eduke32.com/eduke32@4068 1a8010ca-5511-0410-912e-c29ae57300e0
Also, add hitscan test to test.lua -- a crosshair-like sprite is spawned
and continuously updated to the position of where the player aims at.
git-svn-id: https://svn.eduke32.com/eduke32@4059 1a8010ca-5511-0410-912e-c29ae57300e0
The offsets (that will translate the axes for .pitch/.roll rotation) were
calculated improperly with screen sizes other than 1280 x 1024 and were
dependent on other related variables. The fix proceeded empirically, i.e. mostly
trial, error, and some educated guesswork. (It's telling that the magic constant
1280 is needed.) A test for Lunatic is added to test.lua that will rotate
SEENINES.
Bug pointed out by Mblackwell.
git-svn-id: https://svn.eduke32.com/eduke32@4058 1a8010ca-5511-0410-912e-c29ae57300e0
- Need to open some files in binary mode.
- MinGW's "find" doesn't provide -L option, detect that.
git-svn-id: https://svn.eduke32.com/eduke32@4051 1a8010ca-5511-0410-912e-c29ae57300e0
Specifically, for the tables returned with require"DEFS" etc. This allows to
check if maybe parts of a bundle of files is missing (because comparisons like
"spr.picnum == D.NONEXISTENT_NAME" do not yield errors normally).
git-svn-id: https://svn.eduke32.com/eduke32@4050 1a8010ca-5511-0410-912e-c29ae57300e0
Permitting to enable various debugging options. See "eduke32 -debughelp"
for which ones those are: they were previously settable from defs_common.lua,
and a new option 'strict' has been added that makes accesses to void sprites
error. (That is, already "sprite[i]", not "sprite[i].some_member".)
git-svn-id: https://svn.eduke32.com/eduke32@4049 1a8010ca-5511-0410-912e-c29ae57300e0
- engine.c: comment out some unused decls with RELEASE=0 DEBUGANYWAY=1
- Lunatic: update dump.lua and v.lua
- Lunatic: test/test_geom.lua: note a perf regression (wrt older LuaJIT,
or I mis-configured / built something wrong)
git-svn-id: https://svn.eduke32.com/eduke32@4048 1a8010ca-5511-0410-912e-c29ae57300e0
- add gv.GET, gv.WEAPON, gv.RETURN
- specify that sprite[].x/y/z and wall[].x/y are 32-bit ints
- add an example for con.longjmp()
- add an appendix listing the RETURN usage of various events
git-svn-id: https://svn.eduke32.com/eduke32@4032 1a8010ca-5511-0410-912e-c29ae57300e0
On the C side, keep the name g_RETURN. I'm still superstitious about
dropping the "g_".
git-svn-id: https://svn.eduke32.com/eduke32@4031 1a8010ca-5511-0410-912e-c29ae57300e0
The check is dead because it is made after the fact (oob access), but the
cheat string matching logic below actually assures that
cheatbuflen < sizeof(cheatbuf) at all times.
Exposed using the Stack tool from http://css.csail.mit.edu/stack/ .
Also, in gamedef.c's definecheat handling, print the string length (19), not
the buffer length (20) if the cheat was truncated.
git-svn-id: https://svn.eduke32.com/eduke32@4016 1a8010ca-5511-0410-912e-c29ae57300e0
Clang's UBSan reports this as undefined behavior. I think that the reason
is as follows: C99 6.5.3.2#1 (Constraints) says:
The operand of the unary & operator shall be either a function designator, the
result of a [] or unary * operator, or an lvalue that designates an object that
is not a bit-field and is not declared with the register storage-class specifier.
But in case of an expression like "&array[-1]", the operand ("array[-1]") does
not designate a valid object.
Moral: check first -- assure that an expression is valid for a particular
operation before carrying it out. Keep in mind that otherwise, the compiler
is absolutely free to optimize out the *check*.
git-svn-id: https://svn.eduke32.com/eduke32@4014 1a8010ca-5511-0410-912e-c29ae57300e0
DONT_BUILD, because there have been no significant changes of the non-Lua build.
git-svn-id: https://svn.eduke32.com/eduke32@4006 1a8010ca-5511-0410-912e-c29ae57300e0
In foreachmap.lua, make init() be able to return a start index for cmdline args,
for the case where the run worker script wants to handle options, for example.
git-svn-id: https://svn.eduke32.com/eduke32@4005 1a8010ca-5511-0410-912e-c29ae57300e0
- libs and headers are expected in platform/Windows/* (not there yet)
- prefix Lua #includes with luajit-2.0/
- build bytecode objects with absolute path name (used for debug info)
git-svn-id: https://svn.eduke32.com/eduke32@4000 1a8010ca-5511-0410-912e-c29ae57300e0
- 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
- 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
The old extension is an artifact from when I was thought that extensions
should label whether a Lunatic module is to be used in internal/external
contexts.
Also, change test.lua slightly and commit a little updated documentation.
git-svn-id: https://svn.eduke32.com/eduke32@3969 1a8010ca-5511-0410-912e-c29ae57300e0
Its members are already laid out on the natural alignment boundaries.
Compilation tested with {32-bit, 64-bit} x {Lunatic, non-Lua} builds.
git-svn-id: https://svn.eduke32.com/eduke32@3968 1a8010ca-5511-0410-912e-c29ae57300e0
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
Now, if p->visibility differs from the constant visibility, the former converges
toward the latter by three-quartering the difference each second totalclock
increment (1/60th second).
Negative player visibilities are not handled consistently throughout the
different renderers, so make it look the same as 0 (can view to infinity).
git-svn-id: https://svn.eduke32.com/eduke32@3960 1a8010ca-5511-0410-912e-c29ae57300e0
Also, in test.elua, add a currently failing must-fail test (i.e. it wrongly
succeeds where it should not!).
git-svn-id: https://svn.eduke32.com/eduke32@3954 1a8010ca-5511-0410-912e-c29ae57300e0
Because that function might have inserted tsprites itself, e.g. for the fake
floor shadow. Also add one "spritesortcnt < MAXSPRITESONSCREEN" bound check
in legacy ROR code.
git-svn-id: https://svn.eduke32.com/eduke32@3952 1a8010ca-5511-0410-912e-c29ae57300e0
Smoothed using an exponential moving average... with a time constant of 1 sec
if I didn't miscalculate things. Also, split BYTEVERSION_JF into Lunatic and
non-Lua.
git-svn-id: https://svn.eduke32.com/eduke32@3947 1a8010ca-5511-0410-912e-c29ae57300e0
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
- 'copy' may have them as source, 'getarraysize' works fine
- 'setarray' and 'resizearray' are obviously forbidden
- 'readarrayfromfile' and 'writearrayfromfile' is not implemented for them
(use case?)
Also, in the Makefile: don't use realpath on directories. It may give an empty
string.
git-svn-id: https://svn.eduke32.com/eduke32@3940 1a8010ca-5511-0410-912e-c29ae57300e0
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
- 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
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
- 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
- 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
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
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
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
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
... 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
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
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
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
- 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
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
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
(This is the module that implements much of the "hard-coded" functionality
formerly on the C side.)
git-svn-id: https://svn.eduke32.com/eduke32@3871 1a8010ca-5511-0410-912e-c29ae57300e0
However, from the command line, reverse the situation: dirseps must be passed
as '/', dots are forbidden (except in the trailing ".lua").
git-svn-id: https://svn.eduke32.com/eduke32@3867 1a8010ca-5511-0410-912e-c29ae57300e0
It is a 32-bit signed integer. No version bump necessary, although CON code
accessing this new member will not work with earlier revisions (obviously).
git-svn-id: https://svn.eduke32.com/eduke32@3866 1a8010ca-5511-0410-912e-c29ae57300e0
Also from Lunatic, make these members read-only and provide methods that
allow setting them to either -1 or a number in [0..MAX{TILES,SOUNDS}-1].
git-svn-id: https://svn.eduke32.com/eduke32@3865 1a8010ca-5511-0410-912e-c29ae57300e0
The commit revises the definition of qstrdim when TEXT_[XY]OFFSETZERO are used. With these flags, the offsets the user specifies are now the only dimensions the function cares about in terms of tile placement, so depending on the difference between the offset(s) and the size of the final tile, it may be slightly more or less than the dimensions actually displayed on the screen because tile size is never taken into account. (For example, if your font is nominally 9x7 like the Duke bluefont and you use a TEXT_XOFFSETZERO of 5 with a string five characters long, the total x dimension will be 25 even though the last character will overhang that amount by four pixels. If you use a TEXT_XOFFSETZERO of 12 with the same string, the total x width will be 60 even though there will be three pixels of empty space on the right edge.) This change was made because assigning text an arbitrary constant width in general implies an intent to keep character positions constant even with a variable width font, but returning the visible span of pixels on the screen that the tiles cover would have caused the string to move when alignment options other than the top-left were used. In other words, you can now safely use TEXT_[XY]OFFSETZERO with the alignment options and the text won't jiggle.
Also, with TEXT_GAMETEXTNUMHACK, numerals are now effectively TEXT_XOFFSETZERO text that respect the above paragraph, so number count displays can look nice with alignment options too.
Having to modify the extent/offset code makes me realize that I'm not quite happy with its structure because it gets tangled juggling different concepts like character width, X offset, and spacing, and how they relate when the line wraps or in terms of the final size. Fortunately, it produces correct results as far as I know, and it's not necessarily ugly, just hard to understand. Handle with care.
git-svn-id: https://svn.eduke32.com/eduke32@3850 1a8010ca-5511-0410-912e-c29ae57300e0
That is, the gamevars named WEAPONx_* in CON will now have the remapped value
if they were not overridden from CON ('gamevar' at file scope).
For C-CON, everything except signaling an override from the CON parser is in
place.
git-svn-id: https://svn.eduke32.com/eduke32@3848 1a8010ca-5511-0410-912e-c29ae57300e0
Also add some recent keywords to the list in con_lang.lua which I had
forgotten all along.
git-svn-id: https://svn.eduke32.com/eduke32@3845 1a8010ca-5511-0410-912e-c29ae57300e0
Also, make sector[].*stat a bitint type.
Now, a piece of code could look like this:
local sec = sector[i]
local ceil = sec.ceiling
ceil.statx:flip(sector.STAT.SMOOSH)
git-svn-id: https://svn.eduke32.com/eduke32@3844 1a8010ca-5511-0410-912e-c29ae57300e0
The previous behavior was to translate them as global gamevars, since LunaCON
currently has no support for multiplayer. However, then some errors would be
missed where such gamevars are accessed in no-player context
(e.g. EVENT_ENTERLEVEL).
On by default, disabled with -fno-playervar.
git-svn-id: https://svn.eduke32.com/eduke32@3842 1a8010ca-5511-0410-912e-c29ae57300e0
G_PrintGameText(), minitext_(), G_DrawTXDigiNumZ(), and menutext_() now wrap G_ScreenText().
G_GameTextLen() now wraps G_ScreenTextSize().
G_DrawDigiNum_() now wraps G_DrawTXDigiNumZ().
git-svn-id: https://svn.eduke32.com/eduke32@3836 1a8010ca-5511-0410-912e-c29ae57300e0
Hard replacement reassigns the tile flags, while soft replacement bitwise
ORs them, as in CON (since some flags might already have been set using
commands like spritenoshade).
git-svn-id: https://svn.eduke32.com/eduke32@3829 1a8010ca-5511-0410-912e-c29ae57300e0
Also, allow (implicit) actor index -1 to 'sound' like in C-CON and fix
MULTIMODE gamevar definition (was 0, not 1).
git-svn-id: https://svn.eduke32.com/eduke32@3826 1a8010ca-5511-0410-912e-c29ae57300e0
In 3D mode, Alt+F now only attempts to set the first wall of the aimed at
wall, not collecting upper/lower neighbors. For this, press Shift+Alt+F.
In 2D mode, they are always collected.
git-svn-id: https://svn.eduke32.com/eduke32@3825 1a8010ca-5511-0410-912e-c29ae57300e0
Analogously for the negation; remove a couple of redundant decls of "qsetmode".
git-svn-id: https://svn.eduke32.com/eduke32@3823 1a8010ca-5511-0410-912e-c29ae57300e0
Because one may obviously use gettspr/settspr in states called from that
event.
git-svn-id: https://svn.eduke32.com/eduke32@3820 1a8010ca-5511-0410-912e-c29ae57300e0
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
For pre-1.3 CONs, determining the older script version with gamestartup and/or
definelevelname is not implemented.
git-svn-id: https://svn.eduke32.com/eduke32@3806 1a8010ca-5511-0410-912e-c29ae57300e0
NOTE: I'm committing this from my git clone again. If this works OK,
everything is in good order again. If not, I hope that I won't damage
the SVN repo. *Runs away...*
git-svn-id: https://svn.eduke32.com/eduke32@3798 1a8010ca-5511-0410-912e-c29ae57300e0
What is missing is saving and restoring per-player and per-actor gamevars.
Also add a test CON mutator 'mapstate.con'.
git-svn-id: https://svn.eduke32.com/eduke32@3794 1a8010ca-5511-0410-912e-c29ae57300e0
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
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
There's no option letter for loading them, and the extension is checked
case sensitively. Lua modules are loaded after CON translated to Lua.
Also remove -testlua option.
git-svn-id: https://svn.eduke32.com/eduke32@3788 1a8010ca-5511-0410-912e-c29ae57300e0
Selected by writing e.g. 'corruptcheck tryfix 1-14 ??' in the console.
Like with the first alternative, the corruption numbers / range (here, 1-14)
must be given.
git-svn-id: https://svn.eduke32.com/eduke32@3746 1a8010ca-5511-0410-912e-c29ae57300e0
... in the auto-correction. Also,
- make two similar corruptions level 5 (wallptr oob, wallptr+wallnum oob).
- in drawscreen_drawwall(), do a more strict bound check, not only >=0.
git-svn-id: https://svn.eduke32.com/eduke32@3745 1a8010ca-5511-0410-912e-c29ae57300e0
That is, assume that switch(DYNAMICTILEMAP(-1)) (which is an oob access and thus
undefined behavior) gets us to the 'default:' label.
git-svn-id: https://svn.eduke32.com/eduke32@3743 1a8010ca-5511-0410-912e-c29ae57300e0
In the mirror reversing code, get rid of the padding. This may produce
seams, but they appear to be extremely transient and shouldn't be
noticeable.
In game.c, add a debugging compilation switch DEBUG_MIRRORS_ONLY.
git-svn-id: https://svn.eduke32.com/eduke32@3726 1a8010ca-5511-0410-912e-c29ae57300e0
No functional changes, but a (commented out) debug line for an oob read of the
frame buffer when the mirror covers the whole screen is inserted.
git-svn-id: https://svn.eduke32.com/eduke32@3719 1a8010ca-5511-0410-912e-c29ae57300e0
- Return early from drawsprite_classic() if tspr->owner if oob.
Commonize that check between renderers into bad_tspr().
- Make the BIT() macro a left-shift of the *unsigned* number 1,
preventing expansion to (1<<31).
git-svn-id: https://svn.eduke32.com/eduke32@3717 1a8010ca-5511-0410-912e-c29ae57300e0
Numbers 0 and 1 mean 'no spread', but the latter does one krand() call.
Negative numbers are reserved for potential future use.
git-svn-id: https://svn.eduke32.com/eduke32@3715 1a8010ca-5511-0410-912e-c29ae57300e0
... four lines later.
I don't know if that is the intended semantics for this function, but
nasal demons is clearly not what we want. Please review!
git-svn-id: https://svn.eduke32.com/eduke32@3712 1a8010ca-5511-0410-912e-c29ae57300e0
grpinfo
{
name "YourGameName"
scriptname "yourgame.con"
defname "yourgame.def"
size yourgrpsize
dependency DUKE15_CRC
flags GAMEFLAG_ADDON
crc yourgrpcrc
}
The "flags" field can also take the value "GAMEFLAG_DUKE" to define a new base game. Since this is the first commit of a new feature, certain semantics of the implementation and syntax are liable to change as necessary.
git-svn-id: https://svn.eduke32.com/eduke32@3708 1a8010ca-5511-0410-912e-c29ae57300e0
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
This fixes RESPAWN preview wrongly clamping the previewed tsprite z coords to
[-524288 .. 524288] (x/y limits).
Also, make the previewed tsprites be 33% translucent with the option of 66%
translucency by setting 'showrespawn_fulltrans' to 1 in a.m32.
git-svn-id: https://svn.eduke32.com/eduke32@3699 1a8010ca-5511-0410-912e-c29ae57300e0
Sprites are now considered to have out of bounds sector numbers if it is
< 0 or >= numsectors (not merely >= MAXSECTORS). If such a sprite is now
encountered during post-load, an attempt is made first to assign it a sector
number (using updatesector()). If that fails, the sprite is removed from the
map. The background is that a dozen of maps do come with such sprites and
could previously corrupt the sprite list when loaded.
git-svn-id: https://svn.eduke32.com/eduke32@3696 1a8010ca-5511-0410-912e-c29ae57300e0
Specifically, in GL modes, and if the CHAINGUN is not replaced by a model,
- draw the upper part twice: first, two screen pixels * weapon scale lower,
then at the original position
- reverse the previous order: draw the upper part first, then the lower part
This is much preferable to the previous engine-side hack, and to my eye,
it looks perfect now.
git-svn-id: https://svn.eduke32.com/eduke32@3695 1a8010ca-5511-0410-912e-c29ae57300e0
- 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
Also, in two cases, don't assign A_IncurDamage() result to a variable if
it's not needed.
git-svn-id: https://svn.eduke32.com/eduke32@3681 1a8010ca-5511-0410-912e-c29ae57300e0
- 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
- 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
Actually, the tweaked code in VM_Move() is not specific to projectiles, so
other sprites now may pass no-SE7 water boundaries too, but it's most noticeable
with projectiles.
git-svn-id: https://svn.eduke32.com/eduke32@3678 1a8010ca-5511-0410-912e-c29ae57300e0
That is, if submerging, the lower sector MUST have lotag 2. If emerging, the
upper sector MUST have lotag 1. (Previously, emersion happened from ST 2 sectors
unconditionally.) This means that the area where submersion or emersion can
happen is now the same for the top and bottom parts.
git-svn-id: https://svn.eduke32.com/eduke32@3677 1a8010ca-5511-0410-912e-c29ae57300e0
Let me know if this breaks any mods that have #2462 with an x-dimension other than 320.
git-svn-id: https://svn.eduke32.com/eduke32@3674 1a8010ca-5511-0410-912e-c29ae57300e0
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
Nag: The behavoir of atoi() is *undefined* if "the value of the result
cannot be represented" (C99 7.20.1).
Note: my nagging about undefined behaviors will *not* get less over time. :P
git-svn-id: https://svn.eduke32.com/eduke32@3660 1a8010ca-5511-0410-912e-c29ae57300e0
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
Also, implement 'cmenu' in LunaCON, make 'definequote' also allowed as inner
command.
git-svn-id: https://svn.eduke32.com/eduke32@3656 1a8010ca-5511-0410-912e-c29ae57300e0
So that members needing it are checked when they're assigned to using the
usual syntax. What kind of check to perform (sector, player, ... x whether
negative values are allowed) is written in a declarative fashion inside the
C declaration.
Also, make Lunatic's MAXQUOTES be C's OBITQUOTEINDEX and bound-check an
access of sprite[p->wackedbyplayer] in the C code.
git-svn-id: https://svn.eduke32.com/eduke32@3653 1a8010ca-5511-0410-912e-c29ae57300e0
Toggled with Ctrl+Shift+[KP-]. Variable 'headlight_range' controls its range.
For the implementation, a new event EVENT_PREDRAW3DSCREEN was added.
git-svn-id: https://svn.eduke32.com/eduke32@3648 1a8010ca-5511-0410-912e-c29ae57300e0
In Lunatic, gamevars (variables that are saved with savegames) are per-module.
git-svn-id: https://svn.eduke32.com/eduke32@3642 1a8010ca-5511-0410-912e-c29ae57300e0
This is done by always calling FX_PlayAuto3D() to play such sounds. It now
additionally takes a third argument 'loophow', permissible values being
FX_ONESHOT and FX_LOOP.
git-svn-id: https://svn.eduke32.com/eduke32@3631 1a8010ca-5511-0410-912e-c29ae57300e0
Also, for tip_incs values greater or equal than the number of elements in
this table, return early reporting that the hand has been drawn, so that
the otherwise selected weapon is not drawn.
git-svn-id: https://svn.eduke32.com/eduke32@3630 1a8010ca-5511-0410-912e-c29ae57300e0
For events and actors, a flag can be now passed whether to chain the new
function at the beginning or end of an already existing one, or to replace
it entirely.
Also, for the translator, add option -fno-error-nostate, disabled by default.
git-svn-id: https://svn.eduke32.com/eduke32@3629 1a8010ca-5511-0410-912e-c29ae57300e0
- Don't attempt to play an ANM file if it is empty (warn) or too short (error).
- If failing to read IVF file header or initializing VPX codec, don't play ANM.
- Return early from gltexapplyprops() if not in GL modes.
git-svn-id: https://svn.eduke32.com/eduke32@3628 1a8010ca-5511-0410-912e-c29ae57300e0
The code is mostly by other people, who are credited in the CON files.
git-svn-id: https://svn.eduke32.com/eduke32@3627 1a8010ca-5511-0410-912e-c29ae57300e0
With this change, it is impossible for negative values to be used as array
indices inside this function, and I believe that it is also impossible that
they escape to somewhere they might be used as such.
For Lunatic, allow setting actor[].picnum to negative values and in the
translator, add (commented out) code to warn whenever it is set to a constant
negative value. Also, fix a _sound call in _addphealth in control.lua.
git-svn-id: https://svn.eduke32.com/eduke32@3626 1a8010ca-5511-0410-912e-c29ae57300e0
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
There's only one RETURN value on the C side (g_RETURN), which is also referenced
from Lua. Upon entering an event, its value takes on the per-event default one,
and its value when the event code finishes is passed back to the game.
Independently of that, its value is always saved and restored across event calls.
git-svn-id: https://svn.eduke32.com/eduke32@3601 1a8010ca-5511-0410-912e-c29ae57300e0
In passing, fix a couple of omissions: gameactor() being passed nil's in the
middle, more than one moveflag to CON *actor.
git-svn-id: https://svn.eduke32.com/eduke32@3597 1a8010ca-5511-0410-912e-c29ae57300e0
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
Also, for the embedded translator: don't warn on unrecognized command line opt.
git-svn-id: https://svn.eduke32.com/eduke32@3590 1a8010ca-5511-0410-912e-c29ae57300e0
So that it doesn't result in the -t (respawn on) command line switch.
git-svn-id: https://svn.eduke32.com/eduke32@3586 1a8010ca-5511-0410-912e-c29ae57300e0
The unmodified behavior is completely wrong and I don't see how any mod could ever use it.
git-svn-id: https://svn.eduke32.com/eduke32@3578 1a8010ca-5511-0410-912e-c29ae57300e0
This now should look correct for both settings of r_usenewaspect.
git-svn-id: https://svn.eduke32.com/eduke32@3575 1a8010ca-5511-0410-912e-c29ae57300e0
- Make _buildargv[_buildargc] NULL.
- With SDL layer, pass argv and argc directly and get rid of _build* ones.
- Add tilesiz* to dynsymlists.
git-svn-id: https://svn.eduke32.com/eduke32@3573 1a8010ca-5511-0410-912e-c29ae57300e0
Also, fix an error() call in control.lua:gamearray_file_common().
git-svn-id: https://svn.eduke32.com/eduke32@3572 1a8010ca-5511-0410-912e-c29ae57300e0
(Or '0's, but that case is handled automatically.) The resulting generated
number is taken by looking at the 8 lower nibbles and interpreting them as
a signed 32-bit integer.
Also add some number parsing tests to test/nlcf_break.con.
git-svn-id: https://svn.eduke32.com/eduke32@3571 1a8010ca-5511-0410-912e-c29ae57300e0
Toggling whether a getactorvar for a global or per-player gamevar issues
a warning or a hard error, the latter being the default.
Also, make it possible to readgamevar/savegamevar per-actor gamevars and
add userdefs member "idplayers" (read-only).
git-svn-id: https://svn.eduke32.com/eduke32@3570 1a8010ca-5511-0410-912e-c29ae57300e0
The first transformation makes the "control structure too long" error appear
only with larger if/else cascades, though it's still possible.
git-svn-id: https://svn.eduke32.com/eduke32@3569 1a8010ca-5511-0410-912e-c29ae57300e0
The only operation for which proper code is generated is reading a single value
from a system gamearray.
git-svn-id: https://svn.eduke32.com/eduke32@3562 1a8010ca-5511-0410-912e-c29ae57300e0
...at the beginning of each function called back from C, and each case/default
function. Called -fcache-sap. Disabled by default.
git-svn-id: https://svn.eduke32.com/eduke32@3561 1a8010ca-5511-0410-912e-c29ae57300e0
Also,
- an optimization for sprite[]:setpos(). Calls to get_sprite_index()
seem to be pretty slow (at least when they're not compiled).
- add getzrange to the dynsymlists
git-svn-id: https://svn.eduke32.com/eduke32@3560 1a8010ca-5511-0410-912e-c29ae57300e0
Fix 'setsprite' and 'music'. A good timing test for actors performance is
the starfield of WGR2's E1L1 ("Nexus").
git-svn-id: https://svn.eduke32.com/eduke32@3558 1a8010ca-5511-0410-912e-c29ae57300e0
This is the only gamevar of its kind that is handled for Lunatic, neither
PLR_MORALE nor LOGO_FLAGS are.
git-svn-id: https://svn.eduke32.com/eduke32@3556 1a8010ca-5511-0410-912e-c29ae57300e0
This should have no adverse effects or side-effects. The changes only apply if a modder chose to use completely broken functionality in the first place.
git-svn-id: https://svn.eduke32.com/eduke32@3544 1a8010ca-5511-0410-912e-c29ae57300e0
All non-option positional arguments after an @ sign are taken as list files:
hashes at the beginning of a line denote comments, truly empty lines are
ignored, all other lines should contain one root CON file name.
git-svn-id: https://svn.eduke32.com/eduke32@3539 1a8010ca-5511-0410-912e-c29ae57300e0
From the PM conversation "gamearrays in 64-bit". A test case is the breaking
glass at the beginning of the DukePlus map.
git-svn-id: https://svn.eduke32.com/eduke32@3536 1a8010ca-5511-0410-912e-c29ae57300e0
Instead of those of the translated code. Also some codegen tweaks and fixes.
git-svn-id: https://svn.eduke32.com/eduke32@3535 1a8010ca-5511-0410-912e-c29ae57300e0
Also update test/dangling_else.con. See there for how if* cascades are handled
in CON. It's actually kind of pretty. Also, take care to handle code deferred
to after the if/if-else properly (ifpdistl, ifpdistg, ifcanseetartet).
git-svn-id: https://svn.eduke32.com/eduke32@3534 1a8010ca-5511-0410-912e-c29ae57300e0
- add LuaJIT's 'v' module printing trace info
- translator: fix game function name definitions
- revert math.fmod -> math.modf, they are different!
- disable JIT compilation for a function we're getting strange crashes with
- Make some of DukePlayer_t's members 'bool' on the Lua side. It's way
too easy to write something like "ps.jetpack_on" where "ps.jetpack_on~=0"
was meant. [Background: Kyle873 observed that Duke was always floating.]
- Error out if looping in our_module(). I find this behavior more logical
than returning true.
- fix a couple of missed FORBID variables
git-svn-id: https://svn.eduke32.com/eduke32@3530 1a8010ca-5511-0410-912e-c29ae57300e0
Notes:
- MAXJOYBUTTONS is out of sync between the two definitions
- In menus.c, NUMMOUSEFUNCTIONS must equal MAXMOUSEBUTTONS,
fail to compile if this becomes false.
git-svn-id: https://svn.eduke32.com/eduke32@3527 1a8010ca-5511-0410-912e-c29ae57300e0
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
- some more outer commands
- gamearray persistence
- faster 'mod': use math.modf instead of math.fmod (the former is JIT-compiled)
- checkavail*
- THISACTOR special handling
- Fix building in Windows (export A_ShootWithZvel instead of A_Shoot).
git-svn-id: https://svn.eduke32.com/eduke32@3516 1a8010ca-5511-0410-912e-c29ae57300e0
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
If m32script gamevar "move_by_one" is nonzero, the some keys move the
"player arrow" by increments of 1:
- Without SHIFT: LEFT/RIGHT absolute x, DOWN/UP absolute y, A/Z absolute z.
- With SHIFT: DOWN/UP (unbounded!) horiz, LEFT/RIGHT angle.
This can be useful to debug renderer bugs that show a high sensitivity to the
exact location ("are transient in space").
git-svn-id: https://svn.eduke32.com/eduke32@3509 1a8010ca-5511-0410-912e-c29ae57300e0
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
actors.h: remove 'packed' from projectile_t, tiledata_t. In tiledata_t,
make .cacherange member an int32_t so that the following member
"projectile_t defproj" is aligned on a 4-byte boundary.
player.h: remove 'packed' from playerspawn_t, DukeStatus_t, input_t.
In Lunatic, correct packing attribute of the base type of the unrestricted
actor_t and DukePlayer_t pointer types (the declaration was used without
Bump BYTEVERSION.
git-svn-id: https://svn.eduke32.com/eduke32@3458 1a8010ca-5511-0410-912e-c29ae57300e0
Most of them are already aligned to their natural boundaries, so lowering
the alignment to 1 byte can only worsen things by making the C compiler
generate poorer (unaligned access) code for some platforms.
The layout of structures is not specified by the C Standard, but is rather
given by a particular platform + toolchain's ABI (application binary interface).
Most ABIs follow the expected pattern "alignment of scalars is their size,
alignment of arrays is that of its element type, alignment of structs is the
maximum alignment of its members". A couple of links to particular ABIs are
given in build.h.
Problems are expected with archs that care about unaligned access when a pointer
to a non-packed struct is taken that resides in a packed aggregate, but these
uses should be weeded out (I'm not sure if there are any in our codebase).
The following types are affected, only hitdata_t changes its size:
sectortype, walltype, spritetype, spriteext_t, spritesmooth_t,
struct validmode_t, picanm_t, palette_t, vec2_t, vec3_t, hitdata_t.
git-svn-id: https://svn.eduke32.com/eduke32@3455 1a8010ca-5511-0410-912e-c29ae57300e0
And const them appropriately. Also remove #if 0'ed code related to an MSVC
pragma.
git-svn-id: https://svn.eduke32.com/eduke32@3451 1a8010ca-5511-0410-912e-c29ae57300e0
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
Its only use is to have a actor -> tsprite mapping for the EVENT_ANIMATESPRITE
event and .tspr will be set before it is run.
git-svn-id: https://svn.eduke32.com/eduke32@3448 1a8010ca-5511-0410-912e-c29ae57300e0
The m32script variable 'showrespawn_always' toggles whether the respawned picnum
is shown unconditionally instead of only when aimed at (and locked onto the
RESPAWN sprite) in 3D mode.
Cool idea by Micky C.
NOTE: sometimes doesn't work because of a bug in the m32script interpreter.
git-svn-id: https://svn.eduke32.com/eduke32@3447 1a8010ca-5511-0410-912e-c29ae57300e0
Pass types via ffi.typeof() instead of declaring them in the
global namespace when possible.
git-svn-id: https://svn.eduke32.com/eduke32@3437 1a8010ca-5511-0410-912e-c29ae57300e0
Use a new flag to mark hard-coded enemies, not SPRITE_BADGUY.
This fixes an issue where in E1L4, a pigcop would appear in the area
you have to crawl under shrunk. Thanks to LLCoolDave1 for pinpointing
the range of relevant revisions.
git-svn-id: https://svn.eduke32.com/eduke32@3426 1a8010ca-5511-0410-912e-c29ae57300e0
The pixel doubling now only applies to the area where the world scene is drawn,
i.e. it may be smaller than the physical screen / WM window size. The optimized
version is slightly faster than for non-doubled pixels for me (optimized build),
but see code for caveats. Some other minor issues:
- won't work when the world is drawn from demo cameras (and offscreen, but that
matters less)
- will leave a few pixels empty when running with x resolutions not evenly
divisible by 4
git-svn-id: https://svn.eduke32.com/eduke32@3421 1a8010ca-5511-0410-912e-c29ae57300e0
In CON, the bit is still always cleared for user-defined gamevars.
git-svn-id: https://svn.eduke32.com/eduke32@3417 1a8010ca-5511-0410-912e-c29ae57300e0
- more predefined vars
- fix recursive states and ones with a stray "else" before the end
git-svn-id: https://svn.eduke32.com/eduke32@3409 1a8010ca-5511-0410-912e-c29ae57300e0
* Make the "classic status bar fullscreen viewport" mode accessible
in classic too.
* Make range of status bar scale 36..100
* Update ud.statusbarmode when executing OSD command r_size (ud.screen_size).
NOTE: ud.statusbarmode is considered internal. Don't use from CON!
* Make sure 1) loading any configuration and 2) menu bars work correctly.
(The "classic status bar fullscreen viewport" mode will never be restored
though because ud.statusbarmode isn't handled by the OSD var system).
git-svn-id: https://svn.eduke32.com/eduke32@3402 1a8010ca-5511-0410-912e-c29ae57300e0
If enabled, dragging wall vertices will correct the xrepeat after the
mouse button is released, so that the pre-drag absolute stretching is
restored.
git-svn-id: https://svn.eduke32.com/eduke32@3398 1a8010ca-5511-0410-912e-c29ae57300e0
- Run it twice, since the first one is wrong.
- Warn when attempting to align based on a top-oriented wall. When the
sequence of walls to align has "windows", only the bottom parts will
be correct.
- Make the modifiers actually useful:
* Pressing SHIFT aligns at most one wall, remove the old CTRL modifier.
* The rest is as before: ALT makes the walls have (approximately) equal
texture stretching, ['] (quote) aligns the immediate TROR-nextwalls.
git-svn-id: https://svn.eduke32.com/eduke32@3396 1a8010ca-5511-0410-912e-c29ae57300e0
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
This is done by introducing an additional internal bit, meaning
"play only one instance". It is set for all sounds which have bit 1
("repeat in the sound system") set at definesound time, but not those
that set bit 1 temporarily (see r3336).
git-svn-id: https://svn.eduke32.com/eduke32@3393 1a8010ca-5511-0410-912e-c29ae57300e0
Also, rewrite comparison to the non-tint in astub.c to be even less hackish.
git-svn-id: https://svn.eduke32.com/eduke32@3387 1a8010ca-5511-0410-912e-c29ae57300e0
This obviously won't help performance as the scene has still to be drawn at
the original resolution, but it's better than the draw-to-tile hack.
git-svn-id: https://svn.eduke32.com/eduke32@3378 1a8010ca-5511-0410-912e-c29ae57300e0
On the C side, zrange, angrange and autoaimang are represented as
DukePlayer_t members then.
git-svn-id: https://svn.eduke32.com/eduke32@3366 1a8010ca-5511-0410-912e-c29ae57300e0
The diff may look daunting, but it's clear what is changed with
git diff (...) --color-words='[a-zA-Z0-9_]+|[^[:space:]]' -b
git-svn-id: https://svn.eduke32.com/eduke32@3361 1a8010ca-5511-0410-912e-c29ae57300e0
Factoring out 2x almost duplicated code into {P,A}_PostFireHitscan().
git-svn-id: https://svn.eduke32.com/eduke32@3360 1a8010ca-5511-0410-912e-c29ae57300e0
The code is duplicated with small changes for the hardcoded and custom
projectiles.
Adding local functions P_PreFireHitscan(), A_PreFireHitscan() and
Proj_MaybeAddSpread().
git-svn-id: https://svn.eduke32.com/eduke32@3358 1a8010ca-5511-0410-912e-c29ae57300e0
In Lunatic-only build, also always allocate the first 128 quotes.
git-svn-id: https://svn.eduke32.com/eduke32@3356 1a8010ca-5511-0410-912e-c29ae57300e0
Preventing a continuously growing stack top and inevitable program termination.
Also, commonize the error handling to live on the engine side.
git-svn-id: https://svn.eduke32.com/eduke32@3352 1a8010ca-5511-0410-912e-c29ae57300e0
FLAC source from git commit 0920bc1ffb07f038b317e7e8056509fe0e4b680e, patched by me.
Windows libFLAC.a built using i686-MinGW-w64 and x86_64-MinGW-w64.
HUGE thanks to rhoenie for building the Mac fat library (ppc, i686, x86_86).
git-svn-id: https://svn.eduke32.com/eduke32@3335 1a8010ca-5511-0410-912e-c29ae57300e0
* Renamed source/jaudiolib/third-party/mingw32 to source/jaudiolib/third-party/Windows.
* Moved source/jaudiolib/third-party/Windows/include to source/jaudiolib/third-party/common/include to use both on Windows and Apple.
* Deleted Apple/lib/include/{ogg,vorbis}/, see previous point.
* Deleted Apple/lib/libvorbisenc.a, 6MB saved.
* Moved Apple/lib/lib{ogg,vorbis,vorbisfile}.a to source/jaudiolib/third-party/Apple/lib, where they belong.
* Moved source files in Apple/ to source/, where they belong. (SDLMain.[mh] stay.)
* Deleted source/jaudiolib/third-party/{ogg,vorbis}.framework, not used any more.
* Renamed "StartupWinController*" to "startosx*".
git-svn-id: https://svn.eduke32.com/eduke32@3334 1a8010ca-5511-0410-912e-c29ae57300e0
In the normal game, these arrays are conceptually [MAX_WEAPONS][MAXPLAYERS],
allocated as CON per-player gamevars (e.g. WEAPONx_WORKSLIKE).
For Lunatic, they are replaced with
weapondata_t g_playerWeapon[MAXPLAYERS][MAX_WEAPONS].
git-svn-id: https://svn.eduke32.com/eduke32@3328 1a8010ca-5511-0410-912e-c29ae57300e0
Specifically, have a weapondata_t type mimicking the aplWeapon* arrays.
Keep a list weapondefaults[] which undergoes some static->dynamic tweaks
and then makes its way to the WEAPONx_XXX per-player gamevars.
git-svn-id: https://svn.eduke32.com/eduke32@3327 1a8010ca-5511-0410-912e-c29ae57300e0
- Rewrite the "clear background" routine in a no-brainer way instead of
juggling around with rotatesprite(). Make it common to game+editor.
Expose glRectd to glbuild.
- Don't stop OSD text line drawing when encountering a non-printable char.
Instead, treat it as space.
- In OSD_SetTextMode(), don't use swaplong (which really swaps 32-bit ints)
to swap pointers. Write an analogous "swapptr" instead.
- When changing from/to OSD, don't inject a pause key. This *might* have been
the cause of the reported pausing problems.
- clean up the code...
(Yes, this commit throws together too much stuff. I suck sometimes. :P)
git-svn-id: https://svn.eduke32.com/eduke32@3321 1a8010ca-5511-0410-912e-c29ae57300e0