From eeb42f20bfec34736e2a8081965a4f7ca8f1bf61 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 26 May 2012 21:58:24 +0000 Subject: [PATCH] Disallow high-quality (640x480) tilted screen if MAXYDIM is less than 640. This fixes the crash on Wii when looking sidewards (e.g. when dying), but makes the tilted view look more pixelated. The problem was that an attempt was made to render onto a 640x640 tile for the rotated view, but the base engine arrays were too small for that. git-svn-id: https://svn.eduke32.com/eduke32@2698 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 4b11c880e..fc0656a37 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -3585,19 +3585,23 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio) int32_t oviewingrange = viewingrange; // save it from setviewtotile() const int16_t tang = (ud.screen_tilting) ? p->rotscrnang : 0; - if (xres <= 320 && yres <= 240) + // To render a tilted screen in high quality, we need at least + // 640 pixels of *Y* dimension. +#if MAXYDIM >= 640 + if (xres > 320 || yres > 240) + { + tiltcs = 2; + tiltcx = 640; + tiltcy = 400; + } + else +#endif { // JBF 20030807: Increased tilted-screen quality tiltcs = 1; tiltcx = 320; tiltcy = 200; } - else - { - tiltcs = 2; - tiltcx = 640; - tiltcy = 400; - } walock[TILE_TILT] = 255; if (waloff[TILE_TILT] == 0)