mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
fix some issues with menu bg
This commit is contained in:
parent
0a0073dc9f
commit
2d2e57b2cf
3 changed files with 5 additions and 4 deletions
|
@ -73,6 +73,7 @@ static void make_bg(int no_scale)
|
||||||
{
|
{
|
||||||
unsigned short *src = (void *)g_menubg_src_ptr;
|
unsigned short *src = (void *)g_menubg_src_ptr;
|
||||||
int w = g_screen_width, h = g_screen_height;
|
int w = g_screen_width, h = g_screen_height;
|
||||||
|
int pp = g_screen_ppitch;
|
||||||
short *dst;
|
short *dst;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
|
@ -87,7 +88,7 @@ static void make_bg(int no_scale)
|
||||||
d += (g_menuscreen_h / 2 - h * 2 / 2)
|
d += (g_menuscreen_h / 2 - h * 2 / 2)
|
||||||
* g_menuscreen_w / 2;
|
* g_menuscreen_w / 2;
|
||||||
d += (g_menuscreen_w / 2 - w * 2 / 2) / 2;
|
d += (g_menuscreen_w / 2 - w * 2 / 2) / 2;
|
||||||
for (y = 0; y < h; y++, src += w, d += g_menuscreen_w*2/2) {
|
for (y = 0; y < h; y++, src += pp, d += g_menuscreen_w*2/2) {
|
||||||
for (x = 0; x < w; x++) {
|
for (x = 0; x < w; x++) {
|
||||||
t = src[x];
|
t = src[x];
|
||||||
t = ((t & 0xf79e)>>1) - ((t & 0xc618)>>3);
|
t = ((t & 0xf79e)>>1) - ((t & 0xc618)>>3);
|
||||||
|
@ -107,7 +108,7 @@ static void make_bg(int no_scale)
|
||||||
(g_menuscreen_w / 2 - w / 2);
|
(g_menuscreen_w / 2 - w / 2);
|
||||||
|
|
||||||
// darken the active framebuffer
|
// darken the active framebuffer
|
||||||
for (; h > 0; dst += g_menuscreen_w, src += g_screen_ppitch, h--)
|
for (; h > 0; dst += g_menuscreen_w, src += pp, h--)
|
||||||
menu_darken_bg(dst, src, w, 1);
|
menu_darken_bg(dst, src, w, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -273,7 +273,7 @@ void plat_init(void)
|
||||||
shadow_size = 320 * 480 * 2;
|
shadow_size = 320 * 480 * 2;
|
||||||
|
|
||||||
shadow_fb = malloc(shadow_size);
|
shadow_fb = malloc(shadow_size);
|
||||||
g_menubg_ptr = malloc(shadow_size);
|
g_menubg_ptr = calloc(1, shadow_size);
|
||||||
if (shadow_fb == NULL || g_menubg_ptr == NULL) {
|
if (shadow_fb == NULL || g_menubg_ptr == NULL) {
|
||||||
fprintf(stderr, "OOM\n");
|
fprintf(stderr, "OOM\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2b27288eb44ef9247d2a948a207d3ac9b835421a
|
Subproject commit f8cd6a082bb9c228397a0436f28818b74d8e9636
|
Loading…
Add table
Add a link
Reference in a new issue