mirror of
https://github.com/dingusdev/dingusppc.git
synced 2026-01-22 15:16:01 +00:00
display_sdl: Add scale_step.
This commit is contained in:
@@ -74,6 +74,8 @@ Display::~Display() {
|
||||
SDL_DestroyWindow(impl->display_wnd);
|
||||
}
|
||||
|
||||
const double scale_step = std::pow(2.0, 1.0/8.0);
|
||||
|
||||
bool Display::configure(int width, int height) {
|
||||
bool is_initialization = false;
|
||||
|
||||
@@ -304,16 +306,16 @@ void Display::handle_events(const WindowEvent& wnd_event) {
|
||||
if (wnd_event.window_id == impl->disp_wnd_id) {
|
||||
if (this->full_screen_mode == not_full_screen) {
|
||||
if (wnd_event.sub_type == DPPC_WINDOWEVENT_WINDOW_BIGGER)
|
||||
this->scale_window = this->scale_window * std::pow(2.0, 1.0/8.0);
|
||||
this->scale_window *= scale_step;
|
||||
else
|
||||
this->scale_window = this->scale_window / std::pow(2.0, 1.0/8.0);
|
||||
this->scale_window /= scale_step;
|
||||
this->update_window_size();
|
||||
} else {
|
||||
this->use_scale_full_screen = true;
|
||||
if (wnd_event.sub_type == DPPC_WINDOWEVENT_WINDOW_BIGGER)
|
||||
this->scale_full_screen = this->scale_full_screen * std::pow(2.0, 1.0/8.0);
|
||||
this->scale_full_screen *= scale_step;
|
||||
else
|
||||
this->scale_full_screen = this->scale_full_screen / std::pow(2.0, 1.0/8.0);
|
||||
this->scale_full_screen /= scale_step;
|
||||
}
|
||||
|
||||
this->configure_dest();
|
||||
|
||||
Reference in New Issue
Block a user