• R/O
  • SSH
  • HTTPS

deeangband: Commit


Commit MetaInfo

Revision9204 (tree)
Time2014-02-20 12:57:14
Authordeskull

Log Message

Add DoGameCommand() method to GameWorld class.

Change Summary

Incremental Difference

--- source/branch/new_source/Deeangband/Deeangband/GameWorld.h (revision 9203)
+++ source/branch/new_source/Deeangband/Deeangband/GameWorld.h (revision 9204)
@@ -28,6 +28,15 @@
2828 #include "Species.h"
2929 #include "TrapBase.h"
3030
31+/*!
32+ * ゲームコマンド定義
33+ */
34+enum GameCommand
35+{
36+ GAME_COMMAND_REDRAW,
37+ GAME_COMMAND_EXIT
38+};
39+
3140 /*! @class GameWorld
3241 * @brief ゲーム世界のクラス
3342 */
@@ -67,4 +76,8 @@
6776 {
6877 }
6978
79+ /*
80+ * @brief 受け取ったゲームコマンドを処理する
81+ */
82+ void DoGameCommand(GameCommand command);
7083 };
--- source/branch/new_source/Deeangband/Deeangband/GameWorld.cpp (revision 9203)
+++ source/branch/new_source/Deeangband/Deeangband/GameWorld.cpp (revision 9204)
@@ -8,3 +8,14 @@
88
99 #include "stdafx.h"
1010 #include "GameWorld.h"
11+
12+void GameWorld::DoGameCommand(GameCommand command)
13+{
14+ switch(command)
15+ {
16+ case GAME_COMMAND_REDRAW:
17+ break;
18+ case GAME_COMMAND_EXIT:
19+ break;
20+ }
21+}
--- source/branch/new_source/Deeangband/Deeangband/GameSurfaceSDL.h (revision 9203)
+++ source/branch/new_source/Deeangband/Deeangband/GameSurfaceSDL.h (revision 9204)
@@ -17,6 +17,15 @@
1717 #include <SDL_image.h>
1818 #include <SDL_ttf.h>
1919
20+/*!
21+ * @brief SDLのキーコード定義
22+ */
23+enum SDL_KEYCODE_LIST
24+{
25+ SDL_KEY_ESC = 27,
26+};
27+
28+
2029 /*!
2130 * @class GameSurfaceSDL
2231 * @brief ゲームのメインインターフェイスクラス(SDL実装)
--- source/branch/new_source/Deeangband/Deeangband/GameSurfaceSDL.cpp (revision 9203)
+++ source/branch/new_source/Deeangband/Deeangband/GameSurfaceSDL.cpp (revision 9204)
@@ -70,8 +70,8 @@
7070 SDL_Rect src = {0, 0, 300, 200};
7171 SDL_Rect title = {0, 0, 512, 512};
7272
73- ::setlocale(LC_CTYPE, "");
74- ::std::locale::global(std::locale("japanese"));
73+ //::setlocale(LC_CTYPE, "");
74+ //::std::locale::global(std::locale("japanese"));
7575
7676 renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_PRESENTVSYNC);
7777
@@ -112,7 +112,7 @@
112112 {
113113 key=event.key.keysym.sym;
114114
115- if(key == 27)
115+ if(key == SDL_KEY_ESC)
116116 {
117117 return false;
118118 }
Show on old repository browser