mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
(svn r12944) -Codechange: use rev.h instead of externs at many places
This commit is contained in:
parent
0b8b5d1f3b
commit
297f99e100
@ -1319,6 +1319,10 @@
|
|||||||
RelativePath=".\..\src\core\random_func.hpp"
|
RelativePath=".\..\src\core\random_func.hpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\..\src\rev.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\..\src\road_cmd.h"
|
RelativePath=".\..\src\road_cmd.h"
|
||||||
>
|
>
|
||||||
|
@ -1316,6 +1316,10 @@
|
|||||||
RelativePath=".\..\src\core\random_func.hpp"
|
RelativePath=".\..\src\core\random_func.hpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\..\src\rev.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\..\src\road_cmd.h"
|
RelativePath=".\..\src\road_cmd.h"
|
||||||
>
|
>
|
||||||
|
@ -251,6 +251,7 @@ rail.h
|
|||||||
rail_gui.h
|
rail_gui.h
|
||||||
rail_type.h
|
rail_type.h
|
||||||
core/random_func.hpp
|
core/random_func.hpp
|
||||||
|
rev.h
|
||||||
road_cmd.h
|
road_cmd.h
|
||||||
road_func.h
|
road_func.h
|
||||||
road_gui.h
|
road_gui.h
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "window_func.h"
|
#include "window_func.h"
|
||||||
#include "string_func.h"
|
#include "string_func.h"
|
||||||
#include "gfx_func.h"
|
#include "gfx_func.h"
|
||||||
|
#include "rev.h"
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
|
||||||
@ -223,7 +224,6 @@ static const WindowDesc _iconsole_window_desc = {
|
|||||||
|
|
||||||
void IConsoleInit()
|
void IConsoleInit()
|
||||||
{
|
{
|
||||||
extern const char _openttd_revision[];
|
|
||||||
_iconsole_output_file = NULL;
|
_iconsole_output_file = NULL;
|
||||||
_icolour_def = 1;
|
_icolour_def = 1;
|
||||||
_icolour_err = 3;
|
_icolour_err = 3;
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "../string_func.h"
|
#include "../string_func.h"
|
||||||
#include "../player_func.h"
|
#include "../player_func.h"
|
||||||
#include "../settings_type.h"
|
#include "../settings_type.h"
|
||||||
|
#include "../rev.h"
|
||||||
#ifdef DEBUG_DUMP_COMMANDS
|
#ifdef DEBUG_DUMP_COMMANDS
|
||||||
#include "../core/alloc_func.hpp"
|
#include "../core/alloc_func.hpp"
|
||||||
#endif /* DEBUG_DUMP_COMMANDS */
|
#endif /* DEBUG_DUMP_COMMANDS */
|
||||||
@ -1470,7 +1471,6 @@ void NetworkShutDown()
|
|||||||
*/
|
*/
|
||||||
bool IsNetworkCompatibleVersion(const char *other)
|
bool IsNetworkCompatibleVersion(const char *other)
|
||||||
{
|
{
|
||||||
extern const char _openttd_revision[];
|
|
||||||
return strncmp(_openttd_revision, other, NETWORK_REVISION_LENGTH - 1) == 0;
|
return strncmp(_openttd_revision, other, NETWORK_REVISION_LENGTH - 1) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,9 +31,6 @@ static inline void NetworkShutDown() {}
|
|||||||
|
|
||||||
#endif /* ENABLE_NETWORK */
|
#endif /* ENABLE_NETWORK */
|
||||||
|
|
||||||
/** What is the revision of OpenTTD. */
|
|
||||||
extern const char _openttd_revision[];
|
|
||||||
|
|
||||||
/** As which player do we play? */
|
/** As which player do we play? */
|
||||||
extern PlayerID _network_playas;
|
extern PlayerID _network_playas;
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "../player_func.h"
|
#include "../player_func.h"
|
||||||
#include "../player_base.h"
|
#include "../player_base.h"
|
||||||
#include "../player_gui.h"
|
#include "../player_gui.h"
|
||||||
|
#include "../rev.h"
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
|
||||||
@ -122,7 +123,6 @@ DEF_CLIENT_SEND_COMMAND(PACKET_CLIENT_JOIN)
|
|||||||
// String: Unique id to find the player back in server-listing
|
// String: Unique id to find the player back in server-listing
|
||||||
//
|
//
|
||||||
|
|
||||||
extern const char _openttd_revision[];
|
|
||||||
Packet *p;
|
Packet *p;
|
||||||
_network_join_status = NETWORK_JOIN_STATUS_AUTHORIZING;
|
_network_join_status = NETWORK_JOIN_STATUS_AUTHORIZING;
|
||||||
InvalidateWindow(WC_NETWORK_STATUS_WINDOW, 0);
|
InvalidateWindow(WC_NETWORK_STATUS_WINDOW, 0);
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include "newgrf_townname.h"
|
#include "newgrf_townname.h"
|
||||||
#include "newgrf_industries.h"
|
#include "newgrf_industries.h"
|
||||||
#include "gfxinit.h"
|
#include "gfxinit.h"
|
||||||
|
#include "rev.h"
|
||||||
#include "fios.h"
|
#include "fios.h"
|
||||||
#include "rail.h"
|
#include "rail.h"
|
||||||
#include "strings_func.h"
|
#include "strings_func.h"
|
||||||
@ -3643,11 +3644,9 @@ bool GetGlobalVariable(byte param, uint32 *value)
|
|||||||
*value = _opt.landscape == LT_ARCTIC ? GetSnowLine() : 0xFF;
|
*value = _opt.landscape == LT_ARCTIC ? GetSnowLine() : 0xFF;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 0x21: { // OpenTTD version
|
case 0x21: // OpenTTD version
|
||||||
extern uint32 _openttd_newgrf_version;
|
|
||||||
*value = _openttd_newgrf_version;
|
*value = _openttd_newgrf_version;
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
case 0x22: // difficulty level
|
case 0x22: // difficulty level
|
||||||
*value = _opt.diff_level;
|
*value = _opt.diff_level;
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
#include "cheat_func.h"
|
#include "cheat_func.h"
|
||||||
#include "animated_tile_func.h"
|
#include "animated_tile_func.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
#include "rev.h"
|
||||||
|
|
||||||
#include "newgrf.h"
|
#include "newgrf.h"
|
||||||
#include "newgrf_config.h"
|
#include "newgrf_config.h"
|
||||||
@ -136,9 +137,6 @@ void CDECL ShowInfoF(const char *str, ...)
|
|||||||
ShowInfo(buf);
|
ShowInfo(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The current revision of OpenTTD */
|
|
||||||
extern const char _openttd_revision[];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the help message when someone passed a wrong parameter.
|
* Show the help message when someone passed a wrong parameter.
|
||||||
*/
|
*/
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "../../stdafx.h"
|
#include "../../stdafx.h"
|
||||||
#include "../../core/bitmath_func.hpp"
|
#include "../../core/bitmath_func.hpp"
|
||||||
|
#include "../../rev.h"
|
||||||
|
|
||||||
#ifndef CPU_SUBTYPE_POWERPC_970
|
#ifndef CPU_SUBTYPE_POWERPC_970
|
||||||
#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
|
#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
|
||||||
@ -33,7 +34,6 @@ static char *GetOSString()
|
|||||||
char OS[20];
|
char OS[20];
|
||||||
char newgrf[125];
|
char newgrf[125];
|
||||||
long sysVersion;
|
long sysVersion;
|
||||||
extern const char _openttd_revision[];
|
|
||||||
|
|
||||||
// get the hardware info
|
// get the hardware info
|
||||||
host_basic_info_data_t hostInfo;
|
host_basic_info_data_t hostInfo;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
/** @file rev.cpp Autogenerated file with the revision and such of OpenTTD. */
|
/** @file rev.cpp Autogenerated file with the revision and such of OpenTTD. */
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "rev.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The text version of OpenTTD's revision.
|
* The text version of OpenTTD's revision.
|
||||||
@ -19,7 +20,7 @@
|
|||||||
* norev000 is for non-releases that are made on systems without
|
* norev000 is for non-releases that are made on systems without
|
||||||
* subversion or sources that are not a checkout of subversion.
|
* subversion or sources that are not a checkout of subversion.
|
||||||
*/
|
*/
|
||||||
extern const char _openttd_revision[] = "@@VERSION@@";
|
const char _openttd_revision[] = "@@VERSION@@";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The NewGRF revision of OTTD:
|
* The NewGRF revision of OTTD:
|
||||||
@ -34,7 +35,7 @@ extern const char _openttd_revision[] = "@@VERSION@@";
|
|||||||
* final release will always have a lower version number than the released
|
* final release will always have a lower version number than the released
|
||||||
* version, thus making comparisions on specific revisions easy.
|
* version, thus making comparisions on specific revisions easy.
|
||||||
*/
|
*/
|
||||||
uint32 _openttd_newgrf_version = 0 << 28 | 7 << 24 | 0 << 20 | 0 << 19 | (@@REVISION@@ & ((1 << 19) - 1));
|
const uint32 _openttd_newgrf_version = 0 << 28 | 7 << 24 | 0 << 20 | 0 << 19 | (@@REVISION@@ & ((1 << 19) - 1));
|
||||||
|
|
||||||
#ifdef __MORPHOS__
|
#ifdef __MORPHOS__
|
||||||
/**
|
/**
|
||||||
|
11
src/rev.h
Normal file
11
src/rev.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/** @file rev.h declaration of OTTD revision dependant variables */
|
||||||
|
|
||||||
|
#ifndef REV_H
|
||||||
|
#define REV_H
|
||||||
|
|
||||||
|
extern const char _openttd_revision[];
|
||||||
|
extern const uint32 _openttd_newgrf_version;
|
||||||
|
|
||||||
|
#endif /* REV_H */
|
@ -44,6 +44,7 @@
|
|||||||
#include "sound_func.h"
|
#include "sound_func.h"
|
||||||
#include "core/alloc_func.hpp"
|
#include "core/alloc_func.hpp"
|
||||||
#include "player_func.h"
|
#include "player_func.h"
|
||||||
|
#include "rev.h"
|
||||||
#ifdef WITH_FREETYPE
|
#ifdef WITH_FREETYPE
|
||||||
#include "fontcache.h"
|
#include "fontcache.h"
|
||||||
#endif
|
#endif
|
||||||
@ -1769,9 +1770,6 @@ static void NewsDisplaySaveConfig(IniFile *ini, const char *grpname)
|
|||||||
*/
|
*/
|
||||||
static void SaveVersionInConfig(IniFile *ini)
|
static void SaveVersionInConfig(IniFile *ini)
|
||||||
{
|
{
|
||||||
extern const char _openttd_revision[];
|
|
||||||
extern uint32 _openttd_newgrf_version;
|
|
||||||
|
|
||||||
IniGroup *group = ini_getgroup(ini, "version", -1);
|
IniGroup *group = ini_getgroup(ini, "version", -1);
|
||||||
|
|
||||||
if (group == NULL) return;
|
if (group == NULL) return;
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "strings_func.h"
|
#include "strings_func.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
#include "rev.h"
|
||||||
#include "core/endian_func.hpp"
|
#include "core/endian_func.hpp"
|
||||||
#include "date_func.h"
|
#include "date_func.h"
|
||||||
#include "vehicle_base.h"
|
#include "vehicle_base.h"
|
||||||
@ -560,7 +561,6 @@ uint ConvertDisplaySpeedToSpeed(uint speed)
|
|||||||
|
|
||||||
static char* FormatString(char* buff, const char* str, const int64* argv, uint casei, const char* last)
|
static char* FormatString(char* buff, const char* str, const int64* argv, uint casei, const char* last)
|
||||||
{
|
{
|
||||||
extern const char _openttd_revision[];
|
|
||||||
WChar b;
|
WChar b;
|
||||||
const int64 *argv_orig = argv;
|
const int64 *argv_orig = argv;
|
||||||
uint modifier = 0;
|
uint modifier = 0;
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include "../../stdafx.h"
|
#include "../../stdafx.h"
|
||||||
#include "../../debug.h"
|
#include "../../debug.h"
|
||||||
|
#include "../../rev.h"
|
||||||
#include "../../core/geometry_type.hpp"
|
#include "../../core/geometry_type.hpp"
|
||||||
#include "cocoa_v.h"
|
#include "cocoa_v.h"
|
||||||
#include "../../core/math_func.hpp"
|
#include "../../core/math_func.hpp"
|
||||||
@ -410,9 +411,6 @@ static CGColorSpaceRef QZ_GetCorrectColorSpace()
|
|||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
extern const char _openttd_revision[];
|
|
||||||
|
|
||||||
|
|
||||||
void WindowQuartzSubdriver::GetDeviceInfo()
|
void WindowQuartzSubdriver::GetDeviceInfo()
|
||||||
{
|
{
|
||||||
CFDictionaryRef cur_mode;
|
CFDictionaryRef cur_mode;
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include "../../stdafx.h"
|
#include "../../stdafx.h"
|
||||||
#include "../../debug.h"
|
#include "../../debug.h"
|
||||||
|
#include "../../rev.h"
|
||||||
#include "../../core/geometry_type.hpp"
|
#include "../../core/geometry_type.hpp"
|
||||||
#include "cocoa_v.h"
|
#include "cocoa_v.h"
|
||||||
#include "../../core/math_func.hpp"
|
#include "../../core/math_func.hpp"
|
||||||
@ -331,10 +332,6 @@ static bool _resize_icon[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern const char _openttd_revision[];
|
|
||||||
|
|
||||||
|
|
||||||
void WindowQuickdrawSubdriver::GetDeviceInfo()
|
void WindowQuickdrawSubdriver::GetDeviceInfo()
|
||||||
{
|
{
|
||||||
CFDictionaryRef cur_mode;
|
CFDictionaryRef cur_mode;
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "../gfx_func.h"
|
#include "../gfx_func.h"
|
||||||
#include "../sdl.h"
|
#include "../sdl.h"
|
||||||
#include "../variables.h"
|
#include "../variables.h"
|
||||||
|
#include "../rev.h"
|
||||||
#include "../blitter/factory.hpp"
|
#include "../blitter/factory.hpp"
|
||||||
#include "../network/network.h"
|
#include "../network/network.h"
|
||||||
#include "../core/math_func.hpp"
|
#include "../core/math_func.hpp"
|
||||||
@ -186,7 +187,6 @@ static void GetAvailableVideoMode(int *w, int *h)
|
|||||||
|
|
||||||
static bool CreateMainSurface(int w, int h)
|
static bool CreateMainSurface(int w, int h)
|
||||||
{
|
{
|
||||||
extern const char _openttd_revision[];
|
|
||||||
SDL_Surface *newscreen, *icon;
|
SDL_Surface *newscreen, *icon;
|
||||||
char caption[50];
|
char caption[50];
|
||||||
int bpp = BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth();
|
int bpp = BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth();
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "../gfx_func.h"
|
#include "../gfx_func.h"
|
||||||
#include "../variables.h"
|
#include "../variables.h"
|
||||||
#include "../win32.h"
|
#include "../win32.h"
|
||||||
|
#include "../rev.h"
|
||||||
#include "../blitter/factory.hpp"
|
#include "../blitter/factory.hpp"
|
||||||
#include "../network/network.h"
|
#include "../network/network.h"
|
||||||
#include "../core/math_func.hpp"
|
#include "../core/math_func.hpp"
|
||||||
@ -282,7 +283,6 @@ static bool MakeWindow(bool full_screen)
|
|||||||
ShowWindow(_wnd.main_wnd, SW_SHOWNORMAL); // remove maximize-flag
|
ShowWindow(_wnd.main_wnd, SW_SHOWNORMAL); // remove maximize-flag
|
||||||
SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
|
SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
|
||||||
} else {
|
} else {
|
||||||
extern const char _openttd_revision[];
|
|
||||||
TCHAR Windowtitle[50];
|
TCHAR Windowtitle[50];
|
||||||
|
|
||||||
_sntprintf(Windowtitle, sizeof(Windowtitle), _T("OpenTTD %s"), MB_TO_WIDE(_openttd_revision));
|
_sntprintf(Windowtitle, sizeof(Windowtitle), _T("OpenTTD %s"), MB_TO_WIDE(_openttd_revision));
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "gfx_func.h"
|
#include "gfx_func.h"
|
||||||
#include "textbuf_gui.h"
|
#include "textbuf_gui.h"
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
|
#include "rev.h"
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winnt.h>
|
#include <winnt.h>
|
||||||
#include <wininet.h>
|
#include <wininet.h>
|
||||||
@ -460,7 +461,6 @@ extern bool CloseConsoleLogIfActive();
|
|||||||
|
|
||||||
static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
|
static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
|
||||||
{
|
{
|
||||||
extern const char _openttd_revision[];
|
|
||||||
char *output;
|
char *output;
|
||||||
static bool had_exception = false;
|
static bool had_exception = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user