diff --git a/src/sdlmain.cpp b/src/sdlmain.cpp index 052ba15..a28ff46 100644 --- a/src/sdlmain.cpp +++ b/src/sdlmain.cpp @@ -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 diff --git a/src/sys/ags.cpp b/src/sys/ags.cpp index 53a9adb..cd0d1c7 100644 --- a/src/sys/ags.cpp +++ b/src/sys/ags.cpp @@ -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 (表, 裏, メニュー) diff --git a/src/sys/ags.h b/src/sys/ags.h index 2887c8b..e5c4102 100644 --- a/src/sys/ags.h +++ b/src/sys/ags.h @@ -141,6 +141,7 @@ public: int dest_screen; int scroll; + int window_width, window_height; int screen_width, screen_height; // メッセージ表示 diff --git a/src/sys/nact_input.cpp b/src/sys/nact_input.cpp index 1536255..db1b41b 100644 --- a/src/sys/nact_input.cpp +++ b/src/sys/nact_input.cpp @@ -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: