-
Notifications
You must be signed in to change notification settings - Fork 162
Add basic OSD support #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Can you add back Inside rg_display.c you can access display.screen.width directly, that's no problem and you can leave those changes if you want. Edit: I've also fixed the printf in snes on the dev branch, you can remove this unrelated change. |
Okay, On the other hand I'm wondering if it still a good Idea to add transparency? But I can't think of an other way to have my battery icon without a rectangle "behind" it. |
.width = rg_display_get_width(), | ||
.height = rg_display_get_height(), | ||
.width = rg_display_get_info()->screen.width, | ||
.height = rg_display_get_info()->screen.height, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be undone
printf("Rom loaded: name: %s, id: %s, company: %s, size: %dKB\n", Memory.ROMName, Memory.ROMId, Memory.CompanyId, Memory.CalculatedSize / 1024); | ||
Settings.ForceHeader = Settings.ForceHiROM = Settings.ForceLoROM = Settings.ForceInterleaved = Settings.ForceNoHeader = Settings.ForceNotInterleaved = Settings.ForceInterleaved2 = false; | ||
Settings.ForceHeader = false; | ||
Settings.ForceHiROM = false; | ||
Settings.ForceLoROM = false; | ||
Settings.ForceInterleaved = false; | ||
Settings.ForceNoHeader = false; | ||
Settings.ForceNotInterleaved = false; | ||
Settings.ForceInterleaved2 = false; | ||
|
||
printf("Rom loaded: name: %s, id: %s, company: %s, size: %dKB\n", | ||
Memory.ROMName, Memory.ROMId, Memory.CompanyId, (int)(Memory.CalculatedSize / 1024)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be undone.
uint16_t *buffer = osd.surface->data; // Treat the buffer as 16-bit values | ||
for (int i = 0; i < osd.surface->width * osd.surface->height; i++) | ||
buffer[i] = C_TRANSPARENT; // Assign the C_TRANSPARENT color directly to the background |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have finally implemented rg_surface_fill, you should now be able to do rg_surface_fill(osd.surface, NULL, C_TRANSPARENT);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I'm not able to test my own code right now so maybe best don't waste your time...
If we go ahead with transparency then I think we should reconsider how we handle things. Currently you rerender the background pixels which works fine but it bypasses the filtering system and it also makes the code more repetitive. Bypassing the filtering for a few pixels in the case of a battery icon doesn't really matter, the pixels will be close enough. But it might cause visible weirdness if the OSD is bigger with more transparent zones. One possibility I can think of is that in the The other option I can think of is to just ignore the filter problem. We keep your current code but I clean it up a bit to reuse more code and improve correctness.
If the goal is limited to drawing a battery icon then drawing the few rectangles of the icon directly to the screen with But if so, I suggest that we keep this current PR open for when one of us, or someone else, wants to finish the full-fledged OSD :) (or at least transfer your changes to a branch in my repo before you delete them on your side). |
The PR aims to add support for simple OSDs on retro-go during game emulation