(svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
-CodeLayout: Remove trailing spaces and Windows linebreakspull/155/head
parent
1b498bca57
commit
e295e46e3e
@ -1,387 +1,391 @@
|
|||||||
/* -------------------- dont cross this line --------------------- */
|
/* -------------------- dont cross this line --------------------- */
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "ttd.h"
|
#include "ttd.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
# define ENABLE_NETWORK
|
# define ENABLE_NETWORK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ** console command / variable defines ** //
|
// ** console command / variable defines ** //
|
||||||
#define DEF_CONSOLE_CMD(yyyy) static _iconsole_var * yyyy(byte argc, byte* argv[], byte argt[])
|
#define DEF_CONSOLE_CMD(yyyy) static _iconsole_var * yyyy(byte argc, byte* argv[], byte argt[])
|
||||||
#define DEF_CONSOLE_CMD_HOOK(yyyy) static bool yyyy(_iconsole_cmd * hookcmd)
|
#define DEF_CONSOLE_CMD_HOOK(yyyy) static bool yyyy(_iconsole_cmd * hookcmd)
|
||||||
#define DEF_CONSOLE_VAR_HOOK(yyyy) static bool yyyy(_iconsole_var * hookvar)
|
#define DEF_CONSOLE_VAR_HOOK(yyyy) static bool yyyy(_iconsole_var * hookvar)
|
||||||
|
|
||||||
static int32 GetArgumentInteger(byte *arg)
|
static int32 GetArgumentInteger(byte *arg)
|
||||||
{
|
{
|
||||||
int32 result;
|
int32 result;
|
||||||
sscanf((char *)arg, "%u", &result);
|
sscanf((char *)arg, "%u", &result);
|
||||||
|
|
||||||
if (result == 0 && arg[0] == '0' && arg[1] == 'x')
|
if (result == 0 && arg[0] == '0' && arg[1] == 'x')
|
||||||
sscanf((char *)arg, "%x", &result);
|
sscanf((char *)arg, "%x", &result);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* **************************** */
|
/* **************************** */
|
||||||
/* variable and command hooks */
|
/* variable and command hooks */
|
||||||
/* **************************** */
|
/* **************************** */
|
||||||
|
|
||||||
DEF_CONSOLE_CMD_HOOK(ConCmdHookNoNetwork)
|
DEF_CONSOLE_CMD_HOOK(ConCmdHookNoNetwork)
|
||||||
{
|
{
|
||||||
if (_networking) {
|
if (_networking) {
|
||||||
IConsoleError("this command is forbidden in multiplayer");
|
IConsoleError("this command is forbidden in multiplayer");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEF_CONSOLE_VAR_HOOK(ConVarHookNoNetwork)
|
#if 0 /* Not used atm */
|
||||||
{
|
DEF_CONSOLE_VAR_HOOK(ConVarHookNoNetwork)
|
||||||
if (_networking) {
|
{
|
||||||
IConsoleError("this variable is forbidden in multiplayer");
|
if (_networking) {
|
||||||
return false;
|
IConsoleError("this variable is forbidden in multiplayer");
|
||||||
}
|
return false;
|
||||||
return true;
|
}
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
DEF_CONSOLE_VAR_HOOK(ConVarHookNoNetClient)
|
#endif
|
||||||
{
|
|
||||||
if (!_networking_server) {
|
DEF_CONSOLE_VAR_HOOK(ConVarHookNoNetClient)
|
||||||
IConsoleError("this variable only makes sense for a network server");
|
{
|
||||||
return false;
|
if (!_networking_server) {
|
||||||
}
|
IConsoleError("this variable only makes sense for a network server");
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
/* **************************** */
|
}
|
||||||
/* reset commands */
|
|
||||||
/* **************************** */
|
/* **************************** */
|
||||||
|
/* reset commands */
|
||||||
DEF_CONSOLE_CMD(ConResetEngines)
|
/* **************************** */
|
||||||
{
|
|
||||||
StartupEngines();
|
DEF_CONSOLE_CMD(ConResetEngines)
|
||||||
return 0;
|
{
|
||||||
}
|
StartupEngines();
|
||||||
|
return 0;
|
||||||
DEF_CONSOLE_CMD(ConResetTile)
|
}
|
||||||
{
|
|
||||||
if (argc == 2) {
|
DEF_CONSOLE_CMD(ConResetTile)
|
||||||
TileIndex tile = (TileIndex)GetArgumentInteger(argv[1]);
|
{
|
||||||
DoClearSquare(tile);
|
if (argc == 2) {
|
||||||
}
|
TileIndex tile = (TileIndex)GetArgumentInteger(argv[1]);
|
||||||
|
DoClearSquare(tile);
|
||||||
return 0;
|
}
|
||||||
}
|
|
||||||
|
return 0;
|
||||||
DEF_CONSOLE_CMD(ConScrollToTile)
|
}
|
||||||
{
|
|
||||||
if (argc == 2) {
|
DEF_CONSOLE_CMD(ConScrollToTile)
|
||||||
TileIndex tile = (TileIndex)GetArgumentInteger(argv[1]);
|
{
|
||||||
ScrollMainWindowToTile(tile);
|
if (argc == 2) {
|
||||||
}
|
TileIndex tile = (TileIndex)GetArgumentInteger(argv[1]);
|
||||||
|
ScrollMainWindowToTile(tile);
|
||||||
return 0;
|
}
|
||||||
}
|
|
||||||
|
return 0;
|
||||||
// ********************************* //
|
}
|
||||||
// * Network Core Console Commands * //
|
|
||||||
// ********************************* //
|
// ********************************* //
|
||||||
#ifdef ENABLE_NETWORK
|
// * Network Core Console Commands * //
|
||||||
|
// ********************************* //
|
||||||
DEF_CONSOLE_CMD(ConNetworkConnect)
|
#ifdef ENABLE_NETWORK
|
||||||
{
|
|
||||||
byte * b;
|
DEF_CONSOLE_CMD(ConNetworkConnect)
|
||||||
byte * ip = NULL;
|
{
|
||||||
byte * port = NULL;
|
byte * b;
|
||||||
byte * player = NULL;
|
byte * ip = NULL;
|
||||||
byte c;
|
byte * port = NULL;
|
||||||
uint16 rport;
|
byte * player = NULL;
|
||||||
|
byte c;
|
||||||
if (argc<2) return NULL;
|
uint16 rport;
|
||||||
|
|
||||||
b = argv[1];
|
if (argc<2) return NULL;
|
||||||
rport = _network_server_port;
|
|
||||||
c = 0;
|
b = argv[1];
|
||||||
ip = b;
|
rport = _network_server_port;
|
||||||
|
c = 0;
|
||||||
while (b[c] != 0) {
|
ip = b;
|
||||||
if (((char)b[c]) == '#') {
|
|
||||||
player = &b[c+1];
|
while (b[c] != 0) {
|
||||||
b[c] = 0;
|
if (((char)b[c]) == '#') {
|
||||||
}
|
player = &b[c+1];
|
||||||
if (((char)b[c]) == ':') {
|
b[c] = 0;
|
||||||
port = &b[c+1];
|
}
|
||||||
b[c] = 0;
|
if (((char)b[c]) == ':') {
|
||||||
}
|
port = &b[c+1];
|
||||||
c++;
|
b[c] = 0;
|
||||||
}
|
}
|
||||||
|
c++;
|
||||||
IConsolePrintF(_iconsole_color_default,"Connecting to %s...",ip);
|
}
|
||||||
if (player!=NULL) {
|
|
||||||
_network_playas = atoi(player);
|
IConsolePrintF(_iconsole_color_default,"Connecting to %s...",ip);
|
||||||
IConsolePrintF(_iconsole_color_default," player-no: %s",player);
|
if (player!=NULL) {
|
||||||
}
|
_network_playas = atoi(player);
|
||||||
if (port!=NULL) {
|
IConsolePrintF(_iconsole_color_default," player-no: %s",player);
|
||||||
rport = atoi(port);
|
}
|
||||||
IConsolePrintF(_iconsole_color_default," port: %s",port);
|
if (port!=NULL) {
|
||||||
}
|
rport = atoi(port);
|
||||||
|
IConsolePrintF(_iconsole_color_default," port: %s",port);
|
||||||
NetworkCoreConnectGame(b, rport);
|
}
|
||||||
|
|
||||||
return NULL;
|
NetworkCoreConnectGame(b, rport);
|
||||||
}
|
|
||||||
|
return NULL;
|
||||||
#endif
|
}
|
||||||
|
|
||||||
/* **************************** */
|
#endif
|
||||||
/* default console commands */
|
|
||||||
/* **************************** */
|
/* **************************** */
|
||||||
|
/* default console commands */
|
||||||
DEF_CONSOLE_CMD(ConEcho)
|
/* **************************** */
|
||||||
{
|
|
||||||
if (argc<2) return NULL;
|
DEF_CONSOLE_CMD(ConEcho)
|
||||||
IConsolePrint(_iconsole_color_default, argv[1]);
|
{
|
||||||
return NULL;
|
if (argc<2) return NULL;
|
||||||
}
|
IConsolePrint(_iconsole_color_default, argv[1]);
|
||||||
|
return NULL;
|
||||||
DEF_CONSOLE_CMD(ConEchoC)
|
}
|
||||||
{
|
|
||||||
if (argc<3) return NULL;
|
DEF_CONSOLE_CMD(ConEchoC)
|
||||||
IConsolePrint(atoi(argv[1]), argv[2]);
|
{
|
||||||
return NULL;
|
if (argc<3) return NULL;
|
||||||
}
|
IConsolePrint(atoi(argv[1]), argv[2]);
|
||||||
|
return NULL;
|
||||||
DEF_CONSOLE_CMD(ConPrintF)
|
}
|
||||||
{
|
|
||||||
if (argc<3) return NULL;
|
DEF_CONSOLE_CMD(ConPrintF)
|
||||||
IConsolePrintF(_iconsole_color_default, argv[1] ,argv[2],argv[3],argv[4],argv[5],argv[6],argv[7],argv[8],argv[9],argv[10],argv[11],argv[12],argv[13],argv[14],argv[15],argv[16],argv[17],argv[18],argv[19]);
|
{
|
||||||
return NULL;
|
if (argc<3) return NULL;
|
||||||
}
|
IConsolePrintF(_iconsole_color_default, argv[1] ,argv[2],argv[3],argv[4],argv[5],argv[6],argv[7],argv[8],argv[9],argv[10],argv[11],argv[12],argv[13],argv[14],argv[15],argv[16],argv[17],argv[18],argv[19]);
|
||||||
|
return NULL;
|
||||||
DEF_CONSOLE_CMD(ConPrintFC)
|
}
|
||||||
{
|
|
||||||
if (argc<3) return NULL;
|
DEF_CONSOLE_CMD(ConPrintFC)
|
||||||
IConsolePrintF(atoi(argv[1]), argv[2] ,argv[3],argv[4],argv[5],argv[6],argv[7],argv[8],argv[9],argv[10],argv[11],argv[12],argv[13],argv[14],argv[15],argv[16],argv[17],argv[18],argv[19]);
|
{
|
||||||
return NULL;
|
if (argc<3) return NULL;
|
||||||
}
|
IConsolePrintF(atoi(argv[1]), argv[2] ,argv[3],argv[4],argv[5],argv[6],argv[7],argv[8],argv[9],argv[10],argv[11],argv[12],argv[13],argv[14],argv[15],argv[16],argv[17],argv[18],argv[19]);
|
||||||
|
return NULL;
|
||||||
DEF_CONSOLE_CMD(ConScreenShot)
|
}
|
||||||
{
|
|
||||||
if (argc<2) {
|
DEF_CONSOLE_CMD(ConScreenShot)
|
||||||
_make_screenshot=1;
|
{
|
||||||
} else {
|
if (argc<2) {
|
||||||
if (strcmp(argv[1],"big")==0) {
|
_make_screenshot=1;
|
||||||
_make_screenshot=2;
|
} else {
|
||||||
}
|
if (strcmp(argv[1],"big")==0) {
|
||||||
if (strcmp(argv[1],"no_con")==0) {
|
_make_screenshot=2;
|
||||||
IConsoleClose();
|
}
|
||||||
_make_screenshot=1;
|
if (strcmp(argv[1],"no_con")==0) {
|
||||||
}
|
IConsoleClose();
|
||||||
}
|
_make_screenshot=1;
|
||||||
return NULL;
|
}
|
||||||
}
|
}
|
||||||
|
return NULL;
|
||||||
DEF_CONSOLE_CMD(ConVarInfo)
|
}
|
||||||
{
|
|
||||||
if (argc<2) return NULL;
|
DEF_CONSOLE_CMD(ConVarInfo)
|
||||||
if (argt[1]!=ICONSOLE_VAR_REFERENCE) {
|
{
|
||||||
IConsoleError("variable must be an variable reference");
|
if (argc<2) return NULL;
|
||||||
} else {
|
if (argt[1]!=ICONSOLE_VAR_REFERENCE) {
|
||||||
_iconsole_var * item;
|
IConsoleError("variable must be an variable reference");
|
||||||
item = (_iconsole_var *) argv[1];
|
} else {
|
||||||
IConsolePrintF(_iconsole_color_default,"variable_name: %s",item->name);
|
_iconsole_var * item;
|
||||||
IConsolePrintF(_iconsole_color_default,"variable_type: %i",item->type);
|
item = (_iconsole_var *) argv[1];
|
||||||
IConsolePrintF(_iconsole_color_default,"variable_addr: %i",item->addr);
|
IConsolePrintF(_iconsole_color_default,"variable_name: %s",item->name);
|
||||||
if (item->_malloc) IConsolePrintF(_iconsole_color_default,"variable_malloc: internal allocated"); else IConsolePrintF(_iconsole_color_default, "variable_malloc: external allocated");
|
IConsolePrintF(_iconsole_color_default,"variable_type: %i",item->type);
|
||||||
}
|
IConsolePrintF(_iconsole_color_default,"variable_addr: %i",item->addr);
|
||||||
return NULL;
|
if (item->_malloc) IConsolePrintF(_iconsole_color_default,"variable_malloc: internal allocated"); else IConsolePrintF(_iconsole_color_default, "variable_malloc: external allocated");
|
||||||
}
|
}
|
||||||
|
return NULL;
|
||||||
DEF_CONSOLE_CMD(ConDebugLevel)
|
}
|
||||||
{
|
|
||||||
if (argc<2) return NULL;
|
DEF_CONSOLE_CMD(ConDebugLevel)
|
||||||
SetDebugString(argv[1]);
|
{
|
||||||
return NULL;
|
if (argc<2) return NULL;
|
||||||
}
|
SetDebugString(argv[1]);
|
||||||
|
return NULL;
|
||||||
DEF_CONSOLE_CMD(ConExit)
|
}
|
||||||
{
|
|
||||||
_exit_game = true;
|
DEF_CONSOLE_CMD(ConExit)
|
||||||
return NULL;
|
{
|
||||||
}
|
_exit_game = true;
|
||||||
|
return NULL;
|
||||||
DEF_CONSOLE_CMD(ConHelp)
|
}
|
||||||
{
|
|
||||||
IConsolePrint(13 ," -- console help -- ");
|
DEF_CONSOLE_CMD(ConHelp)
|
||||||
IConsolePrint(1 ," variables: [command to list them: list_vars]");
|
{
|
||||||
IConsolePrint(1 ," *temp_string = \"my little \"");
|
IConsolePrint(13 ," -- console help -- ");
|
||||||
IConsolePrint(1 ,"");
|
IConsolePrint(1 ," variables: [command to list them: list_vars]");
|
||||||
IConsolePrint(1 ," commands: [command to list them: list_cmds]");
|
IConsolePrint(1 ," *temp_string = \"my little \"");
|
||||||
IConsolePrint(1 ," [command] [\"string argument with spaces\"] [argument 2] ...");
|
IConsolePrint(1 ,"");
|
||||||
IConsolePrint(1 ," printf \"%s world\" *temp_string");
|
IConsolePrint(1 ," commands: [command to list them: list_cmds]");
|
||||||
IConsolePrint(1 ,"");
|
IConsolePrint(1 ," [command] [\"string argument with spaces\"] [argument 2] ...");
|
||||||
IConsolePrint(1 ," command/variable returning a value into an variable:");
|
IConsolePrint(1 ," printf \"%s world\" *temp_string");
|
||||||
IConsolePrint(1 ," *temp_uint16 << random");
|
IConsolePrint(1 ,"");
|
||||||
IConsolePrint(1 ," *temp_uint16 << *temp_uint16_2");
|
IConsolePrint(1 ," command/variable returning a value into an variable:");
|
||||||
IConsolePrint(1 ,"");
|
IConsolePrint(1 ," *temp_uint16 << random");
|
||||||
return NULL;
|
IConsolePrint(1 ," *temp_uint16 << *temp_uint16_2");
|
||||||
}
|
IConsolePrint(1 ,"");
|
||||||
|
return NULL;
|
||||||
DEF_CONSOLE_CMD(ConRandom)
|
}
|
||||||
{
|
|
||||||
_iconsole_var * result;
|
DEF_CONSOLE_CMD(ConRandom)
|
||||||
result = IConsoleVarAlloc(ICONSOLE_VAR_UINT16);
|
{
|
||||||
IConsoleVarSetValue(result,rand());
|
_iconsole_var * result;
|
||||||
return result;
|
result = IConsoleVarAlloc(ICONSOLE_VAR_UINT16);
|
||||||
}
|
IConsoleVarSetValue(result,rand());
|
||||||
|
return result;
|
||||||
DEF_CONSOLE_CMD(ConListCommands)
|
}
|
||||||
{
|
|
||||||
_iconsole_cmd * item;
|
DEF_CONSOLE_CMD(ConListCommands)
|
||||||
int l = 0;
|
{
|
||||||
|
_iconsole_cmd * item;
|
||||||
if (argv[1]!=NULL) l = strlen((char *) argv[1]);
|
int l = 0;
|
||||||
|
|
||||||
item = _iconsole_cmds;
|
if (argv[1]!=NULL) l = strlen((char *) argv[1]);
|
||||||
while (item != NULL) {
|
|
||||||
if (argv[1]!=NULL) {
|
item = _iconsole_cmds;
|
||||||
|
while (item != NULL) {
|
||||||
if (memcmp((void *) item->name, (void *) argv[1],l)==0)
|
if (argv[1]!=NULL) {
|
||||||
IConsolePrintF(_iconsole_color_default,"%s",item->name);
|
|
||||||
|
if (memcmp((void *) item->name, (void *) argv[1],l)==0)
|
||||||
} else {
|
IConsolePrintF(_iconsole_color_default,"%s",item->name);
|
||||||
|
|
||||||
IConsolePrintF(_iconsole_color_default,"%s",item->name);
|
} else {
|
||||||
|
|
||||||
}
|
IConsolePrintF(_iconsole_color_default,"%s",item->name);
|
||||||
item = item->_next;
|
|
||||||
}
|
}
|
||||||
|
item = item->_next;
|
||||||
return NULL;
|
}
|
||||||
}
|
|
||||||
|
return NULL;
|
||||||
DEF_CONSOLE_CMD(ConListVariables)
|
}
|
||||||
{
|
|
||||||
_iconsole_var * item;
|
DEF_CONSOLE_CMD(ConListVariables)
|
||||||
int l = 0;
|
{
|
||||||
|
_iconsole_var * item;
|
||||||
if (argv[1]!=NULL) l = strlen((char *) argv[1]);
|
int l = 0;
|
||||||
|
|
||||||
item = _iconsole_vars;
|
if (argv[1]!=NULL) l = strlen((char *) argv[1]);
|
||||||
while (item != NULL) {
|
|
||||||
if (argv[1]!=NULL) {
|
item = _iconsole_vars;
|
||||||
|
while (item != NULL) {
|
||||||
if (memcmp((void *) item->name, (void *) argv[1],l)==0)
|
if (argv[1]!=NULL) {
|
||||||
IConsolePrintF(_iconsole_color_default,"%s",item->name);
|
|
||||||
|
if (memcmp(item->name, argv[1],l)==0)
|
||||||
} else {
|
IConsolePrintF(_iconsole_color_default,"%s",item->name);
|
||||||
|
|
||||||
IConsolePrintF(_iconsole_color_default,"%s",item->name);
|
} else {
|
||||||
|
|
||||||
}
|
IConsolePrintF(_iconsole_color_default,"%s",item->name);
|
||||||
item = item->_next;
|
|
||||||
}
|
}
|
||||||
|
item = item->_next;
|
||||||
return NULL;
|
}
|
||||||
}
|
|
||||||
|
return NULL;
|
||||||
DEF_CONSOLE_CMD(ConListDumpVariables)
|
}
|
||||||
{
|
|
||||||
_iconsole_var * item;
|
DEF_CONSOLE_CMD(ConListDumpVariables)
|
||||||
int l = 0;
|
{
|
||||||
|
_iconsole_var * item;
|
||||||
if (argv[1]!=NULL) l = strlen((char *) argv[1]);
|
int l = 0;
|
||||||
|
|
||||||
item = _iconsole_vars;
|
if (argv[1]!=NULL) l = strlen((char *) argv[1]);
|
||||||
while (item != NULL) {
|
|
||||||
if (argv[1]!=NULL) {
|
item = _iconsole_vars;
|
||||||
|
while (item != NULL) {
|
||||||
if (memcmp((void *) item->name, (void *) argv[1],l)==0)
|
if (argv[1]!=NULL) {
|
||||||
IConsoleVarDump(item,NULL);
|
|
||||||
|
if (memcmp(item->name, argv[1],l)==0)
|
||||||
} else {
|
IConsoleVarDump(item,NULL);
|
||||||
|
|
||||||
IConsoleVarDump(item,NULL);
|
} else {
|
||||||
|
|
||||||
}
|
IConsoleVarDump(item,NULL);
|
||||||
item = item->_next;
|
|
||||||
}
|
}
|
||||||
|
item = item->_next;
|
||||||
return NULL;
|
}
|
||||||
}
|
|
||||||
|
return NULL;
|
||||||
#ifdef _DEBUG
|
}
|
||||||
/* ****************************************** */
|
|
||||||
/* debug commands and variables */
|
#ifdef _DEBUG
|
||||||
/* ****************************************** */
|
/* ****************************************** */
|
||||||
|
/* debug commands and variables */
|
||||||
void IConsoleDebugLibRegister()
|
/* ****************************************** */
|
||||||
{
|
|
||||||
IConsoleVarMemRegister("temp_bool",ICONSOLE_VAR_BOOLEAN);
|
void IConsoleDebugLibRegister()
|
||||||
IConsoleVarMemRegister("temp_int16",ICONSOLE_VAR_INT16);
|
{
|
||||||
IConsoleVarMemRegister("temp_int32",ICONSOLE_VAR_INT32);
|
IConsoleVarMemRegister("temp_bool",ICONSOLE_VAR_BOOLEAN);
|
||||||
IConsoleVarMemRegister("temp_pointer",ICONSOLE_VAR_POINTER);
|
IConsoleVarMemRegister("temp_int16",ICONSOLE_VAR_INT16);
|
||||||
IConsoleVarMemRegister("temp_uint16",ICONSOLE_VAR_UINT16);
|
IConsoleVarMemRegister("temp_int32",ICONSOLE_VAR_INT32);
|
||||||
IConsoleVarMemRegister("temp_uint16_2",ICONSOLE_VAR_UINT16);
|
IConsoleVarMemRegister("temp_pointer",ICONSOLE_VAR_POINTER);
|
||||||
IConsoleVarMemRegister("temp_uint32",ICONSOLE_VAR_UINT32);
|
IConsoleVarMemRegister("temp_uint16",ICONSOLE_VAR_UINT16);
|
||||||
IConsoleVarMemRegister("temp_string",ICONSOLE_VAR_STRING);
|
IConsoleVarMemRegister("temp_uint16_2",ICONSOLE_VAR_UINT16);
|
||||||
IConsoleVarMemRegister("temp_string2",ICONSOLE_VAR_STRING);
|
IConsoleVarMemRegister("temp_uint32",ICONSOLE_VAR_UINT32);
|
||||||
IConsoleCmdRegister("resettile",ConResetTile);
|
IConsoleVarMemRegister("temp_string",ICONSOLE_VAR_STRING);
|
||||||
}
|
IConsoleVarMemRegister("temp_string2",ICONSOLE_VAR_STRING);
|
||||||
#endif
|
IConsoleCmdRegister("resettile",ConResetTile);
|
||||||
|
}
|
||||||
/* ****************************************** */
|
#endif
|
||||||
/* console command and variable registration */
|
|
||||||
/* ****************************************** */
|
/* ****************************************** */
|
||||||
|
/* console command and variable registration */
|
||||||
void IConsoleStdLibRegister()
|
/* ****************************************** */
|
||||||
{
|
|
||||||
// stdlib
|
void IConsoleStdLibRegister()
|
||||||
extern byte _stdlib_developer;
|
{
|
||||||
extern bool _stdlib_con_developer;
|
// stdlib
|
||||||
|
extern byte _stdlib_developer;
|
||||||
#ifdef _DEBUG
|
extern bool _stdlib_con_developer;
|
||||||
IConsoleDebugLibRegister();
|
|
||||||
#endif
|
#ifdef _DEBUG
|
||||||
|
IConsoleDebugLibRegister();
|
||||||
// functions [please add them alphabeticaly]
|
#else
|
||||||
#ifdef ENABLE_NETWORK
|
(void)ConResetTile; // Silence warning, this is only used in _DEBUG
|
||||||
IConsoleCmdRegister("connect",ConNetworkConnect);
|
#endif
|
||||||
IConsoleCmdHook("connect",ICONSOLE_HOOK_ACCESS,ConCmdHookNoNetwork);
|
|
||||||
#endif
|
// functions [please add them alphabeticaly]
|
||||||
IConsoleCmdRegister("debug_level",ConDebugLevel);
|
#ifdef ENABLE_NETWORK
|
||||||
IConsoleCmdRegister("dump_vars",ConListDumpVariables);
|
IConsoleCmdRegister("connect",ConNetworkConnect);
|
||||||
IConsoleCmdRegister("echo",ConEcho);
|
IConsoleCmdHook("connect",ICONSOLE_HOOK_ACCESS,ConCmdHookNoNetwork);
|
||||||
IConsoleCmdRegister("echoc",ConEchoC);
|
#endif
|
||||||
IConsoleCmdRegister("exit",ConExit);
|
IConsoleCmdRegister("debug_level",ConDebugLevel);
|
||||||
IConsoleCmdRegister("help",ConHelp);
|
IConsoleCmdRegister("dump_vars",ConListDumpVariables);
|
||||||
IConsoleCmdRegister("printf",ConPrintF);
|
IConsoleCmdRegister("echo",ConEcho);
|
||||||
IConsoleCmdRegister("printfc",ConPrintFC);
|
IConsoleCmdRegister("echoc",ConEchoC);
|
||||||
IConsoleCmdRegister("quit",ConExit);
|
IConsoleCmdRegister("exit",ConExit);
|
||||||
IConsoleCmdRegister("random",ConRandom);
|
IConsoleCmdRegister("help",ConHelp);
|
||||||
IConsoleCmdRegister("list_cmds",ConListCommands);
|
IConsoleCmdRegister("printf",ConPrintF);
|
||||||
IConsoleCmdRegister("list_vars",ConListVariables);
|
IConsoleCmdRegister("printfc",ConPrintFC);
|
||||||
IConsoleCmdRegister("resetengines",ConResetEngines);
|
IConsoleCmdRegister("quit",ConExit);
|
||||||
IConsoleCmdHook("resetengines",ICONSOLE_HOOK_ACCESS,ConCmdHookNoNetwork);
|
IConsoleCmdRegister("random",ConRandom);
|
||||||
IConsoleCmdRegister("screenshot",ConScreenShot);
|
IConsoleCmdRegister("list_cmds",ConListCommands);
|
||||||
IConsoleCmdRegister("scrollto",ConScrollToTile);
|
IConsoleCmdRegister("list_vars",ConListVariables);
|
||||||
IConsoleCmdRegister("varinfo",ConVarInfo);
|
IConsoleCmdRegister("resetengines",ConResetEngines);
|
||||||
|
IConsoleCmdHook("resetengines",ICONSOLE_HOOK_ACCESS,ConCmdHookNoNetwork);
|
||||||
// variables [please add them alphabeticaly]
|
IConsoleCmdRegister("screenshot",ConScreenShot);
|
||||||
IConsoleVarRegister("con_developer",(void *) &_stdlib_con_developer,ICONSOLE_VAR_BOOLEAN);
|
IConsoleCmdRegister("scrollto",ConScrollToTile);
|
||||||
IConsoleVarRegister("developer",(void *) &_stdlib_developer,ICONSOLE_VAR_BYTE);
|
IConsoleCmdRegister("varinfo",ConVarInfo);
|
||||||
#ifdef ENABLE_NETWORK
|
|
||||||
IConsoleVarRegister("net_client_timeout",&_network_client_timeout,ICONSOLE_VAR_UINT16);
|
// variables [please add them alphabeticaly]
|
||||||
IConsoleVarHook("*net_client_timeout",ICONSOLE_HOOK_ACCESS,ConVarHookNoNetClient);
|
IConsoleVarRegister("con_developer",(void *) &_stdlib_con_developer,ICONSOLE_VAR_BOOLEAN);
|
||||||
IConsoleVarRegister("net_ready_ahead",&_network_ready_ahead,ICONSOLE_VAR_UINT16);
|
IConsoleVarRegister("developer",(void *) &_stdlib_developer,ICONSOLE_VAR_BYTE);
|
||||||
IConsoleVarRegister("net_sync_freq",&_network_sync_freq,ICONSOLE_VAR_UINT16);
|
#ifdef ENABLE_NETWORK
|
||||||
IConsoleVarHook("*net_sync_freq",ICONSOLE_HOOK_ACCESS,ConVarHookNoNetClient);
|
IConsoleVarRegister("net_client_timeout",&_network_client_timeout,ICONSOLE_VAR_UINT16);
|
||||||
#endif
|
IConsoleVarHook("*net_client_timeout",ICONSOLE_HOOK_ACCESS,ConVarHookNoNetClient);
|
||||||
|
IConsoleVarRegister("net_ready_ahead",&_network_ready_ahead,ICONSOLE_VAR_UINT16);
|
||||||
|
IConsoleVarRegister("net_sync_freq",&_network_sync_freq,ICONSOLE_VAR_UINT16);
|
||||||
}
|
IConsoleVarHook("*net_sync_freq",ICONSOLE_HOOK_ACCESS,ConVarHookNoNetClient);
|
||||||
/* -------------------- dont cross this line --------------------- */
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/* -------------------- dont cross this line --------------------- */
|
||||||
|
Loading…
Reference in New Issue