summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-07-23 16:48:19 +0000
committertruelight <truelight@openttd.org>2007-07-23 16:48:19 +0000
commit155b912ebb2fd9e999fcd322415d5052f2ec1b08 (patch)
tree619d80c02149927fa4b293d8720d64b59d93b1ac /src
parentef0be0e1dc205b5991f6896c86d921bc1934aecb (diff)
downloadopenttd-155b912ebb2fd9e999fcd322415d5052f2ec1b08.tar.xz
(svn r10663) -Fix r10662: bad me, didn't comply with coding style, as penalty I updated the surrounding code to comply with coding style too; I will never do it again (I hope :p)
Diffstat (limited to 'src')
-rw-r--r--src/gfx.h22
-rw-r--r--src/main_gui.cpp14
-rw-r--r--src/video/cocoa_v.mm14
-rw-r--r--src/video/sdl_v.cpp12
-rw-r--r--src/video/win32_v.cpp11
5 files changed, 34 insertions, 39 deletions
diff --git a/src/gfx.h b/src/gfx.h
index 612dbee43..995f6556d 100644
--- a/src/gfx.h
+++ b/src/gfx.h
@@ -71,7 +71,7 @@ enum WindowKeyCodes {
WKC_F11 = 43,
WKC_F12 = 44,
- /* backquote is the key left of "1"
+ /* Backquote is the key left of "1"
* we only store this key here, no matter what character is really mapped to it
* on a particular keyboard. (US keyboard: ` and ~ ; German keyboard: ^ and °) */
WKC_BACKQUOTE = 45,
@@ -82,19 +82,19 @@ enum WindowKeyCodes {
* a-z are mapped to 97-122 */
/* Other keys, corresponding to their ascii values */
- WKC_SLASH = 47, // / Forward slash
- WKC_SEMICOLON = 59, // ; Semicolon
- WKC_EQUALS = 61, // = Equals
- WKC_L_BRACKET = 91, // [ Left square bracket
- WKC_BACKSLASH = 92, // \ Backslash
- WKC_R_BRACKET = 93, // ] Right square bracket
+ WKC_SLASH = 47, ///< / Forward slash
+ WKC_SEMICOLON = 59, ///< ; Semicolon
+ WKC_EQUALS = 61, ///< = Equals
+ WKC_L_BRACKET = 91, ///< [ Left square bracket
+ WKC_BACKSLASH = 92, ///< \ Backslash
+ WKC_R_BRACKET = 93, ///< ] Right square bracket
/* Other keys of which their ascii value is already taken
* - use unused ascii value not present on keyboard directly */
- WKC_SINGLEQUOTE = 58, // ' Single quote
- WKC_COMMA = 60, // , Comma
- WKC_PERIOD = 62, // . Period
- WKC_MINUS = 95, // - Minus
+ WKC_SINGLEQUOTE = 58, ///< ' Single quote
+ WKC_COMMA = 60, ///< , Comma
+ WKC_PERIOD = 62, ///< . Period
+ WKC_MINUS = 95, ///< - Minus
};
enum GameModes {
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index bbf930f2a..5644323c4 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -1649,13 +1649,13 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e)
case WKC_SHIFT | WKC_F2: ShowVehicleListWindow(_local_player, VEH_ROAD); break;
case WKC_SHIFT | WKC_F3: ShowVehicleListWindow(_local_player, VEH_SHIP); break;
case WKC_SHIFT | WKC_F4: ShowVehicleListWindow(_local_player, VEH_AIRCRAFT); break;
- case WKC_NUM_PLUS: /* Fall through */
- case WKC_EQUALS: /* Fall through */
- case WKC_SHIFT | WKC_EQUALS: /* Fall through */
+ case WKC_NUM_PLUS: // Fall through
+ case WKC_EQUALS: // Fall through
+ case WKC_SHIFT | WKC_EQUALS: // Fall through
case WKC_SHIFT | WKC_F5: ToolbarZoomInClick(w); break;
- case WKC_NUM_MINUS: /* Fall through */
- case WKC_MINUS: /* Fall through */
- case WKC_SHIFT | WKC_MINUS: /* Fall through */
+ case WKC_NUM_MINUS: // Fall through
+ case WKC_MINUS: // Fall through
+ case WKC_SHIFT | WKC_MINUS: // Fall through
case WKC_SHIFT | WKC_F6: ToolbarZoomOutClick(w); break;
case WKC_SHIFT | WKC_F7: if (CanBuildVehicleInfrastructure(VEH_TRAIN)) ShowBuildRailToolbar(_last_built_railtype, -1); break;
case WKC_SHIFT | WKC_F8: ShowBuildRoadToolbar(_last_built_roadtype); break;
@@ -1666,7 +1666,7 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e)
case WKC_CTRL | 'S': MenuClickSmallScreenshot(); break;
case WKC_CTRL | 'G': MenuClickWorldScreenshot(); break;
case WKC_CTRL | WKC_ALT | 'C': if (!_networking) ShowCheatWindow(); break;
- case 'A': if (CanBuildVehicleInfrastructure(VEH_TRAIN)) ShowBuildRailToolbar(_last_built_railtype, 4); break; /* Invoke Autorail */
+ case 'A': if (CanBuildVehicleInfrastructure(VEH_TRAIN)) ShowBuildRailToolbar(_last_built_railtype, 4); break; // Invoke Autorail
case 'L': ShowTerraformToolbar(); break;
case 'M': ShowSmallMap(); break;
case 'V': ShowExtraViewPortWindow(); break;
diff --git a/src/video/cocoa_v.mm b/src/video/cocoa_v.mm
index 409d14215..de5cbb494 100644
--- a/src/video/cocoa_v.mm
+++ b/src/video/cocoa_v.mm
@@ -237,8 +237,7 @@ static const VkMapping _vk_mapping[] = {
AS(QZ_BACKQUOTE, WKC_BACKQUOTE), // key left of '1'
AS(QZ_BACKQUOTE2, WKC_BACKQUOTE), // some keyboards have it on another scancode
- // Pageup stuff + up/down
- //AM(SDLK_PAGEUP, SDLK_PAGEDOWN, WKC_PAGEUP, WKC_PAGEDOWN), <==== Does this include HOME/END?
+ /* Pageup stuff + up/down */
AS(QZ_PAGEUP, WKC_PAGEUP),
AS(QZ_PAGEDOWN, WKC_PAGEDOWN),
@@ -253,7 +252,7 @@ static const VkMapping _vk_mapping[] = {
AS(QZ_INSERT, WKC_INSERT),
AS(QZ_DELETE, WKC_DELETE),
- // Letters. QZ_[a-z] is not in numerical order so we can't use AM(...)
+ /* Letters. QZ_[a-z] is not in numerical order so we can't use AM(...) */
AS(QZ_a, 'A'),
AS(QZ_b, 'B'),
AS(QZ_c, 'C'),
@@ -280,7 +279,7 @@ static const VkMapping _vk_mapping[] = {
AS(QZ_x, 'X'),
AS(QZ_y, 'Y'),
AS(QZ_z, 'Z'),
- // Same thing for digits
+ /* Same thing for digits */
AS(QZ_0, '0'),
AS(QZ_1, '1'),
AS(QZ_2, '2'),
@@ -300,7 +299,7 @@ static const VkMapping _vk_mapping[] = {
AS(QZ_RETURN, WKC_RETURN),
AS(QZ_TAB, WKC_TAB),
- // Function keys
+ /* Function keys */
AS(QZ_F1, WKC_F1),
AS(QZ_F2, WKC_F2),
AS(QZ_F3, WKC_F3),
@@ -314,7 +313,7 @@ static const VkMapping _vk_mapping[] = {
AS(QZ_F11, WKC_F11),
AS(QZ_F12, WKC_F12),
- // Numeric part.
+ /* Numeric part */
AS(QZ_KP0, WKC_NUM_0),
AS(QZ_KP1, WKC_NUM_1),
AS(QZ_KP2, WKC_NUM_2),
@@ -332,7 +331,7 @@ static const VkMapping _vk_mapping[] = {
AS(QZ_KP_ENTER, WKC_NUM_ENTER),
AS(QZ_KP_PERIOD, WKC_NUM_DECIMAL),
- // Other non-letter keys
+ /* Other non-letter keys */
AS(QZ_SLASH, WKC_SLASH),
AS(QZ_SEMICOLON, WKC_SEMICOLON),
AS(QZ_EQUALS, WKC_EQUALS),
@@ -344,7 +343,6 @@ static const VkMapping _vk_mapping[] = {
AS(QZ_COMMA, WKC_COMMA),
AS(QZ_MINUS, WKC_MINUS),
AS(QZ_PERIOD, WKC_PERIOD)
-
};
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 61023965b..002142de3 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -240,7 +240,7 @@ struct VkMapping {
#define AM(x, y, z, w) {x, y - x, z}
static const VkMapping _vk_mapping[] = {
- // Pageup stuff + up/down
+ /* Pageup stuff + up/down */
AM(SDLK_PAGEUP, SDLK_PAGEDOWN, WKC_PAGEUP, WKC_PAGEDOWN),
AS(SDLK_UP, WKC_UP),
AS(SDLK_DOWN, WKC_DOWN),
@@ -253,7 +253,7 @@ static const VkMapping _vk_mapping[] = {
AS(SDLK_INSERT, WKC_INSERT),
AS(SDLK_DELETE, WKC_DELETE),
- // Map letters & digits
+ /* Map letters & digits */
AM(SDLK_a, SDLK_z, 'A', 'Z'),
AM(SDLK_0, SDLK_9, '0', '9'),
@@ -265,11 +265,10 @@ static const VkMapping _vk_mapping[] = {
AS(SDLK_RETURN, WKC_RETURN),
AS(SDLK_TAB, WKC_TAB),
- // Function keys
+ /* Function keys */
AM(SDLK_F1, SDLK_F12, WKC_F1, WKC_F12),
- // Numeric part.
- // What is the virtual keycode for numeric enter??
+ /* Numeric part. */
AM(SDLK_KP0, SDLK_KP9, WKC_NUM_0, WKC_NUM_9),
AS(SDLK_KP_DIVIDE, WKC_NUM_DIV),
AS(SDLK_KP_MULTIPLY, WKC_NUM_MUL),
@@ -278,7 +277,7 @@ static const VkMapping _vk_mapping[] = {
AS(SDLK_KP_ENTER, WKC_NUM_ENTER),
AS(SDLK_KP_PERIOD, WKC_NUM_DECIMAL),
- // Other non-letter keys
+ /* Other non-letter keys */
AS(SDLK_SLASH, WKC_SLASH),
AS(SDLK_SEMICOLON, WKC_SEMICOLON),
AS(SDLK_EQUALS, WKC_EQUALS),
@@ -290,7 +289,6 @@ static const VkMapping _vk_mapping[] = {
AS(SDLK_COMMA, WKC_COMMA),
AS(SDLK_MINUS, WKC_MINUS),
AS(SDLK_PERIOD, WKC_PERIOD)
-
};
static uint32 ConvertSdlKeyIntoMy(SDL_keysym *sym)
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 6a7608705..0164fe595 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -83,9 +83,9 @@ struct VkMapping {
#define AM(x, y, z, w) {x, y - x, z}
static const VkMapping _vk_mapping[] = {
- // Pageup stuff + up/down
+ /* Pageup stuff + up/down */
AM(VK_PRIOR,VK_DOWN, WKC_PAGEUP, WKC_DOWN),
- // Map letters & digits
+ /* Map letters & digits */
AM('A','Z','A','Z'),
AM('0','9','0','9'),
@@ -98,11 +98,10 @@ static const VkMapping _vk_mapping[] = {
AS(VK_RETURN, WKC_RETURN),
AS(VK_TAB, WKC_TAB),
- // Function keys
+ /* Function keys */
AM(VK_F1, VK_F12, WKC_F1, WKC_F12),
- // Numeric part.
- // What is the virtual keycode for numeric enter??
+ /* Numeric part */
AM(VK_NUMPAD0, VK_NUMPAD9, WKC_NUM_0, WKC_NUM_9),
AS(VK_DIVIDE, WKC_NUM_DIV),
AS(VK_MULTIPLY, WKC_NUM_MUL),
@@ -110,7 +109,7 @@ static const VkMapping _vk_mapping[] = {
AS(VK_ADD, WKC_NUM_PLUS),
AS(VK_DECIMAL, WKC_NUM_DECIMAL),
- // Other non-letter keys
+ /* Other non-letter keys */
AS(0xBF, WKC_SLASH),
AS(0xBA, WKC_SEMICOLON),
AS(0xBB, WKC_EQUALS),