- [FIX] Includes cleanup
- [FIX] fullscreen scanlines fixed - [FIX] zoom cannot be modified while in fullscreen
This commit is contained in:
+8
-3
@@ -422,11 +422,12 @@ namespace gbscreen
|
||||
SDL_RenderCopy(ren, tex, NULL, &dest_rect);
|
||||
|
||||
// Pintem les ralles dels pixels
|
||||
if (zoom>2) {
|
||||
if (zoom>2 || fullscreen) {
|
||||
SDL_SetRenderDrawBlendMode(ren, SDL_BLENDMODE_BLEND);
|
||||
SDL_SetRenderDrawColor(ren, 160, 170, 5, 96);
|
||||
for (int i=0;i<144;++i) SDL_RenderDrawLine(ren, 0, i*zoom, 159*zoom, i*zoom);
|
||||
for (int i=0;i<160;++i) SDL_RenderDrawLine(ren, i*zoom, 0, i*zoom, 143*zoom);
|
||||
const float scale = fullscreen ? fullscreen_scale : zoom;
|
||||
for (int i=0;i<144;++i) SDL_RenderDrawLine(ren, dest_rect.x, dest_rect.y+i*scale, dest_rect.x+159*scale, dest_rect.y+i*scale);
|
||||
for (int i=0;i<160;++i) SDL_RenderDrawLine(ren, dest_rect.x+i*scale, dest_rect.y, dest_rect.x+i*scale, dest_rect.y+143*scale);
|
||||
}
|
||||
|
||||
if (present)
|
||||
@@ -457,6 +458,8 @@ namespace gbscreen
|
||||
|
||||
void setZoom(const int value)
|
||||
{
|
||||
if (fullscreen) return;
|
||||
|
||||
if (value < 1) return;
|
||||
SDL_DisplayMode dm;
|
||||
SDL_GetCurrentDisplayMode(0, &dm);
|
||||
@@ -470,11 +473,13 @@ namespace gbscreen
|
||||
|
||||
void incZoom()
|
||||
{
|
||||
if (fullscreen) return;
|
||||
setZoom(zoom+1);
|
||||
}
|
||||
|
||||
void decZoom()
|
||||
{
|
||||
if (fullscreen) return;
|
||||
setZoom(zoom-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,14 +5,11 @@
|
||||
#include "mem.h"
|
||||
#include "sm83dis.h"
|
||||
#include "debug.h"
|
||||
//#include "zx_ula.h"
|
||||
#include "gbscreen.h"
|
||||
//#include "zx_tape.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include <string.h>
|
||||
#include "ui.h"
|
||||
#include "ui_menu.h"
|
||||
//#include "z80analyze.h"
|
||||
#include "ui_window.h"
|
||||
|
||||
uint32_t time = 0;
|
||||
|
||||
Reference in New Issue
Block a user