Commit Graph

81 Commits

Author SHA1 Message Date
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
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 2005-06-02 19:30:21 +00:00
Darkvater 6b7f3da7c6 (svn r2392) - Fix some typos (Tron) 2005-06-01 23:12:29 +00:00
Darkvater a51cfd58b8 (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
2005-06-01 23:08:33 +00:00
hackykid f7dcd2e834 (svn r2390) - Codechange: Fix some warnings on GCC 4.0.0 2005-06-01 11:52:44 +00:00
Darkvater 55423efb06 (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.
2005-05-30 22:16:05 +00:00
Darkvater 35ff9d850c (svn r2118) - Fix: Fix compilation with network disabled, and comment out some of the warnings (unused function) 2005-04-02 00:17:16 +00:00
pasky 0c5d61bd56 (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.
2005-03-27 00:28:14 +00:00
truelight 83637d164e (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)
2005-03-24 17:03:37 +00:00
truelight 88ef277dc3 (svn r2041) -Fix: not all vehicles did get a day_proc call (because of rounding errors) 2005-03-24 13:59:44 +00:00
pasky 087d78d465 (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. 2005-03-20 00:32:26 +00:00
celestar f41be0b25a (svn r2030) -Fix: Save _cur_town_ctr with all its bits to prevent desyncs 2005-03-19 22:45:59 +00:00
tron 195e515de1 (svn r2018) Yet another workaround 2005-03-15 21:07:09 +00:00
tron dad3d12406 (svn r2017) Explicitly mark SlReadByte as 'inline' 2005-03-15 20:07:46 +00:00
tron f91f8d9559 (svn r2014) Don't manually inline a piece of code 2005-03-15 16:56:05 +00:00
Darkvater 50ac80cb4c (svn r1909) - Fix: [ 1145593 ] assertion failed when saving the game. It is nice to also update the savegame format when you update town statistics :) 2005-02-23 00:07:03 +00:00
truelight 020c1e9b6c (svn r1818) -Add: Dynamic orders (up to 64k orders) 2005-02-06 10:24:57 +00:00
truelight e9c93f9c0c (svn r1817) -Codechange: Moved depot-functions to depot.c
-Codechange: Added wrappers around depot-access (GetDepot no exists)
-Codechange: Made depot-functions a bit more logic (no longer 
GetDepotByTile crashes your game when you request it on a non-depot tile)
-Add: made depots dynamic (yes, 64k depots are possible now)
2005-02-06 10:18:47 +00:00
tron f0f85a7ef3 (svn r1803) Move debugging stuff into files of it's own 2005-02-05 15:58:59 +00:00
truelight 10adda0d73 (svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops. 2005-02-04 15:31:30 +00:00