diff options
Diffstat (limited to 'src/px.c')
-rw-r--r-- | src/px.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -39,7 +39,7 @@ pxInit(void) pxtexture = SDL_CreateTexture(___tzr_renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, - PX_WIDTH, PX_HEIGHT); + ___tzr_config.width, ___tzr_config.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 < PX_HEIGHT; y++) { - for (int x = 0; x < PX_WIDTH; x++) { + for (int y = 0; y < ___tzr_config.height; y++) { + for (int x = 0; x < ___tzr_config.width; x++) { const int ix = x << 2; - PxCol col = pxbuf[x + y * PX_WIDTH]; + PxCol col = pxbuf[x + y * ___tzr_config.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 * PX_WIDTH] = c; - pxzbuf[x + y * PX_WIDTH] = 0; + pxbuf[x + y * ___tzr_config.width] = c; + pxzbuf[x + y * ___tzr_config.width] = 0; } } |