diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-11-18 22:29:01 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-11-18 22:29:01 +0000 |
| commit | 72a39a96ac6c46053ed215b02e60c2391bca675d (patch) | |
| tree | c3bbbb74a770317c6b83b7021fb27411d1741489 | |
| parent | d66a2a46efd9369d918a60d5483c23ed39e8dd58 (diff) | |
| download | zcatch-72a39a96ac6c46053ed215b02e60c2391bca675d.tar.gz zcatch-72a39a96ac6c46053ed215b02e60c2391bca675d.zip | |
removed ui scale buttons
| -rw-r--r-- | src/game/client/menu2.cpp | 22 | ||||
| -rw-r--r-- | src/game/game_variables.h | 2 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/game/client/menu2.cpp b/src/game/client/menu2.cpp index f5556bd7..ce81cf5f 100644 --- a/src/game/client/menu2.cpp +++ b/src/game/client/menu2.cpp @@ -78,7 +78,7 @@ typedef struct float x, y, w, h; } RECT; -static float scale = 1.0f; +//static float scale = 1.0f; static RECT screen = { 0.0f, 0.0f, 800.0f, 600.0f }; extern void select_sprite(int id, int flags=0, int sx=0, int sy=0); @@ -90,18 +90,18 @@ RECT *ui2_screen() void ui2_set_scale(float s) { - scale = s; + config.ui_scale = (int)(s*100.0f); } float ui2_scale() { - return scale; + return config.ui_scale/100.0f; } void ui2_hsplit_t(const RECT *original, float cut, RECT *top, RECT *bottom) { RECT r = *original; - cut *= scale; + cut *= ui2_scale(); if (top) { @@ -123,7 +123,7 @@ void ui2_hsplit_t(const RECT *original, float cut, RECT *top, RECT *bottom) void ui2_hsplit_b(const RECT *original, float cut, RECT *top, RECT *bottom) { RECT r = *original; - cut *= scale; + cut *= ui2_scale(); if (top) { @@ -145,7 +145,7 @@ void ui2_hsplit_b(const RECT *original, float cut, RECT *top, RECT *bottom) void ui2_vsplit_l(const RECT *original, float cut, RECT *left, RECT *right) { RECT r = *original; - cut *= scale; + cut *= ui2_scale(); if (left) { @@ -167,7 +167,7 @@ void ui2_vsplit_l(const RECT *original, float cut, RECT *left, RECT *right) void ui2_vsplit_r(const RECT *original, float cut, RECT *left, RECT *right) { RECT r = *original; - cut *= scale; + cut *= ui2_scale(); if (left) { @@ -189,7 +189,7 @@ void ui2_vsplit_r(const RECT *original, float cut, RECT *left, RECT *right) void ui2_margin(const RECT *original, float cut, RECT *other_rect) { RECT r = *original; - cut *= scale; + cut *= ui2_scale(); other_rect->x = r.x + cut; other_rect->y = r.y + cut; @@ -200,7 +200,7 @@ void ui2_margin(const RECT *original, float cut, RECT *other_rect) void ui2_vmargin(const RECT *original, float cut, RECT *other_rect) { RECT r = *original; - cut *= scale; + cut *= ui2_scale(); other_rect->x = r.x + cut; other_rect->y = r.y; @@ -211,7 +211,7 @@ void ui2_vmargin(const RECT *original, float cut, RECT *other_rect) void ui2_hmargin(const RECT *original, float cut, RECT *other_rect) { RECT r = *original; - cut *= scale; + cut *= ui2_scale(); other_rect->x = r.x; other_rect->y = r.y + cut; @@ -1462,10 +1462,12 @@ int menu2_render() first = false; } + /* if (inp_key_down('I') && ui2_scale() > 0.2f) ui2_set_scale(ui2_scale()-0.1f); if (inp_key_down('O')) ui2_set_scale(ui2_scale()+0.1f); + */ if(client_state() == CLIENTSTATE_ONLINE) { diff --git a/src/game/game_variables.h b/src/game/game_variables.h index fb617214..421f376e 100644 --- a/src/game/game_variables.h +++ b/src/game/game_variables.h @@ -31,7 +31,6 @@ MACRO_CONFIG_INT(cl_predict, 1, 0, 1) MACRO_CONFIG_INT(cl_nameplates, 0, 0, 2) - MACRO_CONFIG_STR(sv_maprotation, 512, "") MACRO_CONFIG_INT(dynamic_camera, 1, 0, 1) @@ -48,6 +47,7 @@ MACRO_CONFIG_INT(dbg_new_gui, 0, 0, 1) MACRO_CONFIG_INT(ui_page, 1, 0, 5) MACRO_CONFIG_STR(ui_server_address, 128, "localhost:8303") +MACRO_CONFIG_INT(ui_scale, 100, 1, 100000) MACRO_CONFIG_STR(sv_msg, 512, "") |