Build 4873
SVN-
General
engine.c: fix clipmove() against floor-aligned sprites.
Show details
Introduced in r3207. Oops.
-
General
engine.c: prevent an oob read of spriteext[] in drawsprite_classic().
SVN handles and Git names are merged into one person.
engine.c: fix clipmove() against floor-aligned sprites.
Introduced in r3207. Oops.
engine.c: prevent an oob read of spriteext[] in drawsprite_classic().
disable all loop checks as they spam the log too much. DONT_BUILD.
The one introduced with r4569.
Propagate 'smoothratio' to scenes drawn from the position of a camera.
That is, make interpolation work properly there -- both when 'using' a VIEWSCREEN and when rendering the scene onto a TILE_VIEWSCR. This makes a difference only if the camera is in a moving sector.
Minor cleanup, mostly in engine.c:drawalls().
Tweak the behavior of viewscreens to what is more logical IMO.
- At a given time, at most one viewscreen may display TILE_VIEWSCR, namely that one which is g_curViewscreen - sync kinds of distance to compare against VIEWSCREEN_ACTIVE_DISTANCE (was Manhattan vs. dist(), now both the latter) - fix resetting to VIEWSCREEN tile when player is greater from it than that distance. When the player is closer to it again, it is *not* reset to TILE_VIEWSCR. - more sync'd g_curViewscreen and sprite[i].yvel (for 'i' being the viewscreen sprite) Note: in a multiplayer context, this needs to be thought about once more.
engine.c: clamp all indices for distrecip[] access, as more OOBs were observed.
Convert voxels to models only when starting or changing to Polymost.
Analogously to the way models are processed in a deferred manner for Polymer.
A couple of miscellaneous cleanups.
defs.c: sync some dup'd code for 'definevoxel' and 'voxel' DEF tokens. engine.c: factor out PolymerProcessModels().
engine.c: style-cleanup drawvox(). Also clean up ALL of voxmodel.c.
No deliberate semantic changes here.
include wall[].ypanning in wall invalidation logic.
Fixes bug reported here: http://forums.duke4.net/topic/1348-mapster32-problems-and-bugs/page__view__findpost__p__213759
Minor cleanup around security cameras / viewscreens. DONT_BUILD.
The only semantic change is that an out-of-sync instance of a distance to check (viewscreen sprite <-> player sprite) is changed in actors.c:G_MoveStandables(), from 2048 (as in Duke3D 1.5) to 8192, now represented by the define VIEWSCREEN_ACTIVE_DISTANCE. I have not yet observed any change in behavior regarding this change (but there ought to be one). Also, in DNCOORDS display, print 'totalclock' count, too.
don't draw masked walls with void tile. DONT_BUILD.
This prevents displaying W_FORCEFIELD+1 masks (as e.g. in front of viewscreens) completely black with ART mapping. The old behavior, which is inconsistent with classic, is kept for one-sided masked walls, though.
Pull setting g_noFloorPal[] further down, into makepalookup().
Now passed as last arg 'noFloorPal' to makepalookup(). Used as follows: - from loadlookups(): *false*, i.e. do take over floor pal. - from generatefogpals() [default fog pals] and fillemptylookups(): *true*, i.e. don't take over floor pal - from DEF 'fogpal': true - from DEF 'makepalookup': take over flag from pal from which we are remapping, or set to true if remapping from pal 0 - (CROSSHAIR_PAL: true) This should make the issue reported in http://forums.duke4.net/topic/775-eduke32-20-and-polymer/page__view__findpost__p__197583 resolve in a natural manner.
Move g_noFloorPal[] to the engine side and adapt other stuff accordingly.
- 'nofloorpalrange' DEF token: now handled for both game and editor (for the latter, it's effective only for "shade preview" mode, [']+[X]). - in generatefogpals(), assign g_noFloorPal[] = 1 for every generated (default) fog pal; get rid of its return value / g_firstFogPal
engine.c: prevent an oob access of uwall[] in ceilspritescan().
engine.c: style tweaks (tighter var. declaration) in sprite drawing functions.
voxmodel.c: fix Polymost rendering of voxels.
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.
engine.c: minor stylistic changes. DONT_BUILD.
Since we're targeting C99/C++ now, we can finally declare variables as close to their use as possible.
Fix POLYMER=0 build and a couple of unused-variable warnings with it. DONT_BUILD.
engine.c: in wallscan(), fix oob of umost[] and dmost[] when x2 == xdim-1.
Analogously treat maskwallscan() and transmaskwallscan(), although I could not get the respective accesses to be oob, too.
Fix voxels in classic -- my error, confusing divscale() and mulscale() in r4576.
Optimizations are left to the reader :P. I would prefer to look for ways of giving the compilers hints about loops to unroll instead of having to read the resulting mess of manual unrolling, though.
gameexec.c: In VM_OnEvent_, don't form address like &sprite[-1].
The practical rationale: Clang-sanitize catches this, so this is bad. The real rationale: I *think* it is undefined behavior to even form such a pointer in C99. However, I would be hard pressed to provide a nice formal argument in terms of the Standard wording right now. It looks like 6.5.3.2#4 is to blame.
engine.c: prevent an oob read in drawsprite_classic() w/ floor-aligned sprites.
demote wall check "corruptions" introduced in r4569 to level 2.
The winding of a loop -- with clockdir() -- is determined by examining the two line segments spanned between the points following a leftmost point of the loop. If the loop contains a leftmost point that belongs to the "right" side (as can happen with sliding door constructions), there's a chance that an outer loop is misclassified.
Factor out [l]dist() implementations into static inline functions in common.h.
And use these in jmact/mathutil.c's FindDistance2D()/FindDistance3D(). The main use is to allow passing dx/dy instead of sprite positions; the code that actually uses this is not committed.
introduce two signed integer types, use in engine.c and a-c.c.
They classify former uses of int64_t into two classes: - coord_t: those that represent coordinates and need 64-bit precision for proper functioning with large values - inthi_t: those that were added for e.g. casts merely to prevent undefined behavior on overflow DONT_BUILD.
engine.c: prevent a 64-bit multiply in dosetaspect(). DONT_BUILD.
Properly consider sprites with a clipshape as bridge (p->spritebridge).
fix a crash when m32_settings.cfg contains video setting.
Such as "vid_gamma". In that case, setbrightness() would have been called without basepaltableptr having been initialized. The fix is by moving the preparational setbasepaltable() call from ExtPostStartupWindow() to ExtInit(), just before the OSD command dispatching.
fix possible integer overflow in loopinside().
This could happen when building outside the "classic" grid limits and would then lead to e.g. incorrect loop assignment on sector splitting. Bug reported by MetHy.
prototypical checker for wall loops, enabled partially.
Inspired by http://forums.duke4.net/topic/7506-tror-question/page__view__findpost__p__199151 the corruption checker now checks for certain conditions of the loops of each sector. Recall that CW loops are outer and CCW loops are inner. - If a sector has no or more than one outer loop, count that as corruption (level 4 and 3, respectively). - (Disabled) For sectors with exactly one outer loop, check that all inner ones are inside it. This is currently not compiled due to an asymmetry of loopinside() for degenerate cases, similar to pre-r3898 inside().
r_npotwallmode, emulating 8-bit for walls w/ nonpow2 height textures.
When that mode is enabled (see below for caveats), wall textures that have a non-power-of-two height (call it 'h') will be modified to look like in classic: Let 'H' be the next power of two greater than 'h'. The texture will be uploaded with height 'H', made up from 'h' hlines of the original texture, followed by 'H'-'h' first hlines of the same. No panning "corrections" will take place. The mode is disabled by default. Caveats/notes: * the mode requires that r_hightile is disabled * it is not implemented in Polymer * in the Lunatic build, it is ineffective when a VX map is loaded, as those display walls with NPOT height textures correctly
when pasting onto the bottom part of a [2]-wall, take over y-flipping.
Note that x-flipping is determined by the cstat of the upper part of the wall (that is, the wall facing the player, not the nextwall, from which the picnum for the bottom part is taken.)
Factor out commonly occuring hictinting[]-accessing code into three functions.
Note: in polymer.c, this was buggy (but harmless) because .r is a char: if ((uint32_t)hictinting[MAXPALOOKUPS-1].r & 0xFFFFFF00) != 0xFFFFFF00)
Replace various GL rendering related literal flags with enum labels.
- pthtyp pth->flags bits - Flags of the <dameth> argument of various functions - hictinting[].f / gloadtile_hi() and daskinloader() <effect> arg bits - hicreplctyp hicr->flags bits - texcacheheader cachead.flags bits
polymost.c: stylistic cleanup in gloadtile_hi, uploadtexture, fixtransparency.
in NPOT wall ypanning "correction", behave like Polymer in one corner case.
Specifically, the handling of one-way walls ([1] in Mapster32) was slightly different.
game.c: in A_Spawn(), protect CSTAT_SPRITE_NOSHADE of spawned MASKWALL* sprites.
actors.c: fix a A_CheckSpriteFlags() call for zombie actor to STANDABLE change.
This only affects zombie actors in a sector with a parallaxed ceiling. If they have SFLAG_NOSHADE clear, their shade is taken from the ceiling upon changing the statnum. Previously, A_CheckSpriteFlags() received a value that could only be 0 or 1 for the sprite index (typo).
in linking tag determination, handle 'on' switch picnums (+1).
in e.g. F5 "next free tag" display, note object w/ greatest tag.
don't read some variables from mapster32.cfg redundant since r4344.
Mostly, these are rendering-related variables. We keep *writing* them to mapster32.cfg so that older Mapster32 versions can be used side-by-side for now.
make r_usetileshades 2 the default.
This mode does not take a sector's visibility values into account for uniform darkening of a texture. It is more faithful to classic with respect to fog/visibility *distances*, but may be less so as far as the "tint" of the texture due to visibility attenuation is concerned.
engine.c: instead of fogpal post-tweaks (last 2 commits), normalize by numshades-1.
That is, for every for palette (now, even ones created by the user) the last shade is the (or rather, a color close to the) full fog color by construction. In loadpalette(), reject a PALETTE.DAT with only one shade level.
engine.c: extend the last workaround to all four fogpals generated at startup.