Commit Graph

100 Commits

Author SHA1 Message Date
Darkvater 3efd51dd76 (svn r3628) - Add BOOL and STRING types to saveload capabilities. String is unused up till now and it saves the full-buffer, regardless of how many characters the string actually has. So give a warning for that and figure it out later. 2006-02-20 19:58:46 +00:00
Darkvater fa337ae64a (svn r3626) - Merge the SlGlobVarList (global variables) and SaveLoad (offset in struct, variable determined runtime) structs. The only difference between these two is the last element that either holds the address or the offset in the struct. Which one to take is determined by which function is called; SlObject or SlGlobList. 2006-02-20 19:42:39 +00:00
Darkvater f579e2ee83 (svn r3624) - CodeChange: Some cosmetic changes in the saveload code;
- hide and validate variable-size calculation (SlCalcConvMemLen/SlCalcConvFileLen)
   - some signed/unsigned fixes
   - handle conditional variables the same way for global -and struct types, through checking version_from and version_to
2006-02-20 19:04:18 +00:00
Darkvater f15b8b6cda (svn r3623) - Standardize DEBUG() messages in saveload.c 2006-02-20 18:01:38 +00:00
tron b844aa2db3 (svn r3520) Remove unused parameters from some functions 2006-02-02 07:15:46 +00:00
tron 84fb96fe85 (svn r3511) More whitespace ([FS#46] by Rubidium) 2006-02-01 07:36:15 +00:00
truelight b7beb3d87d (svn r3483) -Fix: fixed warning about setjmp (tnx Bjarni for testing, and tnx for
taking the effort to commit it)
2006-01-29 22:42:17 +00:00
Darkvater 4e09974975 (svn r3472) - [PBS] Remove from trunk. Anyone interested can still find it in branch/pbs. This reverts revisions r3158, r3140, r3075, r2977, r2674, r2625, r2621, r2529, r2528, r2525, r2524, r2519, r2517, r2516, r2507, r2499. (in conjunction with Tron)
- The only change is that the nsignalsw.grf file is kept and that existing nightlies with PBS signals get those signals converted to combo-signals.
2006-01-29 18:57:26 +00:00
bjarni e35a131153 (svn r3403) -Codechange: [multiheaded engines] the references between the front and rear engines are no longer saved
instead the pointers are generated on load
2006-01-18 15:05:01 +00:00
peter1138 90aff7a026 (svn r3396) - Autoreplace changes:
- Change fixed array per player to a single pool. This avoids future problems
    with vehicle numbers and decreases savegame size. Engine replacements from
    previous savegames will be lost.
  - Move engine replacement code from players.c to engine.c.
                                      (thanks to blathijs for rewriting this)
2006-01-12 15:52:18 +00:00
truelight efd3d42107 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
-Fix: [ FS#30 ] don't reset date in SE when pressing RandomLand (rewrote patch of MeusH, but Peter warned me I should put his name in, so... oh well)
2006-01-06 21:57:37 +00:00
peter1138 2a94a64711 (svn r3356) - Remove unused parameter of AfterLoadGame().
- Initialize _sl_version after loading an old savegame.
2005-12-29 22:28:19 +00:00
Darkvater 56998926e7 (svn r3294) - Fix: use INVALID_STRING_ID instead of -1.
- Fix: savegames only give back one message, show this by ignoring the first argument. Perhaps make the message more verbose in the future by adding STR_ equivalents next to the already existing debug messages.
2005-12-13 21:21:57 +00:00
Darkvater 728aba9d7c (svn r3236) - Fix: warnings about 'CDECL must be used with ...' on VS6 2005-11-26 12:57:42 +00:00
truelight 4845ff063b (svn r3227) -Codechange: [Savegame] removed 'minor' version, and renamed 'major' version to just: version. 2005-11-22 19:33:29 +00:00
bjarni 22a4679837 (svn r3218) -Feature: Multiheaded train engines will now stay in the same train
This means that any user attempt to remove a rear engine will tell the user to move the front engine instead
	This fixes the assert when moving multiheaded engines (introduced in r3144)
	Note: to make old savegames use this feature, some engines might be turned around in order to link engines in pairs

-Codechange: train subtype is now a bitmask
	This allows fast access to info like if it is a wagon or engine and if it is in front and so on
	Note: savegame version bump
2005-11-18 23:41:03 +00:00
peter1138 754d26407e (svn r3212) - Waypoints/Depots: Store waypoint index in m2 for waypoints. This moves the ground type bits from m2 to m4 for waypoints and depots (leaving room for depot index in m2 in future), and moves the custom graphics ID to the waypoint struct.
- Waypoints: Until now stat_id was saved but never assigned to. Instead we now save the GRFID/local index of the custom graphics so that GRF file changes can leave graphics intact.
2005-11-16 22:20:15 +00:00
bjarni 5481dcd191 (svn r3155) -Feature: [autoreplace] autoreplace can now remove cars from too long trains
-Trains will now remember the length of stations it visits and sell cars
        when being autoreplaced if they became too long
        -If it needs to remove cars, then it starts from the front and sells
        all it can find until the train is short enough
        -This only works for trains, that knows the station length of the route
        so a full uninterrupted run is needed
        -a train needs 1-2 runs to detect if the shortest station is expanded
        -This feature can be turned on and off in the train replace window
        and each company can have it's own setting
        -NOTE: minor savegame version bump
2005-11-07 23:20:47 +00:00
tron 2cc2154ad2 (svn r3077) static, const, bracing, indentation, 0 -> '\0'/NULL, typos in comments, excess empty lines, minor other changes
nothing spectacular, just some stuff, which piled up
2005-10-22 06:39:32 +00:00
Darkvater a3d40a29fc (svn r3008) [ 1247535 ] Native Support for Win64 (compile&run only) (michi_cc)
Fix warning in graph_gui.c with const problem
2005-10-02 22:39:56 +00:00
Darkvater c5fa3848f6 (svn r2944) Add Revision keyword to the file for --version/-v 2005-09-11 18:20:32 +00:00
Darkvater ffd044c5e8 (svn r2940) (Internal) Remove the need for the 'tmp' variable for _sl.buf, instead operate on _sl.buf_ori which is not changed for init/deinit. 2005-09-11 14:20:46 +00:00
Darkvater b0ddaae4af (svn r2939) Fix racing condition when using threaded saving (last one I hope).
When game is saved and you save again you get an error message (not when autosaving) and it's aborted. When a game is loaded in the meanwhile execution pauses until saving thread finishes.
2005-09-11 14:17:21 +00:00
Darkvater 92270500e9 (svn r2908) If threaded saving fails or does not happen, sending subsequent messages might hang ottd. So don't send them :) 2005-09-02 22:22:02 +00:00
Darkvater a181446829 (svn r2906) Fix some threaded saving problems. Now the thread only interfaces with the main program through a sort of mutex. Communication uses the function OTTD_SendThreadMessage() with the approiate message which is handled in ProcessSentMessage() during the main loop. 2005-09-02 16:05:59 +00:00
tron 38f344b351 (svn r2863) Move some type declarations into saveload.c, should've been part of r2819 2005-08-13 21:34:05 +00:00
tron d7eaf35357 (svn r2861) Move inclusion of setjmp.h into saveload.c, should've been part of r2819 2005-08-12 12:47:35 +00:00
tron 03e860d06d (svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c 2005-08-06 17:40:21 +00:00
bjarni ed8e2bac04 (svn r2817) -Codechange: [autoreplace]: moved autoreplace and autorenew to serverside
-This means that one company can only have one setting for renew and replacing
    more clients will not fight due to different settings anymore
  -This is a needed step in the line to fix autoreplacing dualheaded locomotives
  NOTE: savegame revision bump (peter1138 + me in coop)
2005-08-06 16:07:22 +00:00
tron eb826dfb66 (svn r2813) Plug a thread leak and prevent a race condition which could lead to multiple simultaneous saves and therefore severe corruption 2005-08-06 07:15:17 +00:00
tron c78af95d1d (svn r2810) Threads may now return information when they terminate using a void*.
Also add the new files to the MSVC project files.
2005-08-05 11:53:48 +00:00
tron 4696ef802a (svn r2809) Implement more generic threading functions, which allow more than one thread 2005-08-05 09:15:41 +00:00
tron a86e9689df (svn r2807) Fix two major bugs in the threaded save code:
- Do not dereference a local variable which no longer exists; this lead to random crashes when saving
- (Win32) Do not close a handle before it is used last
There are still many major problems (race conditions and resulting memory corruption/crashes) left
2005-08-05 08:24:12 +00:00
tron a227065ab7 (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron 559babcdc9 (svn r2673) Include functions.h directly, not globally via openttd.h 2005-07-22 07:02:20 +00:00
tron 18d79cc30f (svn r2672) Move saving/loading related declarations to saveload.h 2005-07-22 06:31:31 +00:00
tron 0762aa9ec9 (svn r2669) Shuffle some more stuff around to reduce dependencies 2005-07-21 22:15:02 +00:00
tron d71788c402 (svn r2660) Get rid of some more shifting/anding/casting 2005-07-21 06:31:02 +00:00
tron 4130198f48 (svn r2654) SlWriteUint16() should have a uint16 as parameter, not some arbitrary enum 2005-07-20 19:08:02 +00:00
Darkvater 7da16dbf4b (svn r2651) - Fix: [ 1220776 ] Removes warning when compiling saveload.c on some GCC versions (glx). This only works as long as there is only 1 saving thread active, as is the case now. 2005-07-20 15:36:22 +00:00
ludde 951cde5b72 (svn r2648) Only use _stdcall calling convention for zlib on win32/msvc. 2005-07-20 09:35:05 +00:00
ludde 5862c0a174 (svn r2636) Fix: Switched to using the _fastcall calling convention instead of cdecl. (Please tell me if you get linking problems) 2005-07-19 11:55:47 +00:00
Darkvater 19cb5e054a (svn r2587) - Fix: Don't close the save-thread if it wasn't started because of some error or a network-server 2005-07-16 09:55:31 +00:00
ludde 6013b327f7 (svn r2560) Fix: various minor code changes.
Added RandomTile/RandomTileSeed functions to generate a random tile.
Changed landscape routines so they don't assume that the Y map side is a power of two. (support for this is not complete, though)
Changed some frequently used map macros to not compute the values each time.
Silence some warnings on MSVC.
2005-07-13 19:51:31 +00:00
ludde b5a30ed0fc (svn r2550) raise 32767 limit of gamma values, and 16MB limit of RIFF chunks in saveload code. 2005-07-12 19:15:56 +00:00
tron 1b4a0897b6 (svn r2535) Tabs 2005-07-08 22:25:24 +00:00
celestar 27e61cbd84 (svn r2499) -Codechange: Moved the semaphore bit from bit 2 to bit 3 in _map_hi for rails, in order to make way for pbs 2005-06-30 13:24:17 +00:00
celestar 9b8cb17831 (svn r2441) -Feature: You can now give transfer order to set up feeder systems 2005-06-15 16:58:15 +00:00
Darkvater 5fed47964e (svn r2420) - Codechange: magic number elminitation of cursorsprites. 2005-06-06 13:47:06 +00:00
Darkvater 71c2a573e1 (svn r2419) - Fix: saving no longer changes your cursor if it is in a non-mouse state.
- Fix: autosaving/loading; it no longer returns a fail code when saving is already in progress. In the case of a load, the game pauses to wait for the save to finish. (glx)
- Fix (regression): fix a bug in the 'buggy load' code where a wrong offset was used for the LZO format.
2005-06-06 13:11:35 +00:00