Files
@ r258:61f58f0aac0d
Branch filter:
Location: cpp/openttd-patchpack/source/console.h - annotation
r258:61f58f0aac0d
3.1 KiB
text/x-c
(svn r263) -Fix: on_server.scr contained an unneeded ";"
-Fix: saving or loading a map doesnt pauses the game anymore
-Fix: saving or loading a map doesnt pauses the game anymore
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | r205:49a2f624db4e r205:49a2f624db4e r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r141:ed23912abdee r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r222:4409829eb08f r135:83948fe02372 r135:83948fe02372 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r141:ed23912abdee r141:ed23912abdee r141:ed23912abdee r248:fd82ff1bfd31 r141:ed23912abdee r141:ed23912abdee r141:ed23912abdee r135:83948fe02372 r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r141:ed23912abdee r222:4409829eb08f r141:ed23912abdee r141:ed23912abdee r135:83948fe02372 r222:4409829eb08f r169:55ce1e29f09a r135:83948fe02372 r248:fd82ff1bfd31 r229:bce061e130b4 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r222:4409829eb08f r229:bce061e130b4 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r222:4409829eb08f r228:7c3d0bd71799 r222:4409829eb08f r222:4409829eb08f r135:83948fe02372 r135:83948fe02372 r222:4409829eb08f r135:83948fe02372 r222:4409829eb08f r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r248:fd82ff1bfd31 r205:49a2f624db4e r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r222:4409829eb08f r222:4409829eb08f r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r205:49a2f624db4e | #ifndef CONSOLE_H
#define CONSOLE_H
// ** console ** //
enum {
ICONSOLE_OPENED=0,
ICONSOLE_CLOSED,
} _iconsole_modes;
// ** console parser ** //
enum {
ICONSOLE_VAR_NONE=0,
ICONSOLE_VAR_BOOLEAN,
ICONSOLE_VAR_BYTE,
ICONSOLE_VAR_UINT16,
ICONSOLE_VAR_UINT32,
ICONSOLE_VAR_INT16,
ICONSOLE_VAR_INT32,
ICONSOLE_VAR_STRING,
ICONSOLE_VAR_POINTER,
ICONSOLE_VAR_REFERENCE,
ICONSOLE_VAR_UNKNOWN,
} _iconsole_var_types;
enum {
ICONSOLE_HOOK_ACCESS,
ICONSOLE_HOOK_BEFORE_CHANGE,
ICONSOLE_HOOK_BEFORE_EXEC,
ICONSOLE_HOOK_AFTER_CHANGE,
ICONSOLE_HOOK_AFTER_EXEC,
} _iconsole_hook_types;
typedef struct {
// -------------- //
void * addr;
byte * name;
// -------------- //
void * hook_access;
void * hook_before_exec;
void * hook_after_exec;
// -------------- //
void * _next;
} _iconsole_cmd;
typedef struct {
// --------------- //
void * addr;
const byte * name;
byte type;
// -------------- //
void * hook_access;
void * hook_before_change;
void * hook_after_change;
// -------------- //
void * _next;
bool _malloc;
} _iconsole_var;
// ** console parser ** //
_iconsole_cmd * _iconsole_cmds; // list of registred commands
_iconsole_var * _iconsole_vars; // list of registred vars
// ** console colors ** //
VARDEF byte _iconsole_color_default;
VARDEF byte _iconsole_color_error;
VARDEF byte _iconsole_color_warning;
VARDEF byte _iconsole_color_debug;
VARDEF byte _iconsole_color_commands;
// ** ttd.c functions ** //
void SetDebugString(const char *s);
// ** console functions ** //
void IConsoleClearCommand();
void IConsoleInit();
void IConsoleClear();
void IConsoleFree();
void IConsoleResize();
void IConsoleSwitch();
void IConsoleClose();
void IConsoleOpen();
// ** console cmd buffer ** //
void IConsoleCmdBufferAdd(const byte *cmd);
void IConsoleCmdBufferNavigate(signed char direction);
// ** console output ** //
void IConsolePrint(byte color_code, const byte* string);
void CDECL IConsolePrintF(byte color_code, const char *s, ...);
void IConsoleDebug(byte* string);
void IConsoleError(const byte* string);
void IConsoleWarning(const byte* string);
// *** Commands *** //
void IConsoleCmdRegister(const byte * name, void * addr);
_iconsole_cmd * IConsoleCmdGet(const byte * name);
// *** Variables *** //
void IConsoleVarRegister(const byte * name, void * addr, byte type);
void IConsoleVarMemRegister(const byte * name, byte type);
void IConsoleVarInsert(_iconsole_var * var, const byte * name);
_iconsole_var * IConsoleVarGet(const byte * name);
_iconsole_var * IConsoleVarAlloc(byte type);
void IConsoleVarFree(_iconsole_var * var);
void IConsoleVarSetString(_iconsole_var * var, const byte * string);
void IConsoleVarSetValue(_iconsole_var * var, int value);
void IConsoleVarDump(_iconsole_var * var, const byte * dump_desc);
// *** Parser *** //
void IConsoleCmdExec(const byte* cmdstr);
// ** console std lib ** //
void IConsoleStdLibRegister();
// ** hook code ** //
void IConsoleVarHook(const byte * name, byte type, void * proc);
void IConsoleCmdHook(const byte * name, byte type, void * proc);
bool IConsoleVarHookHandle(_iconsole_var * hook_var, byte type);
bool IConsoleCmdHookHandle(_iconsole_cmd * hook_cmd, byte type);
#endif /* CONSOLE_H */
|