Commit Graph

90 Commits (336a58e797a0664168ab7bd43a6a9fb56bc85ffd)

Author SHA1 Message Date
truelight 45a0cc607c (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)
19 years ago
peter1138 b97d91b96e (svn r3356) - Remove unused parameter of AfterLoadGame().
- Initialize _sl_version after loading an old savegame.
19 years ago
Darkvater 573ce05eb8 (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.
19 years ago
Darkvater 43b09db5ed (svn r3236) - Fix: warnings about 'CDECL must be used with ...' on VS6 19 years ago
truelight 898bb915ac (svn r3227) -Codechange: [Savegame] removed 'minor' version, and renamed 'major' version to just: version. 19 years ago
bjarni 16e65960b9 (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
19 years ago
peter1138 479a9c2e47 (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.
19 years ago
bjarni df6c48fdba (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
19 years ago
tron 0b936c3222 (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
19 years ago
Darkvater e1acd38bc5 (svn r3008) [ 1247535 ] Native Support for Win64 (compile&run only) (michi_cc)
Fix warning in graph_gui.c with const problem
19 years ago
Darkvater 7f31471240 (svn r2944) Add Revision keyword to the file for --version/-v 19 years ago
Darkvater 4926ff03be (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. 19 years ago
Darkvater 52bd795bbb (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.
19 years ago
Darkvater 40997f25e9 (svn r2908) If threaded saving fails or does not happen, sending subsequent messages might hang ottd. So don't send them :) 19 years ago
Darkvater a948fcb605 (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. 19 years ago
tron 0d6f3dbc4d (svn r2863) Move some type declarations into saveload.c, should've been part of r2819 19 years ago
tron 765fc0bbc6 (svn r2861) Move inclusion of setjmp.h into saveload.c, should've been part of r2819 19 years ago
tron 486cffd2ad (svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c 19 years ago
bjarni 9952ff0b59 (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)
19 years ago
tron 35860155f6 (svn r2813) Plug a thread leak and prevent a race condition which could lead to multiple simultaneous saves and therefore severe corruption 19 years ago
tron bd48d67c28 (svn r2810) Threads may now return information when they terminate using a void*.
Also add the new files to the MSVC project files.
19 years ago
tron f315c95fa1 (svn r2809) Implement more generic threading functions, which allow more than one thread 19 years ago
tron 484fae74a2 (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
19 years ago
tron 647cbd6bdd (svn r2701) Insert Id tags into all source files 19 years ago
tron 54cbd01825 (svn r2673) Include functions.h directly, not globally via openttd.h 19 years ago
tron a4ec4da221 (svn r2672) Move saving/loading related declarations to saveload.h 19 years ago
tron 71140a5768 (svn r2669) Shuffle some more stuff around to reduce dependencies 19 years ago
tron 6ad3895306 (svn r2660) Get rid of some more shifting/anding/casting 19 years ago
tron e36d25210e (svn r2654) SlWriteUint16() should have a uint16 as parameter, not some arbitrary enum 19 years ago
Darkvater c1f63a289a (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. 19 years ago
ludde 50660a2c94 (svn r2648) Only use _stdcall calling convention for zlib on win32/msvc. 19 years ago
ludde 868938a64b (svn r2636) Fix: Switched to using the _fastcall calling convention instead of cdecl. (Please tell me if you get linking problems) 19 years ago
Darkvater f043088ec1 (svn r2587) - Fix: Don't close the save-thread if it wasn't started because of some error or a network-server 19 years ago
ludde 2123deff13 (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.
19 years ago
ludde 03bd8afc58 (svn r2550) raise 32767 limit of gamma values, and 16MB limit of RIFF chunks in saveload code. 19 years ago
tron 1307f90b5e (svn r2535) Tabs 19 years ago
celestar 189a1c4017 (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 19 years ago
celestar c7de834059 (svn r2441) -Feature: You can now give transfer order to set up feeder systems 19 years ago
Darkvater c3c69ff5cb (svn r2420) - Codechange: magic number elminitation of cursorsprites. 19 years ago
Darkvater f87df93a70 (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.
19 years ago
Darkvater ba8c649fac (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 19 years ago
Darkvater 043d8a4718 (svn r2392) - Fix some typos (Tron) 19 years ago
Darkvater 13c7b2b337 (svn r2391) - Feature: saving games happen in a seperate thread so you no longer will have to wait such a long time (especially handy on bigger maps and multiplayer games). The mouse also changes into the 'ZZZ' state :P. The thread on windows is currently given a little-bit-less-than-normal priority so it should not interfere that much with the gameplay; it will take a bit longer though. Upon the exit of the game any pending saves are waited upon.
- Fix: fixed GetSavegameFormat() so that it takes the best compressor (highest), or a forced one added with the parameter
- Open issues: 
1. Don't attempt to load a game while saving is in progress, it will kick you back to the intro-screen with only the vast ocean to look at.
2. The server is disabled from threaded-saving, but might be enabled in the future.
3. Current implementation only allows 1 additional running thread.
4. Stupid global variables.....grrr
Big thanks for TrueLight and the amazing memorypool :D
19 years ago
hackykid 2f1a224ea9 (svn r2390) - Codechange: Fix some warnings on GCC 4.0.0 19 years ago
Darkvater f4f5cb93f8 (svn r2387) - CodeChange: made the saveload code more readable and also removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big.
- Fix: also fix an unnoticed error in SlSaveLoadConv() due to wrong types.
19 years ago
Darkvater a636a36989 (svn r2118) - Fix: Fix compilation with network disabled, and comment out some of the warnings (unused function) 20 years ago
pasky 5fa38a4fc7 (svn r2080) - Fix: [OldAI] p->ai.state_counter was uint16 but could hold a tile index, therefore overflowing - changed that to uint32 and bumped the savegame revision to 32. It *MIGHT* close bug 1151374 - it certainly caused AI to stop building anything sometimes.
- While at it, use TileIndex as the tile index type in AiRemovePlayerRailOrRoad() and AiStateRemoveTrack().
- Make the number of tiles scanned 4*MapSizeX() instead of 1000. It *MIGHT* close bug 1116614.
20 years ago
truelight d1e158d6f7 (svn r2046) -Codechange: moved all waypoint code to waypoint.c/waypoint.h
-Codechange: rewrote some functions while moving waypoint-stuff
-Add: added support for 64k waypoints
-Fix: made the waypoint struct a bit more logic (no bit-fucking)
20 years ago
truelight 49d69f6fa3 (svn r2041) -Fix: not all vehicles did get a day_proc call (because of rounding errors) 20 years ago
pasky 00ff85dcb8 (svn r2033) - Fix: Fix some more desync by saving the town growth frequency iterator _cur_town_iter. Needed to bump a svg revision for that thanks to the braindead SlGlob thing, or at least I don't know how to do it without bumping it. 20 years ago