* Skip the given amount of sprite graphics data. * @param type the type of sprite (compressed etc) * @param num the amount of sprites to skip * @return true if the data could be correctly skipped. */
| 102 | * @return true if the data could be correctly skipped. |
| 103 | */ |
| 104 | bool SkipSpriteData(SpriteFile &file, uint8_t type, uint16_t num) |
| 105 | { |
| 106 | if (type & 2) { |
| 107 | file.SkipBytes(num); |
| 108 | } else { |
| 109 | while (num > 0) { |
| 110 | int8_t i = file.ReadByte(); |
| 111 | if (i >= 0) { |
| 112 | int size = (i == 0) ? 0x80 : i; |
| 113 | if (size > num) return false; |
| 114 | num -= size; |
| 115 | file.SkipBytes(size); |
| 116 | } else { |
| 117 | i = -(i >> 3); |
| 118 | num -= i; |
| 119 | file.ReadByte(); |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | return true; |
| 124 | } |
| 125 | |
| 126 | /* Check if the given Sprite ID exists */ |
| 127 | bool SpriteExists(SpriteID id) |
no test coverage detected