Merge branches 'crashlog_improvements', 'save_ext', 'version_utils' into jgrpp
This commit is contained in:
@@ -29,7 +29,7 @@ static bool CheckAPIVersion(const char *api_version)
|
||||
return strcmp(api_version, "0.7") == 0 || strcmp(api_version, "1.0") == 0 || strcmp(api_version, "1.1") == 0 ||
|
||||
strcmp(api_version, "1.2") == 0 || strcmp(api_version, "1.3") == 0 || strcmp(api_version, "1.4") == 0 ||
|
||||
strcmp(api_version, "1.5") == 0 || strcmp(api_version, "1.6") == 0 || strcmp(api_version, "1.7") == 0 ||
|
||||
strcmp(api_version, "1.8") == 0;
|
||||
strcmp(api_version, "1.8") == 0 || strcmp(api_version, "1.9") == 0;
|
||||
}
|
||||
|
||||
#if defined(WIN32)
|
||||
|
@@ -11,17 +11,14 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "core/alloc_func.hpp"
|
||||
#include "core/smallvec_type.hpp"
|
||||
#include "tile_cmd.h"
|
||||
#include "viewport_func.h"
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
/** The table/list with animated tiles. */
|
||||
TileIndex *_animated_tile_list = NULL;
|
||||
/** The number of animated tiles in the current state. */
|
||||
uint _animated_tile_count = 0;
|
||||
/** The number of slots for animated tiles allocated currently. */
|
||||
uint _animated_tile_allocated = 0;
|
||||
SmallVector<TileIndex, 256> _animated_tiles;
|
||||
|
||||
/**
|
||||
* Removes the given tile from the animated tile table.
|
||||
@@ -29,17 +26,11 @@ uint _animated_tile_allocated = 0;
|
||||
*/
|
||||
void DeleteAnimatedTile(TileIndex tile)
|
||||
{
|
||||
for (TileIndex *ti = _animated_tile_list; ti < _animated_tile_list + _animated_tile_count; ti++) {
|
||||
if (tile == *ti) {
|
||||
/* Remove the hole
|
||||
* The order of the remaining elements must stay the same, otherwise the animation loop
|
||||
* may miss a tile; that's why we must use memmove instead of just moving the last element.
|
||||
*/
|
||||
memmove(ti, ti + 1, (_animated_tile_list + _animated_tile_count - (ti + 1)) * sizeof(*ti));
|
||||
_animated_tile_count--;
|
||||
MarkTileDirtyByTile(tile, ZOOM_LVL_DRAW_MAP);
|
||||
return;
|
||||
}
|
||||
TileIndex *to_remove = _animated_tiles.Find(tile);
|
||||
if (to_remove != _animated_tiles.End()) {
|
||||
/* The order of the remaining elements must stay the same, otherwise the animation loop may miss a tile. */
|
||||
_animated_tiles.ErasePreservingOrder(to_remove);
|
||||
MarkTileDirtyByTile(tile, ZOOM_LVL_DRAW_MAP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,19 +42,7 @@ void DeleteAnimatedTile(TileIndex tile)
|
||||
void AddAnimatedTile(TileIndex tile)
|
||||
{
|
||||
MarkTileDirtyByTile(tile, ZOOM_LVL_DRAW_MAP);
|
||||
|
||||
for (const TileIndex *ti = _animated_tile_list; ti < _animated_tile_list + _animated_tile_count; ti++) {
|
||||
if (tile == *ti) return;
|
||||
}
|
||||
|
||||
/* Table not large enough, so make it larger */
|
||||
if (_animated_tile_count == _animated_tile_allocated) {
|
||||
_animated_tile_allocated *= 2;
|
||||
_animated_tile_list = ReallocT<TileIndex>(_animated_tile_list, _animated_tile_allocated);
|
||||
}
|
||||
|
||||
_animated_tile_list[_animated_tile_count] = tile;
|
||||
_animated_tile_count++;
|
||||
_animated_tiles.Include(tile);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,8 +50,8 @@ void AddAnimatedTile(TileIndex tile)
|
||||
*/
|
||||
void AnimateAnimatedTiles()
|
||||
{
|
||||
const TileIndex *ti = _animated_tile_list;
|
||||
while (ti < _animated_tile_list + _animated_tile_count) {
|
||||
const TileIndex *ti = _animated_tiles.Begin();
|
||||
while (ti < _animated_tiles.End()) {
|
||||
const TileIndex curr = *ti;
|
||||
AnimateTile(curr);
|
||||
/* During the AnimateTile call, DeleteAnimatedTile could have been called,
|
||||
@@ -93,7 +72,5 @@ void AnimateAnimatedTiles()
|
||||
*/
|
||||
void InitializeAnimatedTiles()
|
||||
{
|
||||
_animated_tile_list = ReallocT<TileIndex>(_animated_tile_list, 256);
|
||||
_animated_tile_count = 0;
|
||||
_animated_tile_allocated = 256;
|
||||
_animated_tiles.Clear();
|
||||
}
|
||||
|
@@ -219,6 +219,11 @@ public:
|
||||
static bool HasSet(const ContentInfo *ci, bool md5sum);
|
||||
};
|
||||
|
||||
template <class Tbase_set> /* static */ const char *BaseMedia<Tbase_set>::ini_set;
|
||||
template <class Tbase_set> /* static */ const Tbase_set *BaseMedia<Tbase_set>::used_set;
|
||||
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::available_sets;
|
||||
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::duplicate_sets;
|
||||
|
||||
/**
|
||||
* Check whether there's a base set matching some information.
|
||||
* @param ci The content info to compare it to.
|
||||
|
@@ -17,11 +17,6 @@
|
||||
#include "ini_type.h"
|
||||
#include "string_func.h"
|
||||
|
||||
template <class Tbase_set> /* static */ const char *BaseMedia<Tbase_set>::ini_set;
|
||||
template <class Tbase_set> /* static */ const Tbase_set *BaseMedia<Tbase_set>::used_set;
|
||||
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::available_sets;
|
||||
template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::duplicate_sets;
|
||||
|
||||
/**
|
||||
* Try to read a single piece of metadata and return false if it doesn't exist.
|
||||
* @param name the name of the item to fetch.
|
||||
|
@@ -27,6 +27,8 @@
|
||||
#define MARGIN_NORMAL_THRESHOLD (zoom == ZOOM_LVL_OUT_32X ? 8 : 4) ///< Minimum width to use margins with BM_NORMAL.
|
||||
#define MARGIN_REMAP_THRESHOLD 4 ///< Minimum width to use margins with BM_COLOUR_REMAP.
|
||||
|
||||
#undef ALIGN
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define ALIGN(n) __declspec(align(n))
|
||||
#else
|
||||
|
@@ -264,6 +264,6 @@ bool HandleBootstrap()
|
||||
|
||||
/* Failure to get enough working to get a graphics set. */
|
||||
failure:
|
||||
usererror("Failed to find a graphics set. Please acquire a graphics set for OpenTTD. See section 4.1 of readme.txt.");
|
||||
usererror("Failed to find a graphics set. Please acquire a graphics set for OpenTTD. See section 4.1 of README.md.");
|
||||
return false;
|
||||
}
|
||||
|
@@ -175,6 +175,7 @@ CommandProc CmdSetStoryPageDate;
|
||||
CommandProc CmdShowStoryPage;
|
||||
CommandProc CmdRemoveStoryPage;
|
||||
CommandProc CmdRemoveStoryPageElement;
|
||||
CommandProc CmdScrollViewport;
|
||||
|
||||
CommandProc CmdLevelLand;
|
||||
|
||||
@@ -384,6 +385,7 @@ static const Command _command_proc_table[] = {
|
||||
DEF_CMD(CmdShowStoryPage, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_SHOW_STORY_PAGE
|
||||
DEF_CMD(CmdRemoveStoryPage, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_REMOVE_STORY_PAGE
|
||||
DEF_CMD(CmdRemoveStoryPageElement, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_REMOVE_STORY_ELEMENT_PAGE
|
||||
DEF_CMD(CmdScrollViewport, CMD_DEITY, CMDT_OTHER_MANAGEMENT ), // CMD_SCROLL_VIEWPORT
|
||||
|
||||
DEF_CMD(CmdLevelLand, CMD_ALL_TILES | CMD_NO_TEST | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_LEVEL_LAND; test run might clear tiles multiple times, in execution that only happens once
|
||||
|
||||
|
@@ -313,6 +313,8 @@ enum Commands {
|
||||
CMD_SHOW_STORY_PAGE, ///< show a story page
|
||||
CMD_REMOVE_STORY_PAGE, ///< remove a story page
|
||||
CMD_REMOVE_STORY_PAGE_ELEMENT, ///< remove a story page element
|
||||
CMD_SCROLL_VIEWPORT, ///< scroll main viewport of players
|
||||
|
||||
CMD_LEVEL_LAND, ///< level land
|
||||
|
||||
CMD_BUILD_LOCK, ///< build a lock
|
||||
|
@@ -183,9 +183,9 @@ public:
|
||||
inline void Push(const Titem &item)
|
||||
{
|
||||
if (this->value != Tinvalid) {
|
||||
Tindex new_item = _pool.Create();
|
||||
Tindex new_item = SmallStack::GetPool().Create();
|
||||
if (new_item != Tmax_size) {
|
||||
PooledSmallStack &pushed = _pool.Get(new_item);
|
||||
PooledSmallStack &pushed = SmallStack::GetPool().Get(new_item);
|
||||
pushed.value = this->value;
|
||||
pushed.next = this->next;
|
||||
pushed.branch_count = 0;
|
||||
@@ -205,14 +205,14 @@ public:
|
||||
if (this->next == Tmax_size) {
|
||||
this->value = Tinvalid;
|
||||
} else {
|
||||
PooledSmallStack &popped = _pool.Get(this->next);
|
||||
PooledSmallStack &popped = SmallStack::GetPool().Get(this->next);
|
||||
this->value = popped.value;
|
||||
if (popped.branch_count == 0) {
|
||||
_pool.Destroy(this->next);
|
||||
SmallStack::GetPool().Destroy(this->next);
|
||||
} else {
|
||||
--popped.branch_count;
|
||||
if (popped.next != Tmax_size) {
|
||||
++(_pool.Get(popped.next).branch_count);
|
||||
++(SmallStack::GetPool().Get(popped.next).branch_count);
|
||||
}
|
||||
}
|
||||
/* Accessing popped here is no problem as the pool will only set
|
||||
@@ -245,7 +245,7 @@ public:
|
||||
const SmallStack *in_list = this;
|
||||
do {
|
||||
in_list = static_cast<const SmallStack *>(
|
||||
static_cast<const Item *>(&_pool.Get(in_list->next)));
|
||||
static_cast<const Item *>(&SmallStack::GetPool().Get(in_list->next)));
|
||||
if (in_list->value == item) return true;
|
||||
} while (in_list->next != Tmax_size);
|
||||
}
|
||||
@@ -253,7 +253,11 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
static SmallStackPool _pool;
|
||||
static SmallStackPool &GetPool()
|
||||
{
|
||||
static SmallStackPool pool;
|
||||
return pool;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a branch in the pool if necessary.
|
||||
@@ -261,7 +265,7 @@ protected:
|
||||
inline void Branch()
|
||||
{
|
||||
if (this->next != Tmax_size) {
|
||||
++(_pool.Get(this->next).branch_count);
|
||||
++(SmallStack::GetPool().Get(this->next).branch_count);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@@ -158,6 +158,23 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a new item at a specific position into the vector, moving all following items.
|
||||
* @param item Position at which the new item should be inserted
|
||||
* @return pointer to the new item
|
||||
*/
|
||||
inline T *Insert(T *item)
|
||||
{
|
||||
assert(item >= this->Begin() && item <= this->End());
|
||||
|
||||
size_t to_move = this->End() - item;
|
||||
size_t start = item - this->Begin();
|
||||
|
||||
this->Append();
|
||||
if (to_move > 0) MemMoveT(this->Begin() + start + 1, this->Begin() + start, to_move);
|
||||
return this->Begin() + start;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for the first occurrence of an item.
|
||||
* The '!=' operator of T is used for comparison.
|
||||
@@ -232,13 +249,24 @@ public:
|
||||
* @param count Number of consecutive items to remove.
|
||||
*/
|
||||
void ErasePreservingOrder(uint pos, uint count = 1)
|
||||
{
|
||||
ErasePreservingOrder(this->data + pos, count);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove items from the vector while preserving the order of other items.
|
||||
* @param item First item to remove.
|
||||
* @param count Number of consecutive items to remove.
|
||||
*/
|
||||
inline void ErasePreservingOrder(T *item, uint count = 1)
|
||||
{
|
||||
if (count == 0) return;
|
||||
assert(pos < this->items);
|
||||
assert(pos + count <= this->items);
|
||||
assert(item >= this->Begin());
|
||||
assert(item + count <= this->End());
|
||||
|
||||
this->items -= count;
|
||||
uint to_move = this->items - pos;
|
||||
if (to_move > 0) MemMoveT(this->data + pos, this->data + pos + count, to_move);
|
||||
ptrdiff_t to_move = this->End() - item;
|
||||
if (to_move > 0) MemMoveT(item, item + count, to_move);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include "network/network.h"
|
||||
#include "language.h"
|
||||
#include "fontcache.h"
|
||||
#include "news_gui.h"
|
||||
#include "scope_info.h"
|
||||
#include "command_func.h"
|
||||
#include "thread/thread.h"
|
||||
@@ -329,6 +330,27 @@ char *CrashLog::LogGamelog(char *buffer, const char *last) const
|
||||
return CrashLog::gamelog_buffer + seprintf(CrashLog::gamelog_buffer, last, "\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes any recent news messages to the buffer.
|
||||
* @param buffer The begin where to write at.
|
||||
* @param last The last position in the buffer to write to.
|
||||
* @return the position of the \c '\0' character after the buffer.
|
||||
*/
|
||||
char *CrashLog::LogRecentNews(char *buffer, const char *last) const
|
||||
{
|
||||
buffer += seprintf(buffer, last, "Recent news messages:\n");
|
||||
|
||||
for (NewsItem *news = _oldest_news; news != NULL; news = news->next) {
|
||||
YearMonthDay ymd;
|
||||
ConvertDateToYMD(news->date, &ymd);
|
||||
buffer += seprintf(buffer, last, "(%i-%02i-%02i) StringID: %u, Type: %u, Ref1: %u, %u, Ref2: %u, %u\n",
|
||||
ymd.year, ymd.month + 1, ymd.day, news->string_id, news->type,
|
||||
news->reftype1, news->ref1, news->reftype2, news->ref2);
|
||||
}
|
||||
buffer += seprintf(buffer, last, "\n");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the command log data to the buffer.
|
||||
* @param buffer The begin where to write at.
|
||||
@@ -384,6 +406,7 @@ char *CrashLog::FillCrashLog(char *buffer, const char *last) const
|
||||
buffer = this->LogLibraries(buffer, last);
|
||||
buffer = this->LogModules(buffer, last);
|
||||
buffer = this->LogGamelog(buffer, last);
|
||||
buffer = this->LogRecentNews(buffer, last);
|
||||
buffer = this->LogCommandLog(buffer, last);
|
||||
|
||||
buffer += seprintf(buffer, last, "*** End of OpenTTD Crash Report ***\n");
|
||||
|
@@ -103,6 +103,7 @@ protected:
|
||||
char *LogConfiguration(char *buffer, const char *last) const;
|
||||
char *LogLibraries(char *buffer, const char *last) const;
|
||||
char *LogGamelog(char *buffer, const char *last) const;
|
||||
char *LogRecentNews(char *buffer, const char *list) const;
|
||||
char *LogCommandLog(char *buffer, const char *last) const;
|
||||
|
||||
public:
|
||||
|
@@ -110,8 +110,6 @@ char *DumpDebugFacilityNames(char *buf, char *last)
|
||||
return buf;
|
||||
}
|
||||
|
||||
#if !defined(NO_DEBUG_MESSAGES)
|
||||
|
||||
/**
|
||||
* Internal function for outputting the debug line.
|
||||
* @param dbg Debug category.
|
||||
@@ -208,7 +206,6 @@ void CDECL debug(const char *dbg, const char *format, ...)
|
||||
|
||||
debug_print(dbg, buf);
|
||||
}
|
||||
#endif /* NO_DEBUG_MESSAGES */
|
||||
|
||||
/**
|
||||
* Set debugging levels by parsing the text in \a s.
|
||||
|
56
src/debug.h
56
src/debug.h
@@ -28,40 +28,36 @@
|
||||
* 6.. - extremely detailed spamming
|
||||
*/
|
||||
|
||||
#ifdef NO_DEBUG_MESSAGES
|
||||
#define DEBUG(name, level, ...) { }
|
||||
#else /* NO_DEBUG_MESSAGES */
|
||||
/**
|
||||
* Output a line of debugging information.
|
||||
* @param name Category
|
||||
* @param level Debugging level, higher levels means more detailed information.
|
||||
*/
|
||||
#define DEBUG(name, level, ...) if ((level) == 0 || _debug_ ## name ## _level >= (level)) debug(#name, __VA_ARGS__)
|
||||
/**
|
||||
* Output a line of debugging information.
|
||||
* @param name Category
|
||||
* @param level Debugging level, higher levels means more detailed information.
|
||||
*/
|
||||
#define DEBUG(name, level, ...) if ((level) == 0 || _debug_ ## name ## _level >= (level)) debug(#name, __VA_ARGS__)
|
||||
|
||||
extern int _debug_driver_level;
|
||||
extern int _debug_grf_level;
|
||||
extern int _debug_map_level;
|
||||
extern int _debug_misc_level;
|
||||
extern int _debug_net_level;
|
||||
extern int _debug_sprite_level;
|
||||
extern int _debug_oldloader_level;
|
||||
extern int _debug_npf_level;
|
||||
extern int _debug_yapf_level;
|
||||
extern int _debug_freetype_level;
|
||||
extern int _debug_script_level;
|
||||
extern int _debug_sl_level;
|
||||
extern int _debug_gamelog_level;
|
||||
extern int _debug_desync_level;
|
||||
extern int _debug_yapfdesync_level;
|
||||
extern int _debug_console_level;
|
||||
extern int _debug_linkgraph_level;
|
||||
extern int _debug_sound_level;
|
||||
extern int _debug_driver_level;
|
||||
extern int _debug_grf_level;
|
||||
extern int _debug_map_level;
|
||||
extern int _debug_misc_level;
|
||||
extern int _debug_net_level;
|
||||
extern int _debug_sprite_level;
|
||||
extern int _debug_oldloader_level;
|
||||
extern int _debug_npf_level;
|
||||
extern int _debug_yapf_level;
|
||||
extern int _debug_freetype_level;
|
||||
extern int _debug_script_level;
|
||||
extern int _debug_sl_level;
|
||||
extern int _debug_gamelog_level;
|
||||
extern int _debug_desync_level;
|
||||
extern int _debug_yapfdesync_level;
|
||||
extern int _debug_console_level;
|
||||
extern int _debug_linkgraph_level;
|
||||
extern int _debug_sound_level;
|
||||
#ifdef RANDOM_DEBUG
|
||||
extern int _debug_random_level;
|
||||
extern int _debug_random_level;
|
||||
#endif
|
||||
|
||||
void CDECL debug(const char *dbg, const char *format, ...) WARN_FORMAT(2, 3);
|
||||
#endif /* NO_DEBUG_MESSAGES */
|
||||
void CDECL debug(const char *dbg, const char *format, ...) WARN_FORMAT(2, 3);
|
||||
|
||||
char *DumpDebugFacilityNames(char *buf, char *last);
|
||||
void SetDebugString(const char *s);
|
||||
|
@@ -382,38 +382,67 @@ FT_Error GetFontByFaceName(const char *font_name, FT_Face *face)
|
||||
FT_Error err = FT_Err_Cannot_Open_Resource;
|
||||
|
||||
/* Get font reference from name. */
|
||||
CFStringRef name = CFStringCreateWithCString(kCFAllocatorDefault, font_name, kCFStringEncodingUTF8);
|
||||
ATSFontRef font = ATSFontFindFromName(name, kATSOptionFlagsDefault);
|
||||
CFRelease(name);
|
||||
if (font == kInvalidFont) return err;
|
||||
|
||||
/* Get a file system reference for the font. */
|
||||
FSRef ref;
|
||||
UInt8 file_path[PATH_MAX];
|
||||
OSStatus os_err = -1;
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
if (MacOSVersionIsAtLeast(10, 5, 0)) {
|
||||
os_err = ATSFontGetFileReference(font, &ref);
|
||||
CFStringRef name = CFStringCreateWithCString(kCFAllocatorDefault, font_name, kCFStringEncodingUTF8);
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
||||
if (MacOSVersionIsAtLeast(10, 6, 0)) {
|
||||
/* Simply creating the font using CTFontCreateWithNameAndSize will *always* return
|
||||
* something, no matter the name. As such, we can't use it to check for existance.
|
||||
* We instead query the list of all font descriptors that match the given name which
|
||||
* does not do this stupid name fallback. */
|
||||
CTFontDescriptorRef name_desc = CTFontDescriptorCreateWithNameAndSize(name, 0.0);
|
||||
CFSetRef mandatory_attribs = CFSetCreate(kCFAllocatorDefault, (const void **)&kCTFontNameAttribute, 1, &kCFTypeSetCallBacks);
|
||||
CFArrayRef descs = CTFontDescriptorCreateMatchingFontDescriptors(name_desc, mandatory_attribs);
|
||||
CFRelease(mandatory_attribs);
|
||||
CFRelease(name_desc);
|
||||
CFRelease(name);
|
||||
|
||||
/* Loop over all matches until we can get a path for one of them. */
|
||||
for (CFIndex i = 0; descs != NULL && i < CFArrayGetCount(descs) && os_err != noErr; i++) {
|
||||
CTFontRef font = CTFontCreateWithFontDescriptor((CTFontDescriptorRef)CFArrayGetValueAtIndex(descs, i), 0.0, NULL);
|
||||
CFURLRef fontURL = (CFURLRef)CTFontCopyAttribute(font, kCTFontURLAttribute);
|
||||
if (CFURLGetFileSystemRepresentation(fontURL, true, file_path, lengthof(file_path))) os_err = noErr;
|
||||
CFRelease(font);
|
||||
CFRelease(fontURL);
|
||||
}
|
||||
if (descs != NULL) CFRelease(descs);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) && !defined(__LP64__)
|
||||
/* This type was introduced with the 10.5 SDK. */
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5)
|
||||
#define ATSFSSpec FSSpec
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
||||
ATSFontRef font = ATSFontFindFromName(name, kATSOptionFlagsDefault);
|
||||
CFRelease(name);
|
||||
if (font == kInvalidFont) return err;
|
||||
|
||||
/* Get a file system reference for the font. */
|
||||
FSRef ref;
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
if (MacOSVersionIsAtLeast(10, 5, 0)) {
|
||||
os_err = ATSFontGetFileReference(font, &ref);
|
||||
} else
|
||||
#endif
|
||||
FSSpec spec;
|
||||
os_err = ATSFontGetFileSpecification(font, (ATSFSSpec *)&spec);
|
||||
if (os_err == noErr) os_err = FSpMakeFSRef(&spec, &ref);
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) && !defined(__LP64__)
|
||||
/* This type was introduced with the 10.5 SDK. */
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5)
|
||||
#define ATSFSSpec FSSpec
|
||||
#endif
|
||||
FSSpec spec;
|
||||
os_err = ATSFontGetFileSpecification(font, (ATSFSSpec *)&spec);
|
||||
if (os_err == noErr) os_err = FSpMakeFSRef(&spec, &ref);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Get unix path for file. */
|
||||
if (os_err == noErr) os_err = FSRefMakePath(&ref, file_path, sizeof(file_path));
|
||||
#endif
|
||||
}
|
||||
|
||||
if (os_err == noErr) {
|
||||
/* Get unix path for file. */
|
||||
UInt8 file_path[PATH_MAX];
|
||||
if (FSRefMakePath(&ref, file_path, sizeof(file_path)) == noErr) {
|
||||
DEBUG(freetype, 3, "Font path for %s: %s", font_name, file_path);
|
||||
err = FT_New_Face(_library, (const char *)file_path, 0, face);
|
||||
}
|
||||
DEBUG(freetype, 3, "Font path for %s: %s", font_name, file_path);
|
||||
err = FT_New_Face(_library, (const char *)file_path, 0, face);
|
||||
}
|
||||
|
||||
return err;
|
||||
@@ -496,6 +525,7 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
||||
/* Create a font iterator and iterate over all fonts that
|
||||
* are available to the application. */
|
||||
ATSFontIterator itr;
|
||||
@@ -529,6 +559,7 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i
|
||||
}
|
||||
}
|
||||
ATSFontIteratorRelease(&itr);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
|
@@ -55,7 +55,7 @@ public:
|
||||
|
||||
/**
|
||||
* Resume execution of the Game Script. This function will not actually execute
|
||||
* the script, but set a flag so that the script is executed my the usual
|
||||
* the script, but set a flag so that the script is executed by the usual
|
||||
* mechanism that executes the script.
|
||||
*/
|
||||
static void Unpause();
|
||||
|
@@ -26,7 +26,7 @@ static bool CheckAPIVersion(const char *api_version)
|
||||
{
|
||||
return strcmp(api_version, "1.2") == 0 || strcmp(api_version, "1.3") == 0 || strcmp(api_version, "1.4") == 0 ||
|
||||
strcmp(api_version, "1.5") == 0 || strcmp(api_version, "1.6") == 0 || strcmp(api_version, "1.7") == 0 ||
|
||||
strcmp(api_version, "1.8") == 0;
|
||||
strcmp(api_version, "1.8") == 0 || strcmp(api_version, "1.9") == 0;
|
||||
}
|
||||
|
||||
#if defined(WIN32)
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#include "../script/api/game/game_cargo.hpp.sq"
|
||||
#include "../script/api/game/game_cargolist.hpp.sq"
|
||||
#include "../script/api/game/game_cargomonitor.hpp.sq"
|
||||
#include "../script/api/game/game_client.hpp.sq"
|
||||
#include "../script/api/game/game_clientlist.hpp.sq"
|
||||
#include "../script/api/game/game_company.hpp.sq"
|
||||
#include "../script/api/game/game_companymode.hpp.sq"
|
||||
#include "../script/api/game/game_controller.hpp.sq"
|
||||
@@ -122,6 +124,9 @@ void GameInstance::RegisterAPI()
|
||||
SQGSCargoList_IndustryProducing_Register(this->engine);
|
||||
SQGSCargoList_StationAccepting_Register(this->engine);
|
||||
SQGSCargoMonitor_Register(this->engine);
|
||||
SQGSClient_Register(this->engine);
|
||||
SQGSClientList_Register(this->engine);
|
||||
SQGSClientList_Company_Register(this->engine);
|
||||
SQGSCompany_Register(this->engine);
|
||||
SQGSCompanyMode_Register(this->engine);
|
||||
SQGSDate_Register(this->engine);
|
||||
|
@@ -594,12 +594,12 @@ static inline void GetLayouter(Layouter::LineCacheItem &line, const char *&str,
|
||||
break;
|
||||
} else if (c >= SCC_BLUE && c <= SCC_BLACK) {
|
||||
state.SetColour((TextColour)(c - SCC_BLUE));
|
||||
} else if (c == SCC_PREVIOUS_COLOUR) { // Revert to the previous colour.
|
||||
state.SetPreviousColour();
|
||||
} else if (c == SCC_TINYFONT) {
|
||||
state.SetFontSize(FS_SMALL);
|
||||
} else if (c == SCC_BIGFONT) {
|
||||
state.SetFontSize(FS_LARGE);
|
||||
} else if (c == SCC_PUSH_COLOUR) {
|
||||
state.PushColour();
|
||||
} else if (c == SCC_POP_COLOUR) {
|
||||
state.PopColour();
|
||||
} else if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) {
|
||||
state.SetFontSize((FontSize)(c - SCC_FIRST_FONT));
|
||||
} else {
|
||||
/* Filter out text direction characters that shouldn't be drawn, and
|
||||
* will not be handled in the fallback non ICU case because they are
|
||||
|
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <stack>
|
||||
|
||||
#ifdef WITH_ICU_LAYOUT
|
||||
#include "layout/ParagraphLayout.h"
|
||||
@@ -33,10 +34,11 @@
|
||||
struct FontState {
|
||||
FontSize fontsize; ///< Current font size.
|
||||
TextColour cur_colour; ///< Current text colour.
|
||||
TextColour prev_colour; ///< Text colour from before the last colour switch.
|
||||
|
||||
FontState() : fontsize(FS_END), cur_colour(TC_INVALID), prev_colour(TC_INVALID) {}
|
||||
FontState(TextColour colour, FontSize fontsize) : fontsize(fontsize), cur_colour(colour), prev_colour(colour) {}
|
||||
std::stack<TextColour> colour_stack; ///< Stack of colours to assist with colour switching.
|
||||
|
||||
FontState() : fontsize(FS_END), cur_colour(TC_INVALID) {}
|
||||
FontState(TextColour colour, FontSize fontsize) : fontsize(fontsize), cur_colour(colour) {}
|
||||
|
||||
/**
|
||||
* Switch to new colour \a c.
|
||||
@@ -45,14 +47,25 @@ struct FontState {
|
||||
inline void SetColour(TextColour c)
|
||||
{
|
||||
assert(c >= TC_BLUE && c <= TC_BLACK);
|
||||
this->prev_colour = this->cur_colour;
|
||||
this->cur_colour = c;
|
||||
}
|
||||
|
||||
/** Switch to previous colour. */
|
||||
inline void SetPreviousColour()
|
||||
/**
|
||||
* Switch to and pop the last saved colour on the stack.
|
||||
*/
|
||||
inline void PopColour()
|
||||
{
|
||||
Swap(this->cur_colour, this->prev_colour);
|
||||
if (colour_stack.empty()) return;
|
||||
SetColour(colour_stack.top());
|
||||
colour_stack.pop();
|
||||
}
|
||||
|
||||
/**
|
||||
* Push the current colour on to the stack.
|
||||
*/
|
||||
inline void PushColour()
|
||||
{
|
||||
colour_stack.push(this->cur_colour);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +162,7 @@ class Layouter : public AutoDeleteSmallVector<const ParagraphLayouter::Line *, 4
|
||||
{
|
||||
if (this->state_before.fontsize != other.state_before.fontsize) return this->state_before.fontsize < other.state_before.fontsize;
|
||||
if (this->state_before.cur_colour != other.state_before.cur_colour) return this->state_before.cur_colour < other.state_before.cur_colour;
|
||||
if (this->state_before.prev_colour != other.state_before.prev_colour) return this->state_before.prev_colour < other.state_before.prev_colour;
|
||||
if (this->state_before.colour_stack != other.state_before.colour_stack) return this->state_before.colour_stack < other.state_before.colour_stack;
|
||||
return this->str < other.str;
|
||||
}
|
||||
};
|
||||
|
@@ -150,7 +150,7 @@ void CheckExternalFiles()
|
||||
|
||||
if (used_set->GetNumInvalid() != 0) {
|
||||
/* Not all files were loaded successfully, see which ones */
|
||||
add_pos += seprintf(add_pos, last, "Trying to load graphics set '%s', but it is incomplete. The game will probably not run correctly until you properly install this set or select another one. See section 4.1 of readme.txt.\n\nThe following files are corrupted or missing:\n", used_set->name);
|
||||
add_pos += seprintf(add_pos, last, "Trying to load graphics set '%s', but it is incomplete. The game will probably not run correctly until you properly install this set or select another one. See section 4.1 of README.md.\n\nThe following files are corrupted or missing:\n", used_set->name);
|
||||
for (uint i = 0; i < GraphicsSet::NUM_FILES; i++) {
|
||||
MD5File::ChecksumResult res = GraphicsSet::CheckMD5(&used_set->files[i], BASESET_DIR);
|
||||
if (res != MD5File::CR_MATCH) add_pos += seprintf(add_pos, last, "\t%s is %s (%s)\n", used_set->files[i].filename, res == MD5File::CR_MISMATCH ? "corrupt" : "missing", used_set->files[i].missing_warning);
|
||||
@@ -160,7 +160,7 @@ void CheckExternalFiles()
|
||||
|
||||
const SoundsSet *sounds_set = BaseSounds::GetUsedSet();
|
||||
if (sounds_set->GetNumInvalid() != 0) {
|
||||
add_pos += seprintf(add_pos, last, "Trying to load sound set '%s', but it is incomplete. The game will probably not run correctly until you properly install this set or select another one. See section 4.1 of readme.txt.\n\nThe following files are corrupted or missing:\n", sounds_set->name);
|
||||
add_pos += seprintf(add_pos, last, "Trying to load sound set '%s', but it is incomplete. The game will probably not run correctly until you properly install this set or select another one. See section 4.1 of README.md.\n\nThe following files are corrupted or missing:\n", sounds_set->name);
|
||||
|
||||
assert_compile(SoundsSet::NUM_FILES == 1);
|
||||
/* No need to loop each file, as long as there is only a single
|
||||
|
@@ -598,7 +598,7 @@ STR_SORT_BY_TYPE :Тып
|
||||
STR_SORT_BY_TRANSPORTED :Вывезена
|
||||
STR_SORT_BY_NUMBER :Нумар
|
||||
STR_SORT_BY_PROFIT_LAST_YEAR :Прыбытак летась
|
||||
STR_SORT_BY_PROFIT_THIS_YEAR :Прыбытак у бягучым годзе
|
||||
STR_SORT_BY_PROFIT_THIS_YEAR :Прыбытак сёлета
|
||||
STR_SORT_BY_AGE :Узрост
|
||||
STR_SORT_BY_RELIABILITY :Надзейнасьць
|
||||
STR_SORT_BY_TOTAL_CAPACITY_PER_CARGOTYPE :Умяшчальнасьць грузу
|
||||
@@ -1685,6 +1685,8 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :выключа
|
||||
|
||||
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING :Скролінг па кліку левай кнопкай мышы: {STRING}
|
||||
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING_HELPTEXT :Уключыць пракручваньне мапы цягненьнем з націснутай левай кнопкай мышы. Гэта асабліва зручна пры выкарыстоўваньні сэнсарнага экрана.
|
||||
STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE :Зачыняць вокны пстрычкай ПКМ: {STRING}
|
||||
STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :Зачыняць акно пстрычкай правай кнопкай мышы ў яго межах. Пры гэтым адключаецца з'яўленне падказак па правай кнопцы.
|
||||
|
||||
STR_CONFIG_SETTING_AUTOSAVE :Аўтазахаваньні: {STRING}
|
||||
STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :Азначце інтэрвал паміж аўтаматычнымі захаваньнямі
|
||||
@@ -2074,6 +2076,7 @@ STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Прав
|
||||
STR_INTRO_TOOLTIP_SCRIPT_SETTINGS :{BLACK}Зьмяніць наладкі ШІ ды гульнёвага скрыпту
|
||||
STR_INTRO_TOOLTIP_QUIT :{BLACK}Выйсьці з OpenTTD
|
||||
|
||||
STR_INTRO_BASESET :{BLACK}У абраным наборы базавай графікі адсутнічае {NUM} спрайт{P "" а аў}. Калі ласка, абнавіце набор графікі.
|
||||
STR_INTRO_TRANSLATION :{BLACK}На гэту мову не перакладзен{P 0 ы ы а} {NUM} рад{P ок кі коў}. Вы можаце дапамагчы праекту, калi зарэґіструецеся як перакладчык. Інструкцыі ў файле readme.txt.
|
||||
|
||||
# Quit window
|
||||
@@ -2920,6 +2923,7 @@ STR_LAND_AREA_INFORMATION_AIRPORTTILE_NAME :{BLACK}Зона
|
||||
STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF: {LTBLUE}{STRING}
|
||||
STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Прымае: {LTBLUE}
|
||||
STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING})
|
||||
STR_LANG_AREA_INFORMATION_RAIL_TYPE :{BLACK}Тып чыгуначнага палатна: {LTBLUE}{STRING}
|
||||
STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Макс. хуткасьць чыгункi: {LTBLUE}{VELOCITY}
|
||||
STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}Макс. хуткасьць аўтамабіляў: {LTBLUE}{VELOCITY}
|
||||
|
||||
@@ -2932,29 +2936,29 @@ STR_LAI_CLEAR_DESCRIPTION_FIELDS :Палi
|
||||
STR_LAI_CLEAR_DESCRIPTION_SNOW_COVERED_LAND :Засьнежаная зямля
|
||||
STR_LAI_CLEAR_DESCRIPTION_DESERT :Пустэльня
|
||||
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK :Чыгунка рэйкi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_SIGNALS :Чыгунка рэйкi са звычайнымі сыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRESIGNALS :Чыгунка рэйкi з уваходнымі прэсыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXITSIGNALS :Чыгунка рэйкi з выхаднымi сыґналамi (прэсыґналамі)
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBOSIGNALS :Чыгунка рэйкi з камбiнаванымi сыґналамi (прэсыґналамі)
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBSSIGNALS :Чыгунка рэйкi з маршрутнымi (PMS) сыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NOENTRYSIGNALS :Чыгунка рэйкi з аднабаковымi маршрутнымi (PMS) сыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PRESIGNALS :Чыгунка рэйкi са звычайнымi й уваходнымі прэсыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_EXITSIGNALS :Чыгунка рэйкi са звычайнымi й выхаднымi сыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_COMBOSIGNALS :Чыгунка рэйкi са звычайнымi й камбiнаванымi сыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PBSSIGNALS :Чыгунка рэйкi са звычайнымi й маршрутнымi (PMS) сыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_NOENTRYSIGNALS :Чыгунка рэйкi са звычайнымi й аднабаковымi маршрутнымi (PMS) сыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_EXITSIGNALS :Чыгунка рэйкi з уваходнымi (прэcыгналамi) ды выхаднымi сыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_COMBOSIGNALS :Чыгунка рэйкi з уваходнымi (прэсыґналамi) ды камбiнаванымi сыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_PBSSIGNALS :Чыгунка рэйкi з уваходнымi (прэсыґналамi) ды маршрутнымi (PMS) сыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_NOENTRYSIGNALS :Чыгунка рэйкi з уваходнымi (прэсыґналамi) ды аднабаковымi маршрутнымi (PMS) сыґналамi
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_COMBOSIGNALS :Чыгунка рэйкi з выхаднымi й камбінаванымі прэсыґналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_PBSSIGNALS :Чыгунка рэйкі з выхаднымі (прэсыґналамі) ды маршрутнымі (PMS) сыґналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_NOENTRYSIGNALS :Чыгунка рэйкі з выхаднымі (прэсыґналамі) ды аднабаковымі маршрутнымі (PMS) сыґналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_PBSSIGNALS :Чыгунка рэйкі з камбінаванымі (прэсыґналамі) ды маршрутнымі (PMS) сыґналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_NOENTRYSIGNALS :Чыгунка рэйкі з камбінаванымі (прэсыґналамі) ды аднабаковымі маршрутнымі (PMS) сыґналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBS_NOENTRYSIGNALS :Чыгунка рэйкі з маршрутнымі (PMS) ды аднабаковымі маршрутнымі сыґналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRAIN_DEPOT :Чыгунка чыгуначнае дэпо
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK :Чыгуначны пуць
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_SIGNALS :Чыгуначны пуць з сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRESIGNALS :Чыгуначны пуць з уваходнымі сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXITSIGNALS :Чыгуначны пуць з выходнымі сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBOSIGNALS :Чыгуначны пуць з камбінаванымі сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBSSIGNALS :Чыгуначны пуць з маршрутнымі сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NOENTRYSIGNALS :Чыгуначны пуць з аднабаковымі маршрутнымі сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PRESIGNALS :Чыгуначны пуць са звычайным і ўваходным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_EXITSIGNALS :Чыгуначны пуць са звычайным і выходным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_COMBOSIGNALS :Чыгуначны пуць са звычайнымі й камбінаванымі сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_PBSSIGNALS :Чыгуначны пуць са звычайнымі і маршрутнымі сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_NOENTRYSIGNALS :Чыгуначны пуць са звычайным і аднабаковым маршрутным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_EXITSIGNALS :Чыгуначны пуць з уваходным і выходным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_COMBOSIGNALS :Чыгуначны пуць з уваходным і камбінаваным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_PBSSIGNALS :Чыгуначны пуць з выходным і маршрутным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PRE_NOENTRYSIGNALS :Чыгуначны пуць з уваходным і аднабаковым маршрутным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_COMBOSIGNALS :Чыгуначны пуць з выходнымі й камбінаванымі сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_PBSSIGNALS :Чыгуначны пуць з выходным і маршрутным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_EXIT_NOENTRYSIGNALS :Чыгуначны пуць з выходным і аднабаковым маршрутным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_PBSSIGNALS :Чыгуначны пуць з камбінаваным і маршрутным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_COMBO_NOENTRYSIGNALS :Чыгуначны пуць з камбінаваным і аднабаковым маршрутным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_PBS_NOENTRYSIGNALS :Чыгуначны пуць з маршрутным і аднабаковым маршрутным сігналамі
|
||||
STR_LAI_RAIL_DESCRIPTION_TRAIN_DEPOT :Чыгуначнае дэпо
|
||||
|
||||
STR_LAI_ROAD_DESCRIPTION_ROAD :Дарога
|
||||
STR_LAI_ROAD_DESCRIPTION_ROAD_WITH_STREETLIGHTS :Дарога з вулічным асьвятленьнем
|
||||
@@ -3625,6 +3629,9 @@ STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO :{BLACK}Патр
|
||||
STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO_CARGO :{BLACK}Патрабуецца: {YELLOW}{STRING}{STRING}, {STRING}{STRING}, {STRING}{STRING}
|
||||
############ range for requires ends
|
||||
|
||||
STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Патрабуецца:
|
||||
STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING}
|
||||
STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT :{YELLOW}{STRING}{BLACK}: {CARGO_SHORT} чакае{STRING}
|
||||
|
||||
############ range for produces starts
|
||||
STR_INDUSTRY_VIEW_PRODUCES_CARGO :{BLACK}Вырабляе: {YELLOW}{STRING}{STRING}
|
||||
@@ -3645,7 +3652,7 @@ STR_VEHICLE_LIST_ROAD_VEHICLE_TOOLTIP :{BLACK}Аўта
|
||||
STR_VEHICLE_LIST_SHIP_TOOLTIP :{BLACK}Караблi: клікніце для атрыманьня даведкі
|
||||
STR_VEHICLE_LIST_AIRCRAFT_TOOLTIP :{BLACK}Самалёты: клікніце для атрыманьня даведкі
|
||||
|
||||
STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Прыбытак у гэтым годзе: {CURRENCY_LONG} (летась: {CURRENCY_LONG})
|
||||
STR_VEHICLE_LIST_PROFIT_THIS_YEAR_LAST_YEAR :{TINY_FONT}{BLACK}Прыбытак сёлета: {CURRENCY_LONG} (летась: {CURRENCY_LONG})
|
||||
|
||||
STR_VEHICLE_LIST_AVAILABLE_TRAINS :Даступныя цягнiкi
|
||||
STR_VEHICLE_LIST_AVAILABLE_ROAD_VEHICLES :Даступныя аўтамабiлi
|
||||
@@ -3693,6 +3700,10 @@ STR_GROUP_REMOVE_ALL_VEHICLES :Выдаліц
|
||||
|
||||
STR_GROUP_RENAME_CAPTION :{BLACK}Перайменаваць групу
|
||||
|
||||
STR_GROUP_PROFIT_THIS_YEAR :Прыбытак сёлета:
|
||||
STR_GROUP_PROFIT_LAST_YEAR :Прыбытак летась:
|
||||
STR_GROUP_OCCUPANCY :Сярэдняя загрузка ТС:
|
||||
STR_GROUP_OCCUPANCY_VALUE :{NUM}%
|
||||
|
||||
# Build vehicle window
|
||||
STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION :Новы цягнік
|
||||
@@ -3725,6 +3736,7 @@ STR_PURCHASE_INFO_ALL_TYPES :Усе тыпы
|
||||
STR_PURCHASE_INFO_ALL_BUT :Усё, акрамя {CARGO_LIST}
|
||||
STR_PURCHASE_INFO_MAX_TE :{BLACK}Макс. цягавае намаганьне: {GOLD}{FORCE}
|
||||
STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Далёкасьць: {GOLD}{COMMA} клет{P ка кi ак}
|
||||
STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Тып паветр. судна: {GOLD}{STRING}
|
||||
|
||||
STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Сьпіс лакаматываў і вагонаў - пстрыкніце для атрыманьня інфармацыі. Ctrl+пстрычка схавае/пакажа ТС.
|
||||
STR_BUY_VEHICLE_ROAD_VEHICLE_LIST_TOOLTIP :{BLACK}Сьпіс аўтатранспарту - пстрыкніце для атрыманьня інфармацыі. Ctrl+пстрычка схавае/пакажа выбраны аўтамабіль.
|
||||
@@ -3871,6 +3883,10 @@ STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE.acc :магніта
|
||||
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}Кошт: {CURRENCY_LONG} Вага: {WEIGHT_SHORT}{}Хуткасьць: {VELOCITY} Магутнасьць: {POWER}{}Кошт абслуг.: {CURRENCY_LONG}/год{}Ёмістасьць: {CARGO_LONG}
|
||||
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Кошт: {CURRENCY_LONG} Вага: {WEIGHT_SHORT}{}Хуткасьць: {VELOCITY} Магутнасьць: {POWER} Макс. ЦН: {6:FORCE}{}Кошт абслуг.: {4:CURRENCY_LONG}/год{}Ёмістасьць: {5:CARGO_LONG}
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}Кошт: {CURRENCY_LONG} Макс. хуткасьць: {VELOCITY}{}Ёмістасьць: {CARGO_LONG}{}Кошт абслуг.: {CURRENCY_LONG}/год
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_CAP_RUNCOST :{BLACK}Кошт: {CURRENCY_LONG} Макс. хуткасць: {VELOCITY}{}Тып: {STRING}{}Ёмістасць: {CARGO_LONG}, {CARGO_LONG}{}Кошт абслуг.: {CURRENCY_LONG}/год
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}Кошт: {CURRENCY_LONG} Макс. хуткасць: {VELOCITY}{}Тып: {STRING}{}Ёмістасць: {CARGO_LONG}{}Кошт абслуг.: {CURRENCY_LONG}/год
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_CAP_RUNCOST :{BLACK}Кошт: {CURRENCY_LONG} Макс. хуткасць: {VELOCITY}{}Тып: {STRING} Далёкасць: {COMMA} клетак{}Ёмістасць: {CARGO_LONG}, {CARGO_LONG}{}Кошт абслуг.: {CURRENCY_LONG}/год
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_RUNCOST :{BLACK}Кошт: {CURRENCY_LONG} Макс. хуткасць: {VELOCITY}{}Тып: {STRING} Далёкасць: {COMMA} клетак{}Ёмістасць: {CARGO_LONG}{}Кошт абслуг.: {CURRENCY_LONG}/год
|
||||
|
||||
# Autoreplace window
|
||||
STR_REPLACE_VEHICLES_WHITE :{WHITE}Замена {STRING.gen} — {STRING}
|
||||
@@ -3908,6 +3924,7 @@ STR_REPLACE_HELP_STOP_BUTTON :{BLACK}Спын
|
||||
STR_REPLACE_ENGINE_WAGON_SELECT_HELP :{BLACK}Пераключэньне паміж вокнамі замены лякаматываў і ваґонаў
|
||||
STR_REPLACE_ENGINES :Лякаматывы
|
||||
STR_REPLACE_WAGONS :Ваґоны
|
||||
STR_REPLACE_ALL_RAILTYPE :Увесь чыгуначны транспарт
|
||||
|
||||
STR_REPLACE_HELP_RAILTYPE :{BLACK}Выберыце тып чыгуначнага транспарту, цягнікі якога жадаеце замяніць
|
||||
STR_REPLACE_HELP_REPLACE_INFO_TAB :{BLACK}На які транспарт адбываецца замена
|
||||
@@ -4000,10 +4017,12 @@ STR_VEHICLE_INFO_AGE :{COMMA} г{P о
|
||||
STR_VEHICLE_INFO_AGE_RED :{RED}{COMMA} г{P од ады адоў} ({COMMA})
|
||||
|
||||
STR_VEHICLE_INFO_MAX_SPEED :{BLACK}Макс. хуткасьць: {LTBLUE}{VELOCITY}
|
||||
STR_VEHICLE_INFO_MAX_SPEED_TYPE :{BLACK}Макс. хуткасць: {LTBLUE}{VELOCITY} {BLACK}Тып паветр. судна: {LTBLUE}{STRING}
|
||||
STR_VEHICLE_INFO_MAX_SPEED_TYPE_RANGE :{BLACK}Макс. хуткасць: {LTBLUE}{VELOCITY} {BLACK}Тып: {LTBLUE}{STRING} {BLACK}Далёкасць: {LTBLUE}{COMMA} клетак
|
||||
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Вага: {LTBLUE}{WEIGHT_SHORT} {BLACK}Магутнасьць: {LTBLUE}{POWER}{BLACK} Макс. хуткасьць: {LTBLUE}{VELOCITY}
|
||||
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Вага: {LTBLUE}{WEIGHT_SHORT} {BLACK}Магутнасьць: {LTBLUE}{POWER}{BLACK} Макс. хуткасьць: {LTBLUE}{VELOCITY} {BLACK}Макс. ЦН: {LTBLUE}{FORCE}
|
||||
|
||||
STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Прыбытак ў гэтым годзе: {LTBLUE}{CURRENCY_LONG} (летась: {CURRENCY_LONG})
|
||||
STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Прыбытак сёлета: {LTBLUE}{CURRENCY_LONG} (летась: {CURRENCY_LONG})
|
||||
STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Надзейнасьць: {LTBLUE}{COMMA}% {BLACK}Паломак з апошняга агляду: {LTBLUE}{COMMA}
|
||||
|
||||
STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Пабудаваны ў: {LTBLUE}{NUM} г.{BLACK} Кошт: {LTBLUE}{CURRENCY_LONG}
|
||||
|
@@ -473,9 +473,9 @@ STR_ABOUT_MENU_SCREENSHOT :Screenshot
|
||||
STR_ABOUT_MENU_ZOOMIN_SCREENSHOT :Напълно увеличен в кадъра.
|
||||
STR_ABOUT_MENU_DEFAULTZOOM_SCREENSHOT :Увеличение по подразбиране
|
||||
STR_ABOUT_MENU_GIANT_SCREENSHOT :Огромен Screenshot
|
||||
STR_ABOUT_MENU_ABOUT_OPENTTD :За 'OpenTTD'
|
||||
STR_ABOUT_MENU_ABOUT_OPENTTD :Относно 'OpenTTD'
|
||||
STR_ABOUT_MENU_SPRITE_ALIGNER :Подравнител на спрайтове
|
||||
STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Превключва слепване на прозците
|
||||
STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Активиране слепване на прозорците
|
||||
STR_ABOUT_MENU_TOGGLE_DIRTY_BLOCKS :Превключва оцветяване на замърсените блокове
|
||||
############ range ends here
|
||||
|
||||
@@ -755,6 +755,7 @@ STR_SMALLMAP_TOOLTIP_ENABLE_ALL_INDUSTRIES :{BLACK}Пока
|
||||
STR_SMALLMAP_TOOLTIP_SHOW_HEIGHT :{BLACK}Показване/скриване на височинна карта
|
||||
STR_SMALLMAP_TOOLTIP_DISABLE_ALL_COMPANIES :{BLACK}Скриване на собствеността на компанията от картата
|
||||
STR_SMALLMAP_TOOLTIP_ENABLE_ALL_COMPANIES :{BLACK}Показване на цялата собственост на компанията на картата
|
||||
STR_SMALLMAP_TOOLTIP_ENABLE_ALL_CARGOS :{BLACK}Покажи всички товари на картата
|
||||
|
||||
# Status bar messages
|
||||
STR_STATUSBAR_TOOLTIP_SHOW_LAST_NEWS :{BLACK}Покажи последното съобщение или отчет на новините
|
||||
@@ -1282,6 +1283,7 @@ STR_CONFIG_SETTING_POPULATION_IN_LABEL_HELPTEXT :Показва
|
||||
STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS :Дебелина на линиите в графиките: {STRING}
|
||||
STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT :Дебелина на линиите в графиките. Тънките линии са по-лесни за разчитане, но по-дебелите се забелязват и разграничават по-лесно.
|
||||
|
||||
STR_CONFIG_SETTING_LANDSCAPE :Пейзаж: {STRING}
|
||||
STR_CONFIG_SETTING_LAND_GENERATOR :Генератор на земя: {STRING}
|
||||
STR_CONFIG_SETTING_LAND_GENERATOR_ORIGINAL :оригинален
|
||||
STR_CONFIG_SETTING_LAND_GENERATOR_TERRA_GENESIS :тера-генезис
|
||||
@@ -1293,6 +1295,7 @@ STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :много по
|
||||
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH :полегат
|
||||
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH :стръмен
|
||||
STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH :много стръмен
|
||||
STR_CONFIG_SETTING_RIVER_AMOUNT :Количество на реките: {STRING}
|
||||
STR_CONFIG_SETTING_TREE_PLACER :Алгоритъм за поставяне на дървета: {STRING}
|
||||
STR_CONFIG_SETTING_TREE_PLACER_NONE :без дървета
|
||||
STR_CONFIG_SETTING_TREE_PLACER_ORIGINAL :оригинален
|
||||
@@ -1584,6 +1587,7 @@ STR_CONFIG_SETTING_LARGER_TOWNS_DISABLED :Без
|
||||
STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER :Множител за големината на града: {STRING}
|
||||
STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER_HELPTEXT :Относителен размер на мегаполисите в сравнение с градовете в началото на играта
|
||||
|
||||
STR_CONFIG_SETTING_DEMAND_SIZE :Количество на връщания товар при симетричнен режим: {STRING}
|
||||
|
||||
STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY :Единици за скорост: {STRING}
|
||||
STR_CONFIG_SETTING_LOCALISATION_UNITS_VELOCITY_HELPTEXT :Всеки път при показване на скорости, да бъдат изписвани в избраните мерни единици
|
||||
@@ -1624,9 +1628,11 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_SI :SI (m)
|
||||
STR_CONFIG_SETTING_LOCALISATION :{ORANGE}Позициониране
|
||||
STR_CONFIG_SETTING_SOUND :{ORANGE}Звукови ефекти
|
||||
STR_CONFIG_SETTING_INTERFACE :{ORANGE}Интерфейс
|
||||
STR_CONFIG_SETTING_INTERFACE_GENERAL :{ORANGE}Основни
|
||||
STR_CONFIG_SETTING_INTERFACE_CONSTRUCTION :{ORANGE}Строене
|
||||
STR_CONFIG_SETTING_VEHICLES :{ORANGE}Автомобили
|
||||
STR_CONFIG_SETTING_VEHICLES_ROUTING :{ORANGE}Маршрутизация
|
||||
STR_CONFIG_SETTING_ENVIRONMENT_AUTHORITIES :{ORANGE}Права
|
||||
STR_CONFIG_SETTING_ENVIRONMENT_TOWNS :{ORANGE}Градове
|
||||
STR_CONFIG_SETTING_ENVIRONMENT_INDUSTRIES :{ORANGE}Индустрии
|
||||
STR_CONFIG_SETTING_AI :{ORANGE}Съперници
|
||||
@@ -2528,6 +2534,7 @@ STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF:
|
||||
STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Приет товар: {LTBLUE}
|
||||
STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING})
|
||||
STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Ограничение на скоростта на линията: {LTBLUE}{VELOCITY}
|
||||
STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}Макс. скорост на пътя: {LTBLUE}{VELOCITY}
|
||||
|
||||
# Description of land area of different tiles
|
||||
STR_LAI_CLEAR_DESCRIPTION_ROCKS :Скали
|
||||
@@ -3008,6 +3015,7 @@ STR_SUBSIDIES_SUBSIDISED_FROM_TO :{ORANGE}{STRING
|
||||
STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Натисни върху услугата за да се фокусира върху индустрията/града. Ctrl отваря нов изглед към индустрията/града
|
||||
|
||||
# Story book window
|
||||
STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}Прескочи до определена страница чрез избирането й в дроп-даун листата.
|
||||
STR_STORY_BOOK_NEXT_PAGE :{BLACK}Следваща
|
||||
STR_STORY_BOOK_NEXT_PAGE_TOOLTIP :{BLACK}Отиди на следващата страница
|
||||
STR_STORY_BOOK_INVALID_GOAL_REF :{RED}Невалидна цел
|
||||
@@ -3214,6 +3222,7 @@ STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO :{BLACK}Нужд
|
||||
STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO_CARGO :{BLACK}Нуждае се от: {YELLOW}{STRING}{STRING}, {STRING}{STRING}, {STRING}{STRING}
|
||||
############ range for requires ends
|
||||
|
||||
STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT :{YELLOW}{STRING}{BLACK}: {CARGO_SHORT} чакащ{STRING}
|
||||
|
||||
############ range for produces starts
|
||||
STR_INDUSTRY_VIEW_PRODUCES_CARGO :{BLACK}Произвежда: {YELLOW}{STRING}{STRING}
|
||||
@@ -3274,12 +3283,16 @@ STR_GROUP_DELETE_TOOLTIP :{BLACK}Изтр
|
||||
STR_GROUP_RENAME_TOOLTIP :{BLACK}Преименувай избраната група
|
||||
STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Щракни да защитиш тази група от глобална автоматична замяна
|
||||
|
||||
STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Изтрий група
|
||||
STR_GROUP_DELETE_QUERY_TEXT :{WHITE}Сигурен ли си, че искаш да изтриеш тази група и нейните производни?
|
||||
|
||||
STR_GROUP_ADD_SHARED_VEHICLE :Добави споделени превозни средства
|
||||
STR_GROUP_REMOVE_ALL_VEHICLES :Премахни всички превозни средсва
|
||||
|
||||
STR_GROUP_RENAME_CAPTION :{BLACK}Преименовай група
|
||||
|
||||
STR_GROUP_OCCUPANCY :Използва се за:
|
||||
STR_GROUP_OCCUPANCY_VALUE :{NUM}%
|
||||
|
||||
# Build vehicle window
|
||||
STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION :Нови Машини за Двурелсов път
|
||||
@@ -3446,6 +3459,7 @@ STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE :локомот
|
||||
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}Цена: {CURRENCY_LONG} Тегло: {WEIGHT_SHORT}{}Скорост: {VELOCITY} Мощност: {POWER}{}Разход: {CURRENCY_LONG}/г.{}Капацитет: {CARGO_LONG}
|
||||
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Цена: {CURRENCY_LONG} Тегло: {WEIGHT_SHORT}{}Скорост: {VELOCITY} Мощност: {POWER} Макс. Т.С.: {6:FORCE}{}Експлоатационни разходи: {4:CURRENCY_LONG}/год.{}Вместимост: {5:CARGO_LONG}
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}Цена: {CURRENCY_LONG} Макс. Скорост: {VELOCITY}{}Вместимост: {CARGO_LONG}{}Експлоатационни разходи: {CURRENCY_LONG}/год.
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}Цена: {CURRENCY_LONG} Макс.скорост: {VELOCITY}{}Тип самолет: {STRING}{}Вместимост: {CARGO_LONG}{}Оперативни разходи: {CURRENCY_LONG}/yr
|
||||
|
||||
# Autoreplace window
|
||||
STR_REPLACE_VEHICLES_WHITE :{WHITE}Замяна {STRING} - {STRING}
|
||||
@@ -3475,6 +3489,7 @@ STR_REPLACE_HELP_STOP_BUTTON :{BLACK}Нати
|
||||
STR_REPLACE_ENGINE_WAGON_SELECT_HELP :{BLACK}Превключване между замяна на локомотиви и вагони
|
||||
STR_REPLACE_ENGINES :Двигатели
|
||||
STR_REPLACE_WAGONS :Вагони
|
||||
STR_REPLACE_ALL_RAILTYPE :Всички ЖП композиции
|
||||
|
||||
STR_REPLACE_HELP_RAILTYPE :{BLACK}Избор на ЖП линия с която да се заменят локомотивите
|
||||
STR_REPLACE_HELP_REPLACE_INFO_TAB :{BLACK}Показване с кой двигател се заменя ляво избрания, ако има
|
||||
@@ -4268,6 +4283,7 @@ STR_ERROR_YOU_ALREADY_OWN_IT :{WHITE}... ви
|
||||
STR_ERROR_GROUP_CAN_T_CREATE :{WHITE}Групата неможе да бъде създадена...
|
||||
STR_ERROR_GROUP_CAN_T_DELETE :{WHITE}Тази група неможе да бъде изтрита...
|
||||
STR_ERROR_GROUP_CAN_T_RENAME :{WHITE}Групата неможе да бъде преименована...
|
||||
STR_ERROR_GROUP_CAN_T_SET_PARENT :{WHITE}Не може да избере горна група....
|
||||
STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES :{WHITE}Всички превозни средства немогат да бъдат премахнати от тази група...
|
||||
STR_ERROR_GROUP_CAN_T_ADD_VEHICLE :{WHITE}Превозното средство неможе да се добави към тази група...
|
||||
STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE :{WHITE}Поделени превозни средсва немогат да бъдат добавени към групата...
|
||||
|
@@ -1372,6 +1372,7 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :Non-aktifkan
|
||||
|
||||
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING :Geser dgn klik-kiri: {STRING}
|
||||
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING_HELPTEXT :Aktifkan penggeseran peta dengan menyeret menggunakan tombol kiri mouse. Hal ini sangat berguna apabila menggunakan layar sentuh.
|
||||
STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE :Tutup jendela dengan klik kanan: {STRING}
|
||||
|
||||
STR_CONFIG_SETTING_AUTOSAVE :Simpan otomatis: {STRING}
|
||||
STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :Memilih jarak waktu antara menyimpan data game
|
||||
@@ -2587,6 +2588,7 @@ STR_LAND_AREA_INFORMATION_AIRPORTTILE_NAME :{BLACK}Nama are
|
||||
STR_LAND_AREA_INFORMATION_NEWGRF_NAME :{BLACK}NewGRF: {LTBLUE}{STRING}
|
||||
STR_LAND_AREA_INFORMATION_CARGO_ACCEPTED :{BLACK}Muatan diterima: {LTBLUE}
|
||||
STR_LAND_AREA_INFORMATION_CARGO_EIGHTS :({COMMA}/8 {STRING})
|
||||
STR_LANG_AREA_INFORMATION_RAIL_TYPE :{BLACK}Tipe Rel: {LTBLUE}{STRING}
|
||||
STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Batasan kecepatan rel: {LTBLUE}{VELOCITY}
|
||||
STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}Batasan kecepatan jalan: {LTBLUE}{VELOCITY}
|
||||
|
||||
@@ -3356,6 +3358,7 @@ STR_GROUP_REMOVE_ALL_VEHICLES :Jual semua
|
||||
|
||||
STR_GROUP_RENAME_CAPTION :{BLACK}Ubah nama kelompok
|
||||
|
||||
STR_GROUP_PROFIT_THIS_YEAR :Keuntungan tahun ini:
|
||||
|
||||
# Build vehicle window
|
||||
STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION :Kereta Baru
|
||||
@@ -3643,6 +3646,7 @@ STR_VEHICLE_INFO_AGE :{COMMA} tahun (
|
||||
STR_VEHICLE_INFO_AGE_RED :{RED}{COMMA} tahun ({COMMA})
|
||||
|
||||
STR_VEHICLE_INFO_MAX_SPEED :{BLACK}Kec. Max: {LTBLUE}{VELOCITY}
|
||||
STR_VEHICLE_INFO_MAX_SPEED_TYPE :{BLACK}Kecepatan Maks.: {LTBLUE}{VELOCITY} {BLACK}Jenis pesawat: {LTBLUE}{STRING}
|
||||
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Berat: {LTBLUE}{WEIGHT_SHORT} {BLACK}Tenaga: {LTBLUE}{POWER}{BLACK} Kec. Max: {LTBLUE}{VELOCITY}
|
||||
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Berat: {LTBLUE}{WEIGHT_SHORT} {BLACK}Tenaga: {LTBLUE}{POWER}{BLACK} Kec. Max: {LTBLUE}{VELOCITY} {BLACK}Max. T.E.: {LTBLUE}{FORCE}
|
||||
|
||||
|
@@ -301,7 +301,7 @@ STR_SORT_BY_WAITING_TOTAL :Cargamento tota
|
||||
STR_SORT_BY_WAITING_AVAILABLE :Cargamento disponible en espera
|
||||
STR_SORT_BY_RATING_MAX :Valoración más alta de cargamento
|
||||
STR_SORT_BY_RATING_MIN :Valoración más baja de cargamento
|
||||
STR_SORT_BY_ENGINE_ID :EngineID (classic sort)Id. locomotora (orden clásico)
|
||||
STR_SORT_BY_ENGINE_ID :Id. locomotora (orden clásico)
|
||||
STR_SORT_BY_COST :Costo
|
||||
STR_SORT_BY_POWER :Potencia
|
||||
STR_SORT_BY_TRACTIVE_EFFORT :Fuerza de tracción
|
||||
@@ -1108,7 +1108,7 @@ STR_CONFIG_SETTING_RESTRICT_TYPE :{BLACK}Tipo:
|
||||
STR_CONFIG_SETTING_RESTRICT_DROPDOWN_HELPTEXT :{BLACK}Mostrar lista con opciones predeterminadas
|
||||
STR_CONFIG_SETTING_RESTRICT_BASIC :Básico (mostrar solo las opciones más esenciales)
|
||||
STR_CONFIG_SETTING_RESTRICT_ADVANCED :Avanzado (mostrar la mayoría de las opciones)
|
||||
STR_CONFIG_SETTING_RESTRICT_ALL :Experto (mostrar todas las opciones, hasta las más extrañas)
|
||||
STR_CONFIG_SETTING_RESTRICT_ALL :Experto (mostrar todas las opciones, incluso las avanzadas)
|
||||
STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_DEFAULT :Opciones con un valor diferente al predeterminado
|
||||
STR_CONFIG_SETTING_RESTRICT_CHANGED_AGAINST_NEW :Opciones con un valor diferente a las opciones de partida nueva
|
||||
|
||||
@@ -1344,8 +1344,8 @@ STR_CONFIG_SETTING_SMOOTH_SCROLLING :Desplazamiento
|
||||
STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Forma en la que la vista principal se mueve a una ubicación específica al hacer clic en el minimapa o tras una orden de moverse a un objeto determinado del mapa. Si se activa, la vista se mueve de forma suave. Si se desactiva, la vista se mueve instantáneamente al sitio indicado
|
||||
STR_CONFIG_SETTING_MEASURE_TOOLTIP :Mostrar información de medidas al usar las herramientas de construcción: {STRING}
|
||||
STR_CONFIG_SETTING_MEASURE_TOOLTIP_HELPTEXT :Mostrar distancias en número de casillas y las diferencias de altura cuando se realicen labores de construcción
|
||||
STR_CONFIG_SETTING_LIVERIES :Mostrar diseño de colores según el tipo de vehículo: {STRING}
|
||||
STR_CONFIG_SETTING_LIVERIES_HELPTEXT :Controlar el uso de diseños de colores específicos para vehículos en lugar de los específicos de cada empresa
|
||||
STR_CONFIG_SETTING_LIVERIES :Mostrar cromáticas por tipo de vehículo: {STRING}
|
||||
STR_CONFIG_SETTING_LIVERIES_HELPTEXT :Controlar el uso de cromáticas por vehículo y no por empresa
|
||||
STR_CONFIG_SETTING_LIVERIES_NONE :Ninguno
|
||||
STR_CONFIG_SETTING_LIVERIES_OWN :Mi empresa
|
||||
STR_CONFIG_SETTING_LIVERIES_ALL :Todas las empresas
|
||||
@@ -3214,7 +3214,7 @@ STR_COMPANY_VIEW_CAPTION :{WHITE}{COMPANY
|
||||
STR_COMPANY_VIEW_PRESIDENT_MANAGER_TITLE :{WHITE}{PRESIDENT_NAME}{}{GOLD}(Presidente)
|
||||
|
||||
STR_COMPANY_VIEW_INAUGURATED_TITLE :{GOLD}Inaugurada: {WHITE}{NUM}
|
||||
STR_COMPANY_VIEW_COLOUR_SCHEME_TITLE :{GOLD}Diseño de colores:
|
||||
STR_COMPANY_VIEW_COLOUR_SCHEME_TITLE :{GOLD}Cromática:
|
||||
STR_COMPANY_VIEW_VEHICLES_TITLE :{GOLD}Vehículos:
|
||||
STR_COMPANY_VIEW_TRAINS :{WHITE}{COMMA} tren{P "" es}
|
||||
STR_COMPANY_VIEW_ROAD_VEHICLES :{WHITE}{COMMA} vehículo{P "" s} de carretera
|
||||
@@ -3243,8 +3243,8 @@ STR_COMPANY_VIEW_GIVE_MONEY_BUTTON :{BLACK}Dar dine
|
||||
|
||||
STR_COMPANY_VIEW_NEW_FACE_BUTTON :{BLACK}Nueva cara
|
||||
STR_COMPANY_VIEW_NEW_FACE_TOOLTIP :{BLACK}Elegir nueva cara para el presidente
|
||||
STR_COMPANY_VIEW_COLOUR_SCHEME_BUTTON :{BLACK}Diseño de colores
|
||||
STR_COMPANY_VIEW_COLOUR_SCHEME_TOOLTIP :{BLACK}Cambiar el diseño de colores corporativos de la empresa
|
||||
STR_COMPANY_VIEW_COLOUR_SCHEME_BUTTON :{BLACK}Cromática
|
||||
STR_COMPANY_VIEW_COLOUR_SCHEME_TOOLTIP :{BLACK}Cambiar la cromática (colores corporativos) de los vehículos
|
||||
STR_COMPANY_VIEW_COMPANY_NAME_BUTTON :{BLACK}Nombre empresa
|
||||
STR_COMPANY_VIEW_COMPANY_NAME_TOOLTIP :{BLACK}Cambiar el nombre de la empresa
|
||||
STR_COMPANY_VIEW_PRESIDENT_NAME_BUTTON :{BLACK}Nombre presidente
|
||||
|
@@ -1372,6 +1372,8 @@ STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_OFF :I ffwrdd
|
||||
|
||||
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING :Sgrolio Clic-chwith: {STRING}
|
||||
STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING_HELPTEXT :Galluogi sgrolio ar y map drwy ei lusgo gyda botwm chwith y llygoden. Mae hyn yn arbennig o ddefnyddiol pan yn defnyddio sgrin-gyffwrdd ar gyfer sgrolio
|
||||
STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE :Cau ffenest wrth dde-glicio: {STRING}
|
||||
STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :Cau ffenest wrth dde-glicio tu fewn iddo. Mae hyn yn analluogi dangos gwybodaeth ar dde-clicio!
|
||||
|
||||
STR_CONFIG_SETTING_AUTOSAVE :Awtogadw: {STRING}
|
||||
STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :Dewis pa mor aml y dylid awtogadw gemau
|
||||
@@ -1761,6 +1763,7 @@ STR_INTRO_TOOLTIP_ONLINE_CONTENT :{BLACK}Gwirio a
|
||||
STR_INTRO_TOOLTIP_SCRIPT_SETTINGS :{BLACK}Dangos gosodiadau AI a sgript Gêm
|
||||
STR_INTRO_TOOLTIP_QUIT :{BLACK}Gadael 'OpenTTD'
|
||||
|
||||
STR_INTRO_BASESET :{BLACK}Mae {NUM} corlun ar goll o'r set raffeg sylfaenol a ddewiswyd. Gwiriwch am ddiweddariadau i'r set raffeg.
|
||||
STR_INTRO_TRANSLATION :{BLACK}Mae'r cyfieithiad yma'n brin o {NUM} llinyn. Helpwch wella OpenTTD drwy ymaelodi fel cyfieithydd. Gweler readme.txt am fanylion.
|
||||
|
||||
# Quit window
|
||||
@@ -3098,7 +3101,7 @@ STR_STATION_LIST_STATION :{YELLOW}{STATIO
|
||||
STR_STATION_LIST_WAYPOINT :{YELLOW}{WAYPOINT}
|
||||
STR_STATION_LIST_NONE :{YELLOW}- Dim -
|
||||
STR_STATION_LIST_SELECT_ALL_FACILITIES :{BLACK}Dewis pob cyfleuster
|
||||
STR_STATION_LIST_SELECT_ALL_TYPES :{BLACK}Dewis pob math llwyth (gan gynnwys llwythi dim aros)
|
||||
STR_STATION_LIST_SELECT_ALL_TYPES :{BLACK}Dewis pob math llwyth (gan gynnwys llwythi lle nad oes dim yn disgwyl)
|
||||
STR_STATION_LIST_NO_WAITING_CARGO :{BLACK}Nid oes llwyth o unrhyw fath yn disgwyl
|
||||
|
||||
# Station view window
|
||||
@@ -3293,6 +3296,9 @@ STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO :{BLACK}Angen: {
|
||||
STR_INDUSTRY_VIEW_REQUIRES_CARGO_CARGO_CARGO :{BLACK}Angen: {YELLOW}{STRING}{STRING}, {STRING}{STRING}, {STRING}{STRING}
|
||||
############ range for requires ends
|
||||
|
||||
STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Angen:
|
||||
STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING}
|
||||
STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT :{YELLOW}{STRING}{BLACK}: {CARGO_SHORT} yn disgwyl{STRING}
|
||||
|
||||
############ range for produces starts
|
||||
STR_INDUSTRY_VIEW_PRODUCES_CARGO :{BLACK}Cynhyrchu: {YELLOW}{STRING}{STRING}
|
||||
@@ -3361,6 +3367,10 @@ STR_GROUP_REMOVE_ALL_VEHICLES :Dileu pob cerby
|
||||
|
||||
STR_GROUP_RENAME_CAPTION :{BLACK}Ailenwi grŵp
|
||||
|
||||
STR_GROUP_PROFIT_THIS_YEAR :Elw eleni:
|
||||
STR_GROUP_PROFIT_LAST_YEAR :Elw llynedd:
|
||||
STR_GROUP_OCCUPANCY :Defnydd presennol:
|
||||
STR_GROUP_OCCUPANCY_VALUE :{NUM}%
|
||||
|
||||
# Build vehicle window
|
||||
STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION :Cerbydau Rheilffordd Newydd
|
||||
@@ -3393,6 +3403,7 @@ STR_PURCHASE_INFO_ALL_TYPES :Pob math o lwyt
|
||||
STR_PURCHASE_INFO_ALL_BUT :Popeth ond{CARGO_LIST}
|
||||
STR_PURCHASE_INFO_MAX_TE :{BLACK}Grym Tynnu Uchaf: {GOLD}{FORCE}
|
||||
STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Pellter cyrhaeddiad: {GOLD}{COMMA} teil
|
||||
STR_PURCHASE_INFO_AIRCRAFT_TYPE :{BLACK}Math awyren: {GOLD}{STRING}
|
||||
|
||||
STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Rhestr dewis trenau. Cliciwch ar gerbyd am wybodaeth. Mae Ctrl+Clicio'n toglu cuddio'r math cerbyd
|
||||
STR_BUY_VEHICLE_ROAD_VEHICLE_LIST_TOOLTIP :{BLACK}Rhestr dewis cerbydau ffordd. Cliciwch ar gerbyd am wybodaeth. Mae Ctrl+Clicio'n toglu cuddio'r math cerbyd
|
||||
@@ -3527,6 +3538,10 @@ STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE :trên maglef
|
||||
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER :{BLACK}Côst: {CURRENCY_LONG} Pwysau: {WEIGHT_SHORT}{}Cyflymder: {VELOCITY} Pŵer: {POWER}{}Côst Rhedeg: {CURRENCY_LONG}/bl{}Gallu cludo: {CARGO_LONG}
|
||||
STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE :{BLACK}Cost: {CURRENCY_LONG} Pwysau: {WEIGHT_SHORT}{}Cyflymder: {VELOCITY} Pŵer: {POWER} Grym Uchaf: {6:FORCE}{}Cost Rhedeg: {4:CURRENCY_LONG}/bl{}Cynhwysedd: {5:CARGO_LONG}
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Cyflym. Uchaf: {VELOCITY}{}Cynhwysedd: {CARGO_LONG}{}Cost Rhedeg: {CURRENCY_LONG}/bl
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Cyflym. Uchaf: {VELOCITY}{}Math awyren: {STRING}{}Cynhwysedd: {CARGO_LONG}, {CARGO_LONG}{}Cost rhedeg: {CURRENCY_LONG}/bl
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Cyflym. Uchaf: {VELOCITY}{}Math awyren: {STRING}{}Cynhwysedd: {CARGO_LONG}{}Cost Rhedeg: {CURRENCY_LONG}/bl
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Cyflym. Uchaf: {VELOCITY}{}Math awyren: {STRING} Pellter hedfan: {COMMA} teil{}Cynhwysedd: {CARGO_LONG}, {CARGO_LONG}{}Cost Rhedeg: {CURRENCY_LONG}/bl
|
||||
STR_ENGINE_PREVIEW_COST_MAX_SPEED_TYPE_RANGE_CAP_RUNCOST :{BLACK}Cost: {CURRENCY_LONG} Cyflym. Uchaf: {VELOCITY}{}Math awyren: {STRING} Pellter hedfan: {COMMA} teil{}Cynhwysedd: {CARGO_LONG}{}Cost Rhedeg: {CURRENCY_LONG}/bl
|
||||
|
||||
# Autoreplace window
|
||||
STR_REPLACE_VEHICLES_WHITE :{WHITE}Disodli {STRING} - {STRING}
|
||||
@@ -3649,6 +3664,8 @@ STR_VEHICLE_INFO_AGE :{COMMA} blwyddy
|
||||
STR_VEHICLE_INFO_AGE_RED :{RED}{COMMA} blwyddyn ({COMMA})
|
||||
|
||||
STR_VEHICLE_INFO_MAX_SPEED :{BLACK}cyflymder uchaf: {LTBLUE}{VELOCITY}
|
||||
STR_VEHICLE_INFO_MAX_SPEED_TYPE :{BLACK}Cyflym. uchaf: {LTBLUE}{VELOCITY} {BLACK}Math awyren: {LTBLUE}{STRING}
|
||||
STR_VEHICLE_INFO_MAX_SPEED_TYPE_RANGE :{BLACK}Cyflym. uchaf: {LTBLUE}{VELOCITY} {BLACK}Math awyren: {LTBLUE}{STRING} {BLACK}Pellter hedfan: {LTBLUE}{COMMA} teil
|
||||
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}Pwys: {LTBLUE}{WEIGHT_SHORT} {BLACK}Pŵer: {LTBLUE}{POWER}{BLACK} Cyflym. Max: {LTBLUE}{VELOCITY}
|
||||
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}Pwys: {LTBLUE}{WEIGHT_SHORT} {BLACK}Pŵer: {LTBLUE}{POWER}{BLACK} Cyflym. Max: {LTBLUE}{VELOCITY} {BLACK}Max. T.E.: {LTBLUE}{FORCE}
|
||||
|
||||
|
@@ -105,7 +105,7 @@ extern LanguageList _languages;
|
||||
extern const LanguageMetadata *_current_language;
|
||||
|
||||
#ifdef WITH_ICU_SORT
|
||||
extern Collator *_current_collator;
|
||||
extern icu::Collator *_current_collator;
|
||||
#endif /* WITH_ICU_SORT */
|
||||
|
||||
bool ReadLanguagePack(const LanguageMetadata *lang);
|
||||
|
@@ -99,7 +99,6 @@ const char *MusicDriver_DMusic::Start(const char * const *parm)
|
||||
|
||||
int port = GetDriverParamInt(parm, "port", -1);
|
||||
|
||||
#ifndef NO_DEBUG_MESSAGES
|
||||
if (_debug_driver_level > 0) {
|
||||
/* Print all valid output ports. */
|
||||
char desc[DMUS_MAX_DESCRIPTION];
|
||||
@@ -116,7 +115,6 @@ const char *MusicDriver_DMusic::Start(const char * const *parm)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
IDirectMusicPort *music_port = NULL; // NULL means 'use default port'.
|
||||
|
||||
|
@@ -1976,12 +1976,12 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
|
||||
if (length == 0 || number == 0) break;
|
||||
|
||||
if (length > statspec->lengths) {
|
||||
byte diff_length = length - statspec->lengths;
|
||||
statspec->platforms = ReallocT(statspec->platforms, length);
|
||||
memset(statspec->platforms + statspec->lengths, 0, length - statspec->lengths);
|
||||
memset(statspec->platforms + statspec->lengths, 0, diff_length);
|
||||
|
||||
statspec->layouts = ReallocT(statspec->layouts, length);
|
||||
memset(statspec->layouts + statspec->lengths, 0,
|
||||
(length - statspec->lengths) * sizeof(*statspec->layouts));
|
||||
memset(statspec->layouts + statspec->lengths, 0, diff_length * sizeof(*statspec->layouts));
|
||||
|
||||
statspec->lengths = length;
|
||||
}
|
||||
|
@@ -42,10 +42,10 @@
|
||||
|
||||
const NewsItem *_statusbar_news_item = NULL;
|
||||
|
||||
static uint MIN_NEWS_AMOUNT = 30; ///< preferred minimum amount of news messages
|
||||
static uint _total_news = 0; ///< current number of news items
|
||||
static NewsItem *_oldest_news = NULL; ///< head of news items queue
|
||||
static NewsItem *_latest_news = NULL; ///< tail of news items queue
|
||||
static uint MIN_NEWS_AMOUNT = 30; ///< preferred minimum amount of news messages
|
||||
static uint _total_news = 0; ///< current number of news items
|
||||
NewsItem *_oldest_news = NULL; ///< head of news items queue
|
||||
static NewsItem *_latest_news = NULL; ///< tail of news items queue
|
||||
|
||||
/**
|
||||
* Forced news item.
|
||||
|
@@ -12,7 +12,11 @@
|
||||
#ifndef NEWS_GUI_H
|
||||
#define NEWS_GUI_H
|
||||
|
||||
#include "news_type.h"
|
||||
|
||||
void ShowLastNewsMessage();
|
||||
void ShowMessageHistory();
|
||||
|
||||
extern NewsItem *_oldest_news;
|
||||
|
||||
#endif /* NEWS_GUI_H */
|
||||
|
@@ -870,7 +870,7 @@ int openttd_main(int argc, char *argv[])
|
||||
if (sounds_set == NULL && BaseSounds::ini_set != NULL) sounds_set = stredup(BaseSounds::ini_set);
|
||||
if (!BaseSounds::SetSet(sounds_set)) {
|
||||
if (StrEmpty(sounds_set) || !BaseSounds::SetSet(NULL)) {
|
||||
usererror("Failed to find a sounds set. Please acquire a sounds set for OpenTTD. See section 4.1 of readme.txt.");
|
||||
usererror("Failed to find a sounds set. Please acquire a sounds set for OpenTTD. See section 4.1 of README.md.");
|
||||
} else {
|
||||
ErrorMessageData msg(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_BASE_SOUNDS_NOT_FOUND);
|
||||
msg.SetDParamStr(0, sounds_set);
|
||||
@@ -883,7 +883,7 @@ int openttd_main(int argc, char *argv[])
|
||||
if (music_set == NULL && BaseMusic::ini_set != NULL) music_set = stredup(BaseMusic::ini_set);
|
||||
if (!BaseMusic::SetSet(music_set)) {
|
||||
if (StrEmpty(music_set) || !BaseMusic::SetSet(NULL)) {
|
||||
usererror("Failed to find a music set. Please acquire a music set for OpenTTD. See section 4.1 of readme.txt.");
|
||||
usererror("Failed to find a music set. Please acquire a music set for OpenTTD. See section 4.1 of README.md.");
|
||||
} else {
|
||||
ErrorMessageData msg(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_BASE_MUSIC_NOT_FOUND);
|
||||
msg.SetDParamStr(0, music_set);
|
||||
|
@@ -38,4 +38,6 @@ static inline bool MacOSVersionIsAtLeast(long major, long minor, long bugfix)
|
||||
|
||||
bool IsMonospaceFont(CFStringRef name);
|
||||
|
||||
void MacOSSetThreadName(const char *name);
|
||||
|
||||
#endif /* MACOS_H */
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include "../../rev.h"
|
||||
#include "macos.h"
|
||||
#include "../../string_func.h"
|
||||
#include <pthread.h>
|
||||
|
||||
#define Rect OTTDRect
|
||||
#define Point OTTDPoint
|
||||
@@ -21,12 +22,26 @@
|
||||
#undef Rect
|
||||
#undef Point
|
||||
|
||||
#ifndef __clang__
|
||||
#define __bridge
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This file contains objective C
|
||||
* Apple uses objective C instead of plain C to interact with OS specific/native functions
|
||||
*/
|
||||
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10)
|
||||
typedef struct {
|
||||
NSInteger majorVersion;
|
||||
NSInteger minorVersion;
|
||||
NSInteger patchVersion;
|
||||
} OTTDOperatingSystemVersion;
|
||||
|
||||
#define NSOperatingSystemVersion OTTDOperatingSystemVersion
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get the version of the MacOS we are running under. Code adopted
|
||||
* from http://www.cocoadev.com/index.pl?DeterminingOSVersion
|
||||
@@ -40,6 +55,19 @@ void GetMacOSVersion(int *return_major, int *return_minor, int *return_bugfix)
|
||||
*return_major = -1;
|
||||
*return_minor = -1;
|
||||
*return_bugfix = -1;
|
||||
|
||||
if ([[ NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion) ]) {
|
||||
IMP sel = [ [ NSProcessInfo processInfo] methodForSelector:@selector(operatingSystemVersion) ];
|
||||
NSOperatingSystemVersion ver = ((NSOperatingSystemVersion (*)(id, SEL))sel)([ NSProcessInfo processInfo], @selector(operatingSystemVersion));
|
||||
|
||||
*return_major = (int)ver.majorVersion;
|
||||
*return_minor = (int)ver.minorVersion;
|
||||
*return_bugfix = (int)ver.patchVersion;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10)
|
||||
SInt32 systemVersion, version_major, version_minor, version_bugfix;
|
||||
if (Gestalt(gestaltSystemVersion, &systemVersion) == noErr) {
|
||||
if (systemVersion >= 0x1040) {
|
||||
@@ -52,6 +80,7 @@ void GetMacOSVersion(int *return_major, int *return_minor, int *return_bugfix)
|
||||
*return_bugfix = (int)GB(systemVersion, 0, 4);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WITH_SDL
|
||||
@@ -182,7 +211,7 @@ uint GetCPUCoreCount()
|
||||
uint count = 1;
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
if (MacOSVersionIsAtLeast(10, 5, 0)) {
|
||||
count = [ [ NSProcessInfo processInfo ] activeProcessorCount ];
|
||||
count = (uint)[ [ NSProcessInfo processInfo ] activeProcessorCount ];
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
@@ -201,7 +230,25 @@ uint GetCPUCoreCount()
|
||||
*/
|
||||
bool IsMonospaceFont(CFStringRef name)
|
||||
{
|
||||
NSFont *font = [ NSFont fontWithName:(NSString *)name size:0.0f ];
|
||||
NSFont *font = [ NSFont fontWithName:(__bridge NSString *)name size:0.0f ];
|
||||
|
||||
return font != NULL ? [ font isFixedPitch ] : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the name of the current thread for the debugger.
|
||||
* @param name The new name of the current thread.
|
||||
*/
|
||||
void MacOSSetThreadName(const char *name)
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
||||
if (MacOSVersionIsAtLeast(10, 6, 0)) {
|
||||
pthread_setname_np(name);
|
||||
}
|
||||
#endif
|
||||
|
||||
NSThread *cur = [ NSThread currentThread ];
|
||||
if (cur != NULL && [ cur respondsToSelector:@selector(setName:) ]) {
|
||||
[ cur performSelector:@selector(setName:) withObject:[ NSString stringWithUTF8String:name ] ];
|
||||
}
|
||||
}
|
||||
|
@@ -54,6 +54,13 @@
|
||||
#define MAC_OS_X_VERSION_10_9 1090
|
||||
#endif
|
||||
|
||||
#ifndef MAC_OS_X_VERSION_10_10
|
||||
#define MAC_OS_X_VERSION_10_10 101000
|
||||
#endif
|
||||
|
||||
#ifndef MAC_OS_X_VERSION_10_11
|
||||
#define MAC_OS_X_VERSION_10_11 101100
|
||||
#endif
|
||||
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#include <stdint.h>
|
||||
|
@@ -79,8 +79,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,8,0,!!REVISION!!
|
||||
PRODUCTVERSION 1,8,0,!!REVISION!!
|
||||
FILEVERSION 1,9,0,!!ISODATE!!
|
||||
PRODUCTVERSION 1,9,0,!!ISODATE!!
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@@ -276,7 +276,6 @@ static uint NPFReservedTrackCost(AyStarNode *current)
|
||||
*/
|
||||
static void NPFMarkTile(TileIndex tile)
|
||||
{
|
||||
#ifndef NO_DEBUG_MESSAGES
|
||||
if (_debug_npf_level < 1 || _networking) return;
|
||||
switch (GetTileType(tile)) {
|
||||
case MP_RAILWAY:
|
||||
@@ -297,7 +296,6 @@ static void NPFMarkTile(TileIndex tile)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int32 NPFWaterPathCost(AyStar *as, AyStarNode *current, OpenListNode *parent)
|
||||
|
@@ -122,10 +122,8 @@ public:
|
||||
{
|
||||
m_veh = v;
|
||||
|
||||
#ifndef NO_DEBUG_MESSAGES
|
||||
CPerformanceTimer perf;
|
||||
perf.Start();
|
||||
#endif /* !NO_DEBUG_MESSAGES */
|
||||
|
||||
Yapf().PfSetStartupNodes();
|
||||
bool bDestFound = true;
|
||||
@@ -154,7 +152,6 @@ public:
|
||||
|
||||
bDestFound &= (m_pBestDestNode != NULL);
|
||||
|
||||
#ifndef NO_DEBUG_MESSAGES
|
||||
perf.Stop();
|
||||
if (_debug_yapf_level >= 2) {
|
||||
int t = perf.Get(1000000);
|
||||
@@ -174,7 +171,6 @@ public:
|
||||
);
|
||||
}
|
||||
}
|
||||
#endif /* !NO_DEBUG_MESSAGES */
|
||||
return bDestFound;
|
||||
}
|
||||
|
||||
|
@@ -26,18 +26,16 @@ bool IsReleasedVersion()
|
||||
|
||||
/**
|
||||
* The text version of OpenTTD's revision.
|
||||
* This will be either "<major>.<minor>.<build>[-RC<rc>]",
|
||||
* "r<revision number>[M][-<branch>]" or "norev000".
|
||||
* This will be either
|
||||
* - "<tag>", like "<major>.<minor>.<build>[-RC<rc>]",
|
||||
* - "<commitdate>-g<shorthash><modified>" in "master",
|
||||
* - "<commitdate>-<branch>-g<shorthash><modified>" in other branches, or
|
||||
* - "norev000", if the version is unknown.
|
||||
*
|
||||
* The major, minor and build are the numbers that describe releases of
|
||||
* OpenTTD (like 0.5.3). "-RC" is used to flag release candidates.
|
||||
*
|
||||
* The revision number is fairly straight forward. The M is to show that
|
||||
* the binary is made from modified source code. The branch shows the
|
||||
* branch the revision is of and will not be there when it is trunk.
|
||||
*
|
||||
* norev000 is for non-releases that are made on systems without
|
||||
* subversion or sources that are not a checkout of subversion.
|
||||
* <modified> shows a "M", if the binary is made from modified source code.
|
||||
*/
|
||||
const char _openttd_revision[] = "!!VERSION!!";
|
||||
|
||||
@@ -72,13 +70,13 @@ const byte _openttd_revision_modified = !!MODIFIED!!;
|
||||
* 24-27 minor version
|
||||
* 20-23 build
|
||||
* 19 1 if it is a release, 0 if it is not.
|
||||
* 0-18 revision number; 0 for releases and when the revision is unknown.
|
||||
* 0-18 used to be the SVN revision, currently unused
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
const uint32 _openttd_newgrf_version = 1 << 28 | 8 << 24 | 0 << 20 | 0 << 19 | (!!REVISION!! & ((1 << 19) - 1));
|
||||
const uint32 _openttd_newgrf_version = 1 << 28 | 9 << 24 | 0 << 20 | 0 << 19;
|
||||
|
||||
#ifdef __MORPHOS__
|
||||
/**
|
||||
|
@@ -2342,22 +2342,21 @@ bool AfterLoadGame()
|
||||
/* Animated tiles would sometimes not be actually animated or
|
||||
* in case of old savegames duplicate. */
|
||||
|
||||
extern TileIndex *_animated_tile_list;
|
||||
extern uint _animated_tile_count;
|
||||
extern SmallVector<TileIndex, 256> _animated_tiles;
|
||||
|
||||
for (uint i = 0; i < _animated_tile_count; /* Nothing */) {
|
||||
for (TileIndex *tile = _animated_tiles.Begin(); tile < _animated_tiles.End(); /* Nothing */) {
|
||||
/* Remove if tile is not animated */
|
||||
bool remove = _tile_type_procs[GetTileType(_animated_tile_list[i])]->animate_tile_proc == NULL;
|
||||
bool remove = _tile_type_procs[GetTileType(*tile)]->animate_tile_proc == NULL;
|
||||
|
||||
/* and remove if duplicate */
|
||||
for (uint j = 0; !remove && j < i; j++) {
|
||||
remove = _animated_tile_list[i] == _animated_tile_list[j];
|
||||
for (TileIndex *j = _animated_tiles.Begin(); !remove && j < tile; j++) {
|
||||
remove = *tile == *j;
|
||||
}
|
||||
|
||||
if (remove) {
|
||||
DeleteAnimatedTile(_animated_tile_list[i]);
|
||||
DeleteAnimatedTile(*tile);
|
||||
} else {
|
||||
i++;
|
||||
tile++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,22 +12,21 @@
|
||||
#include "../stdafx.h"
|
||||
#include "../tile_type.h"
|
||||
#include "../core/alloc_func.hpp"
|
||||
#include "../core/smallvec_type.hpp"
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
extern TileIndex *_animated_tile_list;
|
||||
extern uint _animated_tile_count;
|
||||
extern uint _animated_tile_allocated;
|
||||
extern SmallVector<TileIndex, 256> _animated_tiles;
|
||||
|
||||
/**
|
||||
* Save the ANIT chunk.
|
||||
*/
|
||||
static void Save_ANIT()
|
||||
{
|
||||
SlSetLength(_animated_tile_count * sizeof(*_animated_tile_list));
|
||||
SlArray(_animated_tile_list, _animated_tile_count, SLE_UINT32);
|
||||
SlSetLength(_animated_tiles.Length() * sizeof(*_animated_tiles.Begin()));
|
||||
SlArray(_animated_tiles.Begin(), _animated_tiles.Length(), SLE_UINT32);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,22 +37,20 @@ static void Load_ANIT()
|
||||
/* Before version 80 we did NOT have a variable length animated tile table */
|
||||
if (IsSavegameVersionBefore(80)) {
|
||||
/* In pre version 6, we has 16bit per tile, now we have 32bit per tile, convert it ;) */
|
||||
SlArray(_animated_tile_list, 256, IsSavegameVersionBefore(6) ? (SLE_FILE_U16 | SLE_VAR_U32) : SLE_UINT32);
|
||||
TileIndex anim_list[256];
|
||||
SlArray(anim_list, 256, IsSavegameVersionBefore(6) ? (SLE_FILE_U16 | SLE_VAR_U32) : SLE_UINT32);
|
||||
|
||||
for (_animated_tile_count = 0; _animated_tile_count < 256; _animated_tile_count++) {
|
||||
if (_animated_tile_list[_animated_tile_count] == 0) break;
|
||||
for (int i = 0; i < 256; i++) {
|
||||
if (anim_list[i] == 0) break;
|
||||
*_animated_tiles.Append() = anim_list[i];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
_animated_tile_count = (uint)SlGetFieldLength() / sizeof(*_animated_tile_list);
|
||||
|
||||
/* Determine a nice rounded size for the amount of allocated tiles */
|
||||
_animated_tile_allocated = 256;
|
||||
while (_animated_tile_allocated < _animated_tile_count) _animated_tile_allocated *= 2;
|
||||
|
||||
_animated_tile_list = ReallocT<TileIndex>(_animated_tile_list, _animated_tile_allocated);
|
||||
SlArray(_animated_tile_list, _animated_tile_count, SLE_UINT32);
|
||||
uint count = (uint)SlGetFieldLength() / sizeof(*_animated_tiles.Begin());
|
||||
_animated_tiles.Clear();
|
||||
_animated_tiles.Append(count);
|
||||
SlArray(_animated_tiles.Begin(), count, SLE_UINT32);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include "../engine_func.h"
|
||||
#include "../company_base.h"
|
||||
#include "../disaster_vehicle.h"
|
||||
#include "../core/smallvec_type.hpp"
|
||||
#include "saveload_internal.h"
|
||||
#include "oldloader.h"
|
||||
|
||||
@@ -490,8 +491,7 @@ static inline uint RemapOrderIndex(uint x)
|
||||
return _savegame_type == SGT_TTO ? (x - 0x1AC4) / 2 : (x - 0x1C18) / 2;
|
||||
}
|
||||
|
||||
extern TileIndex *_animated_tile_list;
|
||||
extern uint _animated_tile_count;
|
||||
extern SmallVector<TileIndex, 256> _animated_tiles;
|
||||
extern char *_old_name_array;
|
||||
|
||||
static uint32 _old_town_index;
|
||||
@@ -640,22 +640,18 @@ static bool LoadOldOrder(LoadgameState *ls, int num)
|
||||
|
||||
static bool LoadOldAnimTileList(LoadgameState *ls, int num)
|
||||
{
|
||||
/* This is slightly hackish - we must load a chunk into an array whose
|
||||
* address isn't static, but instead pointed to by _animated_tile_list.
|
||||
* To achieve that, create an OldChunks list on the stack on the fly.
|
||||
* The list cannot be static because the value of _animated_tile_list
|
||||
* can change between calls. */
|
||||
|
||||
TileIndex anim_list[256];
|
||||
const OldChunks anim_chunk[] = {
|
||||
OCL_VAR ( OC_TILE, 256, _animated_tile_list ),
|
||||
OCL_VAR ( OC_TILE, 256, anim_list ),
|
||||
OCL_END ()
|
||||
};
|
||||
|
||||
if (!LoadChunk(ls, NULL, anim_chunk)) return false;
|
||||
|
||||
/* Update the animated tile counter by counting till the first zero in the array */
|
||||
for (_animated_tile_count = 0; _animated_tile_count < 256; _animated_tile_count++) {
|
||||
if (_animated_tile_list[_animated_tile_count] == 0) break;
|
||||
/* The first zero in the loaded array indicates the end of the list. */
|
||||
for (int i = 0; i < 256; i++) {
|
||||
if (anim_list[i] == 0) break;
|
||||
*_animated_tiles.Append() = anim_list[i];
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@@ -272,7 +272,7 @@
|
||||
* 194 26881 1.5.x, 1.6.0
|
||||
* 195 27572 1.6.x
|
||||
* 196 27778 1.7.x
|
||||
* 197 27978
|
||||
* 197 27978 1.8.x
|
||||
*/
|
||||
extern const uint16 SAVEGAME_VERSION = 197; ///< Current savegame version of OpenTTD.
|
||||
const uint16 SAVEGAME_VERSION_EXT = 0x8000; ///< Savegame extension indicator mask
|
||||
|
@@ -21,15 +21,16 @@ void SQAICompany_Register(Squirrel *engine)
|
||||
SQAICompany.PreRegister(engine);
|
||||
SQAICompany.AddConstructor<void (ScriptCompany::*)(), 1>(engine, "x");
|
||||
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::CURRENT_QUARTER, "CURRENT_QUARTER");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::EARLIEST_QUARTER, "EARLIEST_QUARTER");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_FIRST, "COMPANY_FIRST");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_LAST, "COMPANY_LAST");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_INVALID, "COMPANY_INVALID");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_SELF, "COMPANY_SELF");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_MALE, "GENDER_MALE");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_FEMALE, "GENDER_FEMALE");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_INVALID, "GENDER_INVALID");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::CURRENT_QUARTER, "CURRENT_QUARTER");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::EARLIEST_QUARTER, "EARLIEST_QUARTER");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_FIRST, "COMPANY_FIRST");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_LAST, "COMPANY_LAST");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_INVALID, "COMPANY_INVALID");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_SELF, "COMPANY_SELF");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_SPECTATOR, "COMPANY_SPECTATOR");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_MALE, "GENDER_MALE");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_FEMALE, "GENDER_FEMALE");
|
||||
SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_INVALID, "GENDER_INVALID");
|
||||
|
||||
SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::ResolveCompanyID, "ResolveCompanyID", 2, ".i");
|
||||
SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::IsMine, "IsMine", 2, ".i");
|
||||
|
@@ -15,6 +15,10 @@
|
||||
* functions may still be available if you return an older API version
|
||||
* in GetAPIVersion() in info.nut.
|
||||
*
|
||||
* \b 1.9.0
|
||||
*
|
||||
* 1.9.0 is not yet released. The following changes are not set in stone yet.
|
||||
*
|
||||
* \b 1.8.0
|
||||
*
|
||||
* 1.8.0 is not yet released. The following changes are not set in stone yet.
|
||||
|
34
src/script/api/game/game_client.hpp.sq
Normal file
34
src/script/api/game/game_client.hpp.sq
Normal file
@@ -0,0 +1,34 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
|
||||
|
||||
#include "../script_client.hpp"
|
||||
#include "../template/template_client.hpp.sq"
|
||||
|
||||
|
||||
template <> const char *GetClassName<ScriptClient, ST_GS>() { return "GSClient"; }
|
||||
|
||||
void SQGSClient_Register(Squirrel *engine)
|
||||
{
|
||||
DefSQClass<ScriptClient, ST_GS> SQGSClient("GSClient");
|
||||
SQGSClient.PreRegister(engine);
|
||||
SQGSClient.AddConstructor<void (ScriptClient::*)(), 1>(engine, "x");
|
||||
|
||||
SQGSClient.DefSQConst(engine, ScriptClient::CLIENT_INVALID, "CLIENT_INVALID");
|
||||
SQGSClient.DefSQConst(engine, ScriptClient::CLIENT_SERVER, "CLIENT_SERVER");
|
||||
SQGSClient.DefSQConst(engine, ScriptClient::CLIENT_FIRST, "CLIENT_FIRST");
|
||||
|
||||
SQGSClient.DefSQStaticMethod(engine, &ScriptClient::ResolveClientID, "ResolveClientID", 2, ".i");
|
||||
SQGSClient.DefSQStaticMethod(engine, &ScriptClient::GetName, "GetName", 2, ".i");
|
||||
SQGSClient.DefSQStaticMethod(engine, &ScriptClient::GetCompany, "GetCompany", 2, ".i");
|
||||
SQGSClient.DefSQStaticMethod(engine, &ScriptClient::GetJoinDate, "GetJoinDate", 2, ".i");
|
||||
|
||||
SQGSClient.PostRegister(engine);
|
||||
}
|
37
src/script/api/game/game_clientlist.hpp.sq
Normal file
37
src/script/api/game/game_clientlist.hpp.sq
Normal file
@@ -0,0 +1,37 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
|
||||
|
||||
#include "../script_clientlist.hpp"
|
||||
#include "../template/template_clientlist.hpp.sq"
|
||||
|
||||
|
||||
template <> const char *GetClassName<ScriptClientList, ST_GS>() { return "GSClientList"; }
|
||||
|
||||
void SQGSClientList_Register(Squirrel *engine)
|
||||
{
|
||||
DefSQClass<ScriptClientList, ST_GS> SQGSClientList("GSClientList");
|
||||
SQGSClientList.PreRegister(engine, "GSList");
|
||||
SQGSClientList.AddConstructor<void (ScriptClientList::*)(), 1>(engine, "x");
|
||||
|
||||
SQGSClientList.PostRegister(engine);
|
||||
}
|
||||
|
||||
|
||||
template <> const char *GetClassName<ScriptClientList_Company, ST_GS>() { return "GSClientList_Company"; }
|
||||
|
||||
void SQGSClientList_Company_Register(Squirrel *engine)
|
||||
{
|
||||
DefSQClass<ScriptClientList_Company, ST_GS> SQGSClientList_Company("GSClientList_Company");
|
||||
SQGSClientList_Company.PreRegister(engine, "GSList");
|
||||
SQGSClientList_Company.AddConstructor<void (ScriptClientList_Company::*)(ScriptCompany::CompanyID company), 2>(engine, "xi");
|
||||
|
||||
SQGSClientList_Company.PostRegister(engine);
|
||||
}
|
@@ -27,6 +27,7 @@ void SQGSCompany_Register(Squirrel *engine)
|
||||
SQGSCompany.DefSQConst(engine, ScriptCompany::COMPANY_LAST, "COMPANY_LAST");
|
||||
SQGSCompany.DefSQConst(engine, ScriptCompany::COMPANY_INVALID, "COMPANY_INVALID");
|
||||
SQGSCompany.DefSQConst(engine, ScriptCompany::COMPANY_SELF, "COMPANY_SELF");
|
||||
SQGSCompany.DefSQConst(engine, ScriptCompany::COMPANY_SPECTATOR, "COMPANY_SPECTATOR");
|
||||
SQGSCompany.DefSQConst(engine, ScriptCompany::GENDER_MALE, "GENDER_MALE");
|
||||
SQGSCompany.DefSQConst(engine, ScriptCompany::GENDER_FEMALE, "GENDER_FEMALE");
|
||||
SQGSCompany.DefSQConst(engine, ScriptCompany::GENDER_INVALID, "GENDER_INVALID");
|
||||
|
@@ -21,7 +21,10 @@ void SQGSViewport_Register(Squirrel *engine)
|
||||
SQGSViewport.PreRegister(engine);
|
||||
SQGSViewport.AddConstructor<void (ScriptViewport::*)(), 1>(engine, "x");
|
||||
|
||||
SQGSViewport.DefSQStaticMethod(engine, &ScriptViewport::ScrollTo, "ScrollTo", 2, ".i");
|
||||
SQGSViewport.DefSQStaticMethod(engine, &ScriptViewport::ScrollTo, "ScrollTo", 2, ".i");
|
||||
SQGSViewport.DefSQStaticMethod(engine, &ScriptViewport::ScrollEveryoneTo, "ScrollEveryoneTo", 2, ".i");
|
||||
SQGSViewport.DefSQStaticMethod(engine, &ScriptViewport::ScrollCompanyClientsTo, "ScrollCompanyClientsTo", 3, ".ii");
|
||||
SQGSViewport.DefSQStaticMethod(engine, &ScriptViewport::ScrollClientTo, "ScrollClientTo", 3, ".ii");
|
||||
|
||||
SQGSViewport.PostRegister(engine);
|
||||
}
|
||||
|
@@ -15,9 +15,20 @@
|
||||
* functions may still be available if you return an older API version
|
||||
* in GetAPIVersion() in info.nut.
|
||||
*
|
||||
* \b 1.9.0
|
||||
*
|
||||
* 1.9.0 is not yet released. The following changes are not set in stone yet.
|
||||
* API additions:
|
||||
* \li GSClient
|
||||
* \li GSClientList
|
||||
* \li GSClientList_Company
|
||||
* \li GSViewport::ScrollEveryoneTo
|
||||
* \li GSViewport::ScrollCompanyClientsTo
|
||||
* \li GSViewport::ScrollClientTo
|
||||
*
|
||||
* \b 1.8.0
|
||||
*
|
||||
* 1.8.0 is not yet released. The following changes are not set in stone yet.
|
||||
* No changes
|
||||
*
|
||||
* \b 1.7.0 - 1.7.2
|
||||
*
|
||||
|
74
src/script/api/script_client.cpp
Normal file
74
src/script/api/script_client.cpp
Normal file
@@ -0,0 +1,74 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/** @file script_client.cpp Implementation of ScriptClient. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "script_client.hpp"
|
||||
#include "../../network/network.h"
|
||||
#include "../../network/network_base.h"
|
||||
|
||||
#include "../../safeguards.h"
|
||||
|
||||
#ifdef ENABLE_NETWORK
|
||||
/**
|
||||
* Finds NetworkClientInfo given client-identifier,
|
||||
* is used by other methods to resolve client-identifier.
|
||||
* @param client The client to get info structure for
|
||||
* @return A pointer to corresponding CI struct or NULL when not found.
|
||||
*/
|
||||
static NetworkClientInfo *FindClientInfo(ScriptClient::ClientID client)
|
||||
{
|
||||
if (client == ScriptClient::CLIENT_INVALID) return NULL;
|
||||
if (!_networking) return NULL;
|
||||
return NetworkClientInfo::GetByClientID((::ClientID)client);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* static */ ScriptClient::ClientID ScriptClient::ResolveClientID(ScriptClient::ClientID client)
|
||||
{
|
||||
#ifdef ENABLE_NETWORK
|
||||
return (FindClientInfo(client) == NULL ? ScriptClient::CLIENT_INVALID : client);
|
||||
#else
|
||||
return CLIENT_INVALID;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* static */ char *ScriptClient::GetName(ScriptClient::ClientID client)
|
||||
{
|
||||
#ifdef ENABLE_NETWORK
|
||||
NetworkClientInfo *ci = FindClientInfo(client);
|
||||
if (ci == NULL) return NULL;
|
||||
return stredup(ci->client_name);
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* static */ ScriptCompany::CompanyID ScriptClient::GetCompany(ScriptClient::ClientID client)
|
||||
{
|
||||
#ifdef ENABLE_NETWORK
|
||||
NetworkClientInfo *ci = FindClientInfo(client);
|
||||
if (ci == NULL) return ScriptCompany::COMPANY_INVALID;
|
||||
return (ScriptCompany::CompanyID)ci->client_playas;
|
||||
#else
|
||||
return ScriptCompany::COMPANY_INVALID;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* static */ ScriptDate::Date ScriptClient::GetJoinDate(ScriptClient::ClientID client)
|
||||
{
|
||||
#ifdef ENABLE_NETWORK
|
||||
NetworkClientInfo *ci = FindClientInfo(client);
|
||||
if (ci == NULL) return ScriptDate::DATE_INVALID;
|
||||
return (ScriptDate::Date)ci->join_date;
|
||||
#else
|
||||
return ScriptDate::DATE_INVALID;
|
||||
#endif
|
||||
}
|
70
src/script/api/script_client.hpp
Normal file
70
src/script/api/script_client.hpp
Normal file
@@ -0,0 +1,70 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/** @file script_client.hpp Everything to query a network client's information */
|
||||
|
||||
#ifndef SCRIPT_CLIENT_HPP
|
||||
#define SCRIPT_CLIENT_HPP
|
||||
|
||||
#include "script_text.hpp"
|
||||
#include "script_date.hpp"
|
||||
#include "script_company.hpp"
|
||||
#include "../../network/network_type.h"
|
||||
|
||||
/**
|
||||
* Class that handles all client related functions.
|
||||
*
|
||||
* @api game
|
||||
*/
|
||||
class ScriptClient : public ScriptObject {
|
||||
public:
|
||||
|
||||
/** Different constants related to ClientID. */
|
||||
enum ClientID {
|
||||
CLIENT_INVALID = 0, ///< Client is not part of anything
|
||||
CLIENT_SERVER = 1, ///< Servers always have this ID
|
||||
CLIENT_FIRST = 2, ///< The first client ID
|
||||
};
|
||||
|
||||
/**
|
||||
* Resolves the given client id to the correct index for the client.
|
||||
* If the client with the given id does not exist it will
|
||||
* return CLIENT_INVALID.
|
||||
* @param client The client id to resolve.
|
||||
* @return The resolved client id.
|
||||
*/
|
||||
static ClientID ResolveClientID(ClientID client);
|
||||
|
||||
/**
|
||||
* Get the name of the given client.
|
||||
* @param client The client to get the name for.
|
||||
* @pre ResolveClientID(client) != CLIENT_INVALID.
|
||||
* @return The name of the given client.
|
||||
*/
|
||||
static char *GetName(ClientID client);
|
||||
|
||||
/**
|
||||
* Get the company in which the given client is playing.
|
||||
* @param client The client to get company for.
|
||||
* @pre ResolveClientID(client) != CLIENT_INVALID.
|
||||
* @return The company in which client is playing or COMPANY_SPECTATOR.
|
||||
*/
|
||||
static ScriptCompany::CompanyID GetCompany(ClientID client);
|
||||
|
||||
/**
|
||||
* Get the game date when the given client has joined.
|
||||
* @param client The client to get joining date for.
|
||||
* @pre ResolveClientID(client) != CLIENT_INVALID.
|
||||
* @return The date when client has joined.
|
||||
*/
|
||||
static ScriptDate::Date GetJoinDate(ClientID client);
|
||||
};
|
||||
|
||||
|
||||
#endif /* SCRIPT_CLIENT_HPP */
|
49
src/script/api/script_clientlist.cpp
Normal file
49
src/script/api/script_clientlist.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/** @file script_clientlist.cpp Implementation of ScriptClientList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "script_company.hpp"
|
||||
#include "script_clientlist.hpp"
|
||||
#include "../../network/network.h"
|
||||
#include "../../network/network_base.h"
|
||||
|
||||
#include "../../safeguards.h"
|
||||
|
||||
ScriptClientList::ScriptClientList()
|
||||
{
|
||||
#ifdef ENABLE_NETWORK
|
||||
if (!_networking) return;
|
||||
NetworkClientInfo *ci;
|
||||
FOR_ALL_CLIENT_INFOS(ci) {
|
||||
this->AddItem(ci->client_id);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
ScriptClientList_Company::ScriptClientList_Company(ScriptCompany::CompanyID company)
|
||||
{
|
||||
#ifdef ENABLE_NETWORK
|
||||
if (!_networking) return;
|
||||
CompanyID c;
|
||||
if (company == ScriptCompany::COMPANY_SPECTATOR) {
|
||||
c = ::COMPANY_SPECTATOR;
|
||||
} else {
|
||||
company = ScriptCompany::ResolveCompanyID(company);
|
||||
if (company == ScriptCompany::COMPANY_INVALID) return;
|
||||
c = (CompanyID)company;
|
||||
}
|
||||
|
||||
NetworkClientInfo *ci;
|
||||
FOR_ALL_CLIENT_INFOS(ci) {
|
||||
if (ci->client_playas == c) this->AddItem(ci->client_id);
|
||||
}
|
||||
#endif
|
||||
}
|
42
src/script/api/script_clientlist.hpp
Normal file
42
src/script/api/script_clientlist.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/** @file script_clientlist.hpp List all the TODO. */
|
||||
|
||||
#ifndef SCRIPT_CLIENTLIST_HPP
|
||||
#define SCRIPT_CLIENTLIST_HPP
|
||||
|
||||
#include "script_list.hpp"
|
||||
#include "script_company.hpp"
|
||||
|
||||
|
||||
/**
|
||||
* Creates a list of clients that are currently in game.
|
||||
* @api game
|
||||
* @ingroup ScriptList
|
||||
*/
|
||||
class ScriptClientList : public ScriptList {
|
||||
public:
|
||||
ScriptClientList();
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a list of clients that are playing in the company.
|
||||
* @api game
|
||||
* @ingroup ScriptList
|
||||
*/
|
||||
class ScriptClientList_Company : public ScriptList {
|
||||
public:
|
||||
/**
|
||||
* @param company_id The company to list clients for.
|
||||
*/
|
||||
ScriptClientList_Company(ScriptCompany::CompanyID company);
|
||||
};
|
||||
|
||||
#endif /* SCRIPT_CIENTLIST_HPP */
|
@@ -30,12 +30,13 @@ public:
|
||||
/** Different constants related to CompanyID. */
|
||||
enum CompanyID {
|
||||
/* Note: these values represent part of the in-game Owner enum */
|
||||
COMPANY_FIRST = ::COMPANY_FIRST, ///< The first available company.
|
||||
COMPANY_LAST = ::MAX_COMPANIES, ///< The last available company.
|
||||
COMPANY_FIRST = ::COMPANY_FIRST, ///< The first available company.
|
||||
COMPANY_LAST = ::MAX_COMPANIES, ///< The last available company.
|
||||
|
||||
/* Custom added value, only valid for this API */
|
||||
COMPANY_INVALID = -1, ///< An invalid company.
|
||||
COMPANY_SELF = 254, ///< Constant that gets resolved to the correct company index for your company.
|
||||
COMPANY_INVALID = -1, ///< An invalid company.
|
||||
COMPANY_SELF = 254, ///< Constant that gets resolved to the correct company index for your company.
|
||||
COMPANY_SPECTATOR = 255, ///< Constant indicating that player is spectating (gets resolved to COMPANY_INVALID)
|
||||
};
|
||||
|
||||
/** Possible genders for company presidents. */
|
||||
|
@@ -10,9 +10,11 @@
|
||||
/** @file script_viewport.cpp Implementation of ScriptViewport. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "script_error.hpp"
|
||||
#include "script_viewport.hpp"
|
||||
#include "script_game.hpp"
|
||||
#include "script_map.hpp"
|
||||
#include "../script_instance.hpp"
|
||||
#include "../../viewport_func.h"
|
||||
|
||||
#include "../../safeguards.h"
|
||||
@@ -24,3 +26,34 @@
|
||||
|
||||
ScrollMainWindowToTile(tile);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptViewport::ScrollEveryoneTo(TileIndex tile)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY);
|
||||
EnforcePrecondition(false, ScriptMap::IsValidTile(tile));
|
||||
|
||||
return ScriptObject::DoCommand(tile, VST_EVERYONE, 0, CMD_SCROLL_VIEWPORT);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptViewport::ScrollCompanyClientsTo(ScriptCompany::CompanyID company, TileIndex tile)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY);
|
||||
EnforcePrecondition(false, ScriptMap::IsValidTile(tile));
|
||||
|
||||
company = ScriptCompany::ResolveCompanyID(company);
|
||||
EnforcePrecondition(false, company != ScriptCompany::COMPANY_INVALID);
|
||||
|
||||
return ScriptObject::DoCommand(tile, VST_COMPANY, company, CMD_SCROLL_VIEWPORT);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptViewport::ScrollClientTo(ScriptClient::ClientID client, TileIndex tile)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptGame::IsMultiplayer());
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY);
|
||||
EnforcePrecondition(false, ScriptMap::IsValidTile(tile));
|
||||
|
||||
client = ScriptClient::ResolveClientID(client);
|
||||
EnforcePrecondition(false, client != ScriptClient::CLIENT_INVALID);
|
||||
|
||||
return ScriptObject::DoCommand(tile, VST_CLIENT, client, CMD_SCROLL_VIEWPORT);
|
||||
}
|
||||
|
@@ -13,6 +13,8 @@
|
||||
#define SCRIPT_VIEWPORT_HPP
|
||||
|
||||
#include "script_object.hpp"
|
||||
#include "script_client.hpp"
|
||||
#include "script_company.hpp"
|
||||
|
||||
/**
|
||||
* Class that manipulates the user's viewport.
|
||||
@@ -28,6 +30,38 @@ public:
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
*/
|
||||
static void ScrollTo(TileIndex tile);
|
||||
|
||||
/**
|
||||
* Scroll the viewport of all players to the given tile,
|
||||
* where the tile will be in the center of the screen.
|
||||
* @param tile The tile to put in the center of the screen.
|
||||
* @pre ScriptObject::GetCompany() == OWNER_DEITY
|
||||
* @pre ScriptMap::IsValidTile(tile)
|
||||
*/
|
||||
static bool ScrollEveryoneTo(TileIndex tile);
|
||||
|
||||
/**
|
||||
* Scroll the viewports of all players in the company to the given tile,
|
||||
* where the tile will be in the center of the screen.
|
||||
* @param company The company which players to scroll the viewport of.
|
||||
* @param tile The tile to put in the center of the screen.
|
||||
* @pre ScriptObject::GetCompany() == OWNER_DEITY
|
||||
* @pre ScriptMap::IsValidTile(tile)
|
||||
* @pre ResolveCompanyID(company) != COMPANY_INVALID
|
||||
*/
|
||||
static bool ScrollCompanyClientsTo(ScriptCompany::CompanyID company, TileIndex tile);
|
||||
|
||||
/**
|
||||
* Scroll the viewport of the client to the given tile,
|
||||
* where the tile will be in the center of the screen.
|
||||
* @param client The client to scroll the viewport of.
|
||||
* @param tile The tile to put in the center of the screen.
|
||||
* @pre ScriptGame::IsMultiplayer()
|
||||
* @pre ScriptObject::GetCompany() == OWNER_DEITY
|
||||
* @pre ScriptMap::IsValidTile(tile)
|
||||
* @pre ResolveClientID(client) != CLIENT_INVALID
|
||||
*/
|
||||
static bool ScrollClientTo(ScriptClient::ClientID client, TileIndex tile);
|
||||
};
|
||||
|
||||
#endif /* SCRIPT_ADMIN_HPP */
|
||||
|
25
src/script/api/template/template_client.hpp.sq
Normal file
25
src/script/api/template/template_client.hpp.sq
Normal file
@@ -0,0 +1,25 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
|
||||
|
||||
#include "../script_client.hpp"
|
||||
|
||||
namespace SQConvert {
|
||||
/* Allow enums to be used as Squirrel parameters */
|
||||
template <> inline ScriptClient::ClientID GetParam(ForceType<ScriptClient::ClientID>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptClient::ClientID)tmp; }
|
||||
template <> inline int Return<ScriptClient::ClientID>(HSQUIRRELVM vm, ScriptClient::ClientID res) { sq_pushinteger(vm, (int32)res); return 1; }
|
||||
|
||||
/* Allow ScriptClient to be used as Squirrel parameter */
|
||||
template <> inline ScriptClient *GetParam(ForceType<ScriptClient *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptClient *)instance; }
|
||||
template <> inline ScriptClient &GetParam(ForceType<ScriptClient &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptClient *)instance; }
|
||||
template <> inline const ScriptClient *GetParam(ForceType<const ScriptClient *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptClient *)instance; }
|
||||
template <> inline const ScriptClient &GetParam(ForceType<const ScriptClient &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptClient *)instance; }
|
||||
template <> inline int Return<ScriptClient *>(HSQUIRRELVM vm, ScriptClient *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Client", res, NULL, DefSQDestructorCallback<ScriptClient>, true); return 1; }
|
||||
} // namespace SQConvert
|
30
src/script/api/template/template_clientlist.hpp.sq
Normal file
30
src/script/api/template/template_clientlist.hpp.sq
Normal file
@@ -0,0 +1,30 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
|
||||
|
||||
#include "../script_clientlist.hpp"
|
||||
|
||||
namespace SQConvert {
|
||||
/* Allow ScriptClientList to be used as Squirrel parameter */
|
||||
template <> inline ScriptClientList *GetParam(ForceType<ScriptClientList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptClientList *)instance; }
|
||||
template <> inline ScriptClientList &GetParam(ForceType<ScriptClientList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptClientList *)instance; }
|
||||
template <> inline const ScriptClientList *GetParam(ForceType<const ScriptClientList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptClientList *)instance; }
|
||||
template <> inline const ScriptClientList &GetParam(ForceType<const ScriptClientList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptClientList *)instance; }
|
||||
template <> inline int Return<ScriptClientList *>(HSQUIRRELVM vm, ScriptClientList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "ClientList", res, NULL, DefSQDestructorCallback<ScriptClientList>, true); return 1; }
|
||||
} // namespace SQConvert
|
||||
|
||||
namespace SQConvert {
|
||||
/* Allow ScriptClientList_Company to be used as Squirrel parameter */
|
||||
template <> inline ScriptClientList_Company *GetParam(ForceType<ScriptClientList_Company *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptClientList_Company *)instance; }
|
||||
template <> inline ScriptClientList_Company &GetParam(ForceType<ScriptClientList_Company &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptClientList_Company *)instance; }
|
||||
template <> inline const ScriptClientList_Company *GetParam(ForceType<const ScriptClientList_Company *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptClientList_Company *)instance; }
|
||||
template <> inline const ScriptClientList_Company &GetParam(ForceType<const ScriptClientList_Company &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptClientList_Company *)instance; }
|
||||
template <> inline int Return<ScriptClientList_Company *>(HSQUIRRELVM vm, ScriptClientList_Company *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "ClientList_Company", res, NULL, DefSQDestructorCallback<ScriptClientList_Company>, true); return 1; }
|
||||
} // namespace SQConvert
|
@@ -18,6 +18,7 @@
|
||||
#ifdef WITH_COCOA
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../os/macosx/macos.h"
|
||||
#include "../debug.h"
|
||||
#include "../driver.h"
|
||||
#include "../mixer.h"
|
||||
@@ -47,8 +48,6 @@ static OSStatus audioCallback(void *inRefCon, AudioUnitRenderActionFlags *inActi
|
||||
|
||||
const char *SoundDriver_Cocoa::Start(const char * const *parm)
|
||||
{
|
||||
Component comp;
|
||||
ComponentDescription desc;
|
||||
struct AURenderCallbackStruct callback;
|
||||
AudioStreamBasicDescription requestedDesc;
|
||||
|
||||
@@ -71,21 +70,49 @@ const char *SoundDriver_Cocoa::Start(const char * const *parm)
|
||||
|
||||
MxInitialize((uint)requestedDesc.mSampleRate);
|
||||
|
||||
/* Locate the default output audio unit */
|
||||
desc.componentType = kAudioUnitType_Output;
|
||||
desc.componentSubType = kAudioUnitSubType_HALOutput;
|
||||
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
|
||||
desc.componentFlags = 0;
|
||||
desc.componentFlagsMask = 0;
|
||||
#if defined(__AUDIOCOMPONENT_H__) || defined(HAVE_OSX_107_SDK)
|
||||
if (MacOSVersionIsAtLeast(10, 6, 0)) {
|
||||
/* Locate the default output audio unit */
|
||||
AudioComponentDescription desc;
|
||||
desc.componentType = kAudioUnitType_Output;
|
||||
desc.componentSubType = kAudioUnitSubType_HALOutput;
|
||||
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
|
||||
desc.componentFlags = 0;
|
||||
desc.componentFlagsMask = 0;
|
||||
|
||||
comp = FindNextComponent (NULL, &desc);
|
||||
if (comp == NULL) {
|
||||
return "cocoa_s: Failed to start CoreAudio: FindNextComponent returned NULL";
|
||||
}
|
||||
AudioComponent comp = AudioComponentFindNext (NULL, &desc);
|
||||
if (comp == NULL) {
|
||||
return "cocoa_s: Failed to start CoreAudio: AudioComponentFindNext returned NULL";
|
||||
}
|
||||
|
||||
/* Open & initialize the default output audio unit */
|
||||
if (OpenAComponent(comp, &_outputAudioUnit) != noErr) {
|
||||
return "cocoa_s: Failed to start CoreAudio: OpenAComponent";
|
||||
/* Open & initialize the default output audio unit */
|
||||
if (AudioComponentInstanceNew(comp, &_outputAudioUnit) != noErr) {
|
||||
return "cocoa_s: Failed to start CoreAudio: AudioComponentInstanceNew";
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
||||
/* Locate the default output audio unit */
|
||||
ComponentDescription desc;
|
||||
desc.componentType = kAudioUnitType_Output;
|
||||
desc.componentSubType = kAudioUnitSubType_HALOutput;
|
||||
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
|
||||
desc.componentFlags = 0;
|
||||
desc.componentFlagsMask = 0;
|
||||
|
||||
Component comp = FindNextComponent (NULL, &desc);
|
||||
if (comp == NULL) {
|
||||
return "cocoa_s: Failed to start CoreAudio: FindNextComponent returned NULL";
|
||||
}
|
||||
|
||||
/* Open & initialize the default output audio unit */
|
||||
if (OpenAComponent(comp, &_outputAudioUnit) != noErr) {
|
||||
return "cocoa_s: Failed to start CoreAudio: OpenAComponent";
|
||||
}
|
||||
#else
|
||||
return "cocoa_s: Not supported on this OS X version";
|
||||
#endif
|
||||
}
|
||||
|
||||
if (AudioUnitInitialize(_outputAudioUnit) != noErr) {
|
||||
@@ -132,9 +159,21 @@ void SoundDriver_Cocoa::Stop()
|
||||
return;
|
||||
}
|
||||
|
||||
if (CloseComponent(_outputAudioUnit) != noErr) {
|
||||
DEBUG(driver, 0, "cocoa_s: Core_CloseAudio: CloseComponent failed");
|
||||
return;
|
||||
#if defined(__AUDIOCOMPONENT_H__) || defined(HAVE_OSX_107_SDK)
|
||||
if (MacOSVersionIsAtLeast(10, 6, 0)) {
|
||||
if (AudioComponentInstanceDispose(_outputAudioUnit) != noErr) {
|
||||
DEBUG(driver, 0, "cocoa_s: Core_CloseAudio: AudioComponentInstanceDispose failed");
|
||||
return;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
||||
if (CloseComponent(_outputAudioUnit) != noErr) {
|
||||
DEBUG(driver, 0, "cocoa_s: Core_CloseAudio: CloseComponent failed");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -37,9 +37,6 @@
|
||||
StationPool _station_pool("Station");
|
||||
INSTANTIATE_POOL_METHODS(Station)
|
||||
|
||||
typedef StationIDStack::SmallStackPool StationIDStackPool;
|
||||
template<> StationIDStackPool StationIDStack::_pool = StationIDStackPool();
|
||||
|
||||
BaseStation::~BaseStation()
|
||||
{
|
||||
free(this->name);
|
||||
|
@@ -54,7 +54,7 @@ const LanguageMetadata *_current_language = NULL; ///< The currently loaded lang
|
||||
TextDirection _current_text_dir; ///< Text direction of the currently selected language.
|
||||
|
||||
#ifdef WITH_ICU_SORT
|
||||
Collator *_current_collator = NULL; ///< Collator for the language currently in use.
|
||||
icu::Collator *_current_collator = NULL; ///< Collator for the language currently in use.
|
||||
#endif /* WITH_ICU_SORT */
|
||||
|
||||
static uint64 _global_string_params_data[20]; ///< Global array of string parameters. To access, use #SetDParam.
|
||||
@@ -483,6 +483,8 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, Money n
|
||||
|
||||
/* convert from negative */
|
||||
if (number < 0) {
|
||||
if (buff + Utf8CharLen(SCC_PUSH_COLOUR) > last) return buff;
|
||||
buff += Utf8Encode(buff, SCC_PUSH_COLOUR);
|
||||
if (buff + Utf8CharLen(SCC_RED) > last) return buff;
|
||||
buff += Utf8Encode(buff, SCC_RED);
|
||||
buff = strecpy(buff, "-", last);
|
||||
@@ -519,8 +521,8 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, Money n
|
||||
if (spec->symbol_pos != 0) buff = strecpy(buff, spec->suffix, last);
|
||||
|
||||
if (negative) {
|
||||
if (buff + Utf8CharLen(SCC_PREVIOUS_COLOUR) > last) return buff;
|
||||
buff += Utf8Encode(buff, SCC_PREVIOUS_COLOUR);
|
||||
if (buff + Utf8CharLen(SCC_POP_COLOUR) > last) return buff;
|
||||
buff += Utf8Encode(buff, SCC_POP_COLOUR);
|
||||
*buff = '\0';
|
||||
}
|
||||
|
||||
@@ -2055,7 +2057,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
|
||||
|
||||
/* Create a collator instance for our current locale. */
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
_current_collator = Collator::createInstance(Locale(_current_language->isocode), status);
|
||||
_current_collator = icu::Collator::createInstance(icu::Locale(_current_language->isocode), status);
|
||||
/* Sort number substrings by their numerical value. */
|
||||
if (_current_collator != NULL) _current_collator->setAttribute(UCOL_NUMERIC_COLLATION, UCOL_ON, status);
|
||||
/* Avoid using the collator if it is not correctly set. */
|
||||
@@ -2274,10 +2276,8 @@ bool MissingGlyphSearcher::FindMissingGlyphs(const char **str)
|
||||
FontSize size = this->DefaultSize();
|
||||
if (str != NULL) *str = text;
|
||||
for (WChar c = Utf8Consume(&text); c != '\0'; c = Utf8Consume(&text)) {
|
||||
if (c == SCC_TINYFONT) {
|
||||
size = FS_SMALL;
|
||||
} else if (c == SCC_BIGFONT) {
|
||||
size = FS_LARGE;
|
||||
if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) {
|
||||
size = (FontSize)(c - SCC_FIRST_FONT);
|
||||
} else if (!IsInsideMM(c, SCC_SPRITE_START, SCC_SPRITE_END) && IsPrintable(c) && !IsTextDirectionChar(c) && c != '?' && GetGlyph(size, c) == question_mark[size]) {
|
||||
/* The character is printable, but not in the normal font. This is the case we were testing for. */
|
||||
return true;
|
||||
|
@@ -26,9 +26,13 @@ enum StringControlCode {
|
||||
/* This must be the first entry. It's encoded in strings that are saved. */
|
||||
SCC_ENCODED = SCC_CONTROL_START,
|
||||
|
||||
/* Display control codes */
|
||||
SCC_TINYFONT, ///< Switch to small font
|
||||
SCC_BIGFONT, ///< Switch to large font
|
||||
/* Font selection codes, must be in same order as FontSize enum */
|
||||
SCC_FIRST_FONT,
|
||||
SCC_NORMALFONT = SCC_FIRST_FONT, ///< Switch to normal size font
|
||||
SCC_TINYFONT, ///< Switch to small font
|
||||
SCC_BIGFONT, ///< Switch to large font
|
||||
SCC_MONOFONT, ///< Switch to monospaced font
|
||||
SCC_LAST_FONT = SCC_MONOFONT,
|
||||
|
||||
/* Formatting control codes */
|
||||
SCC_REVISION,
|
||||
@@ -120,7 +124,8 @@ enum StringControlCode {
|
||||
SCC_GRAY,
|
||||
SCC_DKBLUE,
|
||||
SCC_BLACK,
|
||||
SCC_PREVIOUS_COLOUR,
|
||||
SCC_PUSH_COLOUR,
|
||||
SCC_POP_COLOUR,
|
||||
|
||||
SCC_CONSUME_ARG,
|
||||
|
||||
|
@@ -37,8 +37,10 @@ extern void EmitGender(Buffer *buffer, char *buf, int value);
|
||||
|
||||
static const CmdStruct _cmd_structs[] = {
|
||||
/* Font size */
|
||||
{"NORMAL_FONT", EmitSingleChar, SCC_NORMALFONT, 0, -1, C_NONE},
|
||||
{"TINY_FONT", EmitSingleChar, SCC_TINYFONT, 0, -1, C_NONE},
|
||||
{"BIG_FONT", EmitSingleChar, SCC_BIGFONT, 0, -1, C_NONE},
|
||||
{"MONO_FONT", EmitSingleChar, SCC_MONOFONT, 0, -1, C_NONE},
|
||||
|
||||
/* Colours */
|
||||
{"BLUE", EmitSingleChar, SCC_BLUE, 0, -1, C_DONTCOUNT},
|
||||
@@ -58,7 +60,8 @@ static const CmdStruct _cmd_structs[] = {
|
||||
{"GRAY", EmitSingleChar, SCC_GRAY, 0, -1, C_DONTCOUNT},
|
||||
{"DKBLUE", EmitSingleChar, SCC_DKBLUE, 0, -1, C_DONTCOUNT},
|
||||
{"BLACK", EmitSingleChar, SCC_BLACK, 0, -1, C_DONTCOUNT},
|
||||
{"PREVIOUS_COLOUR", EmitSingleChar, SCC_PREVIOUS_COLOUR, 0, -1, C_DONTCOUNT},
|
||||
{"PUSH_COLOUR", EmitSingleChar, SCC_PUSH_COLOUR, 0, -1, C_DONTCOUNT},
|
||||
{"POP_COLOUR", EmitSingleChar, SCC_POP_COLOUR, 0, -1, C_DONTCOUNT},
|
||||
|
||||
{"REV", EmitSingleChar, SCC_REVISION, 0, -1, C_NONE}, // openttd revision string
|
||||
|
||||
|
@@ -50,14 +50,10 @@ struct OTTDThreadStartupMessage {
|
||||
* Default OpenTTD STDIO/ERR debug output is not very useful for this, so we
|
||||
* utilize serial/ramdebug instead.
|
||||
*/
|
||||
#ifndef NO_DEBUG_MESSAGES
|
||||
void KPutStr(CONST_STRPTR format)
|
||||
{
|
||||
RawDoFmt(format, NULL, (void (*)())RAWFMTFUNC_SERIAL, NULL);
|
||||
}
|
||||
#else
|
||||
#define KPutStr(x)
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -14,6 +14,10 @@
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include "../os/macosx/macos.h"
|
||||
#endif
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**
|
||||
@@ -69,6 +73,9 @@ private:
|
||||
pthread_setname_np(pthread_self(), self->name);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#if defined(__APPLE__)
|
||||
MacOSSetThreadName(self->name);
|
||||
#endif
|
||||
self->ThreadProc();
|
||||
pthread_exit(NULL);
|
||||
|
@@ -44,7 +44,7 @@ uint TileHeightOutsideMap(int x, int y);
|
||||
* @param tile The tile to change the height
|
||||
* @param height The new height value of the tile
|
||||
* @pre tile < MapSize()
|
||||
* @pre heigth <= MAX_TILE_HEIGHT
|
||||
* @pre height <= MAX_TILE_HEIGHT
|
||||
*/
|
||||
static inline void SetTileHeight(TileIndex tile, uint height)
|
||||
{
|
||||
|
@@ -259,7 +259,11 @@ uint QZ_ListModes(OTTD_Point *modes, uint max_modes, CGDirectDisplayID display_i
|
||||
@end
|
||||
|
||||
/** Delegate for our NSWindow to send ask for quit on close */
|
||||
@interface OTTD_CocoaWindowDelegate : NSObject {
|
||||
@interface OTTD_CocoaWindowDelegate : NSObject
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
||||
<NSWindowDelegate>
|
||||
#endif
|
||||
{
|
||||
CocoaSubdriver *driver;
|
||||
}
|
||||
|
||||
|
@@ -48,6 +48,9 @@
|
||||
|
||||
|
||||
@interface OTTDMain : NSObject
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
||||
<NSApplicationDelegate>
|
||||
#endif
|
||||
@end
|
||||
|
||||
|
||||
@@ -212,8 +215,7 @@ static void setupApplication()
|
||||
#endif
|
||||
|
||||
/* Become the front process, important when start from the command line. */
|
||||
OSErr err = SetFrontProcess(&psn);
|
||||
if (err != 0) DEBUG(driver, 0, "Could not bring the application to front. Error %d", (int)err);
|
||||
[ [ NSApplication sharedApplication ] activateIgnoringOtherApps:YES ];
|
||||
|
||||
/* Set up the menubar */
|
||||
[ NSApp setMainMenu:[ [ NSMenu alloc ] init ] ];
|
||||
@@ -235,22 +237,39 @@ static int CDECL ModeSorter(const OTTD_Point *p1, const OTTD_Point *p2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint QZ_ListModes(OTTD_Point *modes, uint max_modes, CGDirectDisplayID display_id, int device_depth)
|
||||
static void QZ_GetDisplayModeInfo(CFArrayRef modes, CFIndex i, int &bpp, uint16 &width, uint16 &height)
|
||||
{
|
||||
CFArrayRef mode_list = CGDisplayAvailableModes(display_id);
|
||||
CFIndex num_modes = CFArrayGetCount(mode_list);
|
||||
bpp = 0;
|
||||
width = 0;
|
||||
height = 0;
|
||||
|
||||
/* Build list of modes with the requested bpp */
|
||||
uint count = 0;
|
||||
for (CFIndex i = 0; i < num_modes && count < max_modes; i++) {
|
||||
int intvalue, bpp;
|
||||
uint16 width, height;
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
||||
if (MacOSVersionIsAtLeast(10, 6, 0)) {
|
||||
CGDisplayModeRef mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(modes, i);
|
||||
|
||||
CFDictionaryRef onemode = (const __CFDictionary*)CFArrayGetValueAtIndex(mode_list, i);
|
||||
width = (uint16)CGDisplayModeGetWidth(mode);
|
||||
height = (uint16)CGDisplayModeGetHeight(mode);
|
||||
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11)
|
||||
/* Extract bit depth from mode string. */
|
||||
CFStringRef pixEnc = CGDisplayModeCopyPixelEncoding(mode);
|
||||
if (CFStringCompare(pixEnc, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) bpp = 32;
|
||||
if (CFStringCompare(pixEnc, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) bpp = 16;
|
||||
if (CFStringCompare(pixEnc, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) bpp = 8;
|
||||
CFRelease(pixEnc);
|
||||
#else
|
||||
/* CGDisplayModeCopyPixelEncoding is deprecated on OSX 10.11+, but there are no 8 bpp modes anyway... */
|
||||
bpp = 32;
|
||||
#endif
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
int intvalue;
|
||||
|
||||
CFDictionaryRef onemode = (const __CFDictionary*)CFArrayGetValueAtIndex(modes, i);
|
||||
CFNumberRef number = (const __CFNumber*)CFDictionaryGetValue(onemode, kCGDisplayBitsPerPixel);
|
||||
CFNumberGetValue(number, kCFNumberSInt32Type, &bpp);
|
||||
|
||||
if (bpp != device_depth) continue;
|
||||
CFNumberGetValue(number, kCFNumberSInt32Type, &intvalue);
|
||||
bpp = intvalue;
|
||||
|
||||
number = (const __CFNumber*)CFDictionaryGetValue(onemode, kCGDisplayWidth);
|
||||
CFNumberGetValue(number, kCFNumberSInt32Type, &intvalue);
|
||||
@@ -259,6 +278,29 @@ uint QZ_ListModes(OTTD_Point *modes, uint max_modes, CGDirectDisplayID display_i
|
||||
number = (const __CFNumber*)CFDictionaryGetValue(onemode, kCGDisplayHeight);
|
||||
CFNumberGetValue(number, kCFNumberSInt32Type, &intvalue);
|
||||
height = (uint16)intvalue;
|
||||
}
|
||||
}
|
||||
|
||||
uint QZ_ListModes(OTTD_Point *modes, uint max_modes, CGDirectDisplayID display_id, int device_depth)
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
||||
CFArrayRef mode_list = MacOSVersionIsAtLeast(10, 6, 0) ? CGDisplayCopyAllDisplayModes(display_id, NULL) : CGDisplayAvailableModes(display_id);
|
||||
#elif (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
||||
CFArrayRef mode_list = CGDisplayCopyAllDisplayModes(display_id, NULL);
|
||||
#else
|
||||
CFArrayRef mode_list = CGDisplayAvailableModes(display_id);
|
||||
#endif
|
||||
CFIndex num_modes = CFArrayGetCount(mode_list);
|
||||
|
||||
/* Build list of modes with the requested bpp */
|
||||
uint count = 0;
|
||||
for (CFIndex i = 0; i < num_modes && count < max_modes; i++) {
|
||||
int bpp;
|
||||
uint16 width, height;
|
||||
|
||||
QZ_GetDisplayModeInfo(mode_list, i, bpp, width, height);
|
||||
|
||||
if (bpp != device_depth) continue;
|
||||
|
||||
/* Check if mode is already in the list */
|
||||
bool hasMode = false;
|
||||
@@ -280,6 +322,10 @@ uint QZ_ListModes(OTTD_Point *modes, uint max_modes, CGDirectDisplayID display_i
|
||||
/* Sort list smallest to largest */
|
||||
QSortT(modes, count, &ModeSorter);
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
||||
if (MacOSVersionIsAtLeast(10, 6, 0)) CFRelease(mode_list);
|
||||
#endif
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -575,9 +621,12 @@ void VideoDriver_Cocoa::EditBoxLostFocus()
|
||||
if (_cocoa_subdriver != NULL) {
|
||||
if ([ _cocoa_subdriver->cocoaview respondsToSelector:@selector(inputContext) ] && [ [ _cocoa_subdriver->cocoaview performSelector:@selector(inputContext) ] respondsToSelector:@selector(discardMarkedText) ]) {
|
||||
[ [ _cocoa_subdriver->cocoaview performSelector:@selector(inputContext) ] performSelector:@selector(discardMarkedText) ];
|
||||
} else {
|
||||
}
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
||||
else {
|
||||
[ [ NSInputManager currentInputManager ] markedTextAbandoned:_cocoa_subdriver->cocoaview ];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/* Clear any marked string from the current edit box. */
|
||||
HandleTextInput(NULL, true);
|
||||
@@ -604,7 +653,22 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
|
||||
return;
|
||||
}
|
||||
|
||||
NSRunAlertPanel([ NSString stringWithUTF8String:title ], [ NSString stringWithUTF8String:message ], [ NSString stringWithUTF8String:buttonLabel ], nil, nil);
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
|
||||
if (MacOSVersionIsAtLeast(10, 3, 0)) {
|
||||
NSAlert *alert = [ [ NSAlert alloc ] init ];
|
||||
[ alert setAlertStyle: NSCriticalAlertStyle ];
|
||||
[ alert setMessageText:[ NSString stringWithUTF8String:title ] ];
|
||||
[ alert setInformativeText:[ NSString stringWithUTF8String:message ] ];
|
||||
[ alert addButtonWithTitle: [ NSString stringWithUTF8String:buttonLabel ] ];
|
||||
[ alert runModal ];
|
||||
[ alert release ];
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3)
|
||||
NSRunAlertPanel([ NSString stringWithUTF8String:title ], [ NSString stringWithUTF8String:message ], [ NSString stringWithUTF8String:buttonLabel ], nil, nil);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!wasstarted && VideoDriver::GetInstance() != NULL) VideoDriver::GetInstance()->Stop();
|
||||
|
||||
@@ -1032,7 +1096,17 @@ static const char *Utf8AdvanceByUtf16Units(const char *str, NSUInteger count)
|
||||
{
|
||||
if (!EditBoxInGlobalFocus()) return NSNotFound;
|
||||
|
||||
NSPoint view_pt = [ self convertPoint:[ [ self window ] convertScreenToBase:thePoint ] fromView:nil ];
|
||||
NSPoint view_pt = NSZeroPoint;
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
||||
if ([ [ self window ] respondsToSelector:@selector(convertRectFromScreen:) ]) {
|
||||
view_pt = [ self convertRect:[ [ self window ] convertRectFromScreen:NSMakeRect(thePoint.x, thePoint.y, 0, 0) ] fromView:nil ].origin;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7)
|
||||
view_pt = [ self convertPoint:[ [ self window ] convertScreenToBase:thePoint ] fromView:nil ];
|
||||
#endif
|
||||
}
|
||||
|
||||
Point pt = { (int)view_pt.x, (int)[ self frame ].size.height - (int)view_pt.y };
|
||||
|
||||
@@ -1061,9 +1135,13 @@ static const char *Utf8AdvanceByUtf16Units(const char *str, NSUInteger count)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
|
||||
NSRect window_rect = [ self convertRect:view_rect toView:nil ];
|
||||
NSPoint origin = [ [ self window ] convertBaseToScreen:window_rect.origin ];
|
||||
return NSMakeRect(origin.x, origin.y, window_rect.size.width, window_rect.size.height);
|
||||
#else
|
||||
return NSMakeRect(0, 0, 0, 0);;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Get the bounding rect for the given range. */
|
||||
@@ -1271,7 +1349,12 @@ static const char *Utf8AdvanceByUtf16Units(const char *str, NSUInteger count)
|
||||
NSPoint loc = [ driver->cocoaview convertPoint:[ [ aNotification object ] mouseLocationOutsideOfEventStream ] fromView:nil ];
|
||||
BOOL inside = ([ driver->cocoaview hitTest:loc ] == driver->cocoaview);
|
||||
|
||||
if (inside) [ driver->cocoaview mouseEntered:NULL ];
|
||||
if (inside) {
|
||||
/* We don't care about the event, but the compiler does. */
|
||||
NSEvent *e = [ [ NSEvent alloc ] init ];
|
||||
[ driver->cocoaview mouseEntered:e ];
|
||||
[ e release ];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -100,10 +100,10 @@ static void QZ_WarpCursor(int x, int y)
|
||||
NSPoint p = NSMakePoint(x, y);
|
||||
CGPoint cgp = _cocoa_subdriver->PrivateLocalToCG(&p);
|
||||
|
||||
/* this is the magic call that fixes cursor "freezing" after warp */
|
||||
CGSetLocalEventsSuppressionInterval(0.0);
|
||||
/* Do the actual warp */
|
||||
CGWarpMouseCursorPosition(cgp);
|
||||
/* this is the magic call that fixes cursor "freezing" after warp */
|
||||
CGAssociateMouseAndMouseCursorPosition(true);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -333,7 +333,9 @@ bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp)
|
||||
[ this->window setAcceptsMouseMovedEvents:YES ];
|
||||
[ this->window setViewsNeedDisplay:NO ];
|
||||
|
||||
[ this->window useOptimizedDrawing:YES ];
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
|
||||
if ([ this->window respondsToSelector:@selector(useOptimizedDrawing:) ]) [ this->window useOptimizedDrawing:YES ];
|
||||
#endif
|
||||
|
||||
delegate = [ [ OTTD_CocoaWindowDelegate alloc ] init ];
|
||||
[ delegate setDriver:this ];
|
||||
@@ -517,7 +519,16 @@ CGPoint WindowQuartzSubdriver::PrivateLocalToCG(NSPoint *p)
|
||||
p->y = this->window_height - p->y;
|
||||
*p = [ this->cocoaview convertPoint:*p toView:nil ];
|
||||
|
||||
*p = [ this->window convertBaseToScreen:*p ];
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
||||
if ([ this->window respondsToSelector:@selector(convertRectToScreen:) ]) {
|
||||
*p = [ this->window convertRectToScreen:NSMakeRect(p->x, p->y, 0, 0) ].origin;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
|
||||
*p = [ this->window convertBaseToScreen:*p ];
|
||||
#endif
|
||||
}
|
||||
p->y = this->device_height - p->y;
|
||||
|
||||
CGPoint cgp;
|
||||
@@ -539,7 +550,9 @@ NSPoint WindowQuartzSubdriver::GetMouseLocation(NSEvent *event)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
|
||||
pt = [ this->cocoaview convertPoint:[ [ this->cocoaview window ] convertScreenToBase:[ event locationInWindow ] ] fromView:nil ];
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
pt = [ event locationInWindow ];
|
||||
|
@@ -38,6 +38,9 @@
|
||||
#define PM_QS_INPUT 0x20000
|
||||
#endif
|
||||
|
||||
typedef BOOL (WINAPI *PFNTRACKMOUSEEVENT)(LPTRACKMOUSEEVENT lpEventTrack);
|
||||
static PFNTRACKMOUSEEVENT _pTrackMouseEvent = NULL;
|
||||
|
||||
static struct {
|
||||
HWND main_wnd;
|
||||
HBITMAP dib_sect;
|
||||
@@ -747,7 +750,16 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||
* tracking the mouse for exiting the window */
|
||||
if (!_cursor.in_window) {
|
||||
_cursor.in_window = true;
|
||||
SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
|
||||
if (_pTrackMouseEvent != NULL) {
|
||||
TRACKMOUSEEVENT tme;
|
||||
tme.cbSize = sizeof(tme);
|
||||
tme.dwFlags = TME_LEAVE;
|
||||
tme.hwndTrack = hwnd;
|
||||
|
||||
_pTrackMouseEvent(&tme);
|
||||
} else {
|
||||
SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
|
||||
}
|
||||
}
|
||||
|
||||
if (_cursor.fix_at) {
|
||||
@@ -1038,6 +1050,9 @@ static void RegisterWndClass()
|
||||
|
||||
registered = true;
|
||||
if (!RegisterClass(&wnd)) usererror("RegisterClass failed");
|
||||
|
||||
/* Dynamically load mouse tracking, as it doesn't exist on Windows 95. */
|
||||
_pTrackMouseEvent = (PFNTRACKMOUSEEVENT)GetProcAddress(GetModuleHandle(_T("User32")), "TrackMouseEvent");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -96,6 +96,9 @@
|
||||
#include "linkgraph/linkgraph_gui.h"
|
||||
#include "viewport_sprite_sorter.h"
|
||||
#include "bridge_map.h"
|
||||
#include "company_base.h"
|
||||
#include "command_func.h"
|
||||
#include "network/network_func.h"
|
||||
#include "depot_base.h"
|
||||
#include "tunnelbridge_map.h"
|
||||
#include "gui.h"
|
||||
@@ -4820,6 +4823,43 @@ void InitializeSpriteSorter()
|
||||
assert(_vp_sprite_sorter != NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scroll players main viewport.
|
||||
* @param tile tile to center viewport on
|
||||
* @param flags type of operation
|
||||
* @param p1 ViewportScrollTarget of scroll target
|
||||
* @param p2 company or client id depending on the target
|
||||
* @param text unused
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdScrollViewport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
{
|
||||
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
||||
ViewportScrollTarget target = (ViewportScrollTarget)p1;
|
||||
switch (target) {
|
||||
case VST_EVERYONE:
|
||||
break;
|
||||
case VST_COMPANY:
|
||||
if (_local_company != (CompanyID)p2) return CommandCost();
|
||||
break;
|
||||
case VST_CLIENT:
|
||||
#ifdef ENABLE_NETWORK
|
||||
if (_network_own_client_id != (ClientID)p2) return CommandCost();
|
||||
break;
|
||||
#else
|
||||
return CommandCost();
|
||||
#endif
|
||||
default:
|
||||
return CMD_ERROR;
|
||||
}
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
ResetObjectToPlace();
|
||||
ScrollMainWindowToTile(tile);
|
||||
}
|
||||
return CommandCost();
|
||||
}
|
||||
|
||||
static LineSnapPoint LineSnapPointAtRailTrackEndpoint(TileIndex tile, DiagDirection exit_dir, bool bidirectional)
|
||||
{
|
||||
LineSnapPoint ret;
|
||||
|
@@ -139,4 +139,14 @@ enum ViewportDragDropSelectionProcess {
|
||||
DDSP_REMOVE_TRUCKSTOP, ///< Road stop removal (trucks)
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Target of the viewport scrolling GS method
|
||||
*/
|
||||
enum ViewportScrollTarget {
|
||||
VST_EVERYONE, ///< All players
|
||||
VST_COMPANY, ///< All players in specific company
|
||||
VST_CLIENT, ///< Single player
|
||||
};
|
||||
|
||||
#endif /* VIEWPORT_TYPE_H */
|
||||
|
@@ -1249,7 +1249,8 @@ void ConvertGroundTilesIntoWaterTiles()
|
||||
|
||||
static TrackStatus GetTileTrackStatus_Water(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
|
||||
{
|
||||
static const byte coast_tracks[] = {0, 32, 4, 0, 16, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0};
|
||||
static const TrackBits coast_tracks[] = {TRACK_BIT_NONE, TRACK_BIT_RIGHT, TRACK_BIT_UPPER, TRACK_BIT_NONE, TRACK_BIT_LEFT, TRACK_BIT_NONE, TRACK_BIT_NONE,
|
||||
TRACK_BIT_NONE, TRACK_BIT_LOWER, TRACK_BIT_NONE, TRACK_BIT_NONE, TRACK_BIT_NONE, TRACK_BIT_NONE, TRACK_BIT_NONE, TRACK_BIT_NONE, TRACK_BIT_NONE};
|
||||
|
||||
TrackBits ts;
|
||||
|
||||
@@ -1257,7 +1258,7 @@ static TrackStatus GetTileTrackStatus_Water(TileIndex tile, TransportType mode,
|
||||
|
||||
switch (GetWaterTileType(tile)) {
|
||||
case WATER_TILE_CLEAR: ts = IsTileFlat(tile) ? TRACK_BIT_ALL : TRACK_BIT_NONE; break;
|
||||
case WATER_TILE_COAST: ts = (TrackBits)coast_tracks[GetTileSlope(tile) & 0xF]; break;
|
||||
case WATER_TILE_COAST: ts = coast_tracks[GetTileSlope(tile) & 0xF]; break;
|
||||
case WATER_TILE_LOCK: ts = DiagDirToDiagTrackBits(GetLockDirection(tile)); break;
|
||||
case WATER_TILE_DEPOT: ts = AxisToTrackBits(GetShipDepotAxis(tile)); break;
|
||||
default: return 0;
|
||||
|
Reference in New Issue
Block a user