2582 Commits

Author SHA1 Message Date
Michael Martin 3d5ebf1fa4 Fix build on gcc7.x 2018-01-12 20:57:53 -08:00
Michael Martin cd3d430398 Fix includes for setuid and friends 2018-01-12 20:57:34 -08:00
Michael Martin 98ab7ef3dd Match include guard symbols 2018-01-12 20:05:40 -08:00
Serge van den Boom 7326ff096d Grouping ship properties together at the top of the ship .c files, from oldlaptop. 2013-11-02 21:59:56 +01:00
Michael Martin c0e7a0268c Merge branch 'better-saves' 2013-10-19 17:12:38 -07:00
Michael Martin f66cbbcd89 Finalize the work on the new save file format.
Remove all references to state files from the format. Some still
leaks in in the GmSt chunk, but those are ignored or overwritten
by later loading phases.
2013-10-19 16:59:36 -07:00
Michael Martin f271e8270c Tentative loading logic for the new statefile format. 2013-10-19 15:52:19 -07:00
Michael Martin c30fd90cb4 Intermediate testing save format.
Rationalized statefile chunks are now written out alongside the
original statefile chunks. The loader still relies on the latter
for now. This will make correctness cross-checking a bit easier.
2013-10-19 01:29:02 -07:00
Michael Martin fe0a9a1126 Expose some of the statefile structure to load and save. 2013-10-18 22:38:39 -07:00
Michael Martin 60a9ca61cf Reorganize the GameState array.
This is preparation work so that when the state files are removed
from the savegame format (or possibly removed entirely) it will
not be a savegame compatibility-breaking change.

Legacy support has been modified so that the GameState bits are
reordered as part of load, so loading legacy saves still works.
2013-10-13 23:19:13 -07:00
Michael Martin 40dcd65afa Generalize the getGameState functions. 2013-10-13 18:49:54 -07:00
Michael Martin e7d30008a2 Endian safety in all savegame chunks except statefiles. 2013-10-13 16:36:41 -07:00
Michael Martin 7138aeca64 Major revision to save format
This accomplishes what I set out to do, but doesn't actually
solve the problem well enough given what I learned while doing it.

Documentation forthcoming in future commit.
2013-10-13 05:07:04 -07:00
Mika Kolehmainen 6c6bb6b100 OS X: Compiles now with Xcode 5. SDLMain updated to SDL 1.2.15, fixes input when running binary directly. 2013-10-10 00:52:53 +03:00
Michael Martin eca23397c3 Output bytes now track field sizes.
This removes the clumsy local variable pointer stuff.
2013-10-09 00:34:35 -07:00
Michael Martin 876daf0827 Remove padding and unused data from savegame format. 2013-10-07 00:39:06 -07:00
Michael Martin 51fa5a7ae5 Save format refactoring: Uncompressed save format
Legacy files are handled by load_legacy.c, but this now should be
the only part of the code that still uses the custom decompression
library.

These save formats are very much interim and held for testing
purposes! Do not use these commits for actual play, or your saves
will be lost.
2013-10-06 23:28:31 -07:00
Michael Martin 78d6312a1e Make the UI for named saves acceptable. 2013-10-06 17:24:20 -07:00
Serge van den Boom d490f70016 Add an index to dialog string tables, so that we can refer to dialog lines by a string identifier instead of a volatile number. 2013-09-29 21:16:26 +02:00
Serge van den Boom c8527459c8 Expand inline documentation. 2013-09-29 20:55:45 +02:00
Serge van den Boom 145309927b Remove a few duplicate comments. 2013-09-29 19:09:30 +02:00
Serge van den Boom 29beca352b Some more documentation. 2013-09-29 19:02:56 +02:00
Serge van den Boom d848ccf96f Added a StringHashTable type, for later use. 2013-09-29 18:47:19 +02:00
Serge van den Boom 5c6ba7e51c Fix in currently unused define. 2013-09-28 23:29:07 +02:00
Serge van den Boom 6c8387fff4 A few superficial fixes. 2013-09-28 22:00:47 +02:00
Michael Martin e4657ea3d1 Improved save file format inspired by IFF.
Savefile is built of chunks that include their length. The only
two right now are Summ (the summary, must be first) and OmnZ
(the omnibus compressed data).

Padding that was originally used for alignment purposes has been
removed from the format, unless is it is part of the compressed
data.
2013-09-25 22:31:42 -07:00
Michael Martin 27087d0ea8 Refactor savegame information
Coalesce it out of three header files into one (save.h).
This also includes references to NextActivity, which may
be the wrong place to do it. Time will tell.
2013-09-25 20:35:58 -07:00
Michael Martin 2fc4f01ec4 Normalize legacy/modern save display.
Also clean up some detritus from the initial implementation.
2013-09-25 20:35:53 -07:00
Michael Martin 28fb037258 First draft of namable savegames.
This code is loosely adapted from JMS's code in UQM-HD,
but very little remains beyond the text input loop internals.

Fully backwards compatible, but this format shouldn't
survive to the final merge.
2013-09-25 20:35:39 -07:00
mcmartin 0851e23c8e fix a crash when talking to the Ur-Quan drone on 64-bit Linux
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3782 8092fc87-c524-0410-9efc-e669fe64eaf9
2013-09-23 09:20:31 +00:00
meep-eep 6667b7cc95 Insight from James Scott.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3781 8092fc87-c524-0410-9efc-e669fe64eaf9
2013-03-28 12:36:56 +00:00
avolkov b571a8ce39 Make init_RACE()/uninit_RACE() calls symmetric; takes care of memory leaks from bug #1149; thanks to Louis Delacroix
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3778 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-26 21:05:46 +00:00
avolkov 2e67a5a007 Bugfix: TFB_DRAWCOMMANDTYPE_REINITVIDEO is allowed to be queued from the main() thread
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3777 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-26 20:32:22 +00:00
avolkov f765eac3ee More work towards exit cleanliness; bugs 50, 1149:
* Some atexit() callbacks removed, to be called in order during clean exit (Abort key bypasses these)
  The only things called atexit() are now removeTempDir, SDL_Quit() and log messageboxes
* gfxlib cleans up remaining SDL_Surfaces
* Other cleanup improvements: the goal is to allow library cleanup funcs to be called more than once w/o crashing,
  and then decide which should and can be called atexit() safely.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3776 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-26 19:42:15 +00:00
avolkov 4633ec6e6a Prevent reads from uninitialized ship_footprint variable; bug #1150; thanks for Louis Delacroix
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3775 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-25 20:15:23 +00:00
Meep-Eep c9c3fe6eff The code is not ready for this assertion.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3774 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-25 19:33:43 +00:00
Meep-Eep f5bb4c0c57 Some functions for activities.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3773 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-24 21:00:39 +00:00
Meep-Eep 947767d944 Add setSegue(), getSegue().
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3772 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-24 19:52:10 +00:00
Meep-Eep d085d08fa6 Literacy.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3771 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-18 20:26:58 +00:00
avolkov c7c8916c2e Consolidate duplicate screen init functions
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3770 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-13 01:10:40 +00:00
avolkov dfeaf56b02 Change return type of IsVelocityZero() to reflect the real return value
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3769 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-13 01:08:15 +00:00
avolkov 917cab1b7c Do not leak MenuState.CurFrame in RestartMenu; bug #1156
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3768 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-12 20:46:54 +00:00
avolkov 38acc94022 Cleanup mounted dirs upon exit; bug #1149; thanks to Louis Delacroix
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3767 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-12 20:18:33 +00:00
avolkov 91ce0e9898 Remove dated SCREEN_DRAWABLE logic to allow for Screen FRAME cleanup; bug #1149
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3766 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-12 20:01:20 +00:00
avolkov 2cf7861674 Cleanup colormaps upon exiting the game; bug #1149
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3765 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-12 19:10:15 +00:00
avolkov f87f956cdf Free the state-file data upon delete, from Louis Delacroix
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3764 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-12 02:41:11 +00:00
avolkov f3af42e618 Const-correctness for STRING resources; bug #1155; in part from Louis Delacroix
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3763 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-12 02:32:30 +00:00
avolkov 6be6491c05 Quantum-erase GraphicsLock; Some changes needed to accomplish this:
* comm/trackplayer Callbacks are now queued instead of asynchronously called on the stream decoder thread
* libs/callback now guards the list with a mutex (called from different threads)
* only one thread (Starcon2Main) is allowed to queue draw commands right now; a sanity check is in place (define DEBUG_DCQ_THREADS)
Fixes: Alarms and Callbacks are used for more than just Netplay, reflect this.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3761 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-02-11 23:41:06 +00:00
avolkov 8aab2ae592 Split debug key function into sync and async parts (wrt the game logic thread), paving the way for GraphicsLock and GameClock lock removal
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3759 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-01-29 20:18:50 +00:00
Meep-Eep e4902fa2c3 Generalised some functions.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3757 8092fc87-c524-0410-9efc-e669fe64eaf9
2012-01-29 15:43:55 +00:00