mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-21 05:29:11 +00:00
(svn r5070) Merged the bridge branch
-Feature: Bridges can now be placed above: Any railway track combination (excluding depots and waypoints) Any road combination (excluding depots) Clear tiles (duh), including fields Tunnel entrances Bridge heads Thanks to Tron for idea and implementation, KUDr for the yapf synchronization and many others for hours of testing There are still a number of visual problems remaining, especially when electric railways are on or under the bridge. DO NOT REPORT THOSE BUGS FOR THE TIME BEING please.
This commit is contained in:
39
misc.c
39
misc.c
@@ -859,16 +859,26 @@ static void Load_MAPE(void)
|
||||
uint size = MapSize();
|
||||
uint i;
|
||||
|
||||
for (i = 0; i != size;) {
|
||||
uint8 buf[1024];
|
||||
uint j;
|
||||
if (CheckSavegameVersion(29)) {
|
||||
for (i = 0; i != size;) {
|
||||
uint8 buf[1024];
|
||||
uint j;
|
||||
|
||||
SlArray(buf, lengthof(buf), SLE_UINT8);
|
||||
for (j = 0; j != lengthof(buf); j++) {
|
||||
_m[i++].extra = GB(buf[j], 0, 2);
|
||||
_m[i++].extra = GB(buf[j], 2, 2);
|
||||
_m[i++].extra = GB(buf[j], 4, 2);
|
||||
_m[i++].extra = GB(buf[j], 6, 2);
|
||||
SlArray(buf, lengthof(buf), SLE_UINT8);
|
||||
for (j = 0; j != lengthof(buf); j++) {
|
||||
_m[i++].extra = GB(buf[j], 0, 2);
|
||||
_m[i++].extra = GB(buf[j], 2, 2);
|
||||
_m[i++].extra = GB(buf[j], 4, 2);
|
||||
_m[i++].extra = GB(buf[j], 6, 2);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i != size;) {
|
||||
byte buf[4096];
|
||||
uint j;
|
||||
|
||||
SlArray(buf, lengthof(buf), SLE_UINT8);
|
||||
for (j = 0; j != lengthof(buf); j++) _m[i++].extra = buf[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -878,17 +888,12 @@ static void Save_MAPE(void)
|
||||
uint size = MapSize();
|
||||
uint i;
|
||||
|
||||
SlSetLength(size / 4);
|
||||
SlSetLength(size);
|
||||
for (i = 0; i != size;) {
|
||||
uint8 buf[1024];
|
||||
uint8 buf[4096];
|
||||
uint j;
|
||||
|
||||
for (j = 0; j != lengthof(buf); j++) {
|
||||
buf[j] = _m[i++].extra << 0;
|
||||
buf[j] |= _m[i++].extra << 2;
|
||||
buf[j] |= _m[i++].extra << 4;
|
||||
buf[j] |= _m[i++].extra << 6;
|
||||
}
|
||||
for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].extra;
|
||||
SlArray(buf, lengthof(buf), SLE_UINT8);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user