openttd updated to 1.5.0-beta2

--HG--
branch : openttd
This commit is contained in:
Pavel Stupnikov
2015-03-01 00:30:53 +03:00
parent 0abb47ce90
commit d201932121
682 changed files with 26103 additions and 16553 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: debug.cpp 26058 2013-11-23 13:15:07Z rubidium $ */
/* $Id: debug.cpp 26506 2014-04-24 19:51:45Z rubidium $ */
/*
* This file is part of OpenTTD.
@@ -24,6 +24,8 @@
SOCKET _debug_socket = INVALID_SOCKET;
#endif /* ENABLE_NETWORK */
#include "safeguards.h"
int _debug_driver_level;
int _debug_grf_level;
int _debug_map_level;
@@ -111,7 +113,7 @@ static void debug_print(const char *dbg, const char *buf)
if (_debug_socket != INVALID_SOCKET) {
char buf2[1024 + 32];
snprintf(buf2, lengthof(buf2), "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf);
seprintf(buf2, lastof(buf2), "%sdbg: [%s] %s\n", GetLogPrefix(), dbg, buf);
/* Sending out an error when this fails would be nice, however... the error
* would have to be send over this failing socket which won't work. */
send(_debug_socket, buf2, (int)strlen(buf2), 0);
@@ -161,7 +163,7 @@ void CDECL debug(const char *dbg, const char *format, ...)
va_list va;
va_start(va, format);
vsnprintf(buf, lengthof(buf), format, va);
vseprintf(buf, lastof(buf), format, va);
va_end(va);
debug_print(dbg, buf);
@@ -236,10 +238,10 @@ const char *GetDebugString()
memset(dbgstr, 0, sizeof(dbgstr));
i = debug_level;
snprintf(dbgstr, sizeof(dbgstr), "%s=%d", i->name, *i->level);
seprintf(dbgstr, lastof(dbgstr), "%s=%d", i->name, *i->level);
for (i++; i != endof(debug_level); i++) {
snprintf(dbgval, sizeof(dbgval), ", %s=%d", i->name, *i->level);
seprintf(dbgval, lastof(dbgval), ", %s=%d", i->name, *i->level);
strecat(dbgstr, dbgval, lastof(dbgstr));
}