author | KUDr |
Fri, 20 Apr 2007 19:43:06 +0000 | |
changeset 6513 | 454347ca3dfb |
parent 6491 | 00dc414c909d |
child 6643 | f81bee57bc09 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
6091
diff
changeset
|
3 |
/** @file misc.cpp */ |
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
6091
diff
changeset
|
4 |
|
0 | 5 |
#include "stdafx.h" |
1891
862800791170
(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents:
1881
diff
changeset
|
6 |
#include "openttd.h" |
2308 | 7 |
#include "currency.h" |
2163
b17b313113a0
(svn r2673) Include functions.h directly, not globally via openttd.h
tron
parents:
2159
diff
changeset
|
8 |
#include "functions.h" |
6453
226bcddeba32
(svn r9609) -Codechange: Move some function prototypes out of functions.h and into landscape.h, and add a few where they didn't exist.
maedhros
parents:
6350
diff
changeset
|
9 |
#include "landscape.h" |
2548
49c8a096033f
(svn r3077) static, const, bracing, indentation, 0 -> '\0'/NULL, typos in comments, excess empty lines, minor other changes
tron
parents:
2484
diff
changeset
|
10 |
#include "news.h" |
2191 | 11 |
#include "player.h" |
1375
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
12 |
#include "string.h" |
507
04b5403aaf6b
(svn r815) Include strings.h only in the files which need it.
tron
parents:
500
diff
changeset
|
13 |
#include "table/strings.h" |
1914
2b4b3c3a95b4
(svn r2420) - Codechange: magic number elminitation of cursorsprites.
Darkvater
parents:
1891
diff
changeset
|
14 |
#include "table/sprites.h" |
679
04ca2cd69420
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
543
diff
changeset
|
15 |
#include "map.h" |
0 | 16 |
#include "vehicle.h" |
17 |
#include "saveload.h" |
|
842 | 18 |
#include "engine.h" |
1752
d65cd19f7117
(svn r2256) - Fix: Trains cannot find a depot when they are in a tunnel. (glx)
matthijs
parents:
1595
diff
changeset
|
19 |
#include "vehicle_gui.h" |
2159
f6284cf5fab0
(svn r2669) Shuffle some more stuff around to reduce dependencies
tron
parents:
2112
diff
changeset
|
20 |
#include "variables.h" |
2706
fc872b9b17a7
(svn r3250) -Fix: AIs weren't uninitialized when a new game was loaded
truelight
parents:
2685
diff
changeset
|
21 |
#include "ai/ai.h" |
6332
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
22 |
#include "newgrf_house.h" |
4261
28670f743746
(svn r5887) -Cleanup: move date related functions, defines and variables to date.[ch]
rubidium
parents:
3977
diff
changeset
|
23 |
#include "date.h" |
6091
c8827d9ae04a
(svn r8826) -Codechange: Replace _cargoc's separate arrays with a regular struct array (with accessor) and implement new initialization method using cargo labels.
peter1138
parents:
5971
diff
changeset
|
24 |
#include "cargotype.h" |
0 | 25 |
|
1328
eacd8225ed42
(svn r1832) Next byte -> char iteration: custom names
tron
parents:
1313
diff
changeset
|
26 |
char _name_array[512][32]; |
0 | 27 |
|
2073 | 28 |
#ifndef MERSENNE_TWISTER |
29 |
||
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
507
diff
changeset
|
30 |
#ifdef RANDOM_DEBUG |
5469
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
5385
diff
changeset
|
31 |
#include "network/network_data.h" |
1120
047e8b16a954
(svn r1621) -Fix: fixed some compiler warnings for the random-debug-switch
truelight
parents:
1095
diff
changeset
|
32 |
uint32 DoRandom(int line, const char *file) |
2073 | 33 |
#else // RANDOM_DEBUG |
6247 | 34 |
uint32 Random() |
2073 | 35 |
#endif // RANDOM_DEBUG |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
507
diff
changeset
|
36 |
{ |
1121
8a7e7ace154f
(svn r1622) -Fix: variables can't be defined after a statement.. (Igor2Code)
truelight
parents:
1120
diff
changeset
|
37 |
|
8a7e7ace154f
(svn r1622) -Fix: variables can't be defined after a statement.. (Igor2Code)
truelight
parents:
1120
diff
changeset
|
38 |
uint32 s; |
8a7e7ace154f
(svn r1622) -Fix: variables can't be defined after a statement.. (Igor2Code)
truelight
parents:
1120
diff
changeset
|
39 |
uint32 t; |
8a7e7ace154f
(svn r1622) -Fix: variables can't be defined after a statement.. (Igor2Code)
truelight
parents:
1120
diff
changeset
|
40 |
|
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
507
diff
changeset
|
41 |
#ifdef RANDOM_DEBUG |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
507
diff
changeset
|
42 |
if (_networking && (DEREF_CLIENT(0)->status != STATUS_INACTIVE || !_network_server)) |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
507
diff
changeset
|
43 |
printf("Random [%d/%d] %s:%d\n",_frame_counter, _current_player, file, line); |
260
4819bcce8389
(svn r266) -Fix: hopefully fixed the desync problem nicely (and reverted the
truelight
parents:
256
diff
changeset
|
44 |
#endif |
4819bcce8389
(svn r266) -Fix: hopefully fixed the desync problem nicely (and reverted the
truelight
parents:
256
diff
changeset
|
45 |
|
1121
8a7e7ace154f
(svn r1622) -Fix: variables can't be defined after a statement.. (Igor2Code)
truelight
parents:
1120
diff
changeset
|
46 |
s = _random_seeds[0][0]; |
8a7e7ace154f
(svn r1622) -Fix: variables can't be defined after a statement.. (Igor2Code)
truelight
parents:
1120
diff
changeset
|
47 |
t = _random_seeds[0][1]; |
1446
c95d3cb58985
(svn r1950) Fix: A slight adjustment in the DoRandom() function which however causes dramatic improvement in the distribution of random numbers.
pasky
parents:
1375
diff
changeset
|
48 |
_random_seeds[0][0] = s + ROR(t ^ 0x1234567F, 7) + 1; |
c95d3cb58985
(svn r1950) Fix: A slight adjustment in the DoRandom() function which however causes dramatic improvement in the distribution of random numbers.
pasky
parents:
1375
diff
changeset
|
49 |
return _random_seeds[0][1] = ROR(s, 3) - 1; |
0 | 50 |
} |
2073 | 51 |
#endif // MERSENNE_TWISTER |
0 | 52 |
|
2073 | 53 |
#if defined(RANDOM_DEBUG) && !defined(MERSENNE_TWISTER) |
1120
047e8b16a954
(svn r1621) -Fix: fixed some compiler warnings for the random-debug-switch
truelight
parents:
1095
diff
changeset
|
54 |
uint DoRandomRange(uint max, int line, const char *file) |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
507
diff
changeset
|
55 |
{ |
2484
0e45d70ae908
(svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them
tron
parents:
2430
diff
changeset
|
56 |
return GB(DoRandom(line, file), 0, 16) * max >> 16; |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
507
diff
changeset
|
57 |
} |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
507
diff
changeset
|
58 |
#else |
0 | 59 |
uint RandomRange(uint max) |
60 |
{ |
|
2484
0e45d70ae908
(svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them
tron
parents:
2430
diff
changeset
|
61 |
return GB(Random(), 0, 16) * max >> 16; |
0 | 62 |
} |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
507
diff
changeset
|
63 |
#endif |
0 | 64 |
|
2073 | 65 |
|
6247 | 66 |
uint32 InteractiveRandom() |
0 | 67 |
{ |
206 | 68 |
uint32 t = _random_seeds[1][1]; |
69 |
uint32 s = _random_seeds[1][0]; |
|
1446
c95d3cb58985
(svn r1950) Fix: A slight adjustment in the DoRandom() function which however causes dramatic improvement in the distribution of random numbers.
pasky
parents:
1375
diff
changeset
|
70 |
_random_seeds[1][0] = s + ROR(t ^ 0x1234567F, 7) + 1; |
c95d3cb58985
(svn r1950) Fix: A slight adjustment in the DoRandom() function which however causes dramatic improvement in the distribution of random numbers.
pasky
parents:
1375
diff
changeset
|
71 |
return _random_seeds[1][1] = ROR(s, 3) - 1; |
206 | 72 |
} |
73 |
||
239 | 74 |
uint InteractiveRandomRange(uint max) |
75 |
{ |
|
2484
0e45d70ae908
(svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them
tron
parents:
2430
diff
changeset
|
76 |
return GB(InteractiveRandom(), 0, 16) * max >> 16; |
239 | 77 |
} |
78 |
||
6247 | 79 |
void InitializeVehicles(); |
80 |
void InitializeWaypoints(); |
|
81 |
void InitializeDepots(); |
|
82 |
void InitializeEngines(); |
|
83 |
void InitializeOrders(); |
|
84 |
void InitializeClearLand(); |
|
85 |
void InitializeRailGui(); |
|
86 |
void InitializeRoadGui(); |
|
87 |
void InitializeAirportGui(); |
|
88 |
void InitializeDockGui(); |
|
89 |
void InitializeIndustries(); |
|
90 |
void InitializeMainGui(); |
|
91 |
void InitializeTowns(); |
|
92 |
void InitializeTrees(); |
|
93 |
void InitializeSigns(); |
|
94 |
void InitializeStations(); |
|
95 |
static void InitializeNameMgr(); |
|
96 |
void InitializePlayers(); |
|
97 |
static void InitializeCheats(); |
|
98 |
void InitializeNPF(); |
|
0 | 99 |
|
2828
342f02f7c0d4
(svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents:
2706
diff
changeset
|
100 |
void InitializeGame(int mode, uint size_x, uint size_y) |
0 | 101 |
{ |
2051 | 102 |
AllocateMap(size_x, size_y); |
103 |
||
842 | 104 |
AddTypeToEngines(); // make sure all engines have a type |
915 | 105 |
|
5893
7e431a4abebb
(svn r8511) -Codechange: make WindowClass an enumerated value.
rubidium
parents:
5668
diff
changeset
|
106 |
SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, 0, WC_MAIN_WINDOW, 0); |
0 | 107 |
|
6231
ff7454d35935
(svn r9034) -Codechange: renamed _pause to _pause_game, as some targets already have
truelight
parents:
6201
diff
changeset
|
108 |
_pause_game = 0; |
0 | 109 |
_fast_forward = 0; |
110 |
_tick_counter = 0; |
|
111 |
_date_fract = 0; |
|
112 |
_cur_tileloop_tile = 0; |
|
201
c40d343115f8
(svn r202) -Codechange: I missed some files with trailing spaces.. this should be
truelight
parents:
179
diff
changeset
|
113 |
|
2828
342f02f7c0d4
(svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents:
2706
diff
changeset
|
114 |
if ((mode & IG_DATE_RESET) == IG_DATE_RESET) { |
4295
51b5d00b5f09
(svn r5928) -Cleanup: remove ConvertIntDate and use ConvertYMDToDate as ConvertIntDate was only called with Years.
rubidium
parents:
4285
diff
changeset
|
115 |
SetDate(ConvertYMDToDate(_patches.starting_year, 0, 1)); |
0 | 116 |
} |
117 |
||
2848 | 118 |
InitializeEngines(); |
0 | 119 |
InitializeVehicles(); |
1542
62a03537ad0b
(svn r2046) -Codechange: moved all waypoint code to waypoint.c/waypoint.h
truelight
parents:
1538
diff
changeset
|
120 |
InitializeWaypoints(); |
4347
38fc1b161e89
(svn r6048) -Codechange: all InitializeXXX are plural, just not Depot
truelight
parents:
4344
diff
changeset
|
121 |
InitializeDepots(); |
1024
5e446b5b3ec5
(svn r1525) -Codechange: rewrote the _order_array, now it can be made dynamic.
truelight
parents:
1009
diff
changeset
|
122 |
InitializeOrders(); |
0 | 123 |
|
124 |
InitNewsItemStructs(); |
|
2051 | 125 |
InitializeLandscape(); |
0 | 126 |
InitializeClearLand(); |
127 |
InitializeRailGui(); |
|
128 |
InitializeRoadGui(); |
|
129 |
InitializeAirportGui(); |
|
130 |
InitializeDockGui(); |
|
131 |
InitializeTowns(); |
|
132 |
InitializeTrees(); |
|
988
4304525d1b8b
(svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for
truelight
parents:
983
diff
changeset
|
133 |
InitializeSigns(); |
0 | 134 |
InitializeStations(); |
135 |
InitializeIndustries(); |
|
6332
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
136 |
InitializeBuildingCounts(); |
3622
730fd3cd0050
(svn r4520) -Fix: Did last commit in the wrong branch. Repair and shame on me.
celestar
parents:
3617
diff
changeset
|
137 |
InitializeMainGui(); |
201
c40d343115f8
(svn r202) -Codechange: I missed some files with trailing spaces.. this should be
truelight
parents:
179
diff
changeset
|
138 |
|
0 | 139 |
InitializeNameMgr(); |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
116
diff
changeset
|
140 |
InitializeVehiclesGuiList(); |
0 | 141 |
InitializeTrains(); |
1247 | 142 |
InitializeNPF(); |
0 | 143 |
|
2706
fc872b9b17a7
(svn r3250) -Fix: AIs weren't uninitialized when a new game was loaded
truelight
parents:
2685
diff
changeset
|
144 |
AI_Initialize(); |
0 | 145 |
InitializePlayers(); |
146 |
InitializeCheats(); |
|
147 |
||
148 |
InitTextEffects(); |
|
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
507
diff
changeset
|
149 |
InitTextMessage(); |
0 | 150 |
InitializeAnimatedTiles(); |
151 |
||
152 |
InitializeLandscapeVariables(false); |
|
153 |
||
154 |
ResetObjectToPlace(); |
|
155 |
} |
|
156 |
||
4862
ac034ec9ed2b
(svn r6788) - Codechange: Add and use a function to test if a string ID is a custom name.
peter1138
parents:
4383
diff
changeset
|
157 |
bool IsCustomName(StringID id) |
ac034ec9ed2b
(svn r6788) - Codechange: Add and use a function to test if a string ID is a custom name.
peter1138
parents:
4383
diff
changeset
|
158 |
{ |
ac034ec9ed2b
(svn r6788) - Codechange: Add and use a function to test if a string ID is a custom name.
peter1138
parents:
4383
diff
changeset
|
159 |
return GB(id, 11, 5) == 15; |
ac034ec9ed2b
(svn r6788) - Codechange: Add and use a function to test if a string ID is a custom name.
peter1138
parents:
4383
diff
changeset
|
160 |
} |
ac034ec9ed2b
(svn r6788) - Codechange: Add and use a function to test if a string ID is a custom name.
peter1138
parents:
4383
diff
changeset
|
161 |
|
0 | 162 |
void DeleteName(StringID id) |
163 |
{ |
|
4862
ac034ec9ed2b
(svn r6788) - Codechange: Add and use a function to test if a string ID is a custom name.
peter1138
parents:
4383
diff
changeset
|
164 |
if (IsCustomName(id)) { |
0 | 165 |
memset(_name_array[id & 0x1FF], 0, sizeof(_name_array[id & 0x1FF])); |
166 |
} |
|
167 |
} |
|
168 |
||
4912
0f51b47cb983
(svn r6884) -Codechange: Add strict bounds checking in string formatting system.
Darkvater
parents:
4862
diff
changeset
|
169 |
char *GetName(char *buff, StringID id, const char* last) |
0 | 170 |
{ |
4912
0f51b47cb983
(svn r6884) -Codechange: Add strict bounds checking in string formatting system.
Darkvater
parents:
4862
diff
changeset
|
171 |
return strecpy(buff, _name_array[id & ~0x600], last); |
0 | 172 |
} |
173 |
||
174 |
||
6247 | 175 |
static void InitializeCheats() |
0 | 176 |
{ |
201
c40d343115f8
(svn r202) -Codechange: I missed some files with trailing spaces.. this should be
truelight
parents:
179
diff
changeset
|
177 |
memset(&_cheats, 0, sizeof(Cheats)); |
0 | 178 |
} |
179 |
||
180 |
||
6247 | 181 |
static void InitializeNameMgr() |
0 | 182 |
{ |
183 |
memset(_name_array, 0, sizeof(_name_array)); |
|
184 |
} |
|
185 |
||
1328
eacd8225ed42
(svn r1832) Next byte -> char iteration: custom names
tron
parents:
1313
diff
changeset
|
186 |
StringID RealAllocateName(const char *name, byte skip, bool check_double) |
0 | 187 |
{ |
1375
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
188 |
char (*free_item)[lengthof(*_name_array)] = NULL; |
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
189 |
char (*i)[lengthof(*_name_array)]; |
0 | 190 |
|
1375
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
191 |
for (i = _name_array; i != endof(_name_array); ++i) { |
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
192 |
if ((*i)[0] == '\0') { |
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
193 |
if (free_item == NULL) free_item = i; |
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
194 |
} else if (check_double && strncmp(*i, name, lengthof(*i) - 1) == 0) { |
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
195 |
_error_message = STR_0132_CHOSEN_NAME_IN_USE_ALREADY; |
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
196 |
return 0; |
0 | 197 |
} |
198 |
} |
|
199 |
||
1375
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
200 |
if (free_item != NULL) { |
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
201 |
ttd_strlcpy(*free_item, name, lengthof(*free_item)); |
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
202 |
return (free_item - _name_array) | 0x7800 | (skip << 8); |
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
203 |
} else { |
0 | 204 |
_error_message = STR_0131_TOO_MANY_NAMES_DEFINED; |
205 |
return 0; |
|
206 |
} |
|
207 |
} |
|
208 |
||
6247 | 209 |
void ConvertNameArray() |
5108
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
210 |
{ |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
211 |
uint i; |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
212 |
|
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
213 |
for (i = 0; i < lengthof(_name_array); i++) { |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
214 |
const char *strfrom = _name_array[i]; |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
215 |
char tmp[sizeof(*_name_array)]; |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
216 |
char *strto = tmp; |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
217 |
|
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
218 |
for (; *strfrom != '\0'; strfrom++) { |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
219 |
WChar c = (byte)*strfrom; |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
220 |
switch (c) { |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
221 |
case 0xA4: c = 0x20AC; break; // Euro |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
222 |
case 0xA6: c = 0x0160; break; // S with caron |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
223 |
case 0xA8: c = 0x0161; break; // s with caron |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
224 |
case 0xB4: c = 0x017D; break; // Z with caron |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
225 |
case 0xB8: c = 0x017E; break; // z with caron |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
226 |
case 0xBC: c = 0x0152; break; // OE ligature |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
227 |
case 0xBD: c = 0x0153; break; // oe ligature |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
228 |
case 0xBE: c = 0x0178; break; // Y with diaresis |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
229 |
default: break; |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
230 |
} |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
231 |
if (strto + Utf8CharLen(c) > lastof(tmp)) break; |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
232 |
strto += Utf8Encode(strto, c); |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
233 |
} |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
234 |
|
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
235 |
/* Terminate the new string and copy it back to the name array */ |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
236 |
*strto = '\0'; |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
237 |
memcpy(_name_array[i], tmp, sizeof(*_name_array)); |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
238 |
} |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
239 |
} |
aeaef6fe53b7
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
5016
diff
changeset
|
240 |
|
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
6091
diff
changeset
|
241 |
/* Calculate constants that depend on the landscape type. */ |
0 | 242 |
void InitializeLandscapeVariables(bool only_constants) |
243 |
{ |
|
6091
c8827d9ae04a
(svn r8826) -Codechange: Replace _cargoc's separate arrays with a regular struct array (with accessor) and implement new initialization method using cargo labels.
peter1138
parents:
5971
diff
changeset
|
244 |
if (only_constants) return; |
201
c40d343115f8
(svn r202) -Codechange: I missed some files with trailing spaces.. this should be
truelight
parents:
179
diff
changeset
|
245 |
|
6350
04b19f551aec
(svn r9388) -Codechange: variable scope and type, and standardify all CargoID loops.
peter1138
parents:
6332
diff
changeset
|
246 |
for (CargoID i = 0; i < NUM_CARGO; i++) { |
6091
c8827d9ae04a
(svn r8826) -Codechange: Replace _cargoc's separate arrays with a regular struct array (with accessor) and implement new initialization method using cargo labels.
peter1138
parents:
5971
diff
changeset
|
247 |
_cargo_payment_rates[i] = GetCargo(i)->initial_payment; |
c8827d9ae04a
(svn r8826) -Codechange: Replace _cargoc's separate arrays with a regular struct array (with accessor) and implement new initialization method using cargo labels.
peter1138
parents:
5971
diff
changeset
|
248 |
_cargo_payment_rates_frac[i] = 0; |
0 | 249 |
} |
250 |
} |
|
251 |
||
252 |
||
253 |
||
116
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
105
diff
changeset
|
254 |
int FindFirstBit(uint32 value) |
0 | 255 |
{ |
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
6091
diff
changeset
|
256 |
/* The macro FIND_FIRST_BIT is better to use when your value is |
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
6091
diff
changeset
|
257 |
not more than 128. */ |
116
ca4332a9ec1d
(svn r117) Feature: Performance details window in company league menu (TrueLight)
dominik
parents:
105
diff
changeset
|
258 |
byte i = 0; |
5663
bbb117a6cbf3
(svn r8123) -Fix (r117): FindFirstBit now really returns the first bit. Fixes bug FS#538.
maedhros
parents:
5596
diff
changeset
|
259 |
|
bbb117a6cbf3
(svn r8123) -Fix (r117): FindFirstBit now really returns the first bit. Fixes bug FS#538.
maedhros
parents:
5596
diff
changeset
|
260 |
if (value == 0) return 0; |
bbb117a6cbf3
(svn r8123) -Fix (r117): FindFirstBit now really returns the first bit. Fixes bug FS#538.
maedhros
parents:
5596
diff
changeset
|
261 |
|
bbb117a6cbf3
(svn r8123) -Fix (r117): FindFirstBit now really returns the first bit. Fixes bug FS#538.
maedhros
parents:
5596
diff
changeset
|
262 |
if ((value & 0x0000ffff) == 0) { value >>= 16; i += 16; } |
bbb117a6cbf3
(svn r8123) -Fix (r117): FindFirstBit now really returns the first bit. Fixes bug FS#538.
maedhros
parents:
5596
diff
changeset
|
263 |
if ((value & 0x000000ff) == 0) { value >>= 8; i += 8; } |
bbb117a6cbf3
(svn r8123) -Fix (r117): FindFirstBit now really returns the first bit. Fixes bug FS#538.
maedhros
parents:
5596
diff
changeset
|
264 |
if ((value & 0x0000000f) == 0) { value >>= 4; i += 4; } |
bbb117a6cbf3
(svn r8123) -Fix (r117): FindFirstBit now really returns the first bit. Fixes bug FS#538.
maedhros
parents:
5596
diff
changeset
|
265 |
if ((value & 0x00000003) == 0) { value >>= 2; i += 2; } |
bbb117a6cbf3
(svn r8123) -Fix (r117): FindFirstBit now really returns the first bit. Fixes bug FS#538.
maedhros
parents:
5596
diff
changeset
|
266 |
if ((value & 0x00000001) == 0) { i += 1; } |
bbb117a6cbf3
(svn r8123) -Fix (r117): FindFirstBit now really returns the first bit. Fixes bug FS#538.
maedhros
parents:
5596
diff
changeset
|
267 |
|
0 | 268 |
return i; |
269 |
} |
|
270 |
||
271 |
||
6247 | 272 |
static void Save_NAME() |
0 | 273 |
{ |
274 |
int i; |
|
275 |
||
1375
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
276 |
for (i = 0; i != lengthof(_name_array); ++i) { |
00a24560f025
(svn r1879) Revise name handling, no functional changes
tron
parents:
1328
diff
changeset
|
277 |
if (_name_array[i][0] != '\0') { |
0 | 278 |
SlSetArrayIndex(i); |
4321
958a8e9c012b
(svn r5974) -Codechange: added casts all around the place to make Windows 64bit happy (michi_cc)
truelight
parents:
4300
diff
changeset
|
279 |
SlArray(_name_array[i], (uint)strlen(_name_array[i]), SLE_UINT8); |
201
c40d343115f8
(svn r202) -Codechange: I missed some files with trailing spaces.. this should be
truelight
parents:
179
diff
changeset
|
280 |
} |
0 | 281 |
} |
282 |
} |
|
283 |
||
6247 | 284 |
static void Load_NAME() |
0 | 285 |
{ |
286 |
int index; |
|
201
c40d343115f8
(svn r202) -Codechange: I missed some files with trailing spaces.. this should be
truelight
parents:
179
diff
changeset
|
287 |
|
0 | 288 |
while ((index = SlIterateArray()) != -1) { |
6491
00dc414c909d
(svn r9672) -Cleanup: lots of coding style fixes around operands.
rubidium
parents:
6453
diff
changeset
|
289 |
SlArray(_name_array[index], SlGetFieldLength(), SLE_UINT8); |
0 | 290 |
} |
291 |
} |
|
292 |
||
293 |
static const SaveLoadGlobVarList _date_desc[] = { |
|
4383
f1e2d6c7527e
(svn r6136) -Fix: _cur_year wasn't converting when reading pre-31 savegames, causing nasty desyncs
truelight
parents:
4347
diff
changeset
|
294 |
SLEG_CONDVAR(_date, SLE_FILE_U16 | SLE_VAR_I32, 0, 30), |
f1e2d6c7527e
(svn r6136) -Fix: _cur_year wasn't converting when reading pre-31 savegames, causing nasty desyncs
truelight
parents:
4347
diff
changeset
|
295 |
SLEG_CONDVAR(_date, SLE_INT32, 31, SL_MAX_VERSION), |
4344
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
296 |
SLEG_VAR(_date_fract, SLE_UINT16), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
297 |
SLEG_VAR(_tick_counter, SLE_UINT16), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
298 |
SLEG_VAR(_vehicle_id_ctr_day, SLE_UINT16), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
299 |
SLEG_VAR(_age_cargo_skip_counter, SLE_UINT8), |
5971 | 300 |
SLE_CONDNULL(1, 0, 45), |
4344
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
301 |
SLEG_CONDVAR(_cur_tileloop_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
302 |
SLEG_CONDVAR(_cur_tileloop_tile, SLE_UINT32, 6, SL_MAX_VERSION), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
303 |
SLEG_VAR(_disaster_delay, SLE_UINT16), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
304 |
SLEG_VAR(_station_tick_ctr, SLE_UINT16), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
305 |
SLEG_VAR(_random_seeds[0][0], SLE_UINT32), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
306 |
SLEG_VAR(_random_seeds[0][1], SLE_UINT32), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
307 |
SLEG_CONDVAR(_cur_town_ctr, SLE_FILE_U8 | SLE_VAR_U32, 0, 9), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
308 |
SLEG_CONDVAR(_cur_town_ctr, SLE_UINT32, 10, SL_MAX_VERSION), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
309 |
SLEG_VAR(_cur_player_tick_index, SLE_FILE_U8 | SLE_VAR_U32), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
310 |
SLEG_VAR(_next_competitor_start, SLE_FILE_U16 | SLE_VAR_U32), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
311 |
SLEG_VAR(_trees_tick_ctr, SLE_UINT8), |
6231
ff7454d35935
(svn r9034) -Codechange: renamed _pause to _pause_game, as some targets already have
truelight
parents:
6201
diff
changeset
|
312 |
SLEG_CONDVAR(_pause_game, SLE_UINT8, 4, SL_MAX_VERSION), |
4344
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
313 |
SLEG_CONDVAR(_cur_town_iter, SLE_UINT32, 11, SL_MAX_VERSION), |
3046
baa216f9911a
(svn r3626) - Merge the SlGlobVarList (global variables) and SaveLoad (offset in struct, variable determined runtime) structs. The only difference between these two is the last element that either holds the address or the offset in the struct. Which one to take is determined by which function is called; SlObject or SlGlobList.
Darkvater
parents:
3033
diff
changeset
|
314 |
SLEG_END() |
0 | 315 |
}; |
316 |
||
6201
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
6091
diff
changeset
|
317 |
/* Save load date related variables as well as persistent tick counters |
bee01dc45e39
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
belugas
parents:
6091
diff
changeset
|
318 |
* XXX: currently some unrelated stuff is just put here */ |
6247 | 319 |
static void SaveLoad_DATE() |
0 | 320 |
{ |
321 |
SlGlobList(_date_desc); |
|
322 |
} |
|
323 |
||
324 |
||
325 |
static const SaveLoadGlobVarList _view_desc[] = { |
|
4344
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
326 |
SLEG_CONDVAR(_saved_scrollpos_x, SLE_FILE_I16 | SLE_VAR_I32, 0, 5), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
327 |
SLEG_CONDVAR(_saved_scrollpos_x, SLE_INT32, 6, SL_MAX_VERSION), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
328 |
SLEG_CONDVAR(_saved_scrollpos_y, SLE_FILE_I16 | SLE_VAR_I32, 0, 5), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
329 |
SLEG_CONDVAR(_saved_scrollpos_y, SLE_INT32, 6, SL_MAX_VERSION), |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
330 |
SLEG_VAR(_saved_scrollpos_zoom, SLE_UINT8), |
3046
baa216f9911a
(svn r3626) - Merge the SlGlobVarList (global variables) and SaveLoad (offset in struct, variable determined runtime) structs. The only difference between these two is the last element that either holds the address or the offset in the struct. Which one to take is determined by which function is called; SlObject or SlGlobList.
Darkvater
parents:
3033
diff
changeset
|
331 |
SLEG_END() |
0 | 332 |
}; |
333 |
||
6247 | 334 |
static void SaveLoad_VIEW() |
0 | 335 |
{ |
336 |
SlGlobList(_view_desc); |
|
337 |
} |
|
338 |
||
1218 | 339 |
static uint32 _map_dim_x; |
340 |
static uint32 _map_dim_y; |
|
341 |
||
342 |
static const SaveLoadGlobVarList _map_dimensions[] = { |
|
3046
baa216f9911a
(svn r3626) - Merge the SlGlobVarList (global variables) and SaveLoad (offset in struct, variable determined runtime) structs. The only difference between these two is the last element that either holds the address or the offset in the struct. Which one to take is determined by which function is called; SlObject or SlGlobList.
Darkvater
parents:
3033
diff
changeset
|
343 |
SLEG_CONDVAR(_map_dim_x, SLE_UINT32, 6, SL_MAX_VERSION), |
baa216f9911a
(svn r3626) - Merge the SlGlobVarList (global variables) and SaveLoad (offset in struct, variable determined runtime) structs. The only difference between these two is the last element that either holds the address or the offset in the struct. Which one to take is determined by which function is called; SlObject or SlGlobList.
Darkvater
parents:
3033
diff
changeset
|
344 |
SLEG_CONDVAR(_map_dim_y, SLE_UINT32, 6, SL_MAX_VERSION), |
baa216f9911a
(svn r3626) - Merge the SlGlobVarList (global variables) and SaveLoad (offset in struct, variable determined runtime) structs. The only difference between these two is the last element that either holds the address or the offset in the struct. Which one to take is determined by which function is called; SlObject or SlGlobList.
Darkvater
parents:
3033
diff
changeset
|
345 |
SLEG_END() |
1218 | 346 |
}; |
347 |
||
6247 | 348 |
static void Save_MAPS() |
1218 | 349 |
{ |
1219
1163c59b8650
(svn r1723) Save the map size in tiles, not number of bits
tron
parents:
1218
diff
changeset
|
350 |
_map_dim_x = MapSizeX(); |
1163c59b8650
(svn r1723) Save the map size in tiles, not number of bits
tron
parents:
1218
diff
changeset
|
351 |
_map_dim_y = MapSizeY(); |
1218 | 352 |
SlGlobList(_map_dimensions); |
353 |
} |
|
354 |
||
6247 | 355 |
static void Load_MAPS() |
1218 | 356 |
{ |
357 |
SlGlobList(_map_dimensions); |
|
2051 | 358 |
AllocateMap(_map_dim_x, _map_dim_y); |
1218 | 359 |
} |
360 |
||
6247 | 361 |
static void Load_MAPT() |
2050
3b37e813823a
(svn r2559) Cleaned up new saveload code for the map
ludde
parents:
2049
diff
changeset
|
362 |
{ |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
363 |
uint size = MapSize(); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
364 |
uint i; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
365 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
366 |
for (i = 0; i != size;) { |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
367 |
byte buf[4096]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
368 |
uint j; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
369 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
370 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
371 |
for (j = 0; j != lengthof(buf); j++) _m[i++].type_height = buf[j]; |
817
238bbdaa228b
(svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
truelight
parents:
785
diff
changeset
|
372 |
} |
0 | 373 |
} |
374 |
||
6247 | 375 |
static void Save_MAPT() |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1024
diff
changeset
|
376 |
{ |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
377 |
uint size = MapSize(); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
378 |
uint i; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
379 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
380 |
SlSetLength(size); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
381 |
for (i = 0; i != size;) { |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
382 |
byte buf[4096]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
383 |
uint j; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
384 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
385 |
for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].type_height; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
386 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
387 |
} |
0 | 388 |
} |
389 |
||
6247 | 390 |
static void Load_MAP1() |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1024
diff
changeset
|
391 |
{ |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
392 |
uint size = MapSize(); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
393 |
uint i; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
394 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
395 |
for (i = 0; i != size;) { |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
396 |
byte buf[4096]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
397 |
uint j; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
398 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
399 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
2360
4e4ebe18e448
(svn r2886) Rename the "owner" attribute to "m1", because when it stores an owner it is accessed by [GS]etOwner anyway and when it doesn't store an owner, but arbitrary data, accessing a field called "owner" is confusing.
tron
parents:
2308
diff
changeset
|
400 |
for (j = 0; j != lengthof(buf); j++) _m[i++].m1 = buf[j]; |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
401 |
} |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
402 |
} |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
403 |
|
6247 | 404 |
static void Save_MAP1() |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
405 |
{ |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
406 |
uint size = MapSize(); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
407 |
uint i; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
408 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
409 |
SlSetLength(size); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
410 |
for (i = 0; i != size;) { |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
411 |
byte buf[4096]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
412 |
uint j; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
413 |
|
2360
4e4ebe18e448
(svn r2886) Rename the "owner" attribute to "m1", because when it stores an owner it is accessed by [GS]etOwner anyway and when it doesn't store an owner, but arbitrary data, accessing a field called "owner" is confusing.
tron
parents:
2308
diff
changeset
|
414 |
for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m1; |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
415 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
416 |
} |
0 | 417 |
} |
418 |
||
6247 | 419 |
static void Load_MAP2() |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1024
diff
changeset
|
420 |
{ |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
421 |
uint size = MapSize(); |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
422 |
uint i; |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
423 |
|
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
424 |
for (i = 0; i != size;) { |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
425 |
uint16 buf[4096]; |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
426 |
uint j; |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
427 |
|
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
428 |
SlArray(buf, lengthof(buf), |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
429 |
/* In those versions the m2 was 8 bits */ |
2685
805a28b7c3b7
(svn r3227) -Codechange: [Savegame] removed 'minor' version, and renamed 'major' version to just: version.
truelight
parents:
2548
diff
changeset
|
430 |
CheckSavegameVersion(5) ? SLE_FILE_U8 | SLE_VAR_U16 : SLE_UINT16 |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
431 |
); |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
432 |
for (j = 0; j != lengthof(buf); j++) _m[i++].m2 = buf[j]; |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
433 |
} |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
434 |
} |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
435 |
|
6247 | 436 |
static void Save_MAP2() |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
437 |
{ |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
438 |
uint size = MapSize(); |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
439 |
uint i; |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
440 |
|
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
441 |
SlSetLength(size * sizeof(_m[0].m2)); |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
442 |
for (i = 0; i != size;) { |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
443 |
uint16 buf[4096]; |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
444 |
uint j; |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
445 |
|
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
446 |
for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m2; |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
447 |
SlArray(buf, lengthof(buf), SLE_UINT16); |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
448 |
} |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
449 |
} |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
450 |
|
6247 | 451 |
static void Load_MAP3() |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
452 |
{ |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
453 |
uint size = MapSize(); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
454 |
uint i; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
455 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
456 |
for (i = 0; i != size;) { |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
457 |
byte buf[4096]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
458 |
uint j; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
459 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
460 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
461 |
for (j = 0; j != lengthof(buf); j++) _m[i++].m3 = buf[j]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
462 |
} |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
463 |
} |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
464 |
|
6247 | 465 |
static void Save_MAP3() |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
466 |
{ |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
467 |
uint size = MapSize(); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
468 |
uint i; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
469 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
470 |
SlSetLength(size); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
471 |
for (i = 0; i != size;) { |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
472 |
byte buf[4096]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
473 |
uint j; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
474 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
475 |
for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m3; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
476 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
477 |
} |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
478 |
} |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
479 |
|
6247 | 480 |
static void Load_MAP4() |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
481 |
{ |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
482 |
uint size = MapSize(); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
483 |
uint i; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
484 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
485 |
for (i = 0; i != size;) { |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
486 |
byte buf[4096]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
487 |
uint j; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
488 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
489 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
490 |
for (j = 0; j != lengthof(buf); j++) _m[i++].m4 = buf[j]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
491 |
} |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
492 |
} |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
493 |
|
6247 | 494 |
static void Save_MAP4() |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
495 |
{ |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
496 |
uint size = MapSize(); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
497 |
uint i; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
498 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
499 |
SlSetLength(size); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
500 |
for (i = 0; i != size;) { |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
501 |
byte buf[4096]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
502 |
uint j; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
503 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
504 |
for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m4; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
505 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
506 |
} |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
507 |
} |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
508 |
|
6247 | 509 |
static void Load_MAP5() |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
510 |
{ |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
511 |
uint size = MapSize(); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
512 |
uint i; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
513 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
514 |
for (i = 0; i != size;) { |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
515 |
byte buf[4096]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
516 |
uint j; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
517 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
518 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
519 |
for (j = 0; j != lengthof(buf); j++) _m[i++].m5 = buf[j]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
520 |
} |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
521 |
} |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
522 |
|
6247 | 523 |
static void Save_MAP5() |
2295
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
524 |
{ |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
525 |
uint size = MapSize(); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
526 |
uint i; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
527 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
528 |
SlSetLength(size); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
529 |
for (i = 0; i != size;) { |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
530 |
byte buf[4096]; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
531 |
uint j; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
532 |
|
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
533 |
for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m5; |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
534 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
95e8858e9938
(svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c
tron
parents:
2293
diff
changeset
|
535 |
} |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
536 |
} |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
537 |
|
6247 | 538 |
static void Load_MAP6() |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
539 |
{ |
5596
5bf7128140a0
(svn r8050) -Codechange: Rename map member extra to m6, since its usage has been widden.
belugas
parents:
5587
diff
changeset
|
540 |
/* Still available for loading old games */ |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
541 |
uint size = MapSize(); |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
542 |
uint i; |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
543 |
|
5385
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
544 |
if (CheckSavegameVersion(42)) { |
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
545 |
for (i = 0; i != size;) { |
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
546 |
uint8 buf[1024]; |
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
547 |
uint j; |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
548 |
|
5385
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
549 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
550 |
for (j = 0; j != lengthof(buf); j++) { |
5596
5bf7128140a0
(svn r8050) -Codechange: Rename map member extra to m6, since its usage has been widden.
belugas
parents:
5587
diff
changeset
|
551 |
_m[i++].m6 = GB(buf[j], 0, 2); |
5bf7128140a0
(svn r8050) -Codechange: Rename map member extra to m6, since its usage has been widden.
belugas
parents:
5587
diff
changeset
|
552 |
_m[i++].m6 = GB(buf[j], 2, 2); |
5bf7128140a0
(svn r8050) -Codechange: Rename map member extra to m6, since its usage has been widden.
belugas
parents:
5587
diff
changeset
|
553 |
_m[i++].m6 = GB(buf[j], 4, 2); |
5bf7128140a0
(svn r8050) -Codechange: Rename map member extra to m6, since its usage has been widden.
belugas
parents:
5587
diff
changeset
|
554 |
_m[i++].m6 = GB(buf[j], 6, 2); |
5385
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
555 |
} |
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
556 |
} |
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
557 |
} else { |
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
558 |
for (i = 0; i != size;) { |
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
559 |
byte buf[4096]; |
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
560 |
uint j; |
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
561 |
|
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
562 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
5596
5bf7128140a0
(svn r8050) -Codechange: Rename map member extra to m6, since its usage has been widden.
belugas
parents:
5587
diff
changeset
|
563 |
for (j = 0; j != lengthof(buf); j++) _m[i++].m6 = buf[j]; |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
564 |
} |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
565 |
} |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
566 |
} |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
567 |
|
6247 | 568 |
static void Save_MAP6() |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
569 |
{ |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
570 |
uint size = MapSize(); |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
571 |
uint i; |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
572 |
|
5385
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
573 |
SlSetLength(size); |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
574 |
for (i = 0; i != size;) { |
5385
3868f2e6db9b
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents:
5108
diff
changeset
|
575 |
uint8 buf[4096]; |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
576 |
uint j; |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
577 |
|
5596
5bf7128140a0
(svn r8050) -Codechange: Rename map member extra to m6, since its usage has been widden.
belugas
parents:
5587
diff
changeset
|
578 |
for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m6; |
2049
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
579 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
538e73c53f54
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents:
1999
diff
changeset
|
580 |
} |
0 | 581 |
} |
582 |
||
6332
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
583 |
static void Load_MAP7() |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
584 |
{ |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
585 |
uint size = MapSize(); |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
586 |
uint i; |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
587 |
|
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
588 |
for (i = 0; i != size;) { |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
589 |
uint8 buf[4096]; |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
590 |
uint j; |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
591 |
|
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
592 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
593 |
for (j = 0; j != lengthof(buf); j++) _me[i++].m7 = buf[j]; |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
594 |
} |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
595 |
} |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
596 |
|
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
597 |
static void Save_MAP7() |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
598 |
{ |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
599 |
uint size = MapSize(); |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
600 |
uint i; |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
601 |
|
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
602 |
SlSetLength(size); |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
603 |
for (i = 0; i != size;) { |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
604 |
uint8 buf[4096]; |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
605 |
uint j; |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
606 |
|
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
607 |
for (j = 0; j != lengthof(buf); j++) buf[j] = _me[i++].m7; |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
608 |
SlArray(buf, lengthof(buf), SLE_UINT8); |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
609 |
} |
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
610 |
} |
0 | 611 |
|
6247 | 612 |
static void Save_CHTS() |
0 | 613 |
{ |
614 |
byte count = sizeof(_cheats)/sizeof(Cheat); |
|
615 |
Cheat* cht = (Cheat*) &_cheats; |
|
616 |
Cheat* cht_last = &cht[count]; |
|
617 |
||
2951 | 618 |
SlSetLength(count * 2); |
619 |
for (; cht != cht_last; cht++) { |
|
0 | 620 |
SlWriteByte(cht->been_used); |
621 |
SlWriteByte(cht->value); |
|
622 |
} |
|
623 |
} |
|
624 |
||
6247 | 625 |
static void Load_CHTS() |
0 | 626 |
{ |
2989 | 627 |
Cheat* cht = (Cheat*)&_cheats; |
628 |
uint count = SlGetFieldLength() / 2; |
|
629 |
uint i; |
|
0 | 630 |
|
2989 | 631 |
for (i = 0; i < count; i++) { |
5587
167d9a91ef02
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5584
diff
changeset
|
632 |
cht[i].been_used = (SlReadByte() != 0); |
167d9a91ef02
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5584
diff
changeset
|
633 |
cht[i].value = (SlReadByte() != 0); |
0 | 634 |
} |
635 |
} |
|
636 |
||
637 |
||
5587
167d9a91ef02
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5584
diff
changeset
|
638 |
extern const ChunkHandler _misc_chunk_handlers[] = { |
4344
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
639 |
{ 'MAPS', Save_MAPS, Load_MAPS, CH_RIFF }, |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
640 |
{ 'MAPT', Save_MAPT, Load_MAPT, CH_RIFF }, |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
641 |
{ 'MAPO', Save_MAP1, Load_MAP1, CH_RIFF }, |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
642 |
{ 'MAP2', Save_MAP2, Load_MAP2, CH_RIFF }, |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
643 |
{ 'M3LO', Save_MAP3, Load_MAP3, CH_RIFF }, |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
644 |
{ 'M3HI', Save_MAP4, Load_MAP4, CH_RIFF }, |
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
645 |
{ 'MAP5', Save_MAP5, Load_MAP5, CH_RIFF }, |
5596
5bf7128140a0
(svn r8050) -Codechange: Rename map member extra to m6, since its usage has been widden.
belugas
parents:
5587
diff
changeset
|
646 |
{ 'MAPE', Save_MAP6, Load_MAP6, CH_RIFF }, |
6332
f3f436dcd7d0
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
maedhros
parents:
6247
diff
changeset
|
647 |
{ 'MAP7', Save_MAP7, Load_MAP7, CH_RIFF }, |
0 | 648 |
|
4344
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
649 |
{ 'NAME', Save_NAME, Load_NAME, CH_ARRAY}, |
0 | 650 |
{ 'DATE', SaveLoad_DATE, SaveLoad_DATE, CH_RIFF}, |
651 |
{ 'VIEW', SaveLoad_VIEW, SaveLoad_VIEW, CH_RIFF}, |
|
4344
7e123fec5b0b
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents:
4326
diff
changeset
|
652 |
{ 'CHTS', Save_CHTS, Load_CHTS, CH_RIFF | CH_LAST} |
0 | 653 |
}; |