uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 8b43d0d7ae54169d9ac38d4e76043f7852c63e7d
parent 8a3c86a8793dbd2c683acea0f442645e21016ed7
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date:   Mon, 27 Mar 2023 08:38:54 -0700

Removed redundant pixel param from screen routines

Diffstat:
Msrc/devices/screen.c | 10+++++-----
Msrc/devices/screen.h | 4++--
Msrc/uxnemu.c | 4++--
3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/devices/screen.c b/src/devices/screen.c @@ -108,17 +108,17 @@ screen_clear(UxnScreen *p, Layer *layer) } void -screen_redraw(UxnScreen *p, Uint32 *pixels) +screen_redraw(UxnScreen *p) { Uint32 i, size = p->width * p->height, palette[16]; for(i = 0; i < 16; i++) palette[i] = p->palette[(i >> 2) ? (i >> 2) : (i & 3)]; if(p->mono) { for(i = 0; i < size; i++) - pixels[i] = palette_mono[(p->fg.pixels[i] ? p->fg.pixels[i] : p->bg.pixels[i]) & 0x1]; + p->pixels[i] = palette_mono[(p->fg.pixels[i] ? p->fg.pixels[i] : p->bg.pixels[i]) & 0x1]; } else { for(i = 0; i < size; i++) - pixels[i] = palette[p->fg.pixels[i] << 2 | p->bg.pixels[i]]; + p->pixels[i] = palette[p->fg.pixels[i] << 2 | p->bg.pixels[i]]; } p->fg.changed = p->bg.changed = 0; } @@ -130,10 +130,10 @@ clamp(int val, int min, int max) } void -screen_mono(UxnScreen *p, Uint32 *pixels) +screen_mono(UxnScreen *p) { p->mono = !p->mono; - screen_redraw(p, pixels); + screen_redraw(p); } /* IO */ diff --git a/src/devices/screen.h b/src/devices/screen.h @@ -28,8 +28,8 @@ extern UxnScreen uxn_screen; void screen_palette(UxnScreen *p, Uint8 *addr); void screen_resize(UxnScreen *p, Uint16 width, Uint16 height); void screen_clear(UxnScreen *p, Layer *layer); -void screen_redraw(UxnScreen *p, Uint32 *pixels); -void screen_mono(UxnScreen *p, Uint32 *pixels); +void screen_redraw(UxnScreen *p); +void screen_mono(UxnScreen *p); Uint8 screen_dei(Uxn *u, Uint8 addr); void screen_deo(Uint8 *ram, Uint8 *d, Uint8 port); diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -220,7 +220,7 @@ static void redraw(void) { if(gRect.w != uxn_screen.width || gRect.h != uxn_screen.height) set_size(); - screen_redraw(&uxn_screen, uxn_screen.pixels); + screen_redraw(&uxn_screen); if(SDL_UpdateTexture(gTexture, NULL, uxn_screen.pixels, uxn_screen.width * sizeof(Uint32)) != 0) error("SDL_UpdateTexture", SDL_GetError()); SDL_RenderClear(gRenderer); @@ -376,7 +376,7 @@ do_shortcut(Uxn *u, SDL_Event *event) else if(event->key.keysym.sym == SDLK_F4) restart(u); else if(event->key.keysym.sym == SDLK_F5) { - screen_mono(&uxn_screen, uxn_screen.pixels); + screen_mono(&uxn_screen); redraw(); } }