Commit Graph

613 Commits

Author SHA1 Message Date
helixhorned 599a2049e6 Mapster32: add check for sprites being out of the maximal grid range (+-524288).
Requested auto-correction will place such sprites at their sector's first point.

git-svn-id: https://svn.eduke32.com/eduke32@3029 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-26 22:53:57 +00:00
helixhorned b8ed142c6b Remove some #if 0 blocks that are probably of no interest any more.
For reference, they are the following:
 - cache1d.c: suckcache()
 - build.c: compare_wall_coords()
 - make switch-invisible heuristic
 - Mapster32: old sprite search
 - Mapster32: manual z range
 - m32script: read/writearray, qgetsysstr
 - menus.c: savetemp()

git-svn-id: https://svn.eduke32.com/eduke32@2981 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:00:58 +00:00
helixhorned 13178b7cda Mapster32: properly reset highlights in undo/redo.
git-svn-id: https://svn.eduke32.com/eduke32@2943 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:27:42 +00:00
helixhorned 2b2be071d4 High-level TROR drawing: clean up how things are passed around.
git-svn-id: https://svn.eduke32.com/eduke32@2880 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:37 +00:00
helixhorned bdedbc6f76 Constify various char* vars, parameters, etc. for more -Wwrite-strings cleanness
-Wwrite-strings is useful to detect code where string literals and e.g. alloc'd
strings are used side-by-side, potentially creating dangerous situations, or to
find uses of old, non-constified APIs.  However, enabling it would still flood
the log with too many warnings.  Also, GCC wrongly warns for initializations of
char arrays.

git-svn-id: https://svn.eduke32.com/eduke32@2796 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:33 +00:00
helixhorned 8a89c07261 editor: const char *scripthist -> char *, since it's alloc'd/freed
git-svn-id: https://svn.eduke32.com/eduke32@2795 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:25 +00:00
helixhorned 54721d7461 Make ksqrt take uint32_t, add helper function uint32_t uhypsq(int32_t,int32_t).
uhypsq calculates the hypotenuse using unsigned multiplication. This is
permissible since for arbitrary int32s a and b, the following holds in
two's complement arithmetic:
  (int32_t)((uint32_t)a * b) == (int32_t)((int64_t)a * b)
("Signed and unsigned multiplication is the same on the bit level.")

This fixes various overflows where wall lengths for walls of length > 46340
are calculated, but does not rid us of other overflows in the same vein
(usually dot products between vectors where one point is a wall vertex and
the other a position in a sector).

git-svn-id: https://svn.eduke32.com/eduke32@2791 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:14 +00:00
helixhorned 13a2f97a72 Relative-aligned non-flipped ceiling/floor texture alignment ([;]+[ENTER])
Flipped reference ceilings/floors aren't handled correctly yet.

git-svn-id: https://svn.eduke32.com/eduke32@2774 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-20 20:55:03 +00:00
helixhorned d741df358d Mapster32: display zero-length walls as level-3 corruptions.
git-svn-id: https://svn.eduke32.com/eduke32@2767 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:48 +00:00
helixhorned 8d8196993b Mapster32: fix a div by zero when drawing tile info for void tile in 3D mode.
This was exposed by Clang with -ftrapv, which apparently also traps those.

git-svn-id: https://svn.eduke32.com/eduke32@2757 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:28 +00:00
terminx 169587b5b4 Fix MSVC build error caused by the use of a C99 feature (that should have been added to the compiler about 13 years ago)
git-svn-id: https://svn.eduke32.com/eduke32@2743 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-07 02:59:24 +00:00
hendricks266 67ed6945fd The handling for grp, con, and def filenames has been massively cleaned up and factored into common.c. A new header, common_game.h, was created because common.h was placed in build/include (see r2542) and we need a common header for things that strictly should not be in the engine. RTS file names were also improved but some of the patterned changes were already made in r2420, and they were not factored because they are strictly part of the game, not the editor.
NAM and Napalm can now share their con, def, and rts files if the one for their respective game is not present because the con and rts files are identical.

Also, decapitalize two string literals missed in r2540.

git-svn-id: https://svn.eduke32.com/eduke32@2726 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:09:33 +00:00
hendricks266 19d9d0a71e Incorporate some use of Bfflush(NULL) in hopes to alleviate Wii configuration saving concerns.
git-svn-id: https://svn.eduke32.com/eduke32@2725 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:08:27 +00:00
helixhorned 55bd1ecc34 M32 auto-aligner: calculate panning for non-firstwall-aligned ceilings/floors.
Also, print failure messages on some occasions.

git-svn-id: https://svn.eduke32.com/eduke32@2717 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:24 +00:00
helixhorned df105128cb Mapster32: Part 1 of ceiling/floor auto-alignment functionality.
Usage is from 3D mode only.  When a sector (or wall) is committed to the
clipboard, it (or the wall's sector) is saved, and is subsequently used
when auto-aligning [;-ENTER] another sector's ceiling or floor against the
reference one's.  This temp. sector is reset on any structurally modifying
operation except setting first walls; also, aligning extended ceilings or
floors is impossible as they use .*xrepeat internally.

The auto-alignment does not change picnums (this can be accomplished with
the ['+ENTER] combination), but copies the orientation bits 2^{2..6} to the
alignee.  Afterwards, if the reference is relative-aligned, it tweaks them,
so that every case where the two firstwalls are either parallel or perpendi-
cular is handled correctly.

It does not yet calculate the panning values.

git-svn-id: https://svn.eduke32.com/eduke32@2715 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:19 +00:00
helixhorned f5e884314e Mapster32: in textured 2D mode, make floor flipping [F] work.
git-svn-id: https://svn.eduke32.com/eduke32@2713 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:09 +00:00
helixhorned 85844f96dd Mapster32: In textured 2D mode, allow setting floor relativity [R].
Also factor out the code (2x) setting the alignment bits for sprites.

git-svn-id: https://svn.eduke32.com/eduke32@2712 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:00 +00:00
helixhorned 62727ebd9c Mapster32: more descriptive message when flipping stuff [F], reverse w/ SHIFT.
git-svn-id: https://svn.eduke32.com/eduke32@2711 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:08:57 +00:00
helixhorned 35d989646e A couple of minor fixes and comments that got accumulated in my tree.
git-svn-id: https://svn.eduke32.com/eduke32@2709 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-29 20:01:55 +00:00
helixhorned 0088ed0591 Only check file name case when not in-game; don't warn for ALLUPPER or alllower.
The first means that the expensive (~0.5 ms) SHGetFileInfo() calls won't inter-
fere with smooth gameplay, but files that are opened only at game-time like
sounds won't be checked.  The second means that there are now less false
positives, i.e. warnings about files that would be found due to the
check-all-{upper,lower} hack.

git-svn-id: https://svn.eduke32.com/eduke32@2702 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-28 18:15:19 +00:00
helixhorned d1fed44da6 Mapster/classic: Make Ctrl-P toggle parallax rendering types in 3D mode again.
Of course, it's just for the heck of it, since this setting is not saved into
MAP files.  I kinda like the cylindrical projection...

git-svn-id: https://svn.eduke32.com/eduke32@2605 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-10 20:14:31 +00:00
helixhorned d44f8c761e Fix flipping masked walls in Mapster/classic.
This has been there since searchbottomwall introduction in r1466.

git-svn-id: https://svn.eduke32.com/eduke32@2604 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-10 20:14:17 +00:00
helixhorned 0be9b7e568 Make makepalookup() accept NULL for 'remapbuf', meaning "use identity mapping".
Also,
 - use this in game.c and astub.c palookup loading code
 - when makepalookup() is passed a 0 palnum, return early.  This means that
   'fogpal' will silently fail when attempting to change pal 0.
 - in 'makepalookup' DEF command, error out if passed a pal of 0.

git-svn-id: https://svn.eduke32.com/eduke32@2569 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-29 21:17:03 +00:00
helixhorned c5d8aa29ee The obligatory portion of trivial stuff.
git-svn-id: https://svn.eduke32.com/eduke32@2566 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:45:25 +00:00
helixhorned a7ec51e375 Clean up astub.c in a similar fashion to the preceding changes.
git-svn-id: https://svn.eduke32.com/eduke32@2564 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:44:47 +00:00
helixhorned 0e3adea64e Replace various occurences of "Bstrncpy(buf, src, sz); buf[sz-1]=0;" with Bstrncpyz
git-svn-id: https://svn.eduke32.com/eduke32@2559 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:43:21 +00:00
helixhorned 26d2cf7e01 Replace {get,clear}filenames and duplicate autoload code in astub.c/game.c.
This additionally fixes leaks that were caused by traversing the file name
list with the 'findfiles' pointer and not clearing them afterwards (even if
there was a handle to the list head via 'findfileshigh').

git-svn-id: https://svn.eduke32.com/eduke32@2557 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:42:32 +00:00
helixhorned af9db8cfa2 Mapster32: fix specifying a custom configuration file with -cfg.
We were writing into a string literal. Ouch!

git-svn-id: https://svn.eduke32.com/eduke32@2551 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:05:51 +00:00
helixhorned e7f091cd90 Factor out various instances of getatoken() into common.c.
Alongside, these make into into the header:
 - the 'tokenlist' type (a typedef'd struct)
 - the T_EOF and T_ERROR enumeration values

git-svn-id: https://svn.eduke32.com/eduke32@2549 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:05:23 +00:00
helixhorned e74f8cada1 Replace all occurences of assert in our code with Bassert.
git-svn-id: https://svn.eduke32.com/eduke32@2547 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:04:44 +00:00
helixhorned ee5dd2cf32 Add common.[ch] which should be used for common non-engine types/functions/data.
As inauguration, move G_AddGroup, G_AddPath and struct strllist there.
The header is located in build/include, because in the future, code that resides
closer to (but is not strictly part of) the engine might need to be factored
into here.  The source file, however, is in the source/ directory.

git-svn-id: https://svn.eduke32.com/eduke32@2542 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:03:20 +00:00
hendricks266 9f61e6e2d5 Superficial text changes:
- Help window text cleaned and made more consistent between game and editor
 - Added help entry for "-clipmap"
 - Log text for using CON, DEF, and RTS files has been made consistent
 - All instances of '%s' have been replaced with \"%s\" because ' is a valid filename character. (At least on Windows.)

git-svn-id: https://svn.eduke32.com/eduke32@2538 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 05:05:57 +00:00
helixhorned c4efd9b1fa Take over more correct G_AddGroup from game.c to astub.c.
The code in the editor was potentially doing a strcat on a strdup'd string.
Also, rename AddGamePath to G_AddPath in astub.c and add CODEDUP markers
because shared stuff like this ought to be factored out into a separate
source file some time.

git-svn-id: https://svn.eduke32.com/eduke32@2531 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 22:00:42 +00:00
helixhorned 386d34e3b4 Fix static-main-arrays debug build, which is without the clipshape feature.
git-svn-id: https://svn.eduke32.com/eduke32@2528 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 13:54:46 +00:00
helixhorned 3e1a8c523d In Mapster32, remove ReadGamePalette() and GAMEpalette[] and use engine's palette[].
git-svn-id: https://svn.eduke32.com/eduke32@2515 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-22 22:46:56 +00:00
hendricks266 270342463f More "malloc + strlen + strcpy --> strdup" in module parameter code.
git-svn-id: https://svn.eduke32.com/eduke32@2506 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-20 19:28:22 +00:00
helixhorned 97020caf73 Clear up after r2495. (Because I'm a pedantic asshole.)
- in Mapster, pre-form the default 10 clip map names before returning from
  G_CheckCommandLine() so it gets loaded even if we passed no cmdline args.
- malloc + strlen + strcpy --> strdup
- don't need to spank dead variables ;)
- we may call calloc with zero size, which isn't bad by itself, but asserting
  for non-null afterwards is.  Allocs of 0 are implementation-defined, and may
  well return a null pointer (C99 7.20.3).

git-svn-id: https://svn.eduke32.com/eduke32@2502 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 23:18:32 +00:00
helixhorned 68603b0a28 Mapster32 tag-label system: don't consider 'switch' walls with an upwall as linking.
git-svn-id: https://svn.eduke32.com/eduke32@2496 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 23:16:37 +00:00
hendricks266 cf2b9ec940 New "-clipmap" command-line switch to specify sector collision clip maps. This switch works in an additive fashion like -mx and -mh. _clipshape0.map through _clipshape9.map remain loaded by default.
Also, a very minor change in the con/def module code. (int --> int32_t)

git-svn-id: https://svn.eduke32.com/eduke32@2495 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 08:50:41 +00:00
helixhorned 0f7615daf7 Remix undo/redo system, fixing potential access of freed memory.
A run of consecutive mapstates may share sector/wall/sprite blocks, but
the code was deciding whether to free them solely on local properties.
Now, save a reference count at the beginning of each such allocated block
and free it only if it reaches zero.

git-svn-id: https://svn.eduke32.com/eduke32@2492 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-17 11:35:35 +00:00
helixhorned 4412d5729e In undo/redo, always print the revision that got _restored_.
git-svn-id: https://svn.eduke32.com/eduke32@2491 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-17 11:35:16 +00:00
helixhorned 5246f17169 "Promote" oob sectnum/statnum sprites to corruption level 4.
Also, always print at least level 5 corruptions (that is, have no instances
of completely silent corruptcheck).

git-svn-id: https://svn.eduke32.com/eduke32@2490 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-17 11:34:54 +00:00
helixhorned 4042fa90c4 Mapster32: sprite list consistency checker in corruptcheck.
This checks for about every possible type of sprite list corruption and
reports back with a corruption level 5 if one of the 14 validations fail.

git-svn-id: https://svn.eduke32.com/eduke32@2489 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-17 11:34:32 +00:00
helixhorned d1538d5dfd Tweak Mapster32's sound index (F2).
- start scrolling from about half of the visible page
- PGUP/DGDN moves the cursor by 1/4 of the page
- code cleanup (we only need one displine[80], use clearkeys())

git-svn-id: https://svn.eduke32.com/eduke32@2488 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-17 11:34:09 +00:00
helixhorned 5e1b3bd44b Re-enable Mapster32's undo/redo functionality.
git-svn-id: https://svn.eduke32.com/eduke32@2486 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-15 18:12:17 +00:00
helixhorned 65fe7ce3bd This should fix the assertion failure with undo/redo, my failure in r2478.
git-svn-id: https://svn.eduke32.com/eduke32@2485 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 23:17:54 +00:00
helixhorned 76de780d8b Fix (still not enabled) undo/redo code compilation.
Also include one comment about a currently failing assertion there.

git-svn-id: https://svn.eduke32.com/eduke32@2482 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 22:31:32 +00:00
helixhorned 4d4221d71f Continuously keep track of the number of sprites in the world.
New engine variable 'int32_t Numsprites', not yet saved into savegames
or mapstates. (The capitalization is to distinguish it from the often-used
'numsprites' locals or structure member names.
In the editor, get rid of updatenumsprites().

git-svn-id: https://svn.eduke32.com/eduke32@2478 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 22:30:24 +00:00
helixhorned 4659b691e6 Some sound source cleanup, no functional changes.
- make a couple variables static in sounds_mapster32.c
- KHz --> Hz in initialization text

git-svn-id: https://svn.eduke32.com/eduke32@2439 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-10 21:21:42 +00:00
hendricks266 9f78a773f1 Add "OSX_STARTUPWINDOW" Makefile variable to toggle the OS X startup window. Off by default.
git-svn-id: https://svn.eduke32.com/eduke32@2426 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-08 06:07:10 +00:00
hendricks266 27b279a1ce JFDuke3D port: OS X Startup Window, copied almost verbatim
It needs to have the sound quality box removed and the Game directory box added, possibly among other things.

git-svn-id: https://svn.eduke32.com/eduke32@2396 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 09:30:27 +00:00
helixhorned e14b2808ef Fix non-OpenGL build.
git-svn-id: https://svn.eduke32.com/eduke32@2357 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 17:56:26 +00:00
helixhorned 0ef1721955 Mapster32: Fix extended ceiling/floor picnums taking on picnum 0 in Polymer.
The reason was that drawmasks(), which was where the resetting of the fake
RoR textures happened under Polymer, can be called from polymer_displayrooms()
when mirrors are present. I was assuming that drawmasks() was only ever called
after the 'main' drawrooms and that hence the sequence of fake RoR tile tweaking
was set, reset, set, reset, ... which it was not.
Now, do the resetting explicitly after every drawmasks() in the editor.

git-svn-id: https://svn.eduke32.com/eduke32@2350 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:25:42 +00:00
helixhorned 17ba2664f9 Mapster32: don't use lazy tile loading with r_hightile=0.
git-svn-id: https://svn.eduke32.com/eduke32@2345 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:24:09 +00:00
helixhorned 103ee7a40b rotatesprite(..., windowx1,windowy1,windowx2,windowy2) --> rotatesprite_win
git-svn-id: https://svn.eduke32.com/eduke32@2318 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 21:35:00 +00:00
helixhorned 1d0cb07167 Factor out four instances of identical code into M32_DrawRoomsAndMasks().
git-svn-id: https://svn.eduke32.com/eduke32@2314 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-04 21:33:52 +00:00
helixhorned 99e08bf441 legibility improvements: rotatesprite(..., 0,0,xdim-1,ydim-1) -> rotatesprite_fs
git-svn-id: https://svn.eduke32.com/eduke32@2308 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-02 17:35:05 +00:00
helixhorned 7a4c9253c5 astub.c: remove some tabs in the code
git-svn-id: https://svn.eduke32.com/eduke32@2275 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 22:11:55 +00:00
helixhorned cd89fce9aa less trivial stuff
- fix one bound-checking line
- rewrite two lines in astub.c to potentially not overflow an int16
- make tiletovox[] an array of int16's

git-svn-id: https://svn.eduke32.com/eduke32@2266 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:57:46 +00:00
helixhorned 260bbc1f92 cleanup:
- 'whitecol' was defined in the engine and in build.c, use only the engine one
 - make cachesize, artsize, artversion static in engine.c
 - undo some formatting havoc presumably done by astyle

git-svn-id: https://svn.eduke32.com/eduke32@2260 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:39:38 +00:00
helixhorned e30ed58aa0 Fix parallaxed sector display in Mapster32 on Polymer.
git-svn-id: https://svn.eduke32.com/eduke32@2257 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-14 14:48:45 +00:00
helixhorned b73b9cb732 a.m32: new state 'print_parallel_midpts'
git-svn-id: https://svn.eduke32.com/eduke32@2179 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-12 23:18:53 +00:00
helixhorned 84867ee620 Mapster32: Rudimentary support for auto-aligning along TROR nextwalls.
Usage: press the ['] (quote) modifier together with the PERIOD key.
Aligns only the immediate upper and lower neighbors of each wall that got
aligned by following point2s or nextwalls.  Doesn't play well with Alt
(carry over xrepeat) yet, might need two subsequent alignment passes.

git-svn-id: https://svn.eduke32.com/eduke32@2178 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-12 23:18:35 +00:00
helixhorned 4989c173bd Fix out-of-bounds access in tile selector code in astub.c
git-svn-id: https://svn.eduke32.com/eduke32@2177 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-12 23:18:15 +00:00
helixhorned 151287168c - Fix invalid polymer light array access originating from game's cleanup
callback 'G_Polymer_UnInit'.
- In astub.c, reset spritelightid to -1 when nulling the spritelightptr of
  a sprite  (no crashes observed, just precaution)
- In sdlayer.c, catch SIGILLs with our signal handler too, since illegal
  instructions are what the instrumented debug builds will execute when
  attempting to carry out an undefined (per C) operation.

git-svn-id: https://svn.eduke32.com/eduke32@2169 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:11:31 +00:00
helixhorned c112cdde89 Fix a potential out-of-bounds read and write when loading the help file
in Mapster32.

git-svn-id: https://svn.eduke32.com/eduke32@2161 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:09:14 +00:00
helixhorned 6fc7e5b683 Remove some warnings with clang, code-side changes.
git-svn-id: https://svn.eduke32.com/eduke32@2158 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:08:29 +00:00
helixhorned 086dcf383d Mapster32: fix filling all sectors of a bunch with Ctrl-U. Previously, only
one sector was filled and the 'clear bunch' message was displayed even if the
operation was canceled.

git-svn-id: https://svn.eduke32.com/eduke32@2153 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-04 21:20:31 +00:00
helixhorned f4703a596d Auto-correct the just mentioned inconsistency by clearing the respective TROR
nextwalls. (i.e. setting them to -1 on 'corruptcheck tryfix')

git-svn-id: https://svn.eduke32.com/eduke32@2134 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 14:12:44 +00:00
helixhorned 1402a6d70b corruption checker: catch TROR-nextwalls in non-extended sectors. These
can be caused by copying map parts from one map to another (or a new one).
The copying system is slightly broken right now....

git-svn-id: https://svn.eduke32.com/eduke32@2133 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 14:12:30 +00:00
helixhorned 9a8603d01e - Make old-nextwalls invalid on the following two occasions: ovh_whiteoutgrab
with no highlighted sectors; and when entering 3D mode, even if there are
  highlighted sectors. This should have almost no effect, but I find it cleaner
  that way.
- Check map for corruption every time an editing change is done. This was
  accidentally disabled when commenting out the undo code (which I've yet
  to debug).

git-svn-id: https://svn.eduke32.com/eduke32@2121 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:50:40 +00:00
helixhorned 57e132a044 Remove after_handleevents_hook and its only user, the keystatus-level clearing
of SPACE and C when in side-view mode. Now, this is accomplished by checking
directly in the overheadeditor code.

git-svn-id: https://svn.eduke32.com/eduke32@2119 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:50:07 +00:00
helixhorned ac12a06de4 Fix calling glEnable() without checking for the rendering mode in the tile
selector. This could lead to a crash when OpenGL wasn't initialized before.

git-svn-id: https://svn.eduke32.com/eduke32@2117 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:49:22 +00:00
helixhorned 21274b317f Fix the flickering in the tile selector with lazy hightile loading on
(lazy_tileselector=1 in mapster32.cfg). We're drawing tiles one by one,
so glDrawBuffer(GL_FRONT_AND_BACK) is our friend.

git-svn-id: https://svn.eduke32.com/eduke32@2115 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-17 21:10:04 +00:00
helixhorned 5623334283 Correct thinko with the ceiling/floor movement code. When moving more than one
sector c/f and moving one of them would go beyond the other side (ceilingz >
floorz), don't move any sector c/f at all. When moving only one sector in that
case, move so that ceilingz == floorz.

git-svn-id: https://svn.eduke32.com/eduke32@2112 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-11 22:39:56 +00:00
helixhorned b7834f21dd Tweak raising/lowering (groups of) ceilings or floors.
Now, if more than one sectors are affected, always move them by the same
amount. That is, if one of them would be sticking against the other side,
don't move the rest.  Another change consists of determining the z delta
first, and only then moving the sprites by that amount. This fixes the
problem where you'd e.g. raise a 'floor door' against the ceiling, and the
effector sprites would be raised one time too much, preventing them from
being lowered the next time.

git-svn-id: https://svn.eduke32.com/eduke32@2111 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-11 20:05:44 +00:00
helixhorned b2d789731a A couple of Mapster changes related to saving.
- new mapster32.cfg and OSD variable 'fixmaponsave_sprites', telling the
  editor whether to 'fix' the sprite sectnums on saving and entering 3D
  mode. Note that a) sprite sectnums are never fixed when 'script_expertmode'
  is enabled, as before, and b) sprites that have out-of-bounds sectnums
  are still fixed if a proper sector is found
- if saving and some sprite sectnums have thus been tweaked, inform the
  mapper on the status line and print the changes in the OSD
- fix update issue similar to an earlier one: when 'saving as', the astub.c-
  based file name is now updated too, so saving with Ctrl-S now saves into
  the one save with 'save as' (and not the old one)
- don't attempt to recheck wall pointers from scratch (when saving and running
  with -check) if it's a TROR map

git-svn-id: https://svn.eduke32.com/eduke32@2110 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-11 20:05:29 +00:00
helixhorned 59670ed45e m32: Make a couple of often-used operations not spam messages to the log.
git-svn-id: https://svn.eduke32.com/eduke32@2103 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-03 23:08:35 +00:00
helixhorned 4322bae14c Oops. That last one wasn't supposed to be committed. Here's the log for the
last one + this one:

A couple of tweaks against accidental overwriting of maps.
- first, fix a bug where the map name wasn't reset to 'newboard.map' when starting a
  new map
- When saving with Ctrl-S, query the user for confirmation and also show the file name
  where the map will be written
- when going into the ESC-menu, print the file name where the map will be written
  on pressing 'S' above the '(S)ave' text

git-svn-id: https://svn.eduke32.com/eduke32@2096 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-31 19:50:06 +00:00
helixhorned 004b98e2b3 A couple of tweaks against accidental overwriting of maps.
- first, fix a bug where

git-svn-id: https://svn.eduke32.com/eduke32@2095 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-31 19:49:43 +00:00
helixhorned 48ac042ca4 Eliminate one malloc(0) when corrupt-checking an empty map, clean up
overheadeditor() by allocating temp variables in the blocks where they
are needed.

git-svn-id: https://svn.eduke32.com/eduke32@2088 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-30 19:47:26 +00:00
helixhorned aae60f64c2 Eliminate all 'variable ... set but not used [-Wunused-but-set-variable]'
warnings with GCC 4.6 except one in kplib.c

git-svn-id: https://svn.eduke32.com/eduke32@2079 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-17 18:42:10 +00:00
helixhorned 50bc3a3fcb Two tweaks when keying in values directly in the editor's 3D mode.
First, when pressing 'S on signed members (like the shade), display
the real signed value instead of the value cast to an unsigned type.
Second, when aiming at an overwall and pressing G, affect the overwall
instead of the wall. Maybe these changes affect a few other queries too...

git-svn-id: https://svn.eduke32.com/eduke32@2077 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-17 18:41:17 +00:00
helixhorned 2a6a2d590a - protect stat bit 2 when pasting to ceilings or floors
- when pasting to walls or maskwalls, the following user bits are kept now:
  4 (top/bottom alignment [O])
  1+64 (blocking, hitscan)
  8+256 (x/y-flip)
- print '(one-sided)' when pressing Shift + ([B] or [H]) on a wall

git-svn-id: https://svn.eduke32.com/eduke32@2033 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-18 11:55:31 +00:00
helixhorned b486f3aa0d More natural mouse picking in software mode, closer to "what's under the cursor
is picked" but still not perfect. In particular, sometimes a wrong wall is
selected, and sprites don't get picked through portals. As a rule of thumb,
don't be too far away from the objects you're modifying in 3D mode.

git-svn-id: https://svn.eduke32.com/eduke32@2030 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-17 14:26:02 +00:00
helixhorned 9b1d384723 Three-way clipping in Mapster32 (still toggled with 'N): on and off as
before, and additionally a mode that doesn't clip against masked walls
and sprites.

git-svn-id: https://svn.eduke32.com/eduke32@2028 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-16 19:17:48 +00:00
helixhorned 9fd471a56a Make uninitialization sequence more consistent across the editor code. It's
always like this now:
  ExtUninit -> (writesetup, misc.)
  uninitengine -> (uninitsystem -> (uninit timers, mouse, ...))
  exit()
Some paths still lead to a plain exit(), like failures in cache1d.c or mdsprite.c

git-svn-id: https://svn.eduke32.com/eduke32@2022 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:03:29 +00:00
helixhorned 009d405803 Mapster32: when changing screen palettes, pass flag 2 to setbrightness().
This will prevent it from calling gltexinvalidateall() when e.g. submerging
and resurfacing, mimicking the behavior of the game, where only
gltexinvalidate8() is called in such situations.

git-svn-id: https://svn.eduke32.com/eduke32@2013 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-10 15:44:31 +00:00
helixhorned 85b65c26d3 Mapster32: make the heinum&2 and stat inconsistency be displayed only once
with 'corruptcheck now', but still print each corrected one on tryfix.

git-svn-id: https://svn.eduke32.com/eduke32@2012 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-10 15:44:16 +00:00
helixhorned a145cc93bc Make Polymer declare a callback function G_Polymer_UnInit() that is called
whenever we change to another renderer etc. and define it for the game and
editor.  The purpose of the function is to clean up references to Polymer
resources like lights.
This fixes 1) all lights becoming spot lights in the game and 2)
an issue with maphack lights in the editor (can't recall which exactly).

git-svn-id: https://svn.eduke32.com/eduke32@2006 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-06 17:45:21 +00:00
helixhorned b3d3fd9a39 Better handling of tsprites that are duplicated through TROR portals.
Specifically, now also consider the sprite tile's yoffset, and fix an
issue when a tsprite got duplicated 'toward' the viewer. Also add a
couple of tests in trueror1.map.

git-svn-id: https://svn.eduke32.com/eduke32@2004 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-04 19:44:51 +00:00
helixhorned 962910ce32 Move the fixspritesectors call and the start sector updating into ExtPreSaveMap().
This makes the latter also correct when testing a map from the editor.

git-svn-id: https://svn.eduke32.com/eduke32@2001 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-04 19:43:48 +00:00
helixhorned b391f62ca5 Oops...
git-svn-id: https://svn.eduke32.com/eduke32@1998 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-01 19:58:40 +00:00
helixhorned 8db922737a BACKSPACE key in 3D mode now deletes a red-wall link when aimed at a wall or mask.
With script_expertmode enabled, SHIFT-BACKSPACE clears the upwall link and CTRL-
BACKSPACE the downwall link. These functions are useful because the automatic
nextwall determination code sometimes gets it wrong (not corrupting anything) or
if you want to vertically displace a sector attached to a higher or lower level.
Also add the exploding ceiling example to the TROR test map.

git-svn-id: https://svn.eduke32.com/eduke32@1997 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-01 19:53:05 +00:00
helixhorned b72d351f20 * game and editor: emit a warning when a search-path directory specified
on the command-line isn't found (instead of saying nothing)
* editor: Move inconsistent (stat&2)/heinum detection into the corruption
  checker. This makes a lot of original maps spew countless 'errors', but
  it's preferable for new maps since such floors and ceilings could behave
  strangely with TROR.

git-svn-id: https://svn.eduke32.com/eduke32@1995 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-01 18:37:53 +00:00
helixhorned c8bf3682e0 disable undo/redo editor feature until I can debug the disappearing sprites
git-svn-id: https://svn.eduke32.com/eduke32@1973 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-20 11:54:16 +00:00
helixhorned 26a25bdce5 * Address http://forums.duke4.net/topic/3911-true-room-over-room/page__view__findpost__p__103306
by using setspritez() instead of setsprite() for the sectnum updating.
* Change 'yax-nextwall(0/1)' to 'upwall/downwall' in the corruption checker, makes it much nicer to read.

git-svn-id: https://svn.eduke32.com/eduke32@1959 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-09 16:03:56 +00:00
helixhorned b6d729a553 * skip grayed out sectors when changing tags in 2d mode
* make Ctrl-Alt-A (formerly 'toggle inner gray walls') now remove all gray walls entirely in 2d mode
* make r_usenewaspect enabled by default

git-svn-id: https://svn.eduke32.com/eduke32@1957 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-06 11:50:45 +00:00
helixhorned 54f345f78f Add a warning when calling {save,load}mapstate from EVENT_ANIMATESPRITES (forgotten from earlier changes).
git-svn-id: https://svn.eduke32.com/eduke32@1956 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-03 17:22:46 +00:00
helixhorned aa8b2e4e05 Lots of M32script tweaks:
* fix breaking out of 'switch' blocks and compilation of the 'default' case
* Have a way of assigning 'special function' menu [' F] entries to script states. Writing a string literal after the state name will register the state under that name. Menu names are limited to 24 characters and it's possible to have up to 16 of them.
* new branching command 'ifinteractive', true if a state runs from the menu mentioned above.
* new command: getnumberfromuser <<retvar>> "query_string" <maxnum> <flags>

See 'state collect_teleporting_sectors' in a.m32 for a combined usage of the new functionality.

git-svn-id: https://svn.eduke32.com/eduke32@1955 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-03 17:22:25 +00:00
helixhorned cbf122fa80 fix a typo that made TROR-nextwall corruptions only detected for the ceiling and write an auto-correction routine for inconsistencies with them.
git-svn-id: https://svn.eduke32.com/eduke32@1954 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-01 19:04:41 +00:00
helixhorned 0713c44219 * a.m32: new state 'correctslopes' which will check all ceilings and floors for a stat&2 and heinum mismatch and correct accordingly (the result isn't visible, but such an inconsistency can prevent planes from TROR-joining)
* helper feature: when shade preview is enabled, the ceilings and floors of highlighted sectors are shown in pal 6. This makes it possible to highlight the TROR-joining candidate sectors in 3D mode using e.g. 'sethighlightsector searchsector 1' while aiming at the respective ceilings and floors, and get visual feedback.
* when failing TROR-joining early ('no consistent joining combinations found'), print to the console why it failed.
* more Makefile.deps updating

git-svn-id: https://svn.eduke32.com/eduke32@1952 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-30 13:03:07 +00:00
helixhorned 7e9b2eae0f * Clean up after myself. It seems that Polymost isn't very clean with handling texture IDs sometimes, so switching between the two GL renderers could mess them up with the last revision. This is fixed now by always uninitializing Polymer when changing from it to another renderer.
* New shade/visibility calculation code, which is activated with 'r_usenewshading' (on by default), and is closer to the classic look. Also tweak the FOGSCALE macro to have approximately the same fog distance with all renderers.

* Mapster32: END modifier to RShift. If it's pressed when RShift is released, sprites which are in grayed out sectors are also selected;  Make changing shade affect all highlighted sprites in 3D mode (when aiming at one of them).

* some debug code to watch out for suspicious glGenTexture/glDeleteTextures calls, not active.


git-svn-id: https://svn.eduke32.com/eduke32@1943 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-24 15:15:57 +00:00
hendricks266 8b5761c14d My first commit!
The main feature is the addition of -mx and -mh command-line parameters to EDuke32 and Mapster32. These parameters include a con and def "module" respectively. This translates into essentially including the file from the bottom of the compiled script.

I fixed the classic buggy behavior of the BROKEHYDROPLANT and REACTOR2 sprites.

I also fixed a small, long-standing bug where FRAMEEFFECT1 blurs are not affected by sector floorpal. You can see one example of this by shrinking the Enforcer on the upper inside of the toppled building in E3L11: Freeway.

I tweaked the Makefile so that it would automatically regenerate the keep.me files in the $(OBJ) and $(EOBJ) directories after they are deleted for cleaning.

One final change is a slight positioning cleanup of both programs' --help dialog boxes.

git-svn-id: https://svn.eduke32.com/eduke32@1937 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-21 22:39:29 +00:00
helixhorned 049cc20022 fix stupid crash with Alt-C (picnum replacer)
git-svn-id: https://svn.eduke32.com/eduke32@1936 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-21 21:01:31 +00:00
helixhorned a9290a0d29 Make useractor's <actortype> bit 4 mean 'this actor will not move by itself' to make it possible to have it in a rotating sector with full rounding correction. No token name is provided because the three others come from CON and I don't want to clutter the namespace; fix the editor issue where the box wasn't shown on occasion in the tile selector (8-bit)
git-svn-id: https://svn.eduke32.com/eduke32@1934 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-20 22:08:05 +00:00
helixhorned a15d8bfb98 * new editor cfg options: corruptcheck_noalreadyrefd (silinces 'already referenced warning'), r_usenewaspect, r_screenxy
* Read-only CON access to sector bunchnums by adding the labels '.ceilingbunch' and '.floorbunch' to the CON sector structure

git-svn-id: https://svn.eduke32.com/eduke32@1931 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-10 15:39:21 +00:00
helixhorned 606589f605 * Join-bunch functionality in 2d mode ('J'). When applied to two adjacent extended floors with different bunchnums, this makes them equal so that their sectors can be joined in a next step if their ceiling bunchnums are equal. The two floors also must be non-sloped and at the same height.
* slightly tweaked status line, now also displaying the number of bunches
* fix a couple of issues unearthed by valgrind and a TROR nextwall corruption when joining sectors

git-svn-id: https://svn.eduke32.com/eduke32@1930 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-09 17:36:02 +00:00
helixhorned 57379654a7 Addresses posts #180 and #181 of the TROR thread. Specifically,
* it is now possible to paste (and have an outer red wall automatically) highlighted sectors into a sector that is extended on one side and non-sloped on the other. For this, the highlighted sectors must be in one connected component.
* Make it possible to not display inner gray walls, toggled with Ctrl-Alt-A, but only when no manual grayout (Ctrl-R) is in effect.

* bugfix: don't clear original TROR-nextwall link when duplicating extended highlighted sector
* m32script: protect wall members relevant to TROR
* save autogray (Ctrl-A) and showinnergray (see above) to mapster32.cfg


git-svn-id: https://svn.eduke32.com/eduke32@1928 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-04 21:20:59 +00:00
helixhorned ee4d060b1f * New m32script commands:
- sethighlightsector <sectnum> <on?>
 - updatehighlightsector
 - collectsectors <<array_to_collect_sectnums>> <initial_sector> <<num_collected_sectors>> <sector_filtering_state>

The latter does a breadth-first search starting from an initial sector and collects nextsectors only when the filtering state, given a sectnum as RETURN input, writes a nonzero value into RETURN. As a usage example, a.m32 includes the state 'collect_teleporting_sectors', that collects all sectors containing an SE7 and highlights them afterwards. This way, it should be possible to retrofit old maps with TROR by distributing small scripts that do most of the work (right now, joining has to be done by hand, though).


* corruption checker: for the 'nextwall inconsistent with nextsector' corruption, suggest an alternative fix by searching fitting nextwalls and changing the nextwall of the corrupt wall (as opposed to the nextsector). It will display with a leading '?' in the listing, and can be demanded by suffixing 'corruptcheck tryfix' with it. For example,

corruptcheck tryfix 9-21 ?

would fix some corruptions in Billy Boy's cranium.map without introducing drawing errors.


* fix demo playback (tueidj figured this out)


git-svn-id: https://svn.eduke32.com/eduke32@1927 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-03 22:51:28 +00:00
helixhorned 6a713133cf * Fix usage of uninitialized array (\!), which could result in TROR connections being deleted at random when deleting sectors. I guess this is a sign of approaching senility :(
* When dragging highlighted sprites, do a setsprite() after each position update. This way, they won't end up on the wrong level
* TROR support for SE 31 and 32 in-game, example provided in test map
* some uncommited stuff for TROR: SE 6/14


git-svn-id: https://svn.eduke32.com/eduke32@1924 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-29 19:57:05 +00:00
terminx ef61e48c25 Patch from Hendricks266 and whatever changes happened to be in my tree. I hope they work ;)
"The most noticeable change is the addition of the "includedefault" CON and DEF command, which will attempt to include eduke.con (or nam.con, or ww2gi.con), then game.con, or duke3d.def, or nam.def, or ww2gi.def. This is useful for TCs like my add-ons, where for my pseudo-mutators I currently say "include EDUKE.CON", but I also have to juggle this terrible order of paths, so that I can have an EDUKE.CON file in my HRP which says "include GAME.CON" to allow the mainline game to actually run, but also allow DukePlus to load its EDUKE.CON file (since it uses that and not an -x switch), and also allow any custom EDUKE.CON files in the root to be used."


git-svn-id: https://svn.eduke32.com/eduke32@1909 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-19 00:11:52 +00:00
helixhorned 5a632bc1f0 * Tighter y[ud]most clamping in TROR/classic. This fixes the overdraw bug when standing on the rails in the test map.
* Voxel tweaks: horizontally scale wall-aligned ones by 5/4, make them ignore per-tile yoffset in classic (i.e. emulate Polymost; I think this is more sensible since they're not clipped to floors/ceilings anyway), make Polymost know the voxel scale
* Always cull back-facing, one-sided, wall-aligned sprites (classic/Polymost), irrespective of whether it's a sprite, voxel or model. This can lead to falsely not drawing them in certain circumstances, but IMO that's preferable to visible hidden switches etc.
* Change defaults for r_novoxmips to 1 and lazytileselector to 0


git-svn-id: https://svn.eduke32.com/eduke32@1908 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-18 13:02:08 +00:00
helixhorned 043c756676 A couple more OSX tweaks: pull in 'nibless' SDLMain.m into tree for future hacking, fix backspace ('delete') key in OSD, almost everything to make x86 binaries actually run.
git-svn-id: https://svn.eduke32.com/eduke32@1905 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-17 11:53:41 +00:00
helixhorned 116ab2ed99 Fix mapster's command-line parsing and copy over some of the 'custom mod dir' logic, currently used in the sound board to also find files outside of GRPs.
git-svn-id: https://svn.eduke32.com/eduke32@1904 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-16 19:39:22 +00:00
helixhorned e1d868dc20 A couple of tweaks for easier work with TROR:
* When TROR-joining and sectors reachable through former red walls could need displacement, ask the user; if something is wrong with the walls of the two components to join, jump to that place and print coordinates of offending wall and its point2 in the OSD
 * Ctrl-TAB in 2D mode now toggles filling of the currently aimed-at sector; it's not very in sync with the rest of the controls though (e.g. some commands will potentially affect each sector that contains the crosshair)
 * Fill sectors slightly different so that highlighted sectors above each other are easier to distinguish
 * In the editor, always clear the screen to a 'rainbow' of the palette before each frame. This makes no-draw ('HOM') and accidental translucency glitches stand out more clearly
 * a few misc. tweaks, consistency checks, and fixes


git-svn-id: https://svn.eduke32.com/eduke32@1901 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-04 00:06:08 +00:00
helixhorned d3a9dec77c -- TROR:
* Mapster32 now makes sandwiches, too: select all floors of a bunch and 'extend them below'. This will put a new sector between the highlighted ones and the their lower neighbors and displace the z's accordingly. Make sure you have enough headroom.
 * To facilitate the above, RAlt now has two more modifier keys (checked at release time, as usual): for every sector that would be selected, END will select all sectors whose floor bunchnum equals the first (this is useful for sandwiching), and HOME will select all sectors whose ceiling bunchnum equals it (not very useful, but provided for completeness).
 * Sloping extended sectors is now checked more rigorously

-- misc:
 * When deleting highlighted sectors with DEL, pressing LShift will now always delete them irrespective whether the mouse pointer is over one of them. This is useful for the cleanup of corrupted maps.
 * 2D drawing is slightly tweaked so that active walls always display over inactive ones


git-svn-id: https://svn.eduke32.com/eduke32@1900 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-29 23:10:51 +00:00
helixhorned 68dff06533 TROR: join sectors to a new bunch. For this, highlight exactly two connected components having the same outline and being TROR-consistent (same height etc.) and press Ctrl-J. Any ambiguity (connect c/f with f/c?, move which component?) is resolved by asking the user. Warning: hot off the keyboard and likely buggy
git-svn-id: https://svn.eduke32.com/eduke32@1895 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-23 22:42:39 +00:00
helixhorned 4fb043483d Increase default tile cache size to 24M in Mapster32 and add a command-line parameter '-cachesize <kilobytes>'
git-svn-id: https://svn.eduke32.com/eduke32@1894 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-23 18:07:45 +00:00
helixhorned 5f8cc046cc fix: loop joining/sector splitting with TROR'ed sectors, rendering bugs due to slopes. change keys: [I] toggles invisibility preview, ['I] toggles sprite invisibility bit
git-svn-id: https://svn.eduke32.com/eduke32@1893 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-23 14:22:32 +00:00
helixhorned e92099b2f7 Polymost:
* rudimentary TROR support
 * free mixing of multi- and single-tile pskies
 * Don't cull models behind you. That is, treat them like floor sprites in that respect. This way large models like corpses don't disappear from the view unexpectedly.

Classic:
 * tweak the last row and column of the translucency table so that e.g. a transparent sprite against a FANSPRITE wall doesn't show up purple (only if Duke3D table is found)

Misc.:
 * fixes TROR-nextwall corruption when deleting sectors
 * tile selector 'goto' now has also completion
 * I forgot a file for the non-OpenGL build last time


git-svn-id: https://svn.eduke32.com/eduke32@1892 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-22 21:52:22 +00:00
helixhorned 0c190bfa55 * Auto-grayout for plain old sectors toggled with Ctrl-A. When it is in effect, _all_ sectors which fall outside the [min ceiling z, max floor z] bounds of all active extended sectors are deactivated.
* make it possible to duplicate from extended sectors; all extensions are cleared from them
* lazy hightile loading in tile selector can now be disabled in mapster32.cfg
* fixes USE_OPENGL=0 build


git-svn-id: https://svn.eduke32.com/eduke32@1890 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-18 22:44:09 +00:00
helixhorned 873375025f * Include file cleanup by dragging most declarations into editor.h
* more useful auto-red wall feature: if no structure-changing operations have been applied after highlighting and duplicating, now also paste 'visual' fields of outer walls (this is one example of the use of a system that temporarily keeps track of nextwalls for former red lines)
* multi-pkies now have individual parallaxyscale


git-svn-id: https://svn.eduke32.com/eduke32@1886 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-15 22:37:24 +00:00
helixhorned 98456aefe3 -- engine:
* support for free mixing of multi- and single-tile parallaxed skies in classic
* make visibility independent of yxaspect and viewingrange in OpenGL modes

-- editor:
* when dragging walls, restore pixel width after that (only for the left and right walls of pointhighlight, and its nextwalls, if any)
* pasting on walls and auto-aligning them now carries over a few more fields

-- fixes:
* visibility in OpenGL modes wasn't incremented gradually (regression due to making 'clamp' an inline function instead of a macro)
* memory corruption due to calling qlz_compress with less than the recommended surplus storage of 400 bytes
* decorative sprites in the mirror showing non-flipped
* make the subway SE message (much) more helpful by showing which sector the game considers to be the track sector


git-svn-id: https://svn.eduke32.com/eduke32@1882 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-12 23:31:13 +00:00
helixhorned a0ca3ed041 fix a.m32 script, inserted light SEs now have nonzero repeat
git-svn-id: https://svn.eduke32.com/eduke32@1878 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-08 20:12:16 +00:00
helixhorned 203cf0b7b1 A crapload of random stuff.
* Polymer light access to m32script (light[<lightidx>].<field>). As an application, provide a state 'insertlights' that takes the currently active lights and puts them into the map as SEs (e.g. for maphack recovery).
* Prototype of a mechanism to gray out certain portion of a map, making them inactive to various, but not all, editing operations. Highlighting a set of sectors and pressing Ctrl-R will make the Z bounds be [(least ceiling z), (greatest floor z)] of all selected ones, pressing Ctrl-R when no sectors are highlighted will reset them. Not sure if it's for production use at this stage...
* The 'align walls' feature [.] now has three independently toggleable behaviours: recurse nextwalls (toggled when Ctrl is pressed), iterate point2s (disabled when Shift is pressed), and also copy pixel width (toggled when Alt is pressed).
* Make shades clamp instead of overflowing in the editor

Fixes:
* crash when carrying out certain operations on walls with xrepeat 0
* the Pause key on linux. Also make demo recording start on Shift-ScrollLock because ScrollLock alone is too easily pressed when pausing


git-svn-id: https://svn.eduke32.com/eduke32@1877 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-07 18:23:34 +00:00
helixhorned bd410d8557 fixes a horrible uninitialized value bug with the tag-labeling system
git-svn-id: https://svn.eduke32.com/eduke32@1876 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-02 21:33:11 +00:00
helixhorned 367afadf39 tweak point deleting for less checksectorpointer calls
git-svn-id: https://svn.eduke32.com/eduke32@1875 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-02 16:58:11 +00:00
helixhorned 9c3889e59b Fix more overheadmap crashes, this time with 'Last Pissed Time'. Mapster32 now asks to jump to a sector, wall, sprite, or coordinates with 'J. Also fix crash when pressing '-' (not KP-) when aiming at something with tile 0.
git-svn-id: https://svn.eduke32.com/eduke32@1874 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-28 21:28:33 +00:00
helixhorned 243e50db4b Insert two divide-by-zero checks that seem to fix the overhead map crash, but only with NOASM=1. Fix a couple of Mapster32 bugs and prettify some code there. Fix EDuke32 bug where the demo system overwrote boardname[] while using the file picker, making navigation between directories impossible.
git-svn-id: https://svn.eduke32.com/eduke32@1869 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-22 22:48:06 +00:00
helixhorned 64e22b9c6f * Support for entering names instead of numbers in various contexts (TAB-autocompletion included): first, when querying for a tile number, and second:
* Tag labeling system for 'link'-type tags, including saving and restoring the tag labels to a separate file '<mapname>.maptags'.  Whether a tag is eligible for linking, is determined by a hardcoded (but extensible via m32script) function.


git-svn-id: https://svn.eduke32.com/eduke32@1867 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-17 17:01:20 +00:00
helixhorned a2b3b6006c * Correctly draw floor-aligned sprites with non-power-of-two textures in classic renderer.
* Sprite cstat 2048 ('use own shade', [N]) now works more or less. (Issues may arise when combined with sector light effects.)
* Begin work on 'smart' tag labeling system for Mapster32.  Right now, it only displays a '+' after tags with linking semantics.
* 


git-svn-id: https://svn.eduke32.com/eduke32@1866 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-14 20:48:08 +00:00
helixhorned 1e937bb5aa slightly better linehighlight handling in 2d side-view mode
git-svn-id: https://svn.eduke32.com/eduke32@1865 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-11 22:28:58 +00:00
helixhorned 5d91ec502a Revert 'move sprites with ceiling/floor'-behaviour, maybe fix tile drawing?
git-svn-id: https://svn.eduke32.com/eduke32@1862 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-09 15:35:46 +00:00
helixhorned 76a7799d7c Revise shade preview; fix PGUP/PGDN with selected sectors; allow INS/DEL in 2D side-view mode; 64-bit printf cleanup
git-svn-id: https://svn.eduke32.com/eduke32@1860 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-09 13:27:08 +00:00
helixhorned 958c207622 editor and makefile tweaks
git-svn-id: https://svn.eduke32.com/eduke32@1856 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-25 11:42:07 +00:00
helixhorned 46964b322b * Lazy hightile loading in Mapster32 tile selector (first display all as lowtiles, then load each one while allowing movement)
* Consolidate the various, slightly different, methods of bounding a sprite between a sector's ceiling and floor into one common function
* Fixes for accumulated bugs: shade preview, r_shadescale_unbounded, and a couple of unreported ones
* Yaks, gnus, and bisons...


git-svn-id: https://svn.eduke32.com/eduke32@1854 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-23 17:41:01 +00:00
helixhorned 06afc4dcc5 * Comment out some practically dead code (rendmode 1 and 2, pcx screenshots), cutting some 8k from the release binary.
* Refactor two nearly identical chunks in polymost.c into one function in the hope of getting some more, but interestingly that did nothing at all. At least it's more readable this way...
* Commit, but don't enable, code for writing PNG screenshots (I'm tired of converting them every time). Requires libpng which in turn requires zlib.

git-svn-id: https://svn.eduke32.com/eduke32@1852 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-19 18:07:12 +00:00
helixhorned 4dba12a5d3 Tweakery in various places.
Engine stuff:
 * Add 'r_shadescale_unbounded' cvar. When set to 0, OpenGL renderers should never
   draw completely black objects (currently only implemented for Polymost)

Mapster32:
 * Add 'r_shadescale' to config
 * In 3D mode, make SPACE behave the same as holding down a mose button: the
   currently pointed-at object is locked. Required some modification of a.m32
   to play well (i.e. not reset SPACE). This is useful by itself but more so
   in conjunction with the next point
 * make Alt behave as a modifier with PGUP/PGDN: when aiming at a 2-sided wall,
   move the other side's sector's ceiling or floor (only this is new).
 * Auto-alignment of walls can be controlled in a finer grained fashion now:
   When pressing '.', only the immediate neighbors get aligned. Use Ctrl-. for
   the old behaviour.
 * When inserting a point in 2D mode, auto-align the neighboring wall


git-svn-id: https://svn.eduke32.com/eduke32@1848 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-17 23:37:38 +00:00
helixhorned 16557ff1bb fixes: various ones accumulated in the forum (falling into infinity, stuck in doors), crash in polymer mouse picker when in void space, creation of surplus loops on sector split when sector has weird geometry.
addition: disable sprite sectnum checking with m32script expert mode enabled.

git-svn-id: https://svn.eduke32.com/eduke32@1843 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-13 11:59:32 +00:00
helixhorned b158521449 Besides catching a few more corner cases, there's better mouselook handling and a warning (but no fix) for a rare and bad corruption when splitting a sector in this revision.
git-svn-id: https://svn.eduke32.com/eduke32@1836 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-08 23:02:38 +00:00
helixhorned 2f5a8a0f6b minor fixes
git-svn-id: https://svn.eduke32.com/eduke32@1833 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-07 22:56:00 +00:00
helixhorned 148f3cadef mapster32: new command-line switch '-namesfile <filename>' for overriding NAMES.H; new 'drawlabel <quotenum> <x> <y> <z> <col> <backcol>' m32script command for drawing small labels, see end of a.m32 for an example; some special handling for sprites whose tile yoffset is greater or equal their pixel height.
git-svn-id: https://svn.eduke32.com/eduke32@1832 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-07 16:30:06 +00:00
helixhorned e782dbca61 Make RShift/RAlt-selection and various sector operations available in side-view mode. Adds yet another modifier, this time to RShift: if RCtrl is pressed at release time, select only sprites. (If no box drawn, old behaviour of selecting wall-points of line-highlighted wall's loop.)
git-svn-id: https://svn.eduke32.com/eduke32@1830 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-05 12:59:27 +00:00
terminx ec88a5269f Add the svn revision to the version string in Mapster32
git-svn-id: https://svn.eduke32.com/eduke32@1824 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-04 18:47:06 +00:00
terminx 323008432a Consolidate POLYMOST preprocessor define into USE_OPENGL, remove SUPERBUILD preprocessor define, add additional mode to neartag() to skip sprite searches and speed up processing (and enable for CON_OPERATE), fix issue with nearby single instance sounds not playing due to out of range sounds blocking their playback, fix issue with settings.cfg being reset to default bindings when running a mod that specifies its own cfg base name, improve CON structure member interface read/write performance, fix a bug with CON "move" pointer validation
git-svn-id: https://svn.eduke32.com/eduke32@1820 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-04 08:50:58 +00:00
helixhorned 0fbd035e54 New sector selection mode in 2d mode: if RCtrl is pressed when releasing RAlt, then instead of the sector having to be contained in the rectangle, the mouse pointer must be inside a sector to be selected. This way it's easy to select sectors with arbitrary shapes. Set ops work independently of it, too. Also some annoyance fixes with sprite movement.
git-svn-id: https://svn.eduke32.com/eduke32@1816 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-02 21:21:47 +00:00
helixhorned 619d3c8c9e Final round of Mapster32 hardening. Going over the limits should now always produce an error message instead of corrupting the data. Also fixes crash in defs.c (thanks for the crashlog, LeoD).
git-svn-id: https://svn.eduke32.com/eduke32@1808 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-27 19:13:44 +00:00
terminx bcadbd372b MSVC build fix
git-svn-id: https://svn.eduke32.com/eduke32@1806 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-26 23:38:18 +00:00
helixhorned 73d6ad1d04 Oops, r1801 crashed Mapster in the undo system. Also less/better automatic wall[].xrepeat resizing on things like attaching a wall to another.
git-svn-id: https://svn.eduke32.com/eduke32@1803 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-25 22:10:25 +00:00