summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-09-01 22:45:08 +0200
committerkdx <kikoodx@paranoici.org>2023-09-01 22:45:08 +0200
commit4ea628b8c6d500a803ed0c2c7d12718f57b41fa1 (patch)
treecae0b6b31514204e6a3bee169e47833e682f5432
parent0e80ee2d2cb6d4d70d9dd765fdf2fdae13ec30d8 (diff)
downloadpx-4ea628b8c6d500a803ed0c2c7d12718f57b41fa1.tar.gz
Revert "autodetermine buffer size"
This reverts commit 0e80ee2d2cb6d4d70d9dd765fdf2fdae13ec30d8.
-rw-r--r--src/px.c12
1 files 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;
}
}