OSDN Git Service

SDL_Rect構造体 のサブクラスとして SDL_Rect_Deeを定義。 / Define SDL_Rect_Dee by sub-class of SDL_Rect.
authorDeskull <desull@users.sourceforge.jp>
Mon, 12 Jan 2015 10:21:15 +0000 (19:21 +0900)
committerDeskull <desull@users.sourceforge.jp>
Mon, 12 Jan 2015 10:21:15 +0000 (19:21 +0900)
Deeangband/GameSurfaceSDL.cpp
Deeangband/GameSurfaceSDL.h

index 6370ffe..d52fe05 100644 (file)
@@ -18,6 +18,8 @@
 
 namespace Deeangband
 {
+       SDL_Rect_Dee GameSurfaceSDL::rectTitleDst(10, 10, 266, 266);
+       SDL_Rect_Dee GameSurfaceSDL::rectTitleSrc(0, 0, 256, 256);
 
        std::string toUTF8(LPCSTR str)
        {
@@ -217,8 +219,8 @@ namespace Deeangband
        void GameSurfaceSDL::Redraw(const CREATURE_IT& subjectCreatureIt)
        {
                SDL_Rect rect = {0, 0, 0, 0};
-               SDL_Rect rectTitleDst = {10, 10, 266, 266};
-               SDL_Rect rectTitleSrc = {0, 0, 256, 256};
+               //SDL_Rect rectTitleDst = {10, 10, 266, 266};
+               //SDL_Rect rectTitleSrc = {0, 0, 256, 256};
                Coordinates mapDrawingSize;
                this->calcMapDrawingSize(&mapDrawingSize);
 
index e8a51c2..c238a6d 100644 (file)
@@ -25,6 +25,24 @@ namespace Deeangband
 
        #define FPS_UPDATE 20
 
+       struct SDL_Rect_Dee : public SDL_Rect
+       {
+               SDL_Rect_Dee(int x, int y, int w, int h)
+               {
+                       this->x = x;
+                       this->y = y;
+                       this->w = w;
+                       this->h = h;
+               }
+               SDL_Rect_Dee()
+               {
+                       this->x = 0;
+                       this->y = 0;
+                       this->w = 0;
+                       this->h = 0;
+               }
+       };
+
        /*! 
         * @class GameSurfaceSDL
         * @brief \83Q\81[\83\80\82Ì\83\81\83C\83\93\83C\83\93\83^\81[\83t\83F\83C\83X\83N\83\89\83X(SDL\8eÀ\91\95)
@@ -37,6 +55,9 @@ namespace Deeangband
                static const int squareGraphicWidth = 24; //!< 1\83}\83X\82Ì\83O\83\89\83t\83B\83b\83N\95\9d(\83s\83N\83Z\83\8b
                static const int squareGraphicHeight = 24; //!< 1\83}\83X\82Ì\83O\83\89\83t\83B\83b\83N\8d\82\82³(\83s\83N\83Z\83\8b
 
+               static SDL_Rect_Dee rectTitleDst;
+               static SDL_Rect_Dee rectTitleSrc;
+
                SDL_Renderer *renderer;     //!< SDL\97p\83\8c\83\93\83_\83\89\8eQ\8fÆ\83|\83C\83\93\83^
                SDL_Window *window;         //!< SDL\83E\83B\83\93\83h\83E\8eQ\8fÆ\83|\83C\83\93\83^