diff --git a/changelog.txt b/changelog.txt index 35236f6ab3..fb4c206f9b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,16 @@ +0.6.0???? (2008-03-??) +------------------------------------------------------------------------ +- Fix: Timetable times for aircraft were always doubled [FS#1883] (r12477) +- Fix: Remove broken endian-dependent code and unnecessary rgb to bgr swapping [FS#1880] (r12453) +- Fix: Do not 'disable' the drawing of autorail overlays when the tile is 'error'-marked (red pulsating selection) [FS#1871] (r12439) +- Fix: Plural rule for Icelandic was wrong (r12417) + + 0.6.0-RC1 (2008-03-26) ------------------------------------------------------------------------ - Feature: Show whether a town is a "city" in the town description title bar (r12391) - Feature: Increase house animation frame number from 32 to 128 (r12347) +- Fix: Loading of TTD savegames (r12399, r12401) - Fix: Vehicle lists related to stations not closed when the station is deleted [FS#1872] (r12393) - Fix: Trams failing to turn on bridge heads/tunnel entrances [FS#1851] (r123890) - Fix: Train could break apart when reversed while partially in a depot [FS#1841] (r12386, r12384) @@ -25,7 +34,7 @@ - Fix: Do not try to flood water tile [FS#1836] (r12350) - Fix: NTP skipped junction just after bridge end (r12348) - Fix: Remove duplicated and inconsistent code wrt. autoreplace with rules in both vehicles' group and ALL_GROUP [FS#1748, FS#1825] (r12346) -- Fix: Don't try to restore backupped timetable when timetabling is disabled [FS#1828] (r12345) +- Fix: Don't try to restore backupped timetable when timetabling is disabled [FS#1828] (r12345) - Fix: Slow helicopters never got the 'chance' to finish the landing routine (r12343) - Fix: GRM buffer for cargos was incorrect size [FS#1827] (r12341) - Fix: Recalculate cached train data after clearing reversing flag when entering depot (r12339) @@ -48,7 +57,7 @@ - Fix: Include prop 25 data for all train parts, not just those that carry cargo (r12314) - Fix: YAPF and NTP did not apply penalty for uphill tracks on steep slopes (r12313) - Fix: Restore timetable from backupped orders and add group ID to the backup [FS#1549] (r12296) -- Fix: Do not draw trees nor lamps between tram tracks (r12290) [FS#1807] +- Fix: Do not draw trees nor lamps between tram tracks (r12290) [FS#1807] - Fix: [Win32] Do not create save dir on install (r12269) - Fix: Autoreplace did not update vehicle index for timetable window [FS#1805] (r12261) - Fix: GetProductionAroundTiles() may fail if only the second production slot exists (r12258) @@ -59,7 +68,7 @@ - Fix: When loading a savegame fails, do not start creating a new game, just go straight back to the intro screen (r12202) - Fix: Force AI to build rail or road instead of bridges if possible, so it doesn't build bridges everywhere (r12200) - Fix: "Transparent buildings" now only toggles buildings, so show tick when buildings are transparent [FS#1789] (r12198) -- Fix: Show correct last year profit when the train had negative income [FS#1788] (r12197) +- Fix: Show correct last year profit when the train had negative income [FS#1788] (r12197) - Fix: There can be oil rigs at map borders, do not set water class for them [FS#1787] (r12195) - Fix: Do not start overtaking if the RV reaches wrong-way one-way-road in the next tiles (r12191) - Fix: Assert when trying to play tile sound at NW border of map (placing buyos, leveling land) [FS#1784] (r12186) diff --git a/os/mandrake/README.urpmi b/os/mandrake/README.urpmi deleted file mode 100644 index 0c8385e66c..0000000000 --- a/os/mandrake/README.urpmi +++ /dev/null @@ -1,9 +0,0 @@ -You require the data files of the original Transport Tycoon Deluxe -for Windows to play the game. You have to manually copy the following -files to %{_gamesdatadir}/openttd/data/ -sample.cat -trg1r.grf -trgcr.grf -trghr.grf -trgir.grf -trgtr.grf diff --git a/os/mandrake/openttd.spec b/os/mandrake/openttd.spec deleted file mode 100644 index 96d666a9c4..0000000000 --- a/os/mandrake/openttd.spec +++ /dev/null @@ -1,146 +0,0 @@ -#------------------------------------------------------------------------------ -# openttd.spec -# This SPEC file controls the building of custom OpenTTD RPM -# packages. -#------------------------------------------------------------------------------ - -%define name openttd -%define version 0.5.0 -%define release 1mdk - -#------------------------------------------------------------------------------ -# Prologue information -#------------------------------------------------------------------------------ -Name: %{name} -Version: %{version} -Release: %{release} -Summary: An open source clone of the Microprose game "Transport Tycoon Deluxe" -Group: Games/Strategy -License: GPL - -URL: http://www.openttd.org - -Source: %{name}-%{version}.tar.gz -Packager: Dominik Scherer -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot -BuildRequires: libSDL1.2-devel >= 1.2.7 -BuildRequires: libpng3-devel >= 1.2.5 -BuildRequires: zlib1-devel >= 1.2.1 - -#------------------------------------------------------------------------------ -# Description -#------------------------------------------------------------------------------ -%description -An enhanced open source clone of the Microprose game "Transport Tycoon Deluxe". -You require the data files of the original Transport Tycoon Deluxe -for Windows to play the game. You have to MANUALLY copy them to the -game data directory! - -#------------------------------------------------------------------------------ -# install scripts -#------------------------------------------------------------------------------ -%prep -rm -rf $RPM_BUILD_ROOT -%setup - -%build -make BINARY_DIR=%{_gamesbindir} PREFIX=%{_gamesdatadir} DATA_DIR=openttd INSTALL_DIR=%{_gamesdatadir}/openttd/ USE_HOMEDIR=1 PERSONAL_DIR=.openttd INSTALL=1 RELEASE=%{version} - -%install -mkdir -p $RPM_BUILD_ROOT%{_gamesbindir} -mkdir -p $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/lang -mkdir -p $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/data -mkdir -p $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/scenario - -cp ./openttd $RPM_BUILD_ROOT%{_gamesbindir}/ -cp -r ./lang/*.lng $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/lang/ -cp -r ./data/*.grf $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/data/ -cp -r ./scenario/*.scn $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/scenario/ -cp -r ./data/opntitle.dat $RPM_BUILD_ROOT%{_gamesdatadir}/openttd/data/ - -# icon -install -m644 media/openttd.32.png -D $RPM_BUILD_ROOT%{_miconsdir}/%{name}.png -install -m644 media/openttd.64.png -D $RPM_BUILD_ROOT%{_iconsdir}/%{name}.png -install -m644 media/openttd.128.png -D $RPM_BUILD_ROOT%{_liconsdir}/%{name}.png - -# menu entry -mkdir -p $RPM_BUILD_ROOT/%{_menudir} -cat << EOF > $RPM_BUILD_ROOT/%{_menudir}/%{name} -?package(%{name}):command="%{_gamesbindir}/openttd" icon="%{name}.png" \ - needs="X11" section="Amusement/Strategy" title="OpenTTD" \ - longtitle="%{Summary}" -EOF - -%clean -rm -rf $RPM_BUILD_ROOT - -%post -%{update_menus} - -%postun -%{clean_menus} - -#------------------------------------------------------------------------------ -# Files listing. -#------------------------------------------------------------------------------ -%files -%defattr(-,root,root,0755) -%{_gamesbindir}/openttd - -%{_gamesdatadir}/openttd/lang/american.lng -%{_gamesdatadir}/openttd/lang/catalan.lng -%{_gamesdatadir}/openttd/lang/czech.lng -%{_gamesdatadir}/openttd/lang/danish.lng -%{_gamesdatadir}/openttd/lang/dutch.lng -%{_gamesdatadir}/openttd/lang/english.lng -%{_gamesdatadir}/openttd/lang/finnish.lng -%{_gamesdatadir}/openttd/lang/french.lng -%{_gamesdatadir}/openttd/lang/galician.lng -%{_gamesdatadir}/openttd/lang/german.lng -%{_gamesdatadir}/openttd/lang/hungarian.lng -%{_gamesdatadir}/openttd/lang/icelandic.lng -%{_gamesdatadir}/openttd/lang/italian.lng -%{_gamesdatadir}/openttd/lang/norwegian.lng -%{_gamesdatadir}/openttd/lang/origveh.lng -%{_gamesdatadir}/openttd/lang/polish.lng -%{_gamesdatadir}/openttd/lang/portuguese.lng -%{_gamesdatadir}/openttd/lang/romanian.lng -%{_gamesdatadir}/openttd/lang/slovak.lng -%{_gamesdatadir}/openttd/lang/spanish.lng -%{_gamesdatadir}/openttd/lang/swedish.lng - -%{_gamesdatadir}/openttd/data/autorail.grf -%{_gamesdatadir}/openttd/data/canalsw.grf -%{_gamesdatadir}/openttd/data/openttd.grf -%{_gamesdatadir}/openttd/data/opntitle.dat -%{_gamesdatadir}/openttd/data/signalsw.grf -%{_gamesdatadir}/openttd/data/trkfoundw.grf - -"%{_gamesdatadir}/openttd/scenario/Linkgame Islands 2004.scn" -"%{_gamesdatadir}/openttd/scenario/Mountain Pass.scn" -"%{_gamesdatadir}/openttd/scenario/Volcano City.scn" - -%{_menudir}/%{name} -%{_iconsdir}/*.png -%{_miconsdir}/*.png -%{_liconsdir}/*.png - -%doc changelog.txt readme.txt COPYING os/linux/README.urpmi - -#------------------------------------------------------------------------------ -# Change Log -#------------------------------------------------------------------------------ -%changelog -* Sun Jan 23 2005 Dominik Scherer 0.3.6-1mdk -- Upgraded to 0.3.6 -- Structured and commented the spec file a bit (inspired by ScummVM) - -* Fri Dec 24 2004 Dominik Scherer 0.3.5-1mdk -- Upgraded to 0.3.5 -- Added a warning message about the additional required files (only displayed when installing via urpmi) - -* Wed Sep 15 2004 Dominik Scherer <> 0.3.4-1mdk -- Upgraded to 0.3.4 - -* Wed Jul 31 2004 Dominik Scherer <> 0.3.3-1mdk -- Initial release diff --git a/os/rpm/openttd.spec b/os/rpm/openttd.spec new file mode 100644 index 0000000000..c505453fbe --- /dev/null +++ b/os/rpm/openttd.spec @@ -0,0 +1,75 @@ +# +# spec file for package openttd (trunk) +# +# Copyright (c) 2007 The OpenTTD team. +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself +# +Name: openttd +Version: svn +Release: head +Group: Applications/Games +Source: %{name}-%{version}-%{release}.tar.gz +License: GPL +URL: http://www.openttd.org +Packager: Denis Burlaka +Summary: OpenTTD is an Open Source clone of Chris Sawyer's Transport Tycoon Deluxe +Requires: SDL zlib libpng freetype2 fontconfig +BuildRequires: gcc SDL-devel zlib-devel libpng-devel fontconfig-devel +%if %{_vendor}=="suse" +BuildRequires: freetype2-devel +%endif +%if %{_vendor}=="fedora" +BuildRequires: freetype-devel +%endif +%if %{_vendor}=="mandriva" +BuildRequires: libfreetype6-devel +%endif +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot +Prefix: /usr + +%description +OpenTTD is a clone of the Microprose game "Transport Tycoon Deluxe", a popular game originally written by Chris Sawyer. It attempts to mimic the original game as closely as possible while extending it with new features. + +OpenTTD is licensed under the GNU General Public License version 2.0. For more information, see the file 'COPYING' included with every release and source download of the game. + +%prep +%setup + +%build +./configure --prefix-dir=%{prefix} --binary-dir=bin --install-dir="$RPM_BUILD_ROOT" +make + +%install +make ROOT="$RPM_BUILD_ROOT" install + +mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications +cat << EOF > $RPM_BUILD_ROOT/%{_datadir}/applications/%{name}.desktop +[Desktop Entry] +Categories=Games; +Encoding=UTF-8 +Exec=/usr/bin/openttd +Name=OpenTTD +Icon=openttd.32 +Terminal=false +Type=Application +EOF + +%clean +rm -Rf "$RPM_BUILD_ROOT" + +%files +%dir %{_datadir}/games/%{name} +%dir %{_datadir}/games/%{name}/lang +%dir %{_datadir}/games/%{name}/data +%dir %{_datadir}/games/%{name}/gm +%dir %{_datadir}/games/%{name}/docs +%dir %{_datadir}/pixmaps +%defattr(644, root, games, 755) +%attr(755, root, games) %{_bindir}/%{name} +%{_datadir}/games/%{name}/lang/* +%{_datadir}/games/%{name}/data/* +%{_datadir}/games/%{name}/docs/* +%{_datadir}/pixmaps/* +%{_datadir}/applications/%{name}.desktop + diff --git a/os/suse/openttd.spec b/os/suse/openttd.spec deleted file mode 100644 index 431840b2f7..0000000000 Binary files a/os/suse/openttd.spec and /dev/null differ diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index c15ad0e0fb..8168e21443 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -2135,7 +2135,6 @@ static bool AirportFindFreeHelipad(Vehicle *v, const AirportFTAClass *apc) static void AircraftEventHandler(Vehicle *v, int loop) { v->tick_counter++; - v->current_order_time++; if (v->vehstatus & VS_CRASHED) { HandleCrashedAircraft(v); @@ -2172,6 +2171,8 @@ void Aircraft::Tick() AgeAircraftCargo(this); + this->current_order_time++; + for (uint i = 0; i != 2; i++) { AircraftEventHandler(this, i); if (this->type != VEH_AIRCRAFT) // In case it was deleted diff --git a/src/lang/icelandic.txt b/src/lang/icelandic.txt index 3efbd02080..262d675c6f 100644 --- a/src/lang/icelandic.txt +++ b/src/lang/icelandic.txt @@ -1,7 +1,7 @@ ##name Icelandic ##ownname Íslenska ##isocode is_IS -##plural 0 +##plural 9 ##gender karlkyn kvenkyn hvorugkyn # diff --git a/src/settings.cpp b/src/settings.cpp index e64b5cbcb9..06e63c787a 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1750,6 +1750,36 @@ static void NewsDisplaySaveConfig(IniFile *ini, const char *grpname, uint news_d } } +/** + * Save the version of OpenTTD to the ini file. + * @param ini the ini to write to + */ +static void SaveVersionInConfig(IniFile *ini) +{ + extern const char _openttd_revision[]; + extern uint32 _openttd_newgrf_version; + + IniGroup *group = ini_getgroup(ini, "version", -1); + + if (group == NULL) return; + group->item = NULL; + IniItem **item = &group->item; + + char version[9]; + snprintf(version, lengthof(version), "%08X", _openttd_newgrf_version); + + const char *versions[][2] = { + { "version_string", _openttd_revision }, + { "version_number", version } + }; + + for (uint i = 0; i < lengthof(versions); i++) { + *item = ini_item_alloc(group, versions[i][0], strlen(versions[i][0])); + (*item)->value = (char*)pool_strdup(&ini->pool, versions[i][1], strlen(versions[i][1])); + item = &(*item)->next; + } +} + /* Save a GRF configuration to the given group name */ static void GRFSaveConfig(IniFile *ini, const char *grpname, const GRFConfig *list) { @@ -1814,6 +1844,7 @@ void SaveToConfig() GRFSaveConfig(ini, "newgrf", _grfconfig_newgame); GRFSaveConfig(ini, "newgrf-static", _grfconfig_static); NewsDisplaySaveConfig(ini, "news_display", _news_display_opt); + SaveVersionInConfig(ini); ini_save(_config_file, ini); ini_free(ini); } diff --git a/src/spriteloader/png.cpp b/src/spriteloader/png.cpp index 2af9d02530..1041be7d5f 100644 --- a/src/spriteloader/png.cpp +++ b/src/spriteloader/png.cpp @@ -9,7 +9,6 @@ #include "../fileio.h" #include "../debug.h" #include "../core/alloc_func.hpp" -#include "../core/endian_func.hpp" #include "png.hpp" #include @@ -126,18 +125,8 @@ static bool LoadPNG(SpriteLoader::Sprite *sprite, const char *filename, uint32 i color_type = PNG_COLOR_TYPE_RGB; } -#ifdef TTD_LITTLE_ENDIAN - png_set_bgr(png_ptr); -#else - if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) png_set_swap_alpha(png_ptr); -#endif - if (color_type == PNG_COLOR_TYPE_RGB) { -#ifdef TTD_LITTLE_ENDIAN png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); -#else - png_set_filler(png_ptr, 0xff, PNG_FILLER_BEFORE); -#endif } pixelsize = sizeof(uint32); @@ -159,16 +148,16 @@ static bool LoadPNG(SpriteLoader::Sprite *sprite, const char *filename, uint32 i for (uint x = 0; x < info_ptr->width; x++) { if (mask) { if (row_pointer[x * sizeof(uint8)] != 0) { - dst[x].b = 0; - dst[x].g = 0; dst[x].r = 0; + dst[x].g = 0; + dst[x].b = 0; /* Alpha channel is used from the original image (to allow transparency in remap colors) */ dst[x].m = row_pointer[x * sizeof(uint8)]; } } else { - dst[x].b = row_pointer[x * sizeof(uint32) + 0]; + dst[x].r = row_pointer[x * sizeof(uint32) + 0]; dst[x].g = row_pointer[x * sizeof(uint32) + 1]; - dst[x].r = row_pointer[x * sizeof(uint32) + 2]; + dst[x].b = row_pointer[x * sizeof(uint32) + 2]; dst[x].a = row_pointer[x * sizeof(uint32) + 3]; dst[x].m = 0; } diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 1147e7aecc..d05f0e796a 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -103,7 +103,7 @@ static char _cases[MAX_NUM_CASES][16]; static int _numcases; // for each plural value, this is the number of plural forms. -static const byte _plural_form_counts[] = { 2, 1, 2, 3, 3, 3, 3, 3, 4 }; +static const byte _plural_form_counts[] = { 2, 1, 2, 3, 3, 3, 3, 3, 4, 2 }; static const char *_cur_ident; diff --git a/src/strings.cpp b/src/strings.cpp index 9338c99a4d..32f2a297cf 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -462,6 +462,12 @@ static int DeterminePluralForm(int64 cnt) * Slovenian */ case 8: return n % 100 == 1 ? 0 : n % 100 == 2 ? 1 : n % 100 == 3 || n % 100 == 4 ? 2 : 3; + + /* Two forms; singular used for everything ending in 1 but not in 11. + * Used in: + * Icelandic */ + case 9: + return n % 10 == 1 && n % 100 != 11 ? 0 : 1; } } diff --git a/src/viewport.cpp b/src/viewport.cpp index cc7b7a519a..ad9141b89b 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -941,10 +941,8 @@ static void DrawAutorailSelection(const TileInfo *ti, uint autorail_type) static void DrawTileSelection(const TileInfo *ti) { /* Draw a red error square? */ - if (_thd.redsq != 0 && _thd.redsq == ti->tile) { - DrawTileSelectionRect(ti, PALETTE_TILE_RED_PULSATING); - return; - } + bool is_redsq = _thd.redsq != 0 && _thd.redsq == ti->tile; + if (is_redsq) DrawTileSelectionRect(ti, PALETTE_TILE_RED_PULSATING); /* no selection active? */ if (_thd.drawstyle == 0) return; @@ -953,7 +951,7 @@ static void DrawTileSelection(const TileInfo *ti) if (IsInsideBS(ti->x, _thd.pos.x, _thd.size.x) && IsInsideBS(ti->y, _thd.pos.y, _thd.size.y)) { if (_thd.drawstyle & HT_RECT) { - DrawTileSelectionRect(ti, _thd.make_square_red ? PALETTE_SEL_TILE_RED : PAL_NONE); + if (!is_redsq) DrawTileSelectionRect(ti, _thd.make_square_red ? PALETTE_SEL_TILE_RED : PAL_NONE); } else if (_thd.drawstyle & HT_POINT) { /* Figure out the Z coordinate for the single dot. */ byte z = 0; @@ -994,7 +992,7 @@ static void DrawTileSelection(const TileInfo *ti) } /* Check if it's inside the outer area? */ - if (_thd.outersize.x && + if (!is_redsq && _thd.outersize.x && _thd.size.x < _thd.size.x + _thd.outersize.x && IsInsideBS(ti->x, _thd.pos.x + _thd.offs.x, _thd.size.x + _thd.outersize.x) && IsInsideBS(ti->y, _thd.pos.y + _thd.offs.y, _thd.size.y + _thd.outersize.y)) {