Commit Graph

129 Commits

Author SHA1 Message Date
helixhorned 5ad385c043 Split r3159..r3161, part 10: add explicit casts to *alloc return values.
NOTE: changes such as these are best viewed with something like
git diff (...) --color-words='[a-zA-Z0-9_]+|[^[:space:]]'

git-svn-id: https://svn.eduke32.com/eduke32@3176 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:29 +00:00
helixhorned 1cd11d06ef Revert "Fix the warnings when building with C++, add MSVC C++ build support."
This reverts r3159..r3161.

Conflicts:
	eduke32/build/include/compat.h
(Handled so that r3163's changes are kept applied.)

git-svn-id: https://svn.eduke32.com/eduke32@3165 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:45 +00:00
terminx 3ff46c02b2 Fix the warnings when building with C++, add MSVC C++ build support. This also changes the internal type of lotags, hitags and cstat type fields to uint16_t instead of int16_t to clean up some dubious behavior wherein the code was using a value of 32768 as a flag in these fields for certain types of things, like invisible sprites (using the value as if it was uint16_t) where it was elsewhere checking if the value was < 0 (using the value as if it was int16_t). This change may break a few specific effects if any part of the relevant code was missed when looking for areas that needed to be addressed.
I think there's also a fix for the CON precache system breakage in here (lost it in my local tree when I started getting the C++ build working in MSVC, sorry!)


git-svn-id: https://svn.eduke32.com/eduke32@3159 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-14 23:32:43 +00:00
helixhorned a76a796ebb Fix demo playback with diff application enabled.
This requires ripping out the .proj member of tiledata_t back into
ProjectileData[] again because it was the only one in g_tile[] that
changed during the course of a game.  The g_tile[] array is now also
correctly flagged as "constant throughout a game" (DS_NOCHK).
Savegame version bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3151 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 17:57:06 +00:00
terminx 88c95a18f7 Retire the actorscrptr[], actorLoadEventScrptr[], SpriteFlags[], ActorType[], SpriteCacheList[], ProjectileData[] and DefaultProjectile[] arrays in favor of a tile_t structure exposed as g_tile[]. This consolidates most of the MAXTILES sized arrays on the game side into one place.
git-svn-id: https://svn.eduke32.com/eduke32@3102 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-30 15:54:35 +00:00
helixhorned 7305fbbae9 Add macro CON_ERRPRINTF(Fmt, ...) and use that everywhere.
git-svn-id: https://svn.eduke32.com/eduke32@3000 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:47 +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
helixhorned 05af53ac4b Fix gamearrays on 64-bit platforms.
They were broken by r2666, which made their elements intptr_t instead of
int32_t, but this change was not reflected in related allocation code.
WARNING: players on 64-bit platforms should not attempt to load games saved
with r2665 or earlier.

git-svn-id: https://svn.eduke32.com/eduke32@2689 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 15:23:48 +00:00
helixhorned 8a4519324e Fix one ptr size mismatch and one format letter/arg mismatch on x86_64.
git-svn-id: https://svn.eduke32.com/eduke32@2671 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 21:40: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 cf56956dff Make 'Numsprites' also accessible from CON (read-only) under the same name.
Note the capitalization. I hope that this makes clashes with user variable
names less likely.

git-svn-id: https://svn.eduke32.com/eduke32@2484 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 22:32:04 +00:00
helixhorned 0175562e1f Do bound check for "quick" sector/wall accesses from CON, i.e. in getvarvar.
This was causing oob sector accesses with code like this:
    getwall[hitwall].nextsector temp
    ifvarvare sector[temp].floorz sector[temp].ceilingz setvar tempb 1
(from DT's HYPERCORE).

Also validate quote indices passed to CON's quote and userquote commands at
runtime.

git-svn-id: https://svn.eduke32.com/eduke32@2381 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-24 19:51:54 +00:00
helixhorned ca2d612976 Fix oob accesses when e.g. shooting tile -1. (can propagate via WEAPONx_SHOOTS)
Ideally, we would also warn when setting WEAPONx_SHOOTS to negative values, but
we'd have to intercept CON's setvar's and it wouldn't be pretty.

git-svn-id: https://svn.eduke32.com/eduke32@2268 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:58:23 +00:00
helixhorned f87c0db3ce In G_NewGame(), call Gv_RefreshPointers after Gv_ResetVars.
Resetting the gamevars might produce inconsistencies between an earlier loaded
game (for example, if it was saved with different/earlier CON code), and worst
of all, the gamevars that reference C variables might be overwritten (i.e. the
addresses to those variable, which is very bad!).

git-svn-id: https://svn.eduke32.com/eduke32@2230 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-03 19:55:38 +00:00
helixhorned 8e54a3febf Preliminary commoning of actor[].t_data[10] to an array of int32's on both
32- and 64-bit platforms. Also, make struct type actor_t also have a common
size of 128 bytes. New code currently disabled and #ifdef'd for comparison.

This requires certain t_data[] entries ([1]: move ptr, [4]: action ptr and
[5]: ai ptr with actors) to be converted to script offsets instead of pointers,
breaking savegame and net packet compatibility (we could in theory try hard not
to, but it would be too much trouble).

git-svn-id: https://svn.eduke32.com/eduke32@2185 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:40:47 +00:00
helixhorned b9a4b92bc8 Eliminate one uinitialized mem access related to projectiles (it's the filler
member, so maybe not *that* bad) and an invalid memory access when trying to
access a per-player gamevar in a player-less context (e.g. WGR2 SVN r25
WGR2GAME.CON line 10448).

git-svn-id: https://svn.eduke32.com/eduke32@2102 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-01 22:03:09 +00:00
terminx c698822a41 Add a couple of missed sanity checks for accessing player and sprite structure members as vars. Should fix crashes with stuff like "ifvare player[some value greater than MAXPLAYERS].kickback_pic blah"
git-svn-id: https://svn.eduke32.com/eduke32@2016 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-12 06:25:50 +00:00
terminx ea171d5230 Fix crashes on 64-bit due to unintended address truncation on ptr vars
git-svn-id: https://svn.eduke32.com/eduke32@2005 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-04 23:06:12 +00:00
terminx b996f92c28 Fix gamearray overallocation on 64-bit... was being allocated as (array size * sizeof(intptr_t)) when the struct actually contains a ptr to a block of int32_t
git-svn-id: https://svn.eduke32.com/eduke32@1964 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-12 15:40:28 +00:00
helixhorned 85fba8755b maint 2: refactor bits of code that twiddle/untwiddle pointers for persistent storage into a G_Util_PtrToIdx() function
git-svn-id: https://svn.eduke32.com/eduke32@1950 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-29 22:07:49 +00:00
helixhorned 793aadebc5 Janitorial work part 2, perfect for a rainy day. This fixes a lot of leaks, both on the client side as well as for memory allocated by OpenGL. If you had crashes after a few times of restartvid'ing in Polymer, this should fix it.
git-svn-id: https://svn.eduke32.com/eduke32@1942 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-22 22:00:53 +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 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
terminx 1fdafcdad6 Cleaning out my tree... mostly internal changes. Adds workaround to disable texture compression with the crappy fglrx driver on Linux, fixes FIRE sprites so that they don't render at their sector's floorz all the time, changes CON compiler around a bit to use a loop instead of calling C_ParseCommand() 10 million times.
git-svn-id: https://svn.eduke32.com/eduke32@1857 1a8010ca-5511-0410-912e-c29ae57300e0
2011-04-07 01:16:29 +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 2428b11152 More OSX build fixery and printf/scanf cleanup for 64-bit systems
git-svn-id: https://svn.eduke32.com/eduke32@1791 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-12 13:25:24 +00:00
terminx a7eb0418d1 Global thermonuclear code rape
git-svn-id: https://svn.eduke32.com/eduke32@1677 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-02 08:13:51 +00:00
terminx 013ac85e2d Emit RPG_EXPLODE, PIPEBOMB_EXPODE and LASERTRIP_EXPLODE from the actual EXPLOSION2 sprite instead of whatever spawned EXPLOSION2, to prevent the sound from being owned by whatever sprite happens to spawn with the ID the RPG/pipebomb/whatever had before it was removed
Add brightness/gamma/contrast cvars to Mapster32

Fix bug with WEAPON_SEMIAUTO flag for custom weapons

Fix VM error with starttrack when specifying an invalid music track

Fix detection of 0x1a EOF characters in CON files

Fix a couple of additional sound issues

Fix crash in pushmove()

Fix Mapster32 textured 2D mode display being a few pixels off from the actual lines drawn

Fix crash when clicking "cancel" in Mapster32 startup window

Add Makefile detection to build with -march=pentium3 -mtune=generic on i686


git-svn-id: https://svn.eduke32.com/eduke32@1665 1a8010ca-5511-0410-912e-c29ae57300e0
2010-07-03 08:53:57 +00:00
terminx 068d3c0e52 This is mostly just build fixes for USE_OPENGL=0, POLYMOST=0 and POLYMER=0. Also updated the precompiled libogg/libvorbis/libvorbisfile that are supplied for MinGW.
git-svn-id: https://svn.eduke32.com/eduke32@1660 1a8010ca-5511-0410-912e-c29ae57300e0
2010-06-23 04:20:46 +00:00
terminx 4c3c64286a shading changes and fixes for a few crashes
git-svn-id: https://svn.eduke32.com/eduke32@1657 1a8010ca-5511-0410-912e-c29ae57300e0
2010-06-07 09:03:16 +00:00
terminx ac7767986a Updated synthesis script, moved some non-essential files around, updated license headers on all non-BUILDLIC files, added memory cache on top of texcache to improve load times, moved some duplicated keyboard handling stuff from winlayer/sdlayer to baselayer, fixed keypad / in Mapster32 tile selector, fixed bug where p->rotscrnang and p->look_ang never reset to 0, added support for reloading maphack based polymer lights after mode changes/savegame loads, other minor changes
git-svn-id: https://svn.eduke32.com/eduke32@1652 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-25 10:56:00 +00:00
terminx 65b29ab092 win32 stuck input fix among other minor changes
git-svn-id: https://svn.eduke32.com/eduke32@1642 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-16 22:53:08 +00:00
terminx 45d93544a6 Source code "cleanup," herein referred to as "rape"
git-svn-id: https://svn.eduke32.com/eduke32@1625 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-02 23:27:30 +00:00
helixhorned eb5f59ca7f Improved demo system. Kick ass and watch :)\
Features:  * start recording in mid-game (ScrollLock)
           * saves interleaved diffs for later sync correction
           * supports fast-forward/rewind

Some work still needed to trace down remaining sync problems. Also be sure to check the demo* cvars.

git-svn-id: https://svn.eduke32.com/eduke32@1595 1a8010ca-5511-0410-912e-c29ae57300e0
2010-01-24 23:33:17 +00:00
terminx 2c9aeac2d5 A bunch of crap I meant to commit days ago... gtk startup window patch from bioman, nedmalloc REPLACE_SYSTEM_ALLOCATOR fix (related code uses #ifdef REPLACE_SYSTEM_ALLOCATOR so defining it to 0 was still satisfying the condition), slightly lower CPU usage in Mapster 2D mode, fix an ancient bug causing the player to not make vent footstep sounds on sprite based vents, fix map save state cvars, add "skill" cvar to console, fix saving the game while CON_SHOWVIEW is in use
git-svn-id: https://svn.eduke32.com/eduke32@1540 1a8010ca-5511-0410-912e-c29ae57300e0
2009-11-14 02:30:47 +00:00
terminx 577e3bd124 Misc
git-svn-id: https://svn.eduke32.com/eduke32@1502 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-28 00:01:06 +00:00
terminx 98a359f3e1 Clean out tree... misc changes
git-svn-id: https://svn.eduke32.com/eduke32@1465 1a8010ca-5511-0410-912e-c29ae57300e0
2009-07-24 02:31:34 +00:00
terminx 1538f39289 fix building with MSVC after Helixhorned's commit
fix FastLZ mipmap corruption issue
fix Polymer MSVC warnings
rewrote qsprintf to take up to 32 parameters, either quotes or gamevars
added qstrncat to concatenate n characters of one quote to another
exposed internal sectorofwall() function to CON
changed CON parser to count ( ) ; and , as whitespace so people can make their code more readable
added ACTIVATOR and ACTIVATORLOCKED support to SE49 and SE50
added SPRITE_USEACTIVATOR flag to allow actor execution based on whether a sector is "locked" or not
rearranged a few structures for faster array lookups
fixed EVENT_HOLSTER


git-svn-id: https://svn.eduke32.com/eduke32@1457 1a8010ca-5511-0410-912e-c29ae57300e0
2009-07-12 01:55:34 +00:00
terminx 9190ee2139 Fixes a crash when loading a savegame w/ saved map states in it after restarting EDuke32
git-svn-id: https://svn.eduke32.com/eduke32@1451 1a8010ca-5511-0410-912e-c29ae57300e0
2009-07-05 03:15:35 +00:00
terminx 6f6f0900c8 Fix multiplayer switches casting light in single player
git-svn-id: https://svn.eduke32.com/eduke32@1443 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-27 08:20:09 +00:00
terminx 3d0c34863d Generic non-descript commit message
git-svn-id: https://svn.eduke32.com/eduke32@1440 1a8010ca-5511-0410-912e-c29ae57300e0
2009-06-24 08:20:10 +00:00
qbix79 f568146387 Fix memory addresses being either 32 or 64 bit
git-svn-id: https://svn.eduke32.com/eduke32@1367 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-07 18:50:53 +00:00
plagman 02edf9a0e4 Fix the build with POLYMOST=0.
git-svn-id: https://svn.eduke32.com/eduke32@1366 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-07 16:05:33 +00:00
terminx f3d93e8406 Undo/redo support for Mapster32 and some other minor changes
git-svn-id: https://svn.eduke32.com/eduke32@1361 1a8010ca-5511-0410-912e-c29ae57300e0
2009-05-05 16:21:33 +00:00
terminx f3fbf8d9a3 Add support for cvars of type 'double', fix vid_gamma/brightness/contrast cvars, save cvars to eduke32_binds.cfg at shutdown, better method for drawing the floor textures in Mapster32 2D mode, slightly more yellow/orange lights on fire/rockets/lasers/etc
git-svn-id: https://svn.eduke32.com/eduke32@1358 1a8010ca-5511-0410-912e-c29ae57300e0
2009-04-30 21:09:44 +00:00
terminx 22a7ec1b3b git-svn-id: https://svn.eduke32.com/eduke32@1315 1a8010ca-5511-0410-912e-c29ae57300e0 2009-04-13 06:01:50 +00:00
qbix79 287f173551 Fix crash when reseting to default values
git-svn-id: https://svn.eduke32.com/eduke32@1246 1a8010ca-5511-0410-912e-c29ae57300e0
2009-03-15 16:02:57 +00:00
terminx 151189efab new version of astyle
git-svn-id: https://svn.eduke32.com/eduke32@1229 1a8010ca-5511-0410-912e-c29ae57300e0
2009-02-19 16:47:54 +00:00
terminx 4ff6023244 git-svn-id: https://svn.eduke32.com/eduke32@1228 1a8010ca-5511-0410-912e-c29ae57300e0 2009-02-19 09:39:19 +00:00
terminx 768f3ad6d6 git-svn-id: https://svn.eduke32.com/eduke32@1221 1a8010ca-5511-0410-912e-c29ae57300e0 2009-02-02 01:49:14 +00:00