This commit is contained in:
@@ -31,7 +31,7 @@ pub struct AssetEntry {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct GlyphsMetadata {
|
||||
pub struct GlyphBankMetadata {
|
||||
pub tile_size: u32,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
@@ -40,13 +40,13 @@ pub struct GlyphsMetadata {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct SoundsMetadata {
|
||||
pub struct SoundBankMetadata {
|
||||
pub sample_rate: u32,
|
||||
pub channels: u32,
|
||||
}
|
||||
|
||||
impl AssetEntry {
|
||||
pub fn metadata_as_glyphs(&self) -> Result<GlyphsMetadata, String> {
|
||||
pub fn metadata_as_glyph_bank(&self) -> Result<GlyphBankMetadata, String> {
|
||||
if self.bank_type != BankType::GLYPH {
|
||||
return Err(format!(
|
||||
"Asset {} is not a GLYPH bank (type: {:?})",
|
||||
@@ -57,7 +57,7 @@ impl AssetEntry {
|
||||
.map_err(|e| format!("Invalid GLYPH metadata for asset {}: {}", self.asset_id, e))
|
||||
}
|
||||
|
||||
pub fn metadata_as_sounds(&self) -> Result<SoundsMetadata, String> {
|
||||
pub fn metadata_as_sound_bank(&self) -> Result<SoundBankMetadata, String> {
|
||||
if self.bank_type != BankType::SOUNDS {
|
||||
return Err(format!(
|
||||
"Asset {} is not a SOUNDS bank (type: {:?})",
|
||||
|
||||
Reference in New Issue
Block a user