147 static byte ReadByte(LoadgameState *ls) |
147 static byte ReadByte(LoadgameState *ls) |
148 { |
148 { |
149 /* Old savegames have a nice compression algorithm (RLE) |
149 /* Old savegames have a nice compression algorithm (RLE) |
150 which means that we have a chunk, which starts with a length |
150 which means that we have a chunk, which starts with a length |
151 byte. If that byte is negative, we have to repeat the next byte |
151 byte. If that byte is negative, we have to repeat the next byte |
152 that many times (+1). Else, we need to read that amount of bytes. |
152 that many times ( + 1). Else, we need to read that amount of bytes. |
153 Works pretty good if you have many zero's behind eachother */ |
153 Works pretty good if you have many zero's behind eachother */ |
154 |
154 |
155 if (ls->chunk_size == 0) { |
155 if (ls->chunk_size == 0) { |
156 /* Read new chunk */ |
156 /* Read new chunk */ |
157 int8 new_byte = ReadByteFromFile(ls); |
157 int8 new_byte = ReadByteFromFile(ls); |
431 OCL_SVAR( OC_UINT16, Town, ratings[5] ), |
431 OCL_SVAR( OC_UINT16, Town, ratings[5] ), |
432 OCL_SVAR( OC_UINT16, Town, ratings[6] ), |
432 OCL_SVAR( OC_UINT16, Town, ratings[6] ), |
433 OCL_SVAR( OC_UINT16, Town, ratings[7] ), |
433 OCL_SVAR( OC_UINT16, Town, ratings[7] ), |
434 |
434 |
435 /* XXX - This is pretty odd.. we read 32bit, but only write 8bit.. sure there is |
435 /* XXX - This is pretty odd.. we read 32bit, but only write 8bit.. sure there is |
436 nothing changed?? */ |
436 nothing changed ? ? */ |
437 OCL_SVAR( OC_FILE_U32 | OC_VAR_U8, Town, have_ratings ), |
437 OCL_SVAR( OC_FILE_U32 | OC_VAR_U8, Town, have_ratings ), |
438 OCL_SVAR( OC_FILE_U32 | OC_VAR_U8, Town, statues ), |
438 OCL_SVAR( OC_FILE_U32 | OC_VAR_U8, Town, statues ), |
439 OCL_SVAR( OC_UINT16, Town, num_houses ), |
439 OCL_SVAR( OC_UINT16, Town, num_houses ), |
440 OCL_SVAR( OC_UINT8, Town, time_until_rebuild ), |
440 OCL_SVAR( OC_UINT8, Town, time_until_rebuild ), |
441 OCL_SVAR( OC_UINT8, Town, growth_rate ), |
441 OCL_SVAR( OC_UINT8, Town, growth_rate ), |
1217 return true; |
1217 return true; |
1218 } |
1218 } |
1219 |
1219 |
1220 static const OldChunks sign_chunk[] = { |
1220 static const OldChunks sign_chunk[] = { |
1221 OCL_SVAR( OC_UINT16, Sign, str ), |
1221 OCL_SVAR( OC_UINT16, Sign, str ), |
1222 OCL_SVAR( OC_FILE_U16 | OC_VAR_I32,Sign, x ), |
1222 OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, x ), |
1223 OCL_SVAR( OC_FILE_U16 | OC_VAR_I32,Sign, y ), |
1223 OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, y ), |
1224 OCL_SVAR( OC_FILE_U16 | OC_VAR_I8, Sign, z ), |
1224 OCL_SVAR( OC_FILE_U16 | OC_VAR_I8, Sign, z ), |
1225 |
1225 |
1226 OCL_NULL( 6 ), ///< Width of sign, no longer in use |
1226 OCL_NULL( 6 ), ///< Width of sign, no longer in use |
1227 |
1227 |
1228 OCL_END() |
1228 OCL_END() |