From 90cc9e1b49b78f8385cc45c65cf2533f23cbb222 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 21 Apr 2018 12:14:25 +0200 Subject: [PATCH] conformal:: resizing the window works now --- conformal.cpp | 6 ++++++ control.cpp | 19 +++++++++++-------- hyper.h | 1 + 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/conformal.cpp b/conformal.cpp index 0680da90..6020abd4 100644 --- a/conformal.cpp +++ b/conformal.cpp @@ -210,6 +210,12 @@ namespace spiral { SDL_Event event; while(SDL_PollEvent(&event)) switch (event.type) { + + case SDL_VIDEORESIZE: { + resize_screen_to(event.resize.w, event.resize.h); + precompute(); + break; + } case SDL_QUIT: case SDL_MOUSEBUTTONDOWN: goto breakloop; diff --git a/control.cpp b/control.cpp index 85997519..8e91d82c 100644 --- a/control.cpp +++ b/control.cpp @@ -448,6 +448,15 @@ void mainloopiter() { printf("(compiled without SDL -- no action)\n"); quitmainl int cframelimit = 1000; +void resize_screen_to(int x, int y) { + vid.xres = x; + vid.yres = y; + vid.killreduction = 0; + extern bool setfsize; + setfsize = true; + setvideomode(); + } + void mainloopiter() { DEBB(DF_GRAPH, (debugfile,"main loop\n")); @@ -564,14 +573,8 @@ void mainloopiter() { } } - if(ev.type == SDL_VIDEORESIZE) { - vid.xres = ev.resize.w; - vid.yres = ev.resize.h; - vid.killreduction = 0; - extern bool setfsize; - setfsize = true; - setvideomode(); - } + if(ev.type == SDL_VIDEORESIZE) + resize_screen_to(ev.resize.w, ev.resize.h); if(ev.type == SDL_VIDEOEXPOSE) { drawscreen(); diff --git a/hyper.h b/hyper.h index e8448731..3af524be 100644 --- a/hyper.h +++ b/hyper.h @@ -3260,3 +3260,4 @@ bool horo_ok(); ld master_to_c7_angle(); extern int mutantphase; +void resize_screen_to(int x, int y);