Commit Graph

220 Commits

Author SHA1 Message Date
rubidium 526b2ae81b (svn r10277) [0.5] -Backport from trunk (10116, r10128, r10130, r10131, r10137, r10138):
- Feature: console command to get the current game date (r10137)
- Fix: When you got a sufficiently small resolution, there is a possibility for a division by zero when a sound is played (r10138)
- Fix: When removing a dock, a ship will always try to reach the old location of the dock even when it cannot anymore because it the old location of the dock is now land instead of water [FS#810] (r10131)
- Fix: SetCurrentGrfLangID returned the wrong language ids for most languages (r10130)
2007-06-22 20:06:59 +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 4e3652f337 (svn r8625) [0.5] -Backport from trunk (8253, 8273, 8497, 8520 + 8542):
-Codechange: Be more strict about language generation and fail any languages not having the mandatory ##name, ##ownname and ##isocode pragma's.
-Fix: return value from clamp was ignored 
-Codechange: Increase the size of the sound/video/music-drivers to 32 bytes (instead of 16) so their actual parameters can be passed. Sound has for example 'bufsize' and 'hz'.
-Fix/Feature: requery gameservers that did not respond to their first query.
2007-02-08 10:19:03 +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 a4bab5f17f (svn r8175) -Backport from trunk (r8030, r8070, r8071, r8074):
- crash when removing a town in the scenario editor and the query tool is open for a town's tile (r8030)
 - (FS#537) heightmap crashes when rescaling, or using 24bpp bitmaps (r8070, r8074)
 - (FS#536) inauguration date of companies from TTDP games was wrong (r8071)
2007-01-17 00:29:16 +00:00
Darkvater 563857d5bd (svn r7945) -Backport from trunk (r7700):
- Caret randomly jumping back&forth for new randomseed (r7182)
2007-01-07 11:37:23 +00:00
Darkvater f3424f51bc (svn r7671) -Backport from trunk (r7560, r7561, r7566):
- No new company could join if 8 clients were connected in less than 8 companies (r7560).
 - [FS#431] internal and visible settings of autorenew could go out of sync (r8561).
 - Server told clients to start syncing from a bad position, causing asserts/crashes (r7566).
2006-12-30 23:20:00 +00:00
Darkvater 29ed5e55c7 (svn r7527) -Update appropiate files with release information for 0.5.0-RC1 2006-12-21 14:23:47 +00:00
Darkvater 9b9add65c3 (svn r7523) -Feature: Add the possibility to change the newgrf configuration of a running game.
This is only possible in SP (or in the intro menu). During game play you will
 get a confirmation window when applying the changes as some actions can crash
 OpenTTD and/or make your current game unplayable.
2006-12-21 10:29:16 +00:00
glx 3f6d5e2323 (svn r7479) -Fix r5946: don't lower non-existent widget 2006-12-11 17:11:44 +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 a518ecbabb (svn r7410) -Codechange/Fix: Remove useless and unfollowable programmatic-resize, and implement it
in a sane way. Correctly specify resize flags for windows and only manually change the
 widgets that the resize system cannot handle (eg centering). This changes r6562, and
 probably some other commits
2006-12-07 00:51:20 +00:00
rubidium 810e14cc21 (svn r7350) -Fix: do not handle the save game/scenario filename edit box when loading a game/scenario/heightmap. 2006-12-04 10:55:53 +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
peter1138 c079c83eb6 (svn r7250) -Codechange: Shuffle sprite loading and character width caching around a bit. This reduces the number of times the sprites are loaded from 5 to 2, just for the intro game. 2006-11-24 18:39:22 +00:00
Darkvater ba9f22cee6 (svn r7219) -Fix: Several warnings by gcc introduced in r7206 which MSVC found not of a problem. Thanks Tron 2006-11-19 22:24:18 +00:00
Darkvater 53f954edd3 (svn r7206) -Codechange: Remove (some of) the magic needed for windows that could be invalid after
a call to DeleteWindow() somewhere else. Also do some cleanup with AllowWindowDescFront()
2006-11-18 17:04:44 +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
KUDr f2cda44d2e (svn r7195) -Feature: [FS#297, optional elrails] New patches/vehicles option 'disable electrified railways'.
(original patch by maedhros, ideas: peter1138, Darkvater, Rubidium, Patrick, Eddi|zuHause, ..)
2006-11-17 19:31:44 +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
glx c8685b8c38 (svn r7143) -CodeChange: remove redondancy in saveload dialogs 2006-11-14 00:27:28 +00:00
Darkvater d50f6c8a8c (svn r7128) -Codechange: Replace magic numbers by magic enums (windowdesc positioning WDP_AUTO = -1) 2006-11-10 19:24:14 +00:00
belugas 54b0726d58 (svn r7083) -Fix 6631: Protect out of boundaries widget testing 2006-11-06 19:59:19 +00:00
peter1138 701c47fb4a (svn r7080) -Codechange: Remove negative array indexes, and only add ", " when needed, when building station acceptance lists. 2006-11-06 15:25:02 +00:00
Darkvater eadf788cc5 (svn r7022) -Fix [FS#292]: Properly guard against viewing company-sensitive information from
invalid players (eg spectators) which could lead to crashes.
2006-10-31 21:15:56 +00:00
Darkvater fce44a1ce7 (svn r7000) -Fix: Incorrect use of e->we.click when the event is a 'place'. This didn't cause any
bugs so far because the 'click' element was at the same position in the union for both
 events.
2006-10-28 23:47:00 +00:00
Darkvater bc3c56ffeb (svn r6957) -Cleanup: comments, coding style 2006-10-27 11:09:24 +00:00
Darkvater 98a98ab15e (svn r6954) -Feature: Constrain the drawing of a string inside an editbox to the dimensions of
the widget it is in. This allows for typing longer text into an editbox (if maxwidth
 allows of course) and scroll around properly.
2006-10-27 10:12:57 +00:00
Darkvater 93599c1be5 (svn r6938) -Codechange: Comments, typo, variable naming, whitespace, strecpy and simplification
of order_gui (only disable a single widget if not local player, all others aren't
 visible anyways).
2006-10-24 23:11:40 +00:00
Darkvater b63d946898 (svn r6937) -Codechange: Add an InitializeTextBuffer() function that handles setting up the
textbuffer instead of typing it out each and every time.
2006-10-24 22:57:44 +00:00
Darkvater 1e69ac550d (svn r6926) -Codechange: Rename WWT_4 to WWT_TEXTBTN_2 and WWT_6 to WWT_INSET (credits to peter1138
for the aptly found name)
-Codechange: Remove the explicit numbering from WindowWidgetTypes
2006-10-24 16:27:18 +00:00
Darkvater d303ef94b3 (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
WWT_IMGBTN must contain an image for drawing. Renamed WWT_PANEL_2 to WWT_IMGBTN_2
 because that is what it is. Added WWT_PUSHBTN that is either just a pushable button,
 or a textbutton, which text's drawn dynamically independent of widget.
2006-10-24 14:15:17 +00:00
Darkvater ee27bb497c (svn r6884) -Codechange: Add strict bounds checking in string formatting system.
The last parameter should point to the end of the buffer (eg lastof(buf))
 Courtesy of Tron.
2006-10-21 23:31:34 +00:00
Darkvater e550bccf15 (svn r6879) -Codechange: Remove the superflouos argument CharsetFilter parameter from HandleEditBoxKey
as the same information is present in querystr_d->afilter
-Also (&((querystr_d *)&WP(w, querystr_d))->text is the same as &WP(w, querystr_d).text
2006-10-21 22:50:57 +00:00
Darkvater 2d48fd2861 (svn r6821) -Codechange: For the measurement tool do not show the tooltip when the selection
is only a single tile. Seems this was a bit annoying to some ;)
2006-10-18 14:20:10 +00:00
Darkvater 6b6d908308 (svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an
actual playable player (< MAX_PLAYERS) or not.
2006-10-14 22:31:18 +00:00
Darkvater 0ae642b914 (svn r6758) -Feature: Add a measurement tool that will show dimensions and height
differences of various draggable tools (inspiration, concept and double
 checking by MeusH).
2006-10-12 15:13:40 +00:00
belugas 17eb65050b (svn r6631) -Codechange: Use accessors for click_state.
Another step toward merging XTDwidget.
The only two files not converted (window.h and widget.c) will be done at the very last commit)
2006-10-03 20:16:20 +00:00
bjarni f5d61a1c6f (svn r6569) -Fix r6562: fixed incorrect drawing of road vehicle depot 2006-09-29 10:54:59 +00:00
bjarni 4ccdb0686f (svn r6562) -Codechange: merged the vehicle list window widget arrays
It made no sense to maintain 8 nearly identically arrays when a single one can do the job
  Also made the two buttons always use half of the bottom width each, even when resizing
2006-09-28 23:05:03 +00:00
belugas 1c56a5ae0f (svn r6499) -Codechange: Finally, got "byte event" outside of the union WindowEvent, which is now a struct 2006-09-23 02:39:24 +00:00
Darkvater 3ccc87b376 (svn r6462) -Codechange: Have GetStringWidth() return width as well as the height bounding
box of the string. Therefore rename the function to GetStringBoundingRect()
 and have it return a BoundingRect type of width/height
2006-09-16 13:20:14 +00:00
Darkvater 516d412a77 (svn r6405) -Codechange: When showing tooltips, properly position the tooltip, considering
cursor size and cursor offset (hotspot). The maximum and minimum y-values
 for the tooltip are just below the mainbar and statusbar. Also, if the tooltip
 would be too low, flip it above the cursor.
2006-09-05 23:11:41 +00:00
Darkvater 2f6a4bc1a9 (svn r6169) -Codechange: Use GetString() instead of GetStringWithArgs() which should be
integral to strings.c
2006-08-27 10:04:33 +00:00
rubidium 480af9c917 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct. 2006-08-22 14:38:37 +00:00
rubidium 28a0843707 (svn r5999) -Feature: change the original date format to a 32 bits format based at the year 0.
The game date subsystem now allows someone to start in the year 0 and continue
up to the year 5 000 000. However, you currently cannot build anything before 
1920 as there is no newgrf support for dates before 1920 or after 2090 yet.
2006-08-20 18:40:57 +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
rubidium 3cab5f30c0 (svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
-Codechange: store all year related variables that are _not_ stored in a savegame/transported over the network in the same format as _cur_year
2006-08-16 11:39:55 +00:00
rubidium 1cc6e186f0 (svn r5918) -Cleanup: rename ConvertDayToYMD/ConvertYMDToDay as they really convert a Date to/from a YearMonthDay.
-Cleanup: swap ConvertDateToYMD's parameters to make the order consistent with the name of the function.
2006-08-15 16:49:48 +00:00