Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/data/bg/defaultkeys.txt b/data/bg/defaultkeys.txt
- index 6a6d7ed..c79f4b2 100644
- --- a/data/bg/defaultkeys.txt
- +++ b/data/bg/defaultkeys.txt
- @@ -1,5 +1,7 @@
- # default key bindings
- +Alt-KP+ scaleval_increase
- +Alt-KP- scaleval_decrease
- KP+ brighter
- KP- darker
- Esc close_or_menu
- diff --git a/data/si/defaultkeys.txt b/data/si/defaultkeys.txt
- index 7551be8..faf8fe6 100644
- --- a/data/si/defaultkeys.txt
- +++ b/data/si/defaultkeys.txt
- @@ -1,5 +1,7 @@
- # default key bindings
- +Alt-KP+ scaleval_increase
- +Alt-KP- scaleval_decrease
- KP+ brighter
- KP- darker
- Esc close_or_menu
- diff --git a/exult.cc b/exult.cc
- index 2519247..f7bd05e 100644
- --- a/exult.cc
- +++ b/exult.cc
- @@ -209,6 +209,9 @@ struct resolution {
- };
- int num_res = sizeof(res_list) / sizeof(struct resolution);
- int current_res = 0;
- +#ifdef USE_EXULTSTUDIO
- +int current_scaleval = 1;
- +#endif
- #ifdef XWIN
- # ifdef __GNUC__
- @@ -243,6 +246,7 @@ static int Play();
- static int Get_click(int &x, int &y, char *chr, bool drag_ok, Paintable *p, bool rotate_colors = false);
- static int find_resolution(int w, int h, int s);
- #ifdef USE_EXULTSTUDIO
- +static void set_scaleval(int new_scaleval);
- static void Move_dragged_shape(int shape, int frame, int x, int y,
- int prevx, int prevy, bool show);
- static void Move_dragged_combo(int xtiles, int ytiles, int tiles_right,
- @@ -2229,6 +2233,52 @@ int find_resolution(int w, int h, int s) {
- return res;
- }
- +#ifdef USE_EXULTSTUDIO
- +void increase_scaleval() {
- + if (!cheat()) return;
- +
- + current_scaleval++;
- + if (current_scaleval >= 9)
- + current_scaleval = 1;
- + set_scaleval(current_scaleval);
- +}
- +
- +void decrease_scaleval() {
- + if (!cheat()) return;
- +
- + current_scaleval--;
- + if (current_scaleval < 1)
- + current_scaleval = 8;
- + set_scaleval(current_scaleval);
- +}
- +
- +void set_scaleval(int new_scaleval) {
- + int scaler = gwin->get_win()->get_scaler();
- +
- + if (new_scaleval >= 1 && scaler == Image_window::point && cheat.in_map_editor()) {
- + current_scaleval = new_scaleval;
- + bool fullscreen = gwin->get_win()->is_fullscreen();
- + bool share_settings;
- + config->value("config/video/share_video_settings", share_settings, true);
- + const string &vidStr = (fullscreen || share_settings) ?
- + "config/video" : "config/video/window";
- + int resx, resy;
- + config->value(vidStr + "/display/width", resx);
- + config->value(vidStr + "/display/height", resy);
- +
- + // for Studio zooming we set game area to auto, fill quality to point,
- + // fill mode to fill and increase/decrease the scale value
- + gwin->resized(resx,
- + resy,
- + fullscreen,
- + 0, 0,
- + current_scaleval, scaler,
- + Image_window::Fill,
- + Image_window::point);
- + }
- +}
- +#endif
- +
- void make_screenshot(bool silent) {
- // TODO: Maybe use <SAVEGAME>/exult%03i.pcx instead.
- // Or maybe some form or "My Pictures" on Windows.
- diff --git a/exult.h b/exult.h
- index f3c879d..111f916 100644
- --- a/exult.h
- +++ b/exult.h
- @@ -66,6 +66,10 @@ extern void Wait_for_arrival(
- );
- extern void change_gamma(bool down);
- +#ifdef USE_EXULTSTUDIO
- +extern void increase_scaleval();
- +extern void decrease_scaleval();
- +#endif
- extern void setup_video(bool fullscreen, int setup_video_type,
- int resx = 0, int resy = 0, int gw = 0,
- int gh = 0, int scaleval = 0, int scaler = 0,
- diff --git a/keyactions.cc b/keyactions.cc
- index 9b4b4ec..ddb820f 100644
- --- a/keyactions.cc
- +++ b/keyactions.cc
- @@ -247,6 +247,20 @@ void ActionRepaint(int const *params) {
- Game_window::get_instance()->paint();
- }
- +#ifdef USE_EXULTSTUDIO
- +// { ActionScalevalIncrease, 0, "Increase scaleval", cheat_keys, NONE },
- +void ActionScalevalIncrease(int const *params) {
- + ignore_unused_variable_warning(params);
- + increase_scaleval();
- +}
- +
- +// { ActionScalevalDecrease, 0, "Decrease scaleval", cheat_keys, NONE },
- +void ActionScalevalDecrease(int const *params) {
- + ignore_unused_variable_warning(params);
- + decrease_scaleval();
- +}
- +#endif
- +
- // { ActionBrighter, 0, "Increase brightness", normal_keys, NONE },
- void ActionBrighter(int const *params) {
- ignore_unused_variable_warning(params);
- diff --git a/keyactions.h b/keyactions.h
- index d275c24..ce16757 100644
- --- a/keyactions.h
- +++ b/keyactions.h
- @@ -38,6 +38,10 @@ void ActionKeyboardMode(int const *params);
- void ActionScreenshot(int const *params);
- void ActionRepaint(int const *params);
- +#ifdef USE_EXULTSTUDIO
- +void ActionScalevalIncrease(int const *params);
- +void ActionScalevalDecrease(int const *params);
- +#endif
- void ActionBrighter(int const *params);
- void ActionDarker(int const *params);
- void ActionFullscreen(int const *params);
- diff --git a/keys.cc b/keys.cc
- index df4799c..b33b090 100644
- --- a/keys.cc
- +++ b/keys.cc
- @@ -108,6 +108,16 @@ const struct Action {
- #endif
- {
- +#ifdef USE_EXULTSTUDIO
- + "SCALEVAL_INCREASE",
- + ActionScalevalIncrease, 0, "Increase scaleval", Action::cheat_keys, NONE, true, true, true, false //mapedit_keys
- + },
- + {
- + "SCALEVAL_DECREASE",
- + ActionScalevalDecrease, 0, "Decrease scaleval", Action::cheat_keys, NONE, true, true, true, false
- + },
- + {
- +#endif
- "BRIGHTER",
- ActionBrighter, 0, "Increase brightness", Action::normal_keys, NONE, true, true, true, false
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement