Graphics style: pixel art (360 rows) or high-res (1080 rows, detailed sprites)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
928c34e78b
commit
807a124a0b
23 files changed
+81
-48
No files matched your search
+1
-1
@@ -118,7 +118,7 @@ painted mission whose triggers switch each other on. **Block 4 is done.**
|
|||||||
|
|
||||||
## 5. Next (agreed 2026-11-06)
|
## 5. Next (agreed 2026-11-06)
|
||||||
|
|
||||||
Done: the pixel look (the world 360 rows on every device, 270/480/540/1080 selectable, 32x32 sprites from 1080 rows or close zoom (first: the imp); the interface on the same
|
Done: the pixel look (the world 360 rows on every device, graphics style "pixel art" 360 rows or "high-res" 1080 rows with 32x32 sprites, first the imp; the interface on the same
|
||||||
grid), guard and attack markers (shields and swords), savegames with the game state only.
|
grid), guard and attack markers (shields and swords), savegames with the game state only.
|
||||||
|
|
||||||
1. **Real AI masters** (done, v202611-00052) - rivals, AI seats and the co-op partner play by the player's rules: imps dig,
|
1. **Real AI masters** (done, v202611-00052) - rivals, AI seats and the co-op partner play by the player's rules: imps dig,
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = západ
|
|||||||
dir.nw = severozápad
|
dir.nw = severozápad
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Pixelový vzhled
|
set.render_scale = Grafický styl
|
||||||
set.pixel_rows_val = {0} řádků
|
set.style_pixel = Pixel art
|
||||||
|
set.style_highres = HD grafika
|
||||||
set.debug_fps = Zobrazit FPS
|
set.debug_fps = Zobrazit FPS
|
||||||
set.debug_frame_time = Zobrazit čas snímku
|
set.debug_frame_time = Zobrazit čas snímku
|
||||||
set.debug_ping = Zobrazit ping
|
set.debug_ping = Zobrazit ping
|
||||||
|
|||||||
+3
-2
@@ -379,8 +379,9 @@ dir.w = vest
|
|||||||
dir.nw = nordvest
|
dir.nw = nordvest
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Pixel-look
|
set.render_scale = Grafikstil
|
||||||
set.pixel_rows_val = {0} linjer
|
set.style_pixel = Pixel art
|
||||||
|
set.style_highres = HD-grafik
|
||||||
set.debug_fps = Vis FPS
|
set.debug_fps = Vis FPS
|
||||||
set.debug_frame_time = Vis billedtid
|
set.debug_frame_time = Vis billedtid
|
||||||
set.debug_ping = Vis ping
|
set.debug_ping = Vis ping
|
||||||
|
|||||||
+3
-2
@@ -379,8 +379,9 @@ dir.w = Westen
|
|||||||
dir.nw = Nordwesten
|
dir.nw = Nordwesten
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Pixel-Look
|
set.render_scale = Grafikstil
|
||||||
set.pixel_rows_val = {0} Zeilen
|
set.style_pixel = Pixel-Art
|
||||||
|
set.style_highres = High-Res
|
||||||
set.debug_fps = FPS anzeigen
|
set.debug_fps = FPS anzeigen
|
||||||
set.debug_frame_time = Framezeit anzeigen
|
set.debug_frame_time = Framezeit anzeigen
|
||||||
set.debug_ping = Ping anzeigen
|
set.debug_ping = Ping anzeigen
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = δύση
|
|||||||
dir.nw = βορειοδυτικά
|
dir.nw = βορειοδυτικά
|
||||||
|
|
||||||
val.auto = Αυτόμ. ({0}x)
|
val.auto = Αυτόμ. ({0}x)
|
||||||
set.render_scale = Εμφάνιση pixel
|
set.render_scale = Στυλ γραφικών
|
||||||
set.pixel_rows_val = {0} γραμμές
|
set.style_pixel = Pixel art
|
||||||
|
set.style_highres = Υψηλή ανάλυση
|
||||||
set.debug_fps = Εμφάνιση FPS
|
set.debug_fps = Εμφάνιση FPS
|
||||||
set.debug_frame_time = Εμφάνιση χρόνου καρέ
|
set.debug_frame_time = Εμφάνιση χρόνου καρέ
|
||||||
set.debug_ping = Εμφάνιση ping
|
set.debug_ping = Εμφάνιση ping
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = west
|
|||||||
dir.nw = north-west
|
dir.nw = north-west
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Pixel look
|
set.render_scale = Graphics style
|
||||||
set.pixel_rows_val = {0} rows
|
set.style_pixel = Pixel art
|
||||||
|
set.style_highres = High-res
|
||||||
set.debug_fps = Show FPS
|
set.debug_fps = Show FPS
|
||||||
set.debug_frame_time = Show frame time
|
set.debug_frame_time = Show frame time
|
||||||
set.debug_ping = Show ping
|
set.debug_ping = Show ping
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = oeste
|
|||||||
dir.nw = noroeste
|
dir.nw = noroeste
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Aspecto pixelado
|
set.render_scale = Estilo gráfico
|
||||||
set.pixel_rows_val = {0} líneas
|
set.style_pixel = Pixel art
|
||||||
|
set.style_highres = Gráficos HD
|
||||||
set.debug_fps = Mostrar FPS
|
set.debug_fps = Mostrar FPS
|
||||||
set.debug_frame_time = Mostrar ms por fotograma
|
set.debug_frame_time = Mostrar ms por fotograma
|
||||||
set.debug_ping = Mostrar ping
|
set.debug_ping = Mostrar ping
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = länsi
|
|||||||
dir.nw = luode
|
dir.nw = luode
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Pikseliulkoasu
|
set.render_scale = Grafiikkatyyli
|
||||||
set.pixel_rows_val = {0} riviä
|
set.style_pixel = Pikselitaide
|
||||||
|
set.style_highres = HD-grafiikka
|
||||||
set.debug_fps = Näytä FPS
|
set.debug_fps = Näytä FPS
|
||||||
set.debug_frame_time = Näytä ruutuaika
|
set.debug_frame_time = Näytä ruutuaika
|
||||||
set.debug_ping = Näytä ping
|
set.debug_ping = Näytä ping
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = zapad
|
|||||||
dir.nw = sjeverozapad
|
dir.nw = sjeverozapad
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Pikselni izgled
|
set.render_scale = Grafički stil
|
||||||
set.pixel_rows_val = {0} redaka
|
set.style_pixel = Pixel art
|
||||||
|
set.style_highres = HD grafika
|
||||||
set.debug_fps = Prikaži FPS
|
set.debug_fps = Prikaži FPS
|
||||||
set.debug_frame_time = Prikaži vrijeme sličice
|
set.debug_frame_time = Prikaži vrijeme sličice
|
||||||
set.debug_ping = Prikaži ping
|
set.debug_ping = Prikaži ping
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = nyugat
|
|||||||
dir.nw = északnyugat
|
dir.nw = északnyugat
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Pixeles kinézet
|
set.render_scale = Grafikai stílus
|
||||||
set.pixel_rows_val = {0} sor
|
set.style_pixel = Pixel art
|
||||||
|
set.style_highres = HD grafika
|
||||||
set.debug_fps = FPS mutatása
|
set.debug_fps = FPS mutatása
|
||||||
set.debug_frame_time = Képidő mutatása
|
set.debug_frame_time = Képidő mutatása
|
||||||
set.debug_ping = Ping mutatása
|
set.debug_ping = Ping mutatása
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = ovest
|
|||||||
dir.nw = nord-ovest
|
dir.nw = nord-ovest
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Aspetto pixel
|
set.render_scale = Stile grafico
|
||||||
set.pixel_rows_val = {0} righe
|
set.style_pixel = Pixel art
|
||||||
|
set.style_highres = Grafica HD
|
||||||
set.debug_fps = Mostra FPS
|
set.debug_fps = Mostra FPS
|
||||||
set.debug_frame_time = Mostra tempo frame
|
set.debug_frame_time = Mostra tempo frame
|
||||||
set.debug_ping = Mostra ping
|
set.debug_ping = Mostra ping
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = westen
|
|||||||
dir.nw = noordwesten
|
dir.nw = noordwesten
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Pixellook
|
set.render_scale = Grafische stijl
|
||||||
set.pixel_rows_val = {0} regels
|
set.style_pixel = Pixelart
|
||||||
|
set.style_highres = HD-graphics
|
||||||
set.debug_fps = FPS tonen
|
set.debug_fps = FPS tonen
|
||||||
set.debug_frame_time = Frametijd tonen
|
set.debug_frame_time = Frametijd tonen
|
||||||
set.debug_ping = Ping tonen
|
set.debug_ping = Ping tonen
|
||||||
|
|||||||
+3
-2
@@ -379,8 +379,9 @@ dir.w = vest
|
|||||||
dir.nw = nordvest
|
dir.nw = nordvest
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Pikselutseende
|
set.render_scale = Grafikkstil
|
||||||
set.pixel_rows_val = {0} linjer
|
set.style_pixel = Pikselkunst
|
||||||
|
set.style_highres = HD-grafikk
|
||||||
set.debug_fps = Vis FPS
|
set.debug_fps = Vis FPS
|
||||||
set.debug_frame_time = Vis bildetid
|
set.debug_frame_time = Vis bildetid
|
||||||
set.debug_ping = Vis ping
|
set.debug_ping = Vis ping
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = oeste
|
|||||||
dir.nw = noroeste
|
dir.nw = noroeste
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Aspeto pixelizado
|
set.render_scale = Estilo gráfico
|
||||||
set.pixel_rows_val = {0} linhas
|
set.style_pixel = Pixel art
|
||||||
|
set.style_highres = Gráficos HD
|
||||||
set.debug_fps = Mostrar FPS
|
set.debug_fps = Mostrar FPS
|
||||||
set.debug_frame_time = Mostrar tempo de frame
|
set.debug_frame_time = Mostrar tempo de frame
|
||||||
set.debug_ping = Mostrar ping
|
set.debug_ping = Mostrar ping
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = vest
|
|||||||
dir.nw = nord-vest
|
dir.nw = nord-vest
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Aspect pixelat
|
set.render_scale = Stil grafic
|
||||||
set.pixel_rows_val = {0} rânduri
|
set.style_pixel = Pixel art
|
||||||
|
set.style_highres = Grafică HD
|
||||||
set.debug_fps = Arată FPS
|
set.debug_fps = Arată FPS
|
||||||
set.debug_frame_time = Arată timpul cadrului
|
set.debug_frame_time = Arată timpul cadrului
|
||||||
set.debug_ping = Arată ping
|
set.debug_ping = Arată ping
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = запад
|
|||||||
dir.nw = северо-запад
|
dir.nw = северо-запад
|
||||||
|
|
||||||
val.auto = Авто ({0}x)
|
val.auto = Авто ({0}x)
|
||||||
set.render_scale = Пиксельный вид
|
set.render_scale = Графический стиль
|
||||||
set.pixel_rows_val = {0} строк
|
set.style_pixel = Пиксель-арт
|
||||||
|
set.style_highres = HD-графика
|
||||||
set.debug_fps = Показывать FPS
|
set.debug_fps = Показывать FPS
|
||||||
set.debug_frame_time = Время кадра
|
set.debug_frame_time = Время кадра
|
||||||
set.debug_ping = Показывать пинг
|
set.debug_ping = Показывать пинг
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = západ
|
|||||||
dir.nw = severozápad
|
dir.nw = severozápad
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Pixelový vzhľad
|
set.render_scale = Grafický štýl
|
||||||
set.pixel_rows_val = {0} riadkov
|
set.style_pixel = Pixel art
|
||||||
|
set.style_highres = HD grafika
|
||||||
set.debug_fps = Zobraziť FPS
|
set.debug_fps = Zobraziť FPS
|
||||||
set.debug_frame_time = Zobraziť čas snímky
|
set.debug_frame_time = Zobraziť čas snímky
|
||||||
set.debug_ping = Zobraziť ping
|
set.debug_ping = Zobraziť ping
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = запад
|
|||||||
dir.nw = северозапад
|
dir.nw = северозапад
|
||||||
|
|
||||||
val.auto = Ауто ({0}x)
|
val.auto = Ауто ({0}x)
|
||||||
set.render_scale = Пикселни изглед
|
set.render_scale = Графички стил
|
||||||
set.pixel_rows_val = {0} редова
|
set.style_pixel = Пиксел арт
|
||||||
|
set.style_highres = HD графика
|
||||||
set.debug_fps = Прикажи FPS
|
set.debug_fps = Прикажи FPS
|
||||||
set.debug_frame_time = Прикажи време кадра
|
set.debug_frame_time = Прикажи време кадра
|
||||||
set.debug_ping = Прикажи пинг
|
set.debug_ping = Прикажи пинг
|
||||||
|
|||||||
+3
-2
@@ -380,8 +380,9 @@ dir.w = väster
|
|||||||
dir.nw = nordväst
|
dir.nw = nordväst
|
||||||
|
|
||||||
val.auto = Auto ({0}x)
|
val.auto = Auto ({0}x)
|
||||||
set.render_scale = Pixelutseende
|
set.render_scale = Grafikstil
|
||||||
set.pixel_rows_val = {0} rader
|
set.style_pixel = Pixelkonst
|
||||||
|
set.style_highres = HD-grafik
|
||||||
set.debug_fps = Visa FPS
|
set.debug_fps = Visa FPS
|
||||||
set.debug_frame_time = Visa bildtid
|
set.debug_frame_time = Visa bildtid
|
||||||
set.debug_ping = Visa ping
|
set.debug_ping = Visa ping
|
||||||
|
|||||||
+2
-2
@@ -1373,8 +1373,8 @@ const SPR_CELL: u32 = 12;
|
|||||||
const SPR_K: u32 = 3;
|
const SPR_K: u32 = 3;
|
||||||
pub const ACELL: u32 = SPR_CELL * SPR_K;
|
pub const ACELL: u32 = SPR_CELL * SPR_K;
|
||||||
|
|
||||||
// Detailed 32x32 sprites (generated, see art/generated/), used instead of the 10x10 ones when
|
// Detailed 32x32 sprites (generated, see art/generated/), used instead of the 10x10 ones in the
|
||||||
// the world is rendered fine enough (render3d::billboards). Five views side by side like VIEWS,
|
// high-res graphics style when close enough (render3d::billboards). Five views side by side like VIEWS,
|
||||||
// transparent background, the feet on the bottom row. No gear yet: every tier looks the same.
|
// transparent background, the feet on the bottom row. No gear yet: every tier looks the same.
|
||||||
const HD_SPRITES: [(EK, &[u8]); 1] = [(EK::Worker, include_bytes!("../assets/sprites/imp-32.png"))];
|
const HD_SPRITES: [(EK, &[u8]); 1] = [(EK::Worker, include_bytes!("../assets/sprites/imp-32.png"))];
|
||||||
const HD: u32 = 32;
|
const HD: u32 = 32;
|
||||||
|
|||||||
+2
-2
@@ -151,7 +151,7 @@ fn item_value(it: Item, s: &Settings) -> String {
|
|||||||
Item::DebugTriggerZones => onoff(s.debug_trigger_zones),
|
Item::DebugTriggerZones => onoff(s.debug_trigger_zones),
|
||||||
Item::DebugCommandMarkers => onoff(s.debug_command_markers),
|
Item::DebugCommandMarkers => onoff(s.debug_command_markers),
|
||||||
Item::DebugPathLines => onoff(s.debug_path_lines),
|
Item::DebugPathLines => onoff(s.debug_path_lines),
|
||||||
Item::RenderScale => crate::i18n::trf("set.pixel_rows_val", &[s.pixel_rows.to_string()]),
|
Item::RenderScale => tr(if crate::settings::pixel_rows(s.pixel_rows) == crate::settings::HIGH_RES_ROWS as u32 { "set.style_highres" } else { "set.style_pixel" }),
|
||||||
Item::GameSpeed => format!("{}x", s.game_speed as i32),
|
Item::GameSpeed => format!("{}x", s.game_speed as i32),
|
||||||
Item::Hints => onoff(s.hints),
|
Item::Hints => onoff(s.hints),
|
||||||
Item::Events => onoff(s.events),
|
Item::Events => onoff(s.events),
|
||||||
@@ -200,7 +200,7 @@ fn item_change(it: Item, s: &mut Settings, d: i32) {
|
|||||||
Item::WallDetail => s.wall_detail = cycle(&[1u8, 2, 3], s.wall_detail, d),
|
Item::WallDetail => s.wall_detail = cycle(&[1u8, 2, 3], s.wall_detail, d),
|
||||||
Item::Lights => s.max_lights = cycle(&[8u8, 16, 24], s.max_lights, d),
|
Item::Lights => s.max_lights = cycle(&[8u8, 16, 24], s.max_lights, d),
|
||||||
Item::UiScale => s.ui_size = cycle(&crate::settings::UI_SIZES, s.ui_size, d),
|
Item::UiScale => s.ui_size = cycle(&crate::settings::UI_SIZES, s.ui_size, d),
|
||||||
Item::RenderScale => s.pixel_rows = cycle(&crate::settings::PIXEL_ROWS, crate::settings::pixel_rows(s.pixel_rows) as u16, d),
|
Item::RenderScale => s.pixel_rows = cycle(&crate::settings::STYLES, crate::settings::pixel_rows(s.pixel_rows) as u16, d),
|
||||||
Item::DebugFps => s.debug_fps = !s.debug_fps,
|
Item::DebugFps => s.debug_fps = !s.debug_fps,
|
||||||
Item::DebugFrameTime => s.debug_frame_time = !s.debug_frame_time,
|
Item::DebugFrameTime => s.debug_frame_time = !s.debug_frame_time,
|
||||||
Item::DebugPing => s.debug_ping = !s.debug_ping,
|
Item::DebugPing => s.debug_ping = !s.debug_ping,
|
||||||
|
|||||||
+4
-3
@@ -1658,8 +1658,9 @@ impl R3d {
|
|||||||
let mut mb = MB::new();
|
let mut mb = MB::new();
|
||||||
let sw = SPRITE_TEX_W;
|
let sw = SPRITE_TEX_W;
|
||||||
let sh = SPRITE_TEX_H;
|
let sh = SPRITE_TEX_H;
|
||||||
// screen pixels per tile: a sprite's cell (1.2 sizes high) shows a detailed sprite when
|
// detailed sprites only in the high-res style, and only where a sprite's cell (1.2 sizes
|
||||||
// every texel of it gets nearly a pixel; fewer pixels would only turn it into noise
|
// high) gives every texel nearly a pixel; fewer pixels would only turn it into noise
|
||||||
|
let hd = self.pixel_rows >= crate::settings::HIGH_RES_ROWS as u32;
|
||||||
let px_per_tile = world_rows / cam.view_h().max(0.1);
|
let px_per_tile = world_rows / cam.view_h().max(0.1);
|
||||||
for e in &g.ents {
|
for e in &g.ents {
|
||||||
if !e.alive || e.held || unit_hidden(g, e) {
|
if !e.alive || e.held || unit_hidden(g, e) {
|
||||||
@@ -1760,7 +1761,7 @@ impl R3d {
|
|||||||
}
|
}
|
||||||
let white = e.flash > 0.07;
|
let white = e.flash > 0.07;
|
||||||
let v = if e.captive != 0 { 0 } else { view };
|
let v = if e.captive != 0 { 0 } else { view };
|
||||||
let detailed = w * 1.2 * px_per_tile >= crate::gfx::ACELL as f32 * 0.85;
|
let detailed = hd && w * 1.2 * px_per_tile >= crate::gfx::ACELL as f32 * 0.85;
|
||||||
let src = detailed.then(|| Gfx::hd_cell_view(e.kind, white, e.level, v)).flatten().unwrap_or_else(|| Gfx::sprite_cell_view(e.kind, white, e.level, v));
|
let src = detailed.then(|| Gfx::hd_cell_view(e.kind, white, e.level, v)).flatten().unwrap_or_else(|| Gfx::sprite_cell_view(e.kind, white, e.level, v));
|
||||||
let (mut u0, v0) = (src.x / sw, src.y / sh);
|
let (mut u0, v0) = (src.x / sw, src.y / sh);
|
||||||
let (mut u1, v1) = ((src.x + src.w) / sw, (src.y + src.h) / sh);
|
let (mut u1, v1) = ((src.x + src.w) / sw, (src.y + src.h) / sh);
|
||||||
|
|||||||
+18
-4
@@ -151,7 +151,7 @@ pub struct Settings {
|
|||||||
pub ui_factor: u8, // old interface size (2 large, 3 medium, 4 small; only read to carry old settings over)
|
pub ui_factor: u8, // old interface size (2 large, 3 medium, 4 small; only read to carry old settings over)
|
||||||
pub ui_size: u16, // interface size in percent of the standard (100 = 1080 interface rows), 0 = automatic
|
pub ui_size: u16, // interface size in percent of the standard (100 = 1080 interface rows), 0 = automatic
|
||||||
pub render_scale: u8, // old pixel-look divisor (no longer used, kept for old settings files)
|
pub render_scale: u8, // old pixel-look divisor (no longer used, kept for old settings files)
|
||||||
pub pixel_rows: u16, // pixel look: rows of the world on every screen (one of PIXEL_ROWS)
|
pub pixel_rows: u16, // graphics style: rows of the world on every screen (360 pixel art, 1080 high-res)
|
||||||
pub touch_ui: u8, // touch interface: 0 = automatic (after the first touch), 1 = on, 2 = off
|
pub touch_ui: u8, // touch interface: 0 = automatic (after the first touch), 1 = on, 2 = off
|
||||||
pub debug_fps: bool, // show FPS and rendering backend
|
pub debug_fps: bool, // show FPS and rendering backend
|
||||||
pub debug_frame_time: bool, // show the frame-time line and graph
|
pub debug_frame_time: bool, // show the frame-time line and graph
|
||||||
@@ -264,11 +264,15 @@ impl Settings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the world's pixel rows of the settings menu (more rows: finer world, detailed sprites fit)
|
// the graphics styles of the settings menu as the world's pixel rows: pixel art (360 rows, the
|
||||||
pub const PIXEL_ROWS: [u16; 5] = [270, 360, 480, 540, 1080];
|
// small hand-made sprites) and high-res (1080 rows, detailed sprites; other values from older
|
||||||
|
// settings files count as pixel art)
|
||||||
|
pub const PIXEL_ART_ROWS: u16 = 360;
|
||||||
|
pub const HIGH_RES_ROWS: u16 = 1080;
|
||||||
|
pub const STYLES: [u16; 2] = [PIXEL_ART_ROWS, HIGH_RES_ROWS];
|
||||||
|
|
||||||
pub fn pixel_rows(set: u16) -> u32 {
|
pub fn pixel_rows(set: u16) -> u32 {
|
||||||
if PIXEL_ROWS.contains(&set) { set as u32 } else { 360 }
|
if set == HIGH_RES_ROWS { HIGH_RES_ROWS as u32 } else { PIXEL_ART_ROWS as u32 }
|
||||||
}
|
}
|
||||||
|
|
||||||
// the interface sizes of the settings menu in percent (0 = automatic), from small to large
|
// the interface sizes of the settings menu in percent (0 = automatic), from small to large
|
||||||
@@ -318,4 +322,14 @@ mod tests {
|
|||||||
assert_eq!(ui_size_rows(150), 720);
|
assert_eq!(ui_size_rows(150), 720);
|
||||||
assert!(ui_size_rows(200) < ui_size_rows(175));
|
assert!(ui_size_rows(200) < ui_size_rows(175));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn graphics_styles() {
|
||||||
|
assert_eq!(pixel_rows(1080), 1080);
|
||||||
|
assert_eq!(pixel_rows(360), 360);
|
||||||
|
// older pixel-look values count as pixel art
|
||||||
|
for old in [270u16, 480, 540, 0] {
|
||||||
|
assert_eq!(pixel_rows(old), 360);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user