From 6e750c31686ba90e602b2914a6b5b5730d52441f Mon Sep 17 00:00:00 2001 From: Stefan Arentz Date: Sat, 7 Jan 2017 20:54:40 -0500 Subject: [PATCH] Fixes #120 Implement a software renderer --- src/chr.c | 2 -- src/scr.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chr.c b/src/chr.c index bfca483..f81381c 100644 --- a/src/chr.c +++ b/src/chr.c @@ -76,8 +76,6 @@ static void _set_pixel(SDL_Surface * surface, int x, int y, Uint32 color) { } static SDL_Surface *_generate_surface(SDL_Renderer *renderer, uint8_t rom_data[2048], int c, bool inverse) { - //SDL_Surface *surface = SDL_CreateRGBSurface(0, 7*3, 8*3, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000); - SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, 7*3, 8*3, 32, SDL_PIXELFORMAT_ARGB8888); if (surface == NULL) { fprintf(stderr, "[CHR] Cannot create RGBSurface: %s\n", SDL_GetError()); diff --git a/src/scr.c b/src/scr.c index 3d0da12..c7cc5c9 100644 --- a/src/scr.c +++ b/src/scr.c @@ -72,6 +72,8 @@ static inline void scr_render_character(struct scr_t *scr, int row, int column, SDL_SetSurfaceColorMod(scr->chr->surfaces[c], 255, 255, 255); } + SDL_SetSurfaceBlendMode(scr->chr->surfaces[c], SDL_BLENDMODE_NONE); + SDL_BlitSurface(scr->chr->surfaces[c], &src, SDL_GetWindowSurface(scr->window), &dst); } }