Furniture materials: wood, stone, iron, cloth, straw, fur, book spines and spellbook pages in both styles
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9cba545bc7
commit
c23c4d28ec
46 files changed
+298
-89
No files matched your search
+28
-1
@@ -101,6 +101,8 @@ pub struct Gfx {
|
||||
pub hd_sprites: Texture2D, // detailed sprites (see HD_SPRITES, hd_cell_view)
|
||||
pub atlas_hd: Texture2D, // the tile atlas of the high-res style, 64x64 tiles (see HD_TILES)
|
||||
pub atlas_hd2: Texture2D, // the same with 128x128 tiles (close up)
|
||||
pub materials: [Texture2D; 8], // furniture materials, high-res (see crate::props::Mat)
|
||||
pub materials_px: [Texture2D; 8], // the same for the pixel-art style (16x16)
|
||||
pub cursors: Texture2D, // mouse pointer frames, 16x16 each (see CURSOR_*)
|
||||
pub badges: Texture2D, // achievement badges, 32x32 each (see badges.rs)
|
||||
pub font: Texture2D, // Dinowyde (glyphs of 6x8 px ordered by Unicode, see font_slot) and DINOBYTE
|
||||
@@ -327,6 +329,24 @@ fn earth_px(x: i32, y: i32, v: u32) -> Color {
|
||||
shade(base, (big + fine) as i32)
|
||||
}
|
||||
|
||||
// ---- furniture materials (crate::props::Mat order): grey detail the furniture's colours tint
|
||||
// (the page keeps its colours), 64x64 and 16x16; see art/generated/textures/materials/
|
||||
macro_rules! material {
|
||||
($name:literal) => {
|
||||
(include_bytes!(concat!("../assets/textures/mat/", $name, "-64.png")) as &[u8], include_bytes!(concat!("../assets/textures/mat/", $name, "-16.png")) as &[u8])
|
||||
};
|
||||
}
|
||||
const MATERIALS: [(&[u8], &[u8]); 8] = [
|
||||
material!("wood"),
|
||||
material!("stone"),
|
||||
material!("iron"),
|
||||
material!("cloth"),
|
||||
material!("straw"),
|
||||
material!("fur"),
|
||||
material!("book"),
|
||||
material!("paper"),
|
||||
];
|
||||
|
||||
// ---- high-res tiles
|
||||
// The high-res style's atlases: the same cells as the 16x16 atlas, HD_TILE (64) or HD_TILE2 (128)
|
||||
// texels each; the world shows the 128 one close up, where a tile gets that many pixels (two
|
||||
@@ -2664,7 +2684,14 @@ impl Gfx {
|
||||
atlas_hd2.set_filter(FilterMode::Nearest);
|
||||
let hd_sprites = Texture2D::from_image(&gen_hd_sprites());
|
||||
hd_sprites.set_filter(FilterMode::Nearest);
|
||||
Gfx { atlas, sprites, hd_sprites, atlas_hd, atlas_hd2, cursors, badges, font, font_map }
|
||||
let mat = |b: &[u8]| {
|
||||
let t = Texture2D::from_file_with_format(b, Some(ImageFormat::Png));
|
||||
t.set_filter(FilterMode::Nearest);
|
||||
t
|
||||
};
|
||||
let materials = MATERIALS.map(|(hd, _)| mat(hd));
|
||||
let materials_px = MATERIALS.map(|(_, px)| mat(px));
|
||||
Gfx { atlas, sprites, hd_sprites, atlas_hd, atlas_hd2, materials, materials_px, cursors, badges, font, font_map }
|
||||
}
|
||||
|
||||
pub fn cell(id: u32) -> Rect {
|
||||
|
||||
Reference in new issue
Block a user