Changeset - r25891:90a4bf886d7d
[Not reviewed]
master
2 14 2
Patric Stout - 3 years ago 2021-08-14 16:28:35
truebrain@openttd.org
Change: rebrand 1.12.0 to 12.0

One question that keeps popping up: "when do we release 2.0?".
NewGRF will force that at least 1.16 will be 2.0, but to not wait
for this, let's drop the "1." and be for ever done with that
conversation.

We are following in the footstep of giants here.
18 files changed with 42 insertions and 36 deletions:
0 comments (0 inline, 0 general)
CMakeLists.txt
Show inline comments
 
cmake_minimum_required(VERSION 3.9)
 

	
 
if(NOT BINARY_NAME)
 
    set(BINARY_NAME openttd)
 
endif()
 

	
 
project(${BINARY_NAME}
 
    VERSION 1.12.0
 
    VERSION 12.0
 
)
 

	
 
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
 
    message(FATAL_ERROR "In-source builds not allowed. Please run \"cmake ..\" from the build directory. You may need to delete \"${CMAKE_SOURCE_DIR}/CMakeCache.txt\" first.")
 
endif()
 

	
 
# Debug mode by default.
 
if(NOT CMAKE_BUILD_TYPE)
 
    set(CMAKE_BUILD_TYPE Debug)
 
endif()
 

	
 
if (EMSCRIPTEN)
 
@@ -67,25 +67,24 @@ endif()
 
list(APPEND GENERATED_SOURCE_FILES "${CMAKE_BINARY_DIR}/generated/rev.cpp")
 
if(WIN32)
 
    list(APPEND GENERATED_SOURCE_FILES "${CMAKE_BINARY_DIR}/generated/ottdres.rc")
 
endif()
 

	
 
# Generate a target to determine version, which is execute every 'make' run
 
add_custom_target(find_version
 
        ${CMAKE_COMMAND}
 
                -DFIND_VERSION_BINARY_DIR=${CMAKE_BINARY_DIR}/generated
 
                -DCPACK_BINARY_DIR=${CMAKE_BINARY_DIR}
 
                -DREV_MAJOR=${PROJECT_VERSION_MAJOR}
 
                -DREV_MINOR=${PROJECT_VERSION_MINOR}
 
                -DREV_BUILD=${PROJECT_VERSION_PATCH}
 
                -DWINDOWS=${WIN32}
 
                -P "${CMAKE_SOURCE_DIR}/cmake/scripts/FindVersion.cmake"
 
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
 
        BYPRODUCTS ${GENERATED_SOURCE_FILES}
 
)
 

	
 
# Documentation
 
if(DOXYGEN_EXECUTABLE)
 
    add_custom_target(docs)
 
    add_custom_target(docs_source
 
        ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/docs
 
        COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
bin/ai/CMakeLists.txt
Show inline comments
 
@@ -3,25 +3,25 @@ set(AI_COMPAT_SOURCE_FILES
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.0.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.1.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.2.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.3.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.4.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.5.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.6.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.7.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.8.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.9.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.10.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.12.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_12.nut
 
)
 

	
 
foreach(AI_COMPAT_SOURCE_FILE IN LISTS AI_COMPAT_SOURCE_FILES)
 
    string(REPLACE "${CMAKE_SOURCE_DIR}/bin/" "" AI_COMPAT_SOURCE_FILE_NAME "${AI_COMPAT_SOURCE_FILE}")
 
    string(CONCAT AI_COMPAT_BINARY_FILE "${CMAKE_BINARY_DIR}/" "${AI_COMPAT_SOURCE_FILE_NAME}")
 

	
 
    add_custom_command(OUTPUT ${AI_COMPAT_BINARY_FILE}
 
            COMMAND ${CMAKE_COMMAND} -E copy
 
                    ${AI_COMPAT_SOURCE_FILE}
 
                    ${AI_COMPAT_BINARY_FILE}
 
            MAIN_DEPENDENCY ${AI_COMPAT_SOURCE_FILE}
 
            COMMENT "Copying ${AI_COMPAT_SOURCE_FILE_NAME}"
bin/ai/compat_1.12.nut
Show inline comments
 
deleted file
bin/ai/compat_12.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
bin/game/CMakeLists.txt
Show inline comments
 
set(GS_COMPAT_SOURCE_FILES
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.2.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.3.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.4.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.5.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.6.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.7.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.8.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.9.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.10.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_1.12.nut
 
	${CMAKE_CURRENT_SOURCE_DIR}/compat_12.nut
 
)
 

	
 
foreach(GS_COMPAT_SOURCE_FILE IN LISTS GS_COMPAT_SOURCE_FILES)
 
    string(REPLACE "${CMAKE_SOURCE_DIR}/bin/" "" GS_COMPAT_SOURCE_FILE_NAME "${GS_COMPAT_SOURCE_FILE}")
 
    string(CONCAT GS_COMPAT_BINARY_FILE "${CMAKE_BINARY_DIR}/" "${GS_COMPAT_SOURCE_FILE_NAME}")
 

	
 
    add_custom_command(OUTPUT ${GS_COMPAT_BINARY_FILE}
 
            COMMAND ${CMAKE_COMMAND} -E copy
 
                    ${GS_COMPAT_SOURCE_FILE}
 
                    ${GS_COMPAT_BINARY_FILE}
 
            MAIN_DEPENDENCY ${GS_COMPAT_SOURCE_FILE}
 
            COMMENT "Copying ${GS_COMPAT_SOURCE_FILE_NAME}"
bin/game/compat_1.12.nut
Show inline comments
 
deleted file
bin/game/compat_12.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
cmake/scripts/FindVersion.cmake
Show inline comments
 
cmake_minimum_required(VERSION 3.5)
 

	
 
if(NOT REV_MAJOR)
 
    set(REV_MAJOR 0)
 
endif()
 
if(NOT REV_MINOR)
 
    set(REV_MINOR 0)
 
endif()
 
if(NOT REV_BUILD)
 
    set(REV_BUILD 0)
 
endif()
 

	
 
#
 
# Finds the current version of the current folder.
 
#
 

	
 
find_package(Git QUIET)
 
# ${CMAKE_SOURCE_DIR}/.git may be a directory or a regular file
 
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
 
    # Make sure LC_ALL is set to something desirable
 
    set(SAVED_LC_ALL "$ENV{LC_ALL}")
 
    set(ENV{LC_ALL} C)
 

	
known-bugs.txt
Show inline comments
 
OpenTTD's known bugs
 
Last updated:    2021-04-01
 
Release version: 1.11.0
 
------------------------------------------------------------------------
 

	
 

	
 
Table of contents
 
-----------------
 
1.0) About
 
2.0) Known bugs
 

	
 

	
 
1.0) About
 
---- -----
 
All bugs listed below are marked as known. Please do not submit any bugs
regression/regression/info.nut
Show inline comments
 
class Regression extends AIInfo {
 
	function GetAuthor()      { return "OpenTTD NoAI Developers Team"; }
 
	function GetName()        { return "Regression"; }
 
	function GetShortName()   { return "REGR"; }
 
	function GetDescription() { return "This runs regression-tests on some commands. On the same map the result should always be the same."; }
 
	function GetVersion()     { return 1; }
 
	function GetAPIVersion()  { return "1.12"; }
 
	function GetAPIVersion()  { return "12"; }
 
	function GetDate()        { return "2007-03-18"; }
 
	function CreateInstance() { return "Regression"; }
 
	function UseAsRandomAI()  { return false; }
 
}
 

	
 
RegisterAI(Regression());
 

	
regression/stationlist/info.nut
Show inline comments
 
class StationList extends AIInfo {
 
	function GetAuthor()      { return "OpenTTD NoAI Developers Team"; }
 
	function GetName()        { return "StationList"; }
 
	function GetShortName()   { return "REGS"; }
 
	function GetDescription() { return "This runs stationlist-tests on some commands. On the same map the result should always be the same."; }
 
	function GetVersion()     { return 1; }
 
	function GetAPIVersion()  { return "1.12"; }
 
	function GetAPIVersion()  { return "12"; }
 
	function GetDate()        { return "2007-03-18"; }
 
	function CreateInstance() { return "StationList"; }
 
	function UseAsRandomAI()  { return false; }
 
}
 

	
 
RegisterAI(StationList());
 

	
src/ai/ai_info.cpp
Show inline comments
 
@@ -16,25 +16,25 @@
 
#include "../string_func.h"
 
#include "../rev.h"
 
#include <set>
 

	
 
#include "../safeguards.h"
 

	
 
/**
 
 * Check if the API version provided by the AI is supported.
 
 * @param api_version The API version as provided by the AI.
 
 */
 
static bool CheckAPIVersion(const char *api_version)
 
{
 
	static const std::set<std::string> versions = { "0.7", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "1.12" };
 
	static const std::set<std::string> versions = { "0.7", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "12" };
 
	return versions.find(api_version) != versions.end();
 
}
 

	
 
#if defined(_WIN32)
 
#undef GetClassName
 
#endif /* _WIN32 */
 
template <> const char *GetClassName<AIInfo, ST_AI>() { return "AIInfo"; }
 

	
 
/* static */ void AIInfo::RegisterAPI(Squirrel *engine)
 
{
 
	/* Create the AIInfo class, and add the RegisterAI function */
 
	DefSQClass<AIInfo, ST_AI> SQAIInfo("AIInfo");
src/game/game_info.cpp
Show inline comments
 
@@ -14,25 +14,25 @@
 
#include "game_scanner.hpp"
 
#include "../debug.h"
 
#include <set>
 

	
 
#include "../safeguards.h"
 

	
 
/**
 
 * Check if the API version provided by the Game is supported.
 
 * @param api_version The API version as provided by the Game.
 
 */
 
static bool CheckAPIVersion(const char *api_version)
 
{
 
	static const std::set<std::string> versions = { "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "1.12" };
 
	static const std::set<std::string> versions = { "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "12" };
 
	return versions.find(api_version) != versions.end();
 
}
 

	
 
#if defined(_WIN32)
 
#undef GetClassName
 
#endif /* _WIN32 */
 
template <> const char *GetClassName<GameInfo, ST_GS>() { return "GSInfo"; }
 

	
 
/* static */ void GameInfo::RegisterAPI(Squirrel *engine)
 
{
 
	/* Create the GSInfo class, and add the RegisterGS function */
 
	DefSQClass<GameInfo, ST_GS> SQGSInfo("GSInfo");
src/os/windows/ottdres.rc.in
Show inline comments
 
@@ -68,26 +68,26 @@ BEGIN
 
    DEFPUSHBUTTON   "&OK",12,274,378,50,14,BS_CENTER
 
    EDITTEXT        11,7,6,583,365,ES_MULTILINE | ES_READONLY | WS_VSCROLL | WS_HSCROLL
 
END
 

	
 

	
 
#ifndef _MAC
 
/////////////////////////////////////////////////////////////////////////////
 
//
 
// Version
 
//
 

	
 
VS_VERSION_INFO VERSIONINFO
 
 FILEVERSION ${REV_MAJOR},${REV_MINOR},${REV_BUILD},${REV_ISODATE}
 
 PRODUCTVERSION ${REV_MAJOR},${REV_MINOR},${REV_BUILD},${REV_ISODATE}
 
 FILEVERSION ${REV_MAJOR},${REV_MINOR},0,${REV_ISODATE}
 
 PRODUCTVERSION ${REV_MAJOR},${REV_MINOR},0,${REV_ISODATE}
 
 FILEFLAGSMASK 0x3fL
 
#ifdef _DEBUG
 
 FILEFLAGS 0x1L
 
#else
 
 FILEFLAGS 0x0L
 
#endif
 
 FILEOS 0x4L
 
 FILETYPE 0x1L
 
 FILESUBTYPE 0x0L
 
BEGIN
 
    BLOCK "StringFileInfo"
 
    BEGIN
src/rev.cpp.in
Show inline comments
 
@@ -66,23 +66,26 @@ const char _openttd_revision_year[] = "$
 
const byte _openttd_revision_modified = ${REV_MODIFIED};
 

	
 
/**
 
 * Indicate whether this is a tagged version.
 
 * If this is non-0, then _openttd_revision is the name of the tag,
 
 * and the version is likely a beta, release candidate, or real release.
 
 */
 
const byte _openttd_revision_tagged = ${REV_ISTAG};
 

	
 
/**
 
 * The NewGRF revision of OTTD:
 
 * bits  meaning.
 
 * 28-31 major version
 
 * 24-27 minor version
 
 * 20-23 build
 
 * 24-31 major version + 16
 
 * 20-23 minor version
 
 *    19 1 if it is a release, 0 if it is not.
 
 *  0-18 used to be the SVN revision, now just last revision before switch to git
 
 *
 
 * The 19th bit is there so the development/betas/alpha, etc. leading to a
 
 * final release will always have a lower version number than the released
 
 * version, thus making comparisons on specific revisions easy.
 
 *
 
 * The + 16 for the major version is because we went from 1.11.0 to 12.0, dropping
 
 * the "patch" part of the version. To make sure "1.11.0" is smaller than "12.0", we
 
 * have to adjust the major by 16.
 
 */
 
const uint32 _openttd_newgrf_version = ${REV_MAJOR} << 28 | ${REV_MINOR} << 24 | ${REV_BUILD} << 20 | ${REV_ISSTABLETAG} << 19 | 28004;
 
const uint32 _openttd_newgrf_version = (${REV_MAJOR} + 16) << 24 | ${REV_MINOR} << 20 | ${REV_ISSTABLETAG} << 19 | 28004;
src/script/api/ai_changelog.hpp
Show inline comments
 
@@ -4,25 +4,25 @@
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/**
 
 * @file ai_changelog.hpp Lists all changes / additions to the API.
 
 *
 
 * Only new / renamed / deleted api functions will be listed here. A list of
 
 * bug fixes can be found in the normal changelog. Note that removed API
 
 * functions may still be available if you return an older API version
 
 * in GetAPIVersion() in info.nut.
 
 *
 
 * \b 1.12.0
 
 * \b 12.0
 
 *
 
 * This version is not yet released. The following changes are not set in stone yet.
 
 *
 
 * API additions:
 
 * \li AINewGRF
 
 * \li AINewGRFList
 
 * \li AIGroup::GetNumVehicles
 
 *
 
 * \b 1.11.0
 
 *
 
 * API additions:
 
 * \li AICargo::GetName
src/script/api/game_changelog.hpp
Show inline comments
 
@@ -4,25 +4,25 @@
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/**
 
 * @file game_changelog.hpp Lists all changes / additions to the API.
 
 *
 
 * Only new / renamed / deleted api functions will be listed here. A list of
 
 * bug fixes can be found in the normal changelog. Note that removed API
 
 * functions may still be available if you return an older API version
 
 * in GetAPIVersion() in info.nut.
 
 *
 
 * \b 1.12.0
 
 * \b 12.0
 
 *
 
 * This version is not yet released. The following changes are not set in stone yet.
 
 *
 
 * API additions:
 
 * \li GSNewGRF
 
 * \li GSNewGRFList
 
 *
 
 * \b 1.11.0
 
 *
 
 * API additions:
 
 * \li GSCargo::GetName
 
 * \li GSEventStoryPageButtonClick
src/script/api/script_controller.hpp
Show inline comments
 
@@ -126,29 +126,38 @@ public:
 
	static int GetOpsTillSuspend();
 

	
 
	/**
 
	 * Get the value of one of your settings you set via info.nut.
 
	 * @param name The name of the setting.
 
	 * @return the value for the setting, or -1 if the setting is not known.
 
	 */
 
	static int GetSetting(const char *name);
 

	
 
	/**
 
	 * Get the OpenTTD version of this executable. The version is formatted
 
	 * with the bits having the following meaning:
 
	 * 28-31 major version
 
	 * 24-27 minor version
 
	 * 20-23 build
 
	 * 24-31 major version + 16.
 
	 * 20-23 minor version.
 
	 *    19 1 if it is a release, 0 if it is not.
 
	 *  0-18 revision number; 0 when the revision is unknown.
 
	 * You have to subtract 16 from the major version to get the correct
 
	 * value.
 
	 *
 
	 * Prior to OpenTTD 12, the bits have the following meaning:
 
	 * 28-31 major version.
 
	 * 24-27 minor version.
 
	 * 20-23 build.
 
	 *    19 1 if it is a release, 0 if it is not.
 
	 *  0-18 revision number; 0 when the revision is unknown.
 
	 *
 
	 * @return The version in newgrf format.
 
	 */
 
	static uint GetVersion();
 

	
 
	/**
 
	 * Change the minimum amount of time the script should be put in suspend mode
 
	 *   when you execute a command. Normally in SP this is 1, and in MP it is
 
	 *   what ever delay the server has been programmed to delay commands
 
	 *   (normally between 1 and 5). To give a more 'real' effect to your script,
 
	 *   you can control that number here.
 
	 * @param ticks The minimum amount of ticks to wait.
 
	 * @pre Ticks should be positive. Too big values will influence performance of the script.
0 comments (0 inline, 0 general)