avatar ordering fixed
This commit is contained in:
parent
96b956e0f2
commit
e328661fbf
42
src/game.rs
42
src/game.rs
|
@ -1,17 +1,4 @@
|
||||||
use crate::{
|
use crate::{Avatar, Dialogue, Ending, Font, Item, Palette, Room, Sprite, TextDirection, Tile, Variable, optional_data_line, ToBase36};
|
||||||
Avatar,
|
|
||||||
Dialogue,
|
|
||||||
Ending,
|
|
||||||
Font,
|
|
||||||
Item,
|
|
||||||
Palette,
|
|
||||||
Room,
|
|
||||||
Sprite,
|
|
||||||
TextDirection,
|
|
||||||
Tile,
|
|
||||||
Variable,
|
|
||||||
optional_data_line
|
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
pub struct Version {
|
pub struct Version {
|
||||||
|
@ -186,6 +173,24 @@ impl ToString for Game {
|
||||||
segments.push(tile.to_string());
|
segments.push(tile.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for some reason the sprites with numeric IDs go first,
|
||||||
|
// then SPR A (avatar), then all the non-numeric IDs
|
||||||
|
fn is_string_numeric(str: String) -> bool {
|
||||||
|
for c in str.chars() {
|
||||||
|
if ! c.is_numeric() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for sprite in &self.sprites {
|
||||||
|
if is_string_numeric(sprite.id.to_base36()) {
|
||||||
|
segments.push(sprite.to_string());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
segments.push(self.avatar.to_string());
|
segments.push(self.avatar.to_string());
|
||||||
|
|
||||||
for sprite in &self.sprites {
|
for sprite in &self.sprites {
|
||||||
|
@ -343,15 +348,6 @@ fn test_add_tile() {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_bitsy_omnibus() {
|
fn test_bitsy_omnibus() {
|
||||||
let acceptable_failures: Vec<String> = vec![
|
let acceptable_failures: Vec<String> = vec![
|
||||||
// avatar ordering issues
|
|
||||||
"src/test-resources/omnibus/682993AC.bitsy.txt".to_string(),
|
|
||||||
"src/test-resources/omnibus/0D901EE6.bitsy.txt".to_string(),
|
|
||||||
"src/test-resources/omnibus/7FEF71E4.bitsy.txt".to_string(),
|
|
||||||
"src/test-resources/omnibus/245E93CB.bitsy.txt".to_string(),
|
|
||||||
"src/test-resources/omnibus/A643C5F4.bitsy.txt".to_string(),
|
|
||||||
"src/test-resources/omnibus/7533372B.bitsy.txt".to_string(),
|
|
||||||
"src/test-resources/omnibus/DBD5D375.bitsy.txt".to_string(),
|
|
||||||
|
|
||||||
// fails because of sprite colours but also because a tile contains "NaN"
|
// fails because of sprite colours but also because a tile contains "NaN"
|
||||||
"src/test-resources/omnibus/DA88C287.bitsy.txt".to_string(),
|
"src/test-resources/omnibus/DA88C287.bitsy.txt".to_string(),
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue