Commit Graph

2765 Commits

Author SHA1 Message Date
helixhorned 994bdd4759 Polymer: Fix a potential uninitialized mem read in debug msg when in void space.
git-svn-id: https://svn.eduke32.com/eduke32@2565 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:45:05 +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 b06ce8456a Make g_grpNamePtr memory-clean, extern clearGrpNamePtr().
git-svn-id: https://svn.eduke32.com/eduke32@2563 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:44:33 +00:00
helixhorned 55f3fdb9bc numgrpfiles --> NUMGRPFILES in Apple/GameListSource.game.m
git-svn-id: https://svn.eduke32.com/eduke32@2562 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:44:14 +00:00
helixhorned 3deb8d1d99 Clear up handling of g_*NamePtr in the game.
The primary change is that things have been made memory-clean.  Some of these
pointers may point to wildly different places during the course of the program
such as statically or dynamically allocated storage, the buffer returned by
getenv() (which must not be modified according to the docs), or an element of
argv[].  Consequently, we need to strdup, or better, dup_filename them if they
are ever to be passed to a function that modifies their pointed-to data.

Specifically:
 - added statics or consts according to usage
 - 3 new functions clear{Grp,Def,Script}NamePtr, only 'Def' one extern for now
 - in G_CheckCommandLine, don't strip 'const'; use Bstrncpyz where appropriate
 - remove multiple declarations

Also, warn if an application parameter has been ignored (not matched).

git-svn-id: https://svn.eduke32.com/eduke32@2561 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:44:00 +00:00
helixhorned 77918caf9c New helper function "char *dup_filename(const char *fn)" in common.h.
It allocates a buffer of size BMAX_PATH and copies the passed string into it.

git-svn-id: https://svn.eduke32.com/eduke32@2560 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:43:39 +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 0ea9feee2d Minor tweaks of makepalookup() and hicinit().
git-svn-id: https://svn.eduke32.com/eduke32@2558 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:42:49 +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 0c5c58cbbb Replace {get,clear}filenames with fnlist functions in build.c, menus.c and osdcmds.c
git-svn-id: https://svn.eduke32.com/eduke32@2556 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:42:16 +00:00
helixhorned a7f6f3bacc Factor out different {clear,get}filenames definitions into fnlist_t + functions.
Don't actually replace the instances in the code now.
Additions in common.h:
 - fnlist_t, which combines CACHE1D_FIND_REC *finddirs, *findfiles and
   int32_t numdirs, numfiles
 - the FNLIST_INITIALIZER macro, which MUST be used for automatic variables
 - fnlist_clearnames, fnlist_getnames functions
 - G_LoadGroupsInDir, G_DoAutoload, two often-occurring uses of these

git-svn-id: https://svn.eduke32.com/eduke32@2555 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:41:57 +00:00
helixhorned d77e388522 Factor out eleven (!) instances of identical code into check_file_exist().
git-svn-id: https://svn.eduke32.com/eduke32@2554 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:41:39 +00:00
helixhorned d8b9c9b188 Clean up defs.c a little.
- remove redundant bound checks
- add necessary bound checks
- make one comparison pair consistent (> vs. >=)
- one if-if --> clamp

git-svn-id: https://svn.eduke32.com/eduke32@2553 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:41:15 +00:00
helixhorned 68f0842b85 Fix a potential sprintf to a buffer passed to it as a string argument.
git-svn-id: https://svn.eduke32.com/eduke32@2552 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:06:05 +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 e350502cd0 Add "static inline" helper function "Bstrncpyz" to compat.h.
git-svn-id: https://svn.eduke32.com/eduke32@2550 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:05:38 +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 b7495ef5bd Guard scriptfile.h with an #ifndef sentinel.
git-svn-id: https://svn.eduke32.com/eduke32@2548 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:04:59 +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 2cc9f751cd Add Bassert to compatibility macros/functions, currently only an assert wrapper.
git-svn-id: https://svn.eduke32.com/eduke32@2546 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:04:24 +00:00
helixhorned ebaf65951b Change input and return types of inline function clamp() from int to int32_t.
git-svn-id: https://svn.eduke32.com/eduke32@2545 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:04:06 +00:00
helixhorned 4d3e668352 Makefile.common: comment out usage of llvm versions of ar and ranlib with clang.
These are for LLVM bitcode, I think.  In any case, they're giving me errors.

git-svn-id: https://svn.eduke32.com/eduke32@2544 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:03:51 +00:00
helixhorned f0885f665b Capitalize numgrpfiles macro to NUMGRPFILES.
git-svn-id: https://svn.eduke32.com/eduke32@2543 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:03:40 +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 6336856227 osxbuild.sh: more options and designation of presets
git-svn-id: https://svn.eduke32.com/eduke32@2541 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 05:07:42 +00:00
hendricks266 efb440ada0 All string literals sent as normal messages to the player in-game written in ALL CAPS have been converted by hand to more proper capitalization. (Critical errors have been left as-is, and the editor did not need changes.)
git-svn-id: https://svn.eduke32.com/eduke32@2540 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 05:07:12 +00:00
hendricks266 9d74cd700e Add "specularpower" and "specularfactor" as synonyms of "specpower" and "specfactor" respectively.
git-svn-id: https://svn.eduke32.com/eduke32@2539 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 05:06:31 +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
hendricks266 3929d60744 OS X: Fix more warnings.
git-svn-id: https://svn.eduke32.com/eduke32@2537 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 05:04:21 +00:00
plagman 90e410cf47 polymer: cull sprite lights after computing sprite geometry
This was broken ever since updatesprite() had been forked off drawsprite() and
would cause static lights to never hit static sprites until one or the other
changed, after which the light would always get culled against outdated sprite
geometry.

git-svn-id: https://svn.eduke32.com/eduke32@2536 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 00:55:53 +00:00
plagman 3818282811 polymer: don't shadow-optimize light culling in cached sprites
Since updatesprite() only happens once for static sprites, avoiding
light culling if we hit it in a shadow pass means that sprite will
never be lit as long as that happens.

git-svn-id: https://svn.eduke32.com/eduke32@2535 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 00:55:41 +00:00
helixhorned ef7ad7b554 Lunatic: more complex gamevar-decl code.
git-svn-id: https://svn.eduke32.com/eduke32@2534 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 22:01:36 +00:00
helixhorned b897a59d82 Bound-check the 'picnum' argument to rotatesprite; tweak CON digitalnumber check.
There are instances where oob picnums may propagate to that function, so
protect it.  The digitanumber[z] bound check is actually made more permissive,
but could also just as well be removed now.

git-svn-id: https://svn.eduke32.com/eduke32@2533 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 22:01:21 +00:00
helixhorned 6cd11d0468 Accumulated trivia.
- engine.c: move some variables into a lower block
- premap.c: clearbufbyte --> Bmemset

git-svn-id: https://svn.eduke32.com/eduke32@2532 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 22:01:03 +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 694acef9fe Allow up to 7 skills, coded by M210 and taken over with modifications.
Skill names are defined via 'defineskillname' as before, but the index
of the last non-empty skill name (plus one) is taken as the skill count.
So, if you only define the 6th, there will be no effect.
Note that currently, there is no way to specify less than four skills
because the CON parser doesn't allow the empty string for the name (it'll
go beyond the line) and because the default skill names are initialized in
EDuke32 too, in addition to the CONs.

git-svn-id: https://svn.eduke32.com/eduke32@2530 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 22:00:27 +00:00
helixhorned e706258c43 Fix an assertion failure with dorotatesprite 4-pixels vline drawing.
See http://forums.duke4.net/topic/5362-crash-with-current-svn/

git-svn-id: https://svn.eduke32.com/eduke32@2529 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 13:55:03 +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 adc8b302ea Factor out two practically identical instances of ceiling/floor setup code.
git-svn-id: https://svn.eduke32.com/eduke32@2527 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 13:54:31 +00:00
helixhorned 102e97659d Factor out assignment of various globals in 4 instances of wall drawing code.
This makes the differences in these codes stand out much more clearly.

git-svn-id: https://svn.eduke32.com/eduke32@2526 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 13:54:14 +00:00
helixhorned 549e9f6216 Make "LIBS+= $(L_SSP) -Wl,--enable-auto-import" conditional to Windows.
git-svn-id: https://svn.eduke32.com/eduke32@2525 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-24 15:59:53 +00:00
helixhorned cd3947f3f4 Correct 'nofloorpalrange' range clamping, move one get_hud_pal() farther down.
The nofloorpalrange beginning and end indices are silently clamped to 1 .. 255.

git-svn-id: https://svn.eduke32.com/eduke32@2524 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-24 15:59:39 +00:00
hendricks266 0122764017 - Makefiles:
- Fix typo, correctly adding SDL libs to the tools on OS X so that makesdlkeytrans builds.
  - Move all mention of $(LIBS) out of build/Makefile into build/Makefile.shared because no linking takes place in the engine itself so LIBS additions were lost. This should fix USE_LIBPNG=1 on Windows at least.
- Other assorted cleanup.

git-svn-id: https://svn.eduke32.com/eduke32@2523 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-24 08:30:28 +00:00
hendricks266 62dd05a2e5 Update credits in menus.c with people from the Credits wiki page. Also, fix the text and order of other entries.
git-svn-id: https://svn.eduke32.com/eduke32@2522 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-23 20:24:30 +00:00
hendricks266 fd71c5ef4c Build tools:
- Fix up and add building instructions for kmd2tool, getdxdidf, and makesdlkeytrans.
 - Add kmd2tool to "utils" build job.
 - Fix warning in and cross-platform building of generateicon.
 - Source and text cleanup!

git-svn-id: https://svn.eduke32.com/eduke32@2521 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-23 20:23:46 +00:00
hendricks266 64595adfb2 Makefiles:
- Properly handle the architecture definition when BUILD32_ON_64=1
 - Add proper $(*LDFLAGS) to which LTO and ARCH are correctly passed.
 - Cleanup of compiler flag variables.

This should fix to some degree building of the Build tools on OS X, and it may possibly fix the crashing of the OS X x86 32-bit build.

git-svn-id: https://svn.eduke32.com/eduke32@2520 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-23 20:22:10 +00:00
helixhorned d51d9a0fb8 Rather trivial changes in engine.c and crc32.c.
git-svn-id: https://svn.eduke32.com/eduke32@2519 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-22 22:48:06 +00:00
helixhorned b5894eb7e0 Make 'nofloorpalrange' def token affect HUD weapons.
git-svn-id: https://svn.eduke32.com/eduke32@2518 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-22 22:47:47 +00:00
helixhorned 5944a9ab0f New game def token "nofloorpal <pbeg> <pend>", disabling sprites taking on floor pals.
It has always annoyed me how floors with "shirt-color" type palookups like 21
affected the color of its containing sprites and HUD-drawn stuff.  This commit
allows one to specify an inclusive range of pals for which this should be
disabled for sprites (but not for HUD stuff, yet).

git-svn-id: https://svn.eduke32.com/eduke32@2517 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-22 22:47:29 +00:00
helixhorned 85ab7d2e39 Remove global 'uint8_t *anim_pal' which was only used once as a temporary.
git-svn-id: https://svn.eduke32.com/eduke32@2516 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-22 22:47:13 +00:00