From 4ea628b8c6d500a803ed0c2c7d12718f57b41fa1 Mon Sep 17 00:00:00 2001 From: kdx Date: Fri, 1 Sep 2023 22:45:08 +0200 Subject: Revert "autodetermine buffer size" This reverts commit 0e80ee2d2cb6d4d70d9dd765fdf2fdae13ec30d8. --- src/px.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/px.c b/src/px.c index fa61e97..5281432 100644 --- a/src/px.c +++ b/src/px.c @@ -39,7 +39,7 @@ pxInit(void) pxtexture = SDL_CreateTexture(___tzr_renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, - ___tzr_config.width, ___tzr_config.height); + PX_WIDTH, PX_HEIGHT); if (pxtexture == NULL) { fprintf(stderr, "%s\n", SDL_GetError()); return -1; @@ -66,10 +66,10 @@ pxFlip(void) return -1; } - for (int y = 0; y < ___tzr_config.height; y++) { - for (int x = 0; x < ___tzr_config.width; x++) { + for (int y = 0; y < PX_HEIGHT; y++) { + for (int x = 0; x < PX_WIDTH; x++) { const int ix = x << 2; - PxCol col = pxbuf[x + y * ___tzr_config.width]; + PxCol col = pxbuf[x + y * PX_WIDTH]; if (pxpal[col].spal) col = pxpal[col].spal - 1; pixels[ix + y * pitch + 0] = pxpal[col].b; @@ -90,8 +90,8 @@ pxCls(PxCol c) { for (int y = pxclip.y; y < pxclip.y + pxclip.h; y++) for (int x = pxclip.x; x < pxclip.x + pxclip.w; x++) { - pxbuf[x + y * ___tzr_config.width] = c; - pxzbuf[x + y * ___tzr_config.width] = 0; + pxbuf[x + y * PX_WIDTH] = c; + pxzbuf[x + y * PX_WIDTH] = 0; } } -- cgit v1.2.3