1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef GLK_HUGO_TYPES 24 #define GLK_HUGO_TYPES 25 26 #include "common/scummsys.h" 27 28 namespace Glk { 29 namespace Hugo { 30 31 /** 32 * Library/engine globals 33 */ 34 enum EngineGlobals { 35 object = 0, 36 xobject = 1, 37 self = 2, 38 wordcount = 3, 39 player = 4, 40 actor = 5, 41 location = 6, 42 verbroutine = 7, 43 endflag = 8, 44 prompt = 9, 45 objectcount = 10, 46 system_status = 11 47 }; 48 49 /** 50 * Library/engine properties 51 */ 52 enum EngineProperties { 53 before = 1, 54 after = 2, 55 noun = 3, 56 adjective = 4, 57 article = 5 58 }; 59 60 /** 61 * "display" object properties 62 */ 63 enum ObjectProperties { 64 screenwidth = 1, 65 screenheight = 2, 66 linelength = 3, 67 windowlines = 4, 68 cursor_column = 5, 69 cursor_row = 6, 70 hasgraphics = 7, 71 title_caption = 8, 72 hasvideo = 9, 73 needs_repaint = 10, 74 pointer_x = 11, 75 pointer_y = 12 76 }; 77 78 /** 79 * Fatal errors 80 */ 81 enum ERROR_TYPE { 82 MEMORY_E = 1, ///< out of memory 83 OPEN_E, ///< error opening file 84 READ_E, ///< error reading from file 85 WRITE_E, ///< error writing to file 86 EXPECT_VAL_E, ///< expecting value 87 UNKNOWN_OP_E, ///< unknown operation 88 ILLEGAL_OP_E, ///< illegal operation 89 OVERFLOW_E, ///< overflow 90 DIVIDE_E ///< divide by zero 91 }; 92 93 enum RESOURCE_TYPE { 94 JPEG_R, ///< JPEG image 95 WAVE_R, ///< RIFF WAVE audio sample 96 MOD_R, ///< MOD music module 97 S3M_R, ///< S3M music module 98 XM_R, ///< XM music module 99 MIDI_R, ///< MIDI music 100 MP3_R, ///< MP3 audio layer 101 AVI_R, ///< Video for Windows 102 MPEG_R, ///< MPEG video 103 UNKNOWN_R 104 }; 105 106 /** 107 * A structure used for disambiguation in MatchObject() 108 */ 109 struct pobject_structure { 110 int obj; ///< the actual object number 111 char type; ///< referred to by noun or adjective 112 pobject_structurepobject_structure113 pobject_structure() : obj(0), type(0) {} 114 }; 115 116 struct SAVED_WINDOW_DATA { 117 int left, top, right, bottom; 118 int width, height, charwidth, lineheight; 119 int currentpos, currentline; 120 int currentfont; 121 }; 122 123 /** 124 * Structure used for navigating {...} blocks: 125 */ 126 struct CODE_BLOCK { 127 int type; ///< see #defines, below 128 long brk; ///< break address, or 0 to indicate NOP 129 long returnaddr; ///< used only for do-while loops 130 #if defined (DEBUGGER) 131 int dbnest; ///< for recovering from 'break' 132 #endif 133 CODE_BLOCKCODE_BLOCK134 CODE_BLOCK() : type(0), brk(0), returnaddr(0) 135 #if defined (DEBUGGER) 136 , dbnest(0) 137 #endif 138 { 139 } 140 }; 141 142 #if defined (DEBUGGER) 143 enum DEBUGGER_ERROR { 144 D_MEMORY_ERROR 145 }; 146 147 struct CALL { 148 long addr; 149 bool param; 150 CALLCALL151 CALL() : addr(0), param(false) {} 152 }; 153 154 struct WINDOW { 155 int count; 156 bool changed; 157 WINDOWWINDOW158 WINDOW() : count(99), changed(false) {} 159 }; 160 161 struct BREAKPOINT { 162 bool isbreak; 163 long addr; 164 const char *in; 165 int count; 166 BREAKPOINTBREAKPOINT167 BREAKPOINT() : isbreak(false), addr(0), in(nullptr), count(0) { 168 } 169 }; 170 #endif 171 172 } // End of namespace Hugo 173 } // End of namespace Glk 174 175 #endif 176