Commit Graph

172 Commits

Author SHA1 Message Date
Darkvater 7656bf8075 (svn r4001) - Add length parameter to FiosMakeSavegameName() and use this function for creating the full path instead of home-brewn snprintf. 2006-03-21 22:08:15 +00:00
Darkvater 873768c2d2 (svn r3872) - [win32] Show the revision in crash.txt and enable the button to show the crash text in the crash-window 2006-03-14 21:31:51 +00:00
tron 84fb96fe85 (svn r3511) More whitespace ([FS#46] by Rubidium) 2006-02-01 07:36:15 +00:00
peter1138 9fd6b1009e (svn r3496) - Validate filename titles before they get displayed. This avoids crashes with UTF-8 encoded or bad filenames by replacing undisplayable characters with a '?' 2006-01-31 12:08:49 +00:00
Darkvater c8a2c7ae94 (svn r3442) - Fix: Only windows has stricmp. So define strcasecmp to stricmp when using MSVC 2006-01-26 17:32:49 +00:00
peter1138 592aee1e27 (svn r3309) Cygwin doesn't define _MSC_VER; check it exists before basing decisions on its value. 2005-12-16 22:01:38 +00:00
tron f7abff5f96 (svn r3181) -Bracing
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
2005-11-14 19:48:04 +00:00
tron 1c867927a3 (svn r3163) Include header for toupper() 2005-11-10 17:21:05 +00:00
Darkvater 9bbf8ea9d0 (svn r3097) - Fix (regression): unix has a trailing slash after the paths, windows does not, no idea why os2 has. Way to go consistency :s. So anyways, just strip trailing slash 2005-10-28 00:18:57 +00:00
Darkvater f561993112 (svn r3096) - Feature: 'HOME' icon to saveload dialogs that jumps to the default save/load directory based on the dialog (added icon to openttd.grf, introduced FIOS_TYPE_DIRECT that allows arbitrary directory jumping).
- Fix: on Win32 capitalize the drive-letter in the saveload dialog windows when it is first opened.
2005-10-28 00:09:59 +00:00
Darkvater be984d9bcc (svn r3061) - CodeChange: revert r3056, r3057 and add a simpler fix to satisfy the needs of the absolute strict (eg. root directory is C:\ not C:) 2005-10-18 20:18:05 +00:00
Darkvater d4463b4b95 (svn r3057) - (Post)Fix: fix backslash occurence in all cases, also when going to root directory through 'parent directory', and of course don't show parent dir in root. 2005-10-17 22:49:15 +00:00
Darkvater 6bf4e4af3c (svn r3056) - Fix: Problem on Win98 and lower when if you go to the root directory of a drive (eg. C:\) you were stuck there indefinitely and couldn't change any directories or see any files 2005-10-17 22:24:32 +00:00
tron 23ecc82ad3 (svn r3055) Give the savegame/scenarion sort order flags symbolic names 2005-10-17 19:57:00 +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
tron c2c865e4b9 (svn r2984) Use adequate types, this should aid portability a bit 2005-09-25 09:04:59 +00:00
Darkvater e9401f09a7 (svn r2954) - Force assertion message to be output to a messagebox instead to the console which MinGW32 had the habit of doing. Using undocumented (in mingw) __set_error_mode() function. 2005-09-15 21:59:07 +00:00
tron bdd5d4ebb1 (svn r2864) Code simplification and diff reduction 2005-08-13 21:35:31 +00:00
tron bdff0fa2d2 (svn r2860) Fix some issues in the savegame/scenario list code:
-Fix: Sort the directories when making a scenario list
-Fix: Sort the directories when making a savegame list on Windows
-Fix: On OS/2 show the trailing \ if the current directory is a root directory
-Regression: On OS/2 the savegame list showed the scenario directory or crashed (probably introduced in r2609)
The rest is diff reduction between the 3 variants
2005-08-12 06:37: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 fc5e2d4861 (svn r2775) Deleting a file can fail, display an error message when it happens 2005-08-01 00:14:22 +00:00
tron 2ff85cdc56 (svn r2729) Fix #include 2005-07-27 20:08:52 +00:00
tron 5821529859 (svn r2728) -Fix/Feature: Change the driver probing algorithm
Instead of trying to start a single driver and bailing out if that fails, try to initialise one by one and use the first one which succeeds.
This should fix problems on machines with no sound card, where -s null had to be specified manually.
2005-07-27 19:57:12 +00:00
tron 6c52a8629d (svn r2727) Fix last commit, don't ask 2005-07-27 19:26:53 +00:00
tron c43653b565 (svn r2726) Fix last commit 2005-07-27 19:25:50 +00:00
tron 286f8726d5 (svn r2725) Move MyShowCursor() back into win32.c, it fits better there 2005-07-27 19:22:38 +00:00
tron 84f78ea44a (svn r2710) Simplify dedicated server code a bit and don't compile it at all, if network support ist disabled 2005-07-25 16:33:58 +00:00
tron 201990b5d9 (svn r2704) Remove . from include path again, too much trouble. Also add some #ifdefs and #includes for the Windows build 2005-07-25 07:16:10 +00:00
tron a227065ab7 (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron 384b284846 (svn r2699) Hopefully fix the compilation on Windows when SDL is not present 2005-07-24 10:39:12 +00:00
tron 475d7fc0ae (svn r2697) Make compiling with SDL on Windows work again (missing #includes) and fix some warnings 2005-07-24 06:09:54 +00:00
tron 4a14350711 (svn r2691) Separate dedicated video driver and fix bemidi declarations 2005-07-23 17:22:39 +00:00
tron 10fd03e222 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my... 2005-07-23 15:48:00 +00:00
tron 5178ad768d (svn r2686) Revert accidently commited change 2005-07-23 15:24:31 +00:00
tron 07a6e612ec (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
This results in shorter and hopefully easier to maintain files.
Note: I had to change paths in #include statements of some unrelated files, because I added the ottd base directory to the include path (-I.)
2005-07-23 15:16:57 +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 11d21bb2a1 (svn r2670) Fix r2669 2005-07-21 22:18:02 +00:00
tron ac66e3e28f (svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read 2005-07-20 15:29:28 +00:00
ludde f432314fa9 (svn r2649) Get rid of 2 warnings. 2005-07-20 09:49:04 +00:00
ludde 3e97dda275 (svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* instead of Dijkstra.
- Benchmark shows that NTP is now around 10x faster than NPF.
  - Made IsTunnelTile macro to determine if a tile is a tunnel.
  - Added some useful debugging functions for making tiles red / getting accurate timestamps.
  - Remove old depot finding algorithm.
  - Disable warning for signed/unsigned comparisons.
2005-07-19 11:42:40 +00:00
Darkvater 80aa8c868b (svn r2609) - Feature: remove extension from savegames/scenarios when browsing the folders. 2005-07-17 15:58:47 +00:00
ludde 3ce9fb6bbd (svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier. 2005-07-17 12:49:00 +00:00
ludde 71f9078bdd (svn r2583) Move OS specific code out of misc.c
Added support for Mersenne Twister random number generator (not implemented in network yet)
Wrap player randoms around #ifdef
2005-07-15 20:29:06 +00:00
tron 8f71864bef (svn r2571) Add explicit type Pixel for ... Pixels 2005-07-15 14:16:14 +00:00
tron 1a046ff4c6 (svn r2563) -Fix: [1209084] Spaces in the path to the MIDI files caused the win32 MIDI player to fail 2005-07-14 06:10:23 +00:00
tron 1b4a0897b6 (svn r2535) Tabs 2005-07-08 22:25:24 +00:00
tron 75bb548da4 (svn r2501) Forgot to change part of the win32 code in r2497 2005-06-30 19:28:00 +00:00
tron 9d75047211 (svn r2497) Use a struct array for palette entries instead of a flat byte array 2005-06-30 05:27:32 +00:00
Darkvater e9115f28c9 (svn r2463) - Fix: partly revert the strncat madness and update nightly script (invisible) to correctly insert date. 2005-06-20 19:39:49 +00:00
Darkvater 3042e945d3 (svn r2459) - Fix: windows title-bar did not correctly add date/revision for nightly build 2005-06-18 20:23:35 +00:00
Darkvater 2bcb41293f (svn r2417) - Fix: threads on morphos are apparently unexistent, so implement stubs for them (tokai) 2005-06-06 12:11:44 +00:00
tron 43f7974f6d (svn r2405) Simplify a few '? true : false' and '? false : true', especially the latter is confusing 2005-06-04 07:35:12 +00:00
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 2005-06-02 19:30:21 +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
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 7daaf1f100 (svn r2334) - Fix (regression): moved togglefullscreen into the video-driver, now windows works, dedicated works and sdl works. Also reverted the change to the makefile. 2005-05-16 16:19:32 +00:00
Darkvater 2aa94201dc (svn r2310) - Fix: Game would crash if you full-screened with the 'fullscreen' button than chose a resolution from the dropdown box that was no longer valid. Big thanks to DaleStan for track down the crashing bug.
- Fix: There would be duplicate entries in the resolutions dropdown box. Copy SDL method or removing duplicates and sort the list.
- Feature: in the settings menu, you don't have to click on the arrows anymore, clicking on the dropdown box itself has the same effect. Consistent with other dropdowns in the game
2005-05-14 21:01:57 +00:00
darkvater 860242b811 (svn r2190) - Fix: [1179424] '.. (Parent directory)' does not show up in the root-directory anymore; win32 only (mgasterix) 2005-04-13 13:09:25 +00:00
darkvater dfe6c34bf1 (svn r2153) - Fix: [ 1173690 ] Path displaying as "C:\\" in saveload window win32-only (glx) 2005-04-05 21:09:36 +00:00
darkvater 6bca4c041a (svn r2100) - Fix: [1024703]: Infinite access for A:\ (win32). Patch [1171208]. Only requery drive(s) if the user changes a directory, also surpress the OS error box that pops up on some windows machines. Tron + glx (and me) 2005-03-28 13:30:51 +00:00
pasky 8acc24f000 (svn r2086) - Codechange: Two indentation fixes coming from Loic Guilloux' patch 1171208. 2005-03-27 15:12:26 +00:00
tron aba225c88d (svn r2084) Set the name for drive items 2005-03-27 10:35:01 +00:00
tron 742513d708 (svn r2076) Set the name for the parent directory to ".." 2005-03-26 18:04:42 +00:00
darkvater 602fda327f (svn r2052) - Fix Regression: ALT+F4 once again shuts down openttd in windows and F10, etc. is fixed. 2005-03-24 20:47:21 +00:00
tron 3763ec7652 (svn r2012) When making a savegame name, don't append the extension, if it is already there 2005-03-15 14:06:28 +00:00
tron f04780e66d (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch]) 2005-03-12 09:38:03 +00:00
tron 70be35f319 (svn r1999) r1990 broke savegame deletion, fix that [1161729] 2005-03-12 09:24:27 +00:00
tron d755b7908e (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome) 2005-03-11 14:14:54 +00:00
Darkvater a0ef37e7bc (svn r1986) - Fix: free _config_file when shutting down openttd. Strange that Valgrind didn't catch this, kudos to TrueLight
- Feature (small): new command-line option -c <config_file>. You can have OpenTTD load alternative config files with this setup, handy for servers, or for saves from other players if you don't want to rename your own config. This will have to do until all game-related settings are saved ingame. Couldn't find the SF patch, so credits to the guy that wrote it.
2005-03-10 21:44:17 +00:00
tron 8982342c54 (svn r1984) -Fix: [1155762] Don't try to open the non-existent menu, when F10 is pressed 2005-03-10 15:41:25 +00:00
tron 11ba413c4a (svn r1972) Several cleanups and fix some latent bugs 2005-03-09 16:56:26 +00:00
tron 34f14e657d (svn r1970) Fix some warnings which Cygwin showed 2005-03-09 11:49:34 +00:00
darkvater 0abd611c0a (svn r1907) - Fix: [ 1114261 ] Speeding up when pressing ALT+TAB (Windows) 2005-02-22 22:14:27 +00:00
Darkvater d865c55007 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
- Codechange: Introduction of Textbuf struct which not only holds physical data as length but also pixel-constrains (width) and information about the caret
- Codechange: Move Clipboard function to OS specific file. Currently only Windows has clipboard actions
- Feature: Editboxes, console and exit screen also accept the numeric-enter as a yes
- Feature: Navigation through text with cursor keys is possible, as well as arbitrary insertion (also paste) and deletion; both backspace and del keys. Functions DeleteTextBufferChar, InsertTextBufferChar and InsertTextBufferClipboard handle input and deletion. Navigation is done through MoveTextBufferPos.
- Fix: OTTD crash when opening 'add server' editbox
- CodeChange: fix up some stringwidth calculations in gfx.c. You can get the width in pixels of a character by calling GetCharacterWidth().
2005-02-21 18:59:54 +00:00
tron 4b2e34e0aa (svn r1850) Change the last consumers of str_buffr so they use local static buffers now and remove the global array str_buffr. 2005-02-08 17:31:13 +00:00
tron b1baa4ed8b (svn r1840) Repel str_buffr and use local buffers where possible 2005-02-07 12:32:35 +00:00
tron b2ae5b197e (svn r1821) Move generic string handling functions to string.[ch] and introduce stre{cpy,cat}, see string.h for their semantics 2005-02-06 13:41:02 +00:00
tron 7d3a576a7b (svn r1806) Add missing includes (see r1803) 2005-02-05 21:57:01 +00:00
tron 17ca2c49a5 (svn r1805) Teach the driver layer a few things about const correctness 2005-02-05 18:05:42 +00:00
darkvater 1527ef3db0 (svn r1734) - Fix: [ 1112253 ] hijacking of arrow keys, game also scrolled when it was out of focus (dominik) 2005-01-30 16:54:39 +00:00
darkvater 720b183017 (svn r1603) -Fix: unused variable in FormatTinyDate
-Fix: added void to all win32.c functions as well
2005-01-23 10:34:39 +00:00
dominik b119b6c474 (svn r1541) Fix: [ 1100767 ] fast forward in main menu 2005-01-16 13:59:07 +00:00
darkvater 633786f55e (svn r1529) -Feature: [1090950] Adding 16:10 resolutions for mainly laptops (doode) 2005-01-15 20:43:01 +00:00
darkvater 732c362dea (svn r1524) -"Feature": when windows exception tracker is enabled (release builds) and the game crashes for any reason any active log file is closed first. This ensures the log file and ingame debug messages can be used to debug a problem. Any *nix versions are welcome 2005-01-15 16:38:10 +00:00
darkvater ef3b9161f8 (svn r1523) -Fix: somehow mousewheel was disabled on windows using SDL; reenabled again
-Fix: added missing CDECL to ellipsis functions and changed VS6 project file to use _cdecl calling conventions (thx tamlin)
2005-01-15 15:48:05 +00:00
darkvater 5fac6142e8 (svn r1479) -Added highscore chart (accessible from the difficulty window) with top5 companies for a given difficulty (select the difficulty in the menu)
-Added endgame score on 1 jan 2051 where you are added to the highscore if sufficiently large points have been accumulated. Game is paused while
-These values are saved in hs.dat; added read/write functions for it
-Added code to delete all windows to show charts. There is one issue left: somehow a news-gui pops up in front of the the chart at the end of the game.
2005-01-11 00:54:06 +00:00
tron 8b7c1e94e1 (svn r1402) Trim trailing whitespace 2005-01-06 18:45:28 +00:00
miham 57852f6498 (svn r1297) Language fixes in the source.. (ln-) 2004-12-29 13:13:29 +00:00
darkvater b249954538 (svn r1266) -Fix: fix some cygwin/mingw warnings
-Note: when compiling with MinGW (-mno-cygwin) __MINGW32__ is defined; when compiling without it __CYGWIN32__ is defined. You need to set either -mno-cygwin (MinGW) or -mwin32 (Cygwin) to have WIN32 defined
2004-12-23 22:31:46 +00:00
darkvater ffed7d6834 (svn r1262) -Fix: [1088996] kill some warnings for MinGW (luzi82) 2004-12-23 20:23:05 +00:00
dominik 8c6c4e5262 (svn r1171) Fix: Console hotkey works again on keyboards where this key is a deadkey. 2004-12-19 13:28:09 +00:00
truelight 17a613546c (svn r1154) -Add: [Network] Forked dedicated server (start openttd with -Df) (GeniusDex) 2004-12-18 14:19:21 +00:00
dominik 64f98e058d (svn r1148) Fix: The console hotkey is finally working properly on all keyboards. It's the key on the top left corner 2004-12-17 23:32:54 +00:00
darkvater c58549d512 (svn r1093) -Fix: Hopefully fixed windows revision issues once and for all. Removed globalness of _openttd_revision and put all such ifdefs into one place. If server has a revision only the same revisions can join; if the server has no revision everyone can join. I reckon this should be a server-side option to allow people to join or not to join. 2004-12-15 00:31:08 +00:00
truelight b6c74c1c20 (svn r1090) -Fix: Made the _openttd_revision variable global, and with that
hopefully killed the windows-revision problem. If WITH_REV is defined, 
for both Windows as *nix system _openttd_revision is filled with normal 
info, else _openttd_revision is set to 'norev000'
-Fix: Small possible server-crash
2004-12-14 20:27:00 +00:00
darkvater 043b8bc5ad (svn r1079) -Fix: you can once again quit the game in windows by pressing ALT+F4 or the 'exit' button in the main menu. 2004-12-14 00:45:24 +00:00
dominik 77e882c3bd (svn r1076) Feature: Patch setting to autosave the game on exit
If you set autosave_on_exit = true in openttd.cfg, your game will be saved as exit.sav in the autosave folder and you won't be asked if you want to quit the game any more.
2004-12-13 22:10:12 +00:00
truelight b8f6d41418 (svn r942) -Merged branch/network back into the trunk 2004-12-04 17:54:56 +00:00