Game Engine Architecture
239 5.3.4.4. Dictionaries and Hash Tables A dictionary is a table of key-value pairs. A value in the dictionary can be looked up ...
240 5. Engine Support Systems Hashing Hashing is the process of turning a key of some arbitrary data type into an integer, which ...
241 U32 asU32; } u; u.asFloat = f; return u.asU32; } If the key is a string, we can employ a string hashing function, which comb ...
242 5. Engine Support Systems so on, making sure to modulo the resulting indices into the valid range of the table. Linear probi ...
243 text is oriented vertically instead of horizontally, and some languages like He- brew read right-to-left. Your game also nee ...
244 5. Engine Support Systems write.) As a rule of thumb, always pass string objects by reference, never by value (as the latt e ...
245 code. This is useful for debugging purposes and to permit hashed strings to be displayed on-screen or in log fi les. Game pr ...
246 5. Engine Support Systems this because the latt er implementation causes the strings to be unnecessarily re-interned every t ...
247 StringId internString(const char* str) { StringId sid = hashCrc32(str); HashTable<StringId, const char*>::iterator it ...
248 5. Engine Support Systems 5.4.4.1. Unicode The problem for most English-speaking soft ware developers is that they are train ...
249 Unicode under Windows Under Microsoft Windows, the data type wchar_t is used to represent a single “wide ” UTF-16 character ...
250 5. Engine Support Systems Unicode on Consoles The Xbox 360 soft ware development kit (XDK) uses WCS strings prett y much exc ...
251 French, our database would look something like the simple example shown in Table 5.2. Additional columns can be added for ea ...
252 5. Engine Support Systems Of course, you’ll need some way to set the “current” language globally. This might be done via a c ...
253 [AnotherSection] Key3=Value3 Key4=Value4 Key5=Value5 The XML format is another common choice for confi gurable game op- tion ...
254 5. Engine Support Systems to his or her liking. It is also a useful concept during development of the game, because it allow ...
255 calling Cvar_Set(). One of the bit fl ags, CVAR_ARCHIVE, controls whether or not the CVAR will be saved into a confi guratio ...
256 5. Engine Support Systems and a special item is returned that will bring up the menu when selected. Presumably the code call ...
257 Command Line Arguments The Uncharted engine scans the command line for a predefi ned set of special options. The name of the ...
258 5. Engine Support Systems (define-exportanim-walk-fast (new simple-animation :name "walk" :speed 2.0 ) ) (define-exportanim- ...
«
9
10
11
12
13
14
15
16
17
18
»
Free download pdf