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