Use non-square pixels for Gakuen Senki

Stretch 512 horizontal pixels to 582 pixels. This is the same pixel
aspect ratio used by WebMSX.

Also set SDL_HINT_RENDER_SCALE_QUALITY to "linear", to improve the
scaling quality.
This commit is contained in:
kichikuou
2023-04-09 18:23:39 +09:00
parent 24224e0d2b
commit ec1dfbffcf
4 changed files with 10 additions and 7 deletions
+1
View File
@@ -34,6 +34,7 @@ int main(int argc, char *argv[])
SDL_Init(SDL_INIT_VIDEO);
SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
#ifdef __EMSCRIPTEN__
// Stop SDL from calling emscripten_sleep() in functions that are called
// indirectly, which does not work with ASYNCIFY_IGNORE_INDIRECT=1. For
+6 -5
View File
@@ -40,16 +40,17 @@ AGS::AGS(NACT* parent, const Config& config) : nact(parent), dirty(false)
{
// 画面サイズ
if (nact->crc32_a == CRC32_GAKUEN || nact->crc32_a == CRC32_GAKUEN_ENG) {
window_width = 582;
screen_width = 512;
screen_height = 424;
window_height = screen_height = 424;
} else {
screen_width = 640;
screen_height = 400;
window_width = screen_width = 640;
window_height = screen_height = 400;
}
scroll = screen_height;
SDL_SetWindowSize(g_window, screen_width, screen_height);
SDL_RenderSetLogicalSize(g_renderer, screen_width, screen_height);
SDL_SetWindowSize(g_window, window_width, window_height);
SDL_RenderSetLogicalSize(g_renderer, window_width, window_height);
sdlTexture = SDL_CreateTexture(g_renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, screen_width, screen_height); // TOOD: pixelformat?
// DIBSection 8bpp * 3 (表, 裏, メニュー)
+1
View File
@@ -141,6 +141,7 @@ public:
int dest_screen;
int scroll;
int window_width, window_height;
int screen_width, screen_height;
// メッセージ表示
+2 -2
View File
@@ -45,8 +45,8 @@ void NACT::pump_events()
break;
case SDL_MOUSEMOTION:
mousex = e.motion.x;
mousey = e.motion.y;
mousex = e.motion.x * ags->screen_width / ags->window_width;
mousey = e.motion.y * ags->screen_height / ags->window_height;
break;
case SDL_FINGERDOWN: