Page 1 of 1
dsb_lores_scaling
Posted: Tue Jan 11, 2022 12:07 am
by Sophia
DSB 0.80 will include
dsb_lores_scaling, which takes a boolean parameter and, when enabled, tells DSB's scaling code to scale everything to 50% of the specified size and then scale it back up, so distant objects have a more authentic DM low resolution look.
Ideally it's something you'll set and forget in your own
startup.lua like this:
However you can also disable it as needed in case it does strange things to some of your other graphics.
Re: dsb_lores_scaling
Posted: Tue Jan 11, 2022 5:14 pm
by Gambit37
Wowsers, that's amazing, thank you! Does this apply to the entire screen, or just the dungeon view?
Re: dsb_lores_scaling
Posted: Tue Jan 11, 2022 10:16 pm
by Sophia
It modifies how DSB's image scaling code works so it applies to anything that gets scaled before it is drawn. This is most commonly objects in the dungeon view, but you can also scale bitmaps yourself via dsb_bitmap_blit. Bitmaps that are drawn at their normal size aren't affected at all.
Re: dsb_lores_scaling
Posted: Sun Feb 09, 2025 11:41 pm
by Gambit37
I finally tried this out in v0.84, it doesn't appear to work. I'm getting a black image where the viewport should be with a few visible pixels at the very top. I removed my hack that simulates this effect before trying it out, so I don't think it's a Lua code conflict, however my viewport has a different position from the deafult, might that affect it?

Re: dsb_lores_scaling
Posted: Mon Feb 10, 2025 3:28 am
by Gambit37
Hmm, it does seem to work if i put the command in my sys_render_other function, but not in my startup, eg this is working:
Code: Select all
if (gui_name == "lores") then
dsb_bitmap_clear(bmp, color.powerpink )
dsb_lores_scaling(true)
end
Re: dsb_lores_scaling
Posted: Mon Feb 10, 2025 4:38 am
by Sophia
I can't reproduce this. Since you found a solution that works for you it's probably not worth delving into!
Re: dsb_lores_scaling
Posted: Mon Feb 10, 2025 5:36 pm
by Gambit37
I've just realised why I got that black screenshot: although I'd removed the rendering code of my old hack from
sys_render_other, I had forgotten to remove the area definition from
gui_info, eg this bit:
Code: Select all
viewhack = {
x = 0,
y = 90,
w = 448,
h = 272
},
So DSB was creating an uninitialised bitmap for the viewhack area which was obscuring the viewport. The reason my solution above worked is due to clearing the bitmap to powerpink first.
It's nice to see this working now. Even though the scaling is now super-chunky, it's exactly how it needs to look
