From d0583ff075854738524f0eadf988d0480000a894 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 3 Mar 2010 23:24:37 +0000 Subject: [PATCH] (svn r19312) [1.0] -Backport from trunk: - Feature: [YAPF] Consider the railtype imposed speed limit for pathfinding (r19301) - Change: Increase the default small font size for freetype fonts as 6 point fonts are usually unreadable [FS#3655] (r19308) - Change: [NewGRF] Railtype cost factor from byte to word value (r19306) - Fix: Disable sound when a sound error happens instead of crashing [FS#3652] (r19304) --- bin/gm/orig_win.obm | 4 +-- changelog.txt | 38 +++++++++++++++++++++++++++++ known-bugs.txt | 8 ++++-- os/debian/changelog | 6 +++++ os/os2/installer/make_installer.cmd | 2 +- os/windows/installer/install.nsi | 4 +-- readme.txt | 4 +-- src/newgrf.cpp | 4 +-- src/pathfinder/follow_track.hpp | 7 +++++- src/rail.h | 2 +- src/sound/win32_s.cpp | 24 ++++++++++++------ src/table/settings.h | 2 +- 12 files changed, 83 insertions(+), 22 deletions(-) diff --git a/bin/gm/orig_win.obm b/bin/gm/orig_win.obm index 4b32a4beba..bd98989572 100644 --- a/bin/gm/orig_win.obm +++ b/bin/gm/orig_win.obm @@ -13,8 +13,8 @@ description.bg_BG = Оригинална музика на Transport Tycoon Delu description.ca_ES = Música Original de Transport Tycoon Deluxe per a Windows. description.cs_CZ = Původní hudba Transport Tycoon Deluxe (verze pro Windows). description.de_DE = Original Transport Tycoon Deluxe Windows Musikset. -description.en_GB = Original Transport Tycoon Deluxe Windows edition sounds. -description.en_US = Original Transport Tycoon Deluxe Windows edition sounds. +description.en_GB = Original Transport Tycoon Deluxe Windows edition music. +description.en_US = Original Transport Tycoon Deluxe Windows edition music. description.es_ES = Música original de Transport Tycoon Deluxe versión Windows. description.fi_FI = Alkuperäinen Transport Tycoon Deluxe Windows musiikki. description.fr_FR = Musiques originales de Transport Tycoon Deluxe (version Windows). diff --git a/changelog.txt b/changelog.txt index 1450618b33..392ac1da5c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,41 @@ +1.0.0-RC2 (2010-03-04) +------------------------------------------------------------------------ +- Feature: [YAPF] Consider the railtype imposed speed limit for pathfinding (r19301) +- Feature: BaNaNaS support for music sets (r19262) +- Feature: [NewGRF] Add 2 bits of pseudo-random data for rail types, based on tile location (r19235) +- Feature: [Windows] Add OpenMSX to the installer (r19220, r19219) +- Feature: [NewGRF] Add CB36 support for aircraft properties 0F and 11 (r19218) +- Feature: Scroll to current order destination when ctrl+clicking the start/stop bar (r19216, r19215) +- Feature: Concept of fallback base sets, i.e. do not automatically load the NoMusic/NoSound sets when there is another set; make NoSound part of base installations (r19214, r19213, r19212, r19211, r19206) +- Feature: Support for genders for cargos, industries, vehicles, stations (r19180, r19179, r19178, r19177) +- Change: Increase the default small font size for freetype fonts as 6 point fonts are usually unreadable [FS#3655] (r19308) +- Change: [NewGRF] Railtype cost factor from byte to word value (r19306) +- Change: Improve error message with track building when signals are in the way (r19190, r19189) +- Change: Do not print the absolute path to AI script files in the AI debug window, use the relative path from /ai/ instead (r19166) +- Change: The Debian packaging; bring it in sync with the packaging used at Debian excluding package splitting (r19162) +- Fix: [Windows] Disable sound when a sound error happens instead of crashing [FS#3652] (r19304) +- Fix: [NewGRF] Return the TTD airport type in station var 0xF1 (r19299) +- Fix: [NewGRF] Segfault when station vars 0xF2/0xF3 is accessed when there is no truck/bus stop (r19298) +- Fix: [NoAI] Some methods of AIAbstractList left invalid iterators [FS#3566] (r19293) +- Fix: [YAPP] If reversing at path signals was disabled, a train would not reverse when hitting the back of an one-way signal (r19286) +- Fix: [NewGRF] Ensure prices cannot be set to zero. Zero prices break a lot of the internal logic to determine whether something has been done [FS#3646] (r19277) +- Fix: 'Cannot build here... in the way' showed the to-be-built industry twice, instead of the to-be-built industry and the industry that is in the way [FS#3618] (r19265) +- Fix: Writing (console) output to a file failed on Windows if the date would not be logged [FS#3639] (r19252) +- Fix: [NewGRF] Some GRF error messages did not free the previous error messages, creating a memory leak (r19251) +- Fix: With RTL languages clicking a horizontal scrollbar that could not scroll could cause a crash [FS#3643] (r19250) +- Fix: Start and end tiles were swapped in CMD_REMOVE_LONG_ROAD causing too much road to be removed [FS#3642] (r19249) +- Fix: DOS 'port' did not compile anymore (r19248) +- Fix: The -M command line option did not work (r19233) +- Fix: GetDestination() is invalid for nearest-depot orders (r19210) +- Fix: Compilation was broken for gcc 3.3 (r19207) +- Fix: The vehicle info in the autoreplace gui was drawn even when the window was shaded [FS#3634] (r19187) +- Fix: When selecting 'build many industries' in the scenario editor the 'build' button was not enabled [FS#3632] (r19176) +- Fix: Buoys are no Stations, only BaseStations (r19174) +- Fix: Under some circumstances timidity (via extmidi) would not shut down properly causing all kinds of trouble (e.g. blocked audio output). Try harder to shut down timidity and first shut down the music so shut down order is the inverse of initialisation order (r19168) +- Fix: Industry 0 could be choosen even if not available [FS#3631] (r19167) +- Fix: Vehicle running costs should not be changed in a running game [FS#3629] (r19165) + + 1.0.0-RC1 (2010-02-18) ------------------------------------------------------------------------ - Feature: Allow to select different land colours for the smallmap (r19064) diff --git a/known-bugs.txt b/known-bugs.txt index 9c5700d812..460a196942 100644 --- a/known-bugs.txt +++ b/known-bugs.txt @@ -1,6 +1,6 @@ OpenTTD's known bugs -Last updated: 2010-02-18 -Release version: 1.0.0-RC1 +Last updated: 2010-03-04 +Release version: 1.0.0-RC2 ------------------------------------------------------------------------ @@ -34,6 +34,10 @@ that you can find at: http://bugs.openttd.org If the bugs are closed but still listed here it means that the bug is fixed and that the nightlies and next major release will not have that bug. +- 3651 [OSX] Crash when selecting full screen +- 3648 [OSX] Crash when selecting music +- 3637 Second highest competing station gets penalised twice +- 3546 Ignoring signals might crash trains - 3447 [OSX] SDL port is unuseable - 2782 [OSX] Port hopelessly outdated - 2585 [OSX] OS' mouse pointer showing diff --git a/os/debian/changelog b/os/debian/changelog index 8a288afe91..cf7996a31a 100644 --- a/os/debian/changelog +++ b/os/debian/changelog @@ -1,3 +1,9 @@ +openttd (1.0.0~RC2) unstable; urgency=low + + * New upstream release. + + -- Matthijs Kooijman Thu, 04 Mar 2010 00:01:02 +0100 + openttd (1.0.0~RC1) unstable; urgency=low * New upstream release. diff --git a/os/os2/installer/make_installer.cmd b/os/os2/installer/make_installer.cmd index 3455f586cd..88a6c56c58 100644 --- a/os/os2/installer/make_installer.cmd +++ b/os/os2/installer/make_installer.cmd @@ -1,6 +1,6 @@ @echo off -set OPENTTD_VERSION=1.0.0-RC1 +set OPENTTD_VERSION=1.0.0-RC2 set OPENSFX_VERSION=0.8.0 set NOSOUND_VERSION=0.8.0 set OPENGFX_VERSION=0.7.0 diff --git a/os/windows/installer/install.nsi b/os/windows/installer/install.nsi index 43b86890b6..215e1881bf 100644 --- a/os/windows/installer/install.nsi +++ b/os/windows/installer/install.nsi @@ -2,8 +2,8 @@ !define APPV_MAJOR 1 !define APPV_MINOR 0 !define APPV_MAINT 0 -!define APPV_BUILD 4 -!define APPV_EXTRA "-RC1" +!define APPV_BUILD 5 +!define APPV_EXTRA "-RC2" !define APPNAME "OpenTTD" ; Define application name !define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version diff --git a/readme.txt b/readme.txt index d463d09ab3..0c33e7f49d 100644 --- a/readme.txt +++ b/readme.txt @@ -1,6 +1,6 @@ OpenTTD README -Last updated: 2010-02-18 -Release version: 1.0.0-RC1 +Last updated: 2010-03-04 +Release version: 1.0.0-RC2 ------------------------------------------------------------------------ diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 571d49c269..d0af3cb11f 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2571,7 +2571,7 @@ static ChangeInfoResult RailTypeChangeInfo(uint id, int numinfo, int prop, ByteR break; case 0x13: // Construction cost factor - rti->cost_multiplier = buf->ReadByte(); + rti->cost_multiplier = buf->ReadWord(); break; case 0x14: // Speed limit @@ -2622,6 +2622,7 @@ static ChangeInfoResult RailTypeReserveInfo(uint id, int numinfo, int prop, Byte case 0x0B: // Build window caption case 0x0C: // Autoreplace text case 0x0D: // New loco + case 0x13: // Construction cost case 0x14: // Speed limit buf->ReadWord(); break; @@ -2634,7 +2635,6 @@ static ChangeInfoResult RailTypeReserveInfo(uint id, int numinfo, int prop, Byte case 0x10: // Rail Type flags case 0x11: // Curve speed advantage case 0x12: // Station graphic - case 0x13: // Construction cost case 0x15: // Acceleration model buf->ReadByte(); break; diff --git a/src/pathfinder/follow_track.hpp b/src/pathfinder/follow_track.hpp index 4c0fa7805a..6fdebc3e6d 100644 --- a/src/pathfinder/follow_track.hpp +++ b/src/pathfinder/follow_track.hpp @@ -428,12 +428,17 @@ public: int min_speed = 0; int max_speed = INT_MAX; // no limit - /* for now we handle only on-bridge speed limit */ + /* Check for on-bridge speed limit */ if (!IsWaterTT() && IsBridgeTile(m_old_tile)) { int spd = GetBridgeSpec(GetBridgeType(m_old_tile))->speed; if (IsRoadTT()) spd *= 2; if (max_speed > spd) max_speed = spd; } + /* Check for speed limit imposed by railtype */ + if (IsRailTT()) { + uint16 rail_speed = GetRailTypeInfo(GetRailType(m_old_tile))->max_speed; + if (rail_speed > 0) max_speed = min(max_speed, rail_speed); + } /* if min speed was requested, return it */ if (pmin_speed) *pmin_speed = min_speed; diff --git a/src/rail.h b/src/rail.h index 8caf2573dc..049e4286e3 100644 --- a/src/rail.h +++ b/src/rail.h @@ -186,7 +186,7 @@ struct RailtypeInfo { /** * Cost multiplier for building this rail type */ - uint8 cost_multiplier; + uint16 cost_multiplier; /** * Acceleration type of this rail type diff --git a/src/sound/win32_s.cpp b/src/sound/win32_s.cpp index b770224dc0..c0e5da5d20 100644 --- a/src/sound/win32_s.cpp +++ b/src/sound/win32_s.cpp @@ -33,7 +33,7 @@ static void PrepareHeader(WAVEHDR *hdr) hdr->dwBufferLength = _bufsize * 4; hdr->dwFlags = 0; hdr->lpData = MallocT(_bufsize * 4); - if (waveOutPrepareHeader(_waveout, hdr, sizeof(WAVEHDR)) != MMSYSERR_NOERROR) usererror("waveOutPrepareHeader failed"); + if (waveOutPrepareHeader(_waveout, hdr, sizeof(WAVEHDR)) != MMSYSERR_NOERROR) throw "waveOutPrepareHeader failed"; } static DWORD WINAPI SoundThread(LPVOID arg) @@ -42,7 +42,10 @@ static DWORD WINAPI SoundThread(LPVOID arg) for (WAVEHDR *hdr = _wave_hdr; hdr != endof(_wave_hdr); hdr++) { if ((hdr->dwFlags & WHDR_INQUEUE) != 0) continue; MxMixSamples(hdr->lpData, hdr->dwBufferLength / 4); - if (waveOutWrite(_waveout, hdr, sizeof(WAVEHDR)) != MMSYSERR_NOERROR) usererror("waveOutWrite failed"); + if (waveOutWrite(_waveout, hdr, sizeof(WAVEHDR)) != MMSYSERR_NOERROR) { + MessageBox(NULL, _T("Sounds are disabled until restart."), _T("waveOutWrite failed"), MB_ICONINFORMATION); + return 0; + } } WaitForSingleObject(_event, INFINITE); } while (_waveout != NULL); @@ -62,16 +65,21 @@ const char *SoundDriver_Win32::Start(const char * const *parm) _bufsize = GetDriverParamInt(parm, "bufsize", (GB(GetVersion(), 0, 8) > 5) ? 8192 : 4096); - if (NULL == (_event = CreateEvent(NULL, FALSE, FALSE, NULL))) return "Failed to create event"; + try { + if (NULL == (_event = CreateEvent(NULL, FALSE, FALSE, NULL))) throw "Failed to create event"; - if (waveOutOpen(&_waveout, WAVE_MAPPER, &wfex, (DWORD_PTR)_event, 0, CALLBACK_EVENT) != MMSYSERR_NOERROR) return "waveOutOpen failed"; + if (waveOutOpen(&_waveout, WAVE_MAPPER, &wfex, (DWORD_PTR)_event, 0, CALLBACK_EVENT) != MMSYSERR_NOERROR) throw "waveOutOpen failed"; - MxInitialize(wfex.nSamplesPerSec); + MxInitialize(wfex.nSamplesPerSec); - PrepareHeader(&_wave_hdr[0]); - PrepareHeader(&_wave_hdr[1]); + PrepareHeader(&_wave_hdr[0]); + PrepareHeader(&_wave_hdr[1]); - if (NULL == (_thread = CreateThread(NULL, 8192, SoundThread, 0, 0, &_threadId))) return "Failed to create thread"; + if (NULL == (_thread = CreateThread(NULL, 8192, SoundThread, 0, 0, &_threadId))) throw "Failed to create thread"; + } catch (char *error) { + this->Stop(); + return error; + } return NULL; } diff --git a/src/table/settings.h b/src/table/settings.h index 745c100dcd..81b7a7a9d4 100644 --- a/src/table/settings.h +++ b/src/table/settings.h @@ -262,7 +262,7 @@ static const SettingDescGlobVarList _misc_settings[] = { SDTG_STR("small_font", SLE_STRB, S, 0, _freetype.small_font, NULL, STR_NULL, NULL), SDTG_STR("medium_font", SLE_STRB, S, 0, _freetype.medium_font, NULL, STR_NULL, NULL), SDTG_STR("large_font", SLE_STRB, S, 0, _freetype.large_font, NULL, STR_NULL, NULL), - SDTG_VAR("small_size", SLE_UINT, S, 0, _freetype.small_size, 6, 0, 72, 0, STR_NULL, NULL), + SDTG_VAR("small_size", SLE_UINT, S, 0, _freetype.small_size, 8, 0, 72, 0, STR_NULL, NULL), SDTG_VAR("medium_size", SLE_UINT, S, 0, _freetype.medium_size, 10, 0, 72, 0, STR_NULL, NULL), SDTG_VAR("large_size", SLE_UINT, S, 0, _freetype.large_size, 16, 0, 72, 0, STR_NULL, NULL), SDTG_BOOL("small_aa", S, 0, _freetype.small_aa, false, STR_NULL, NULL),