Commit Graph

172 Commits

Author SHA1 Message Date
glx c50cf74889 (svn r9852) [0.5] -Backport from trunk (r9728, r9834):
- Fix: [win32] Dead key and open/close console. (r9728)
- Add: win9x check in win32 builds
2007-05-15 22:00:41 +00:00
glx 64f7b3a059 (svn r9358) [0.5] -Backport from trunk (r9055, r9082, r9083, r9084, r9085, r9086):
- Codechange: Change windows unicode handling and allow a pure non-unicode build to function. (r9055)
- Codechange: [win32] Update VS2003 and VS2005 project files to build in UNICODE mode. When making a release it is probably better to make two binaries, one without UNICODE, the other with, guaranteeing full Win9x compatibility (UNICODE with MSLU also works, without it's even better). (r9082)
- Codechange: Be more lenient when trimming UTF-8 strings and don't terminate the string when an invalid encoding is encountered, but only focus on maximum length. (r9083)
- Fix: [win9x] Clipboard paste for Windows95 (doesn't have CF_UNICODETEXT) correctly converts the input to the current locale. (r9084)
- Fix: [win32] Move the initialisation of _codepage (non-UNICODE) to winMain as a dedicated server, or different video driver will not have a win32 messageloop. (r9085)
- Fix: [win32] Rewrite keyboard input and handle all keypresses in a WM_CHAR event. This saves us from doing translation (ToUnicode[Ex], ToAscii[Ex]), and we get free IME-input support as a plus. (r9086)
2007-03-20 00:02:18 +00:00
glx 3158cdaa7a (svn r9354) [0.5] -Backport from trunk (r8975, r9003, r9011, r9012):
-Regression: [win32] Possible buffer overflow if unicode text is pasted into an input box and needs trimming. (r8975)
-Codechange: Introduce a function Utf8PrevCharLen that finds the starting character of an UTF-8 sequence from a given position and returns the length to the first UTF-8 encoding byte of that sequence. (r9003)
-Codechange: Rework Utf8PrevChar so that it returns a pointer to the previous UTF8 character's first byte instead of a byte-length offset (r9011)
-Fix: When cutting strings into multiple lines also take into consideration whitespace characters of more than 1 byte length (eg IDEOGRAPHIC SPACE, IsWhitespace() function). When trimming such strings, account for multiple-byte long sequences so use *Utf8PrevChar(v) = '\0'. (r9012)
-Codechange: Add a function Utf8TrimString() that properly trims a string to an UTF8 encoding seperation instead of somewhere in the wild (and use it in the chat area) (r9012)
2007-03-19 21:42:05 +00:00
rubidium 6ad4716dc1 (svn r9349) [0.5] -Backport from trunk (r9043, r9062, r9064, r9070):
- Fix: the personal (.openttd) directories were hidden in the load/save directory listings (r9043)
- Fix: the station list, sorted by cargo rating, now takes stations into account that have no cargo waiting (r9062)
- Fix: don't keep on scrolling for non-numeric values in settings, but require reclick (r9064)
- Fix: when a bribe failed and you haven't picked up cargo yet, you would never be able to do so for a given station (r9070)
2007-03-19 20:17:24 +00:00
Darkvater 9321458918 (svn r8922) [0.5] -Backport from trunk (r8907, r8919, r8920, r8921):
- [OSX] Reading from an unitialized variable (r8907)
 - [Win9x] FindFile with C:\\* doesn't work, don't append a slash doubly (r8919)
 - Do not require to press 'Apply changes' in the newgrf GUI if the changes in there are not activated (this happens in the title screen) (r8920)
 - Possible crashes, problems with aircraft and airport removal (r8921)
2007-02-27 16:23:02 +00:00
Darkvater 9e3f020ae8 (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
- Unable to load TTDP (on *NIX) games (r8784)
 - Unable to browse directories on *nix if the filesystem is not in UTF-8 charset and special characters are used (r8821, r8823, r8824)
2007-02-24 01:21:31 +00:00
rubidium 1584e061eb (svn r8624) [0.5] -Backport from trunk (8239, 8240, 8315):
-Regression (r7278): Help window was empty for UNICODE builds 
-Fix (r8013): Put the output of -h to stdout and not to stderr (through ShowInfo) 
-Fix: use ShowInfo over fprintf(stderr, as Windows doesn't always have a stderr visible/available
2007-02-08 10:04:57 +00:00
Darkvater 1ec915e1c8 (svn r8228) [0.5] -Revert win32 changes 2007-01-18 00:52:33 +00:00
Darkvater b30c56d15a (svn r8227) [0.5] -Fix:?
- Prepare 0.5 branch for release. Update readme's, bugs, installers, changelog, etc. to 0.5.0-RC4
2007-01-18 00:50:56 +00:00
Darkvater 25059d28df (svn r8172) -Backport from trunk (r8013, r8134):
- Show error messages about our own data files as ShowInfo(F) and output console error to stderr and not stdout.
2007-01-17 00:05:51 +00:00
Darkvater b342991853 (svn r7953) -Backport from trunk (r7840, r7843):
- [win32] Update crash window text (+crash.dmp -submit)
2007-01-07 12:16:53 +00:00
Darkvater d85e9fe405 (svn r7500) -Fix (r7460): GetEnvironmentVariable and strncat take the number of characters and
not the number of bytes as an argument. Thanks Tron.
2006-12-15 15:21:13 +00:00
Darkvater aea6916e3a (svn r7468) -Codechange: [win32] Add some comments to MB/WIDE_TO_WIDE/MB_[BUFFER] macros and
use them some more in win32 code. Also for the clipboard use the convert_from_fs
 function instead of calling Win32 API directly. Make the static buffers in OTTD2FS
 and FS2OTTD the same size (character-length wise)
2006-12-10 11:46:43 +00:00
Darkvater ff5f9349c8 (svn r7467) -Cleanup: [win32] Disable the submit-savegame-on-crash code as we (webserver)
doesn't do anything with it and the button has been disabled for ages.
2006-12-10 11:40:31 +00:00
Darkvater 2158acb1ae (svn r7466) -Cleanup: [win32] Coding style, indentation, variable localization. 2006-12-10 11:37:22 +00:00
Darkvater 74106ce6e9 (svn r7460) -Fix (r7337): [win32] If the underlying OS didn't have support for SHGetFolderPath the
application failed to run. Now test if the function exists and if not try a different
 approach using our own OTTDSHGetFolderPath wrapper.
2006-12-09 23:55:56 +00:00
Darkvater f87c8834e2 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
it interferes with OS/2 symbol in libc (psmedley)
2006-12-09 10:56:12 +00:00
Darkvater b789cacb40 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
into a predefined buffer insted of using the static (global) buffer. This is useful if
 the converted value will be used later on; no need to copy it somewhere else to save it.
-CodeChange: [win32] Added appropiate macros WIDE_TO_MB_BUFFER, MB_TO_WIDE_BUFFER next to
 existing WIDE_TO_MB and MB_TO_WIDE that only do work when UNICODE is defined, saves
 #ifdefs all over the place
2006-12-03 17:47:53 +00:00
Darkvater d8d210056d (svn r7278) -Codechange: [win32] Add UNICODE support so it should compile on OS's using UNICODE
API exclusively.
2006-11-28 19:58:13 +00:00
Darkvater 4e71091137 (svn r7274) -Codechange [utf8]: Add input/output unicode support. This actually only changes win32
since it uses UTF16 for file access. To keep os-specific code to a minimum, OpenTTD
 uses UTF8 internally everywhere, converting to OS-type when needed (save/load/screenshot/etc.)
2006-11-28 14:42:31 +00:00
Darkvater c4d841dcdb (svn r7200) -Codechange: remove unneeded redraw (console.c), coding style, use FindWindowById
instead of _windows loop (viewport.c), remove dump-code (mixer.c), MSVC6 borkdness
 in stdafx.h, constness (viewport.c), variable localization (win32.c), comments (window.c)
2006-11-18 00:14:43 +00:00
peter1138 1a4f1c8177 (svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come. 2006-11-16 22:05:33 +00:00
Darkvater 87761ab2d9 (svn r6421) -Revert r6420: The dedicated server's console actually needs to work. It misses half the input at the moment. Sorry, too hasty commit. 2006-09-07 22:36:33 +00:00
Darkvater 67e9294b22 (svn r6420) -Feature [Win32]: Use an existing console if openttd was started from one.
Unfortunately this only works for WindowsXP or higher, all older MS-OS's
 are stuck with the old behaviour.
2006-09-07 21:52:21 +00:00
truelight 76bcaba601 (svn r6089) -Backport r6088: added -s (source) and -d (destination) to strgen (Darkvater) 2006-08-24 12:08:25 +00:00
rubidium d14ac4478d (svn r6086) -Fix: InteractiveRandom was not seeded properly resulting in the dedicated server always generating the same map. Thanks to the #openttdcoop team for detecting. 2006-08-24 10:19:59 +00:00
truelight 5fb6c9e1cc (svn r5974) -Codechange: added casts all around the place to make Windows 64bit happy (michi_cc) 2006-08-20 12:09:32 +00:00
truelight 10b842bddc (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
- New optional landscape generator (TerraGenesis Perlin)
  - Load heightmaps (either BMP or PNG)
  - Progress dialog while generating worlds (no longer a 'hanging' screen)
  - New dialogs for NewGame, Create Scenario and Play Heightmap
    - Easier to configure your landscape
    - More things to configure (tree-placer, ..)
  - Speedup of world generation
  - New console command 'restart': restart the map EXACTLY as it was when you
      first started it (needs a game made after or with this commit)
  - New console command 'getseed': get the seed of your map and share it with
      others (of course only works with generated maps)
  - Many new, world generation related, things
  - Many internal cleanups and rewrites
  Many tnx to those people who helped making this:
     Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic)
  Many tnx to those who helped testing:
     Arnau, Bjarni, and tokai (alfabetic)
  And to all other people who helped testing and sending comments / bugs
  Stats: 673 lines changed, 3534 new lines, 79 new strings
2006-08-19 10:00:30 +00:00
truelight 83d56d6d79 (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
allow certain patterns (like numbers only)
2006-08-19 09:31:22 +00:00
Darkvater 581476b7d2 (svn r5836) - Silence a warning on mingw. Thanks glx. 2006-08-10 17:28:13 +00:00
Darkvater 4ccdb04cd3 (svn r5831) - Fix (r5765): regression regarding windows filetimes. st->st_mtime's type time_t is only 64bit on windows64, so we need to convert it. 2006-08-10 09:10:41 +00:00
Darkvater adcaf779c4 (svn r5801) - Codechange: The exception dialog showed the last modification-date of win32.c instead of the last compilation-date. Use __DATE__ __TIME__ instead of __TIMESTAMP__; only affected windows not built with mingw/cygwin. 2006-08-07 11:31:27 +00:00
Darkvater 2a776775e5 (svn r5769) - Fix (r5762): fix some mistakes in the opendir code and filesize calculation. Thanks to Tron for noticing (and fixing). 2006-08-05 10:30:43 +00:00
Darkvater a9251d2d02 (svn r5767) - Cleanup: Improve upon the header file mess regarding fios. Move all relevant types from hal.h into fios.h, eliminate the unneccessary passing of a global variable, and extern variables in header files (declare in fios.c and misc_gui.c 2006-08-05 00:59:45 +00:00
Darkvater 198f6caf20 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText 2006-08-05 00:53:09 +00:00
Darkvater 525a0ad4c0 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks. 2006-08-05 00:47:32 +00:00
Darkvater ee7b3de2f5 (svn r5764) - Cleanup: - Cleanup: Move the now unified FiosAlloc, compare_FiosItems, FiosFreeSavegameList, FiosMakeSavegameName, FiosDelete and FileExists to newly created file fios.c where it belongs.
- Fix: forgot to remove GetLanguageList from functions.h in previous commit
2006-08-05 00:16:24 +00:00
Darkvater b5e3718ac4 (svn r5763) - Cleanup: Move the now unified GetLanguageList and comparator function to strings.c where it belongs. 2006-08-04 23:45:20 +00:00
Darkvater 4de30befae (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
- Add new header file fios.h that will be the place for all FIOS (game-list) types.
2006-08-04 23:41:13 +00:00
Darkvater 5bcaef5d86 (svn r5698) - Fix [r5697]: don't remove ctype include for win32.c; needed for toupper...ugh 2006-08-01 19:24:29 +00:00
Darkvater c5a3632929 (svn r5697) -Fix [r5684]: tolower() was undefined for certain architectures, strangly VS2003 didn't complain, VS2005 did. Thanks glx 2006-08-01 19:19:39 +00:00
belugas 2f6c73f098 (svn r5393) CodeChange : Little typo correction. Nothing spectacular. Only broke in MSVC 2006-06-28 03:29:14 +00:00
tron 2b27073156 (svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular 2006-06-27 21:25:53 +00:00
glx afee99ad06 (svn r4807) - Fix: win32 compilation was broken by r4802 2006-05-09 15:36:48 +00:00
Darkvater a665462cc1 (svn r4560) - Fix: (r3008) Remove VS2005 undefined vsnprintf() as it doesn't exist in the windows libraries (only _vsnprintf). This caused the bad function to be called that could result in non-properly terminated strings. Thanks for noticing Tron. 2006-04-23 22:28:26 +00:00
Darkvater b68b9b149a (svn r4301) - Fix: the maxlength parameter of Textbuf is supposed to be the size of the buffer (so length of string + '\0'), but in the code it was a mix of both. It didn't cause any problems though, only an occasionaly one-less character than allowed. (thanks Tron for noticing) 2006-04-06 19:11:41 +00:00
orudge fa467d2f58 (svn r4203) - Fix compilation on mingw32 (stdint.h not included) 2006-03-31 15:34:22 +00:00
Darkvater a91c52e169 (svn r4125) - Feature: Add a general TIC() TOC() mechanism using rdtsc or something similar on non-i386 architectures to performance-tune (critical) code. Some systems are probably missing, but those can be added later. 2006-03-26 21:15:09 +00:00
Darkvater 4125aa21f8 (svn r4124) - CodeChange: remove windows-specific code from initializing the random generator. There was no need for it. 2006-03-26 21:13:16 +00:00
Darkvater 9b5d8a9921 (svn r4105) - Feature: Add proper ISO-8859-15 <> LOCALCODE conversion. As the mess that is makefile can't properly support it at the moment, it is only available for MACOSX. Windows doesn't need FS conversion and I have no idea about OS/2 so it's disabled for them.
- CodeChange: Change the function GetCurrentLocale(). It returns the locale from some default environment-variables, plus a custom one defined as parameter. If all fail, it tries $LANG.
2006-03-25 09:22:10 +00:00