From 39643cd94e5fff3e1da4c30b0a6d157aa92d9f6d Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Fri, 14 May 2004 14:04:48 +0000 Subject: [PATCH] Just changed hard coded values by definitions. Please do this, or else the code turns ugly and gets hard to change that value everywhere. Also tuned the values. SVN-Revision: 1177 --- src/leveleditor.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/leveleditor.cpp b/src/leveleditor.cpp index 93160de35..80949a97a 100644 --- a/src/leveleditor.cpp +++ b/src/leveleditor.cpp @@ -54,9 +54,10 @@ #define MOUSE_LEFT_MARGIN 80 #define MOUSE_RIGHT_MARGIN (560-32) -/* right_margin should noticed that the cursor is 32 pixels, - so it should subtract that value */ -#define MOUSE_POS_SPEED 20 + +/* scolling speed */ +#define KEYBOARD_SPEED 140 +#define MOUSE_SPEED 40 /* look */ #define SELECT_W 2 // size of the selections lines @@ -1512,11 +1513,11 @@ void le_checkevents() switch(le_move_left_bt->get_state()) { case BUTTON_PRESSED: - pos_x -= 192; + pos_x -= KEYBOARD_SPEED; show_minimap = true; break; case BUTTON_HOVER: - pos_x -= 32; + pos_x -= MOUSE_SPEED; show_minimap = true; break; case BUTTON_CLICKED: @@ -1529,11 +1530,11 @@ void le_checkevents() switch(le_move_right_bt->get_state()) { case BUTTON_PRESSED: - pos_x += 192; + pos_x += KEYBOARD_SPEED; show_minimap = true; break; case BUTTON_HOVER: - pos_x += 32; + pos_x += MOUSE_SPEED; show_minimap = true; break; case BUTTON_CLICKED: @@ -1546,11 +1547,11 @@ void le_checkevents() switch(le_move_up_bt->get_state()) { case BUTTON_PRESSED: - pos_y -= 192; + pos_y -= KEYBOARD_SPEED; show_minimap = true; break; case BUTTON_HOVER: - pos_y -= 32; + pos_y -= MOUSE_SPEED; show_minimap = true; break; case BUTTON_CLICKED: @@ -1563,11 +1564,11 @@ void le_checkevents() switch(le_move_down_bt->get_state()) { case BUTTON_PRESSED: - pos_y += 192; + pos_y += KEYBOARD_SPEED; show_minimap = true; break; case BUTTON_HOVER: - pos_y += 32; + pos_y += MOUSE_SPEED; show_minimap = true; break; case BUTTON_CLICKED: -- 2.11.0