Commit Graph

130 Commits

Author SHA1 Message Date
terminx 34453f5090 Continued cleanup. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5827 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:40:56 +00:00
terminx 205a757109 Move palette related functionality from engine.c to palette.c/h.
git-svn-id: https://svn.eduke32.com/eduke32@5789 1a8010ca-5511-0410-912e-c29ae57300e0
2016-06-21 00:33:06 +00:00
terminx eacd9527a3 Mapster32: configurable point and line highlight/selection distances
git-svn-id: https://svn.eduke32.com/eduke32@5568 1a8010ca-5511-0410-912e-c29ae57300e0
2016-01-15 07:58:57 +00:00
hendricks266 344e10628f Part two of more const casting, this time affecting argv instances.
git-svn-id: https://svn.eduke32.com/eduke32@5552 1a8010ca-5511-0410-912e-c29ae57300e0
2016-01-12 10:30:56 +00:00
terminx e27eb7a7e5 Use XXH64 functions for editor undo/redo when building for 64-bit.
git-svn-id: https://svn.eduke32.com/eduke32@5546 1a8010ca-5511-0410-912e-c29ae57300e0
2016-01-11 05:06:02 +00:00
helixhorned f8076f9207 Mapster32: honor "blocking color" declared with DEF 'spritecol' et al.
Meaning tilegroup's 'colors' directive.

Also, to the packaged tiles.cfg, add a description of how to emulate the
earlier Mapster32 sprite coloring for one tile group.

git-svn-id: https://svn.eduke32.com/eduke32@5429 1a8010ca-5511-0410-912e-c29ae57300e0
2015-11-14 23:40:59 +00:00
helixhorned 51489e44d4 Mapster32: add var 'corruptcheck_game_duke3d' and enable by default.
Currently, this checks for effector sprites that are not face-aligned.
See
https://forums.duke4.net/topic/8324-icestation-colossus-map-broken

git-svn-id: https://svn.eduke32.com/eduke32@5420 1a8010ca-5511-0410-912e-c29ae57300e0
2015-11-14 17:21:11 +00:00
helixhorned d824ddf406 Mapster32: fix fillsector() calls before fade_editor_screen().
The latter allows one to specify a color to keep, but with r5302 the
fillsector() highlights are drawn with transparency, thus making it ineffective.
Add an argument to toggle transparency to fillsector()
(now fillsector_maybetrans()) and two wrapper functions.

git-svn-id: https://svn.eduke32.com/eduke32@5411 1a8010ca-5511-0410-912e-c29ae57300e0
2015-10-31 15:13:32 +00:00
terminx 470449a963 Fix saving and loading crosshaircolor, and fix fps counter color when using a palette that doesn't correspond to Duke3D's color indexes.
git-svn-id: https://svn.eduke32.com/eduke32@5387 1a8010ca-5511-0410-912e-c29ae57300e0
2015-10-20 07:15:01 +00:00
terminx e30ab0068e Mapster32: fix 2d3d mode input issue when sector is -1
git-svn-id: https://svn.eduke32.com/eduke32@5385 1a8010ca-5511-0410-912e-c29ae57300e0
2015-10-20 07:14:52 +00:00
hendricks266 1ca367960f Defs: Add basepalette, palookup, and blendtable tokens.
git-svn-id: https://svn.eduke32.com/eduke32@5351 1a8010ca-5511-0410-912e-c29ae57300e0
2015-09-23 17:55:19 +00:00
hendricks266 ce7a20d4f2 Restructure loadpalette() so that read errors are not immediately fatal and enforce that the necessary parts have been loaded in E_PostInit (after loaddefinitionsfile()).
git-svn-id: https://svn.eduke32.com/eduke32@5346 1a8010ca-5511-0410-912e-c29ae57300e0
2015-09-23 17:54:50 +00:00
hendricks266 43459780af Engine: Add E_PostInit, called from the game after loaddefinitionsfile().
git-svn-id: https://svn.eduke32.com/eduke32@5345 1a8010ca-5511-0410-912e-c29ae57300e0
2015-09-23 17:54:42 +00:00
helixhorned 1ea397d0b4 Mapster32: RCtrl+RAlt (+['] or [;]) selects sectors in 3D mode, by The Mechanic.
git-svn-id: https://svn.eduke32.com/eduke32@5339 1a8010ca-5511-0410-912e-c29ae57300e0
2015-09-05 08:30:59 +00:00
helixhorned e8623165a7 Mapster32: add config variable 'corruptcheck_heinum'.
With 3 modes:
 0: auto-correction and warning disabled
 1: auto-correction enabled (default, current behavior)
 2: auto-correction and warning enabled

git-svn-id: https://svn.eduke32.com/eduke32@5320 1a8010ca-5511-0410-912e-c29ae57300e0
2015-08-08 07:04:14 +00:00
terminx 6f9a9c94ec Mapster32: fix frame locking issue with 2d3d mode, crash when toggling bottom texture swap, issues with drawing certain types of walls.
git-svn-id: https://svn.eduke32.com/eduke32@5307 1a8010ca-5511-0410-912e-c29ae57300e0
2015-07-22 02:06:23 +00:00
terminx 480dc0ecaf Mapster32:
-Improved indication of selections in 2d mode. This includes both highlighted objects and multiple object selection.
-2d3d improvements: it's no longer possible to end up with a black view due to the z position being out of range when moving the cursor position to a new area with the right mouse button.
-The middle mouse button can now be used in place of the right alt key when selecting sectors, similar to how the left mouse button can be used in place of the right shift key to select points and sprites.
-2d mode mouse cursor has been changed to a 1 pixel thick red cross with a shadow instead of a 2 pixel thick red cross with no shadow. This improves visibility when working in textured mode with lava sectors and other textures similar in color.
-2d mode palette now changes when working in an underwater sector.
-Misc tweaks

git-svn-id: https://svn.eduke32.com/eduke32@5302 1a8010ca-5511-0410-912e-c29ae57300e0
2015-07-17 00:12:48 +00:00
terminx e676b04687 Engine: misc cleanups, support for drawing transparent lines in 2d mode. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5300 1a8010ca-5511-0410-912e-c29ae57300e0
2015-07-17 00:12:40 +00:00
helixhorned 0419e64c0a Mapster32: fix a possible oob read via drawspritelabel; sanitize 2d3d mode.
That is, in m32_is2d3dmode(), also check if 2d and 3d mode resultions are
the same. Otherwise, oob writes (e.g. via tileinfo_doprint()) and other
thinkable niceties may ensue.

git-svn-id: https://svn.eduke32.com/eduke32@5291 1a8010ca-5511-0410-912e-c29ae57300e0
2015-07-11 14:13:04 +00:00
terminx 253f0b8771 Mapster32: improve 2d mode sprite label display. I want to test this further, so this is marked as DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5289 1a8010ca-5511-0410-912e-c29ae57300e0
2015-07-10 07:56:48 +00:00
terminx f72dffce07 Mapster32 changes:
-2d mode sprite colors are now automatically generated from the sprite's 8-bit tile.
-Zooming in and out has been smoothed out.
-The 2d mode crosshair cursor is now 1px thick instead of 2.
-The left mouse button can now be used to select multiple wall points and sprites in 2d mode.
-Ctrl-x now skips corrupt maps instead of going into an infinite loop. ;)
-'-L function in 3d mode works again.
-Sprites with a clipdist that has been changed from the default value of 32 will display a circular approximation of the distance in 2d mode. Note that the real clipping distance is actually closer to a square, but a circle looks much less confusing/stupid alongside the display of floor sprites.
-2d mode status bar has been made a few shades lighter.

git-svn-id: https://svn.eduke32.com/eduke32@5282 1a8010ca-5511-0410-912e-c29ae57300e0
2015-07-08 03:34:46 +00:00
terminx 86f94d2897 New experimental Mapster32 hybrid 2D/3D mode feature. Pressing F10 in 2D mode enables a picture-in-picture 3D view in the corner of the screen. When moving the mouse over the 3D view, the controls change to 3D mode controls and all 3D mode operations can be performed. The 3D view can be resized with shift + F10 and can be moved to different positions by holding CTRL and using the arrow keys.
This commit also implements a much more useful automatic grid sizing feature and smooths out zooming in and out of the map.

git-svn-id: https://svn.eduke32.com/eduke32@5281 1a8010ca-5511-0410-912e-c29ae57300e0
2015-07-08 03:34:42 +00:00
terminx 5064e8b8cd Make 'L' key toggle grid lock in 3D mode, because it affects placement of sprites inserted with 'S'.
git-svn-id: https://svn.eduke32.com/eduke32@5240 1a8010ca-5511-0410-912e-c29ae57300e0
2015-05-26 00:48:01 +00:00
helixhorned 451dcfa073 Mapster32: remove unused key* options in mapster32.cfg and corresponding BK_* macros. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4934 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-18 22:11:31 +00:00
terminx 4911b9a949 Revise C++ structure trackers for performance and introduce "tspritetype", for temporary sprites or other usages where using the trackers would be invalid or undesired. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4898 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:55:07 +00:00
hendricks266 9268b9f0b6 Make a bunch of things extern "C". This should fix C++ builds on OS X and with Lunatic. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4766 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-26 04:39:23 +00:00
terminx 99e21ffa94 Part 1 of attempting to adhere to C standard section 7.1.3. It turns out it's illegal to use identifiers that begin with _ or have __ anywhere in them. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4747 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-22 12:32:56 +00:00
terminx cbe91be9ff Additional engine cleanups and optimizations. About as generic as it sounds. Also changes internal dummytile/tilefromtexture behavior so that the LZ4 compressed version of a texture is kept and the cache1d entries associated with the tiles can expire, like any other tile.
git-svn-id: https://svn.eduke32.com/eduke32@4661 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:30:38 +00:00
terminx 598876e411 Extra files for previous commits
git-svn-id: https://svn.eduke32.com/eduke32@4607 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:06:57 +00:00
helixhorned 363f0b3af6 Mapster32: 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().

git-svn-id: https://svn.eduke32.com/eduke32@4569 1a8010ca-5511-0410-912e-c29ae57300e0
2014-08-08 20:02:54 +00:00
hendricks266 a7fb2721e4 Move code non-specific to Duke Nukem 3D from astub.c to a new m32common.c.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4561 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-28 06:44:37 +00:00
hendricks266 b48f3b44e3 Progress towards KenBuild Editor, part 1.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4558 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-28 06:43:16 +00:00
hendricks266 e8949e1c31 Elimininate some codedup between game.c and astub.c.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4557 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-28 06:42:28 +00:00
hendricks266 4f67f8f969 KenBuild.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4555 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-24 14:01:44 +00:00
helixhorned b82b5dc6b7 Mapster32: in e.g. F5 "next free tag" display, note object w/ greatest tag.
git-svn-id: https://svn.eduke32.com/eduke32@4464 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-06 22:15:19 +00:00
hendricks266 a21f340553 Mapster32: Introduce m32_settings.cfg, analogous to settings.cfg, so that you can save your cvars and aliases for the editor.
One potential use is to add r_togglecomposition "0" if you don't like Aero turning on and off every time you switch between 2D mode and 32-bit 3D mode.

git-svn-id: https://svn.eduke32.com/eduke32@4344 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 08:03:02 +00:00
helixhorned c2797e4b11 Mapster32: take initial map file name from ExtPreInit()->G_CheckCommandLine().
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
2013-10-28 21:26:25 +00:00
helixhorned 514a3bfd64 Prevent calling function pointers cast to an incompatible type.
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
2013-09-21 13:38:44 +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 593b82692e Mapster32: allow setting first walls of TROR sectors independently.
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
2013-05-30 18:10:45 +00:00
helixhorned f6a577ff68 Mapster32: add "movement by one" debugging functionality via a.m32.
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
2013-02-19 20:35:14 +00:00
helixhorned dc9f4eb360 Mapster32: add cvar/mapster32.cfg option "keeptexturestretch".
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
2013-01-16 20:38:56 +00:00
helixhorned 8fb886b14a Replace dragpoint()'s "dragpoint_noreset" global with a "flags" argument.
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
2013-01-16 20:38:41 +00:00
helixhorned 0dd78fb029 Cleanup of console/on-screen-display (OSD) functionality.
- 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
2012-12-25 16:13:50 +00:00
helixhorned 0316868c75 Clean up engine code by factoring repeated 3-liners into spriteheightofs().
This function also changed: it doesn't handle floor-aligned sprites now,
and the z offset is returned instead of set by pointer.

git-svn-id: https://svn.eduke32.com/eduke32@3205 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:43 +00:00
hendricks266 fcf9beae6a Work-in-progress adjustment to the C code to compile under C++. It builds for me without errors using Win32 MinGW-GCC, but it still generates warning soup. No guarantees about MSVC or anything using SDL. Enable C++ by building with CPLUSPLUS=1. C remains the default and should compile with no change in setup.
Credit to Plagman for the idea and doing the work on the game side, which is included in this commit.

(Building as C++ will give us features with which we can make improvements and optimizations on the multiplayer code and Polymer.)

git-svn-id: https://svn.eduke32.com/eduke32@3116 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-05 02:49:08 +00:00
helixhorned 65a7ed04f7 Mapster32: functionality to rotate or scale RShift-highlighted stuff smoothly.
This is done by pressing LShift and
 - holding down the left mouse button for scaling, or
 - the right mouse button for rotating the highlighted walls/sprites
with respect to a pivot point determined as the center of the bounding box of
all highlighted points.

Note that scaling sectors isn't that easy and the current functionality is very
rudimentary: there's no z scaling, no xrepeat correction, and sprites aren't
touched expect for their position.  The user is responsible to maintain map
consistency, for example to prevent wall-lines of the same sector crossing
each other.

git-svn-id: https://svn.eduke32.com/eduke32@3113 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-04 23:03:22 +00:00
helixhorned e6fdb25d6d Mapster32: draw lines to linking sprites with LShift, jump to them with +[ or +]
When LShift is pressed and the mouse is over a linking sprite (as determined by
the tag labeling system), lines are drawn to all other sprites, and pressing
[ or ] will cycle these then. False positives and missed sprites are possible.

Additional changes:
 - consider SE 31 and 32's lotag to NOT be linking, since the ACTIVATOR is what
   matters.  The original maps are inconsistent there.
 - When pressing Alt+[ or Alt+] and there are no corruptions, say so instead of
   doing [ or ].

git-svn-id: https://svn.eduke32.com/eduke32@3108 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-03 19:32:39 +00:00
helixhorned 5b311f98cc Clean up redundant/local function declarations in build.c.
git-svn-id: https://svn.eduke32.com/eduke32@3061 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:17 +00:00
helixhorned 9d0bffebde Mapster32: factor out some code (3x) into GetSaveBoardFilename().
git-svn-id: https://svn.eduke32.com/eduke32@3046 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:44 +00:00