OSDN Git Service

Field::GetSquare() を修正。 / Fix Field::GetSquare().
authorDeskull <desull@users.sourceforge.jp>
Mon, 12 Jan 2015 11:35:04 +0000 (20:35 +0900)
committerDeskull <desull@users.sourceforge.jp>
Mon, 12 Jan 2015 11:35:04 +0000 (20:35 +0900)
Deeangband/Field.cpp
Deeangband/GameSurfaceSDL.cpp

index 279f0c4..358890d 100644 (file)
@@ -86,7 +86,7 @@ namespace Deeangband
        {
                //! @note \83t\83B\81[\83\8b\83h\82Ì\94Í\88Í\8aO\82Ì\8dÀ\95W\82Ì\8fê\8d\87false\82ð\95Ô\82·\81B
                if(x < 0 || y < 0 || x >= this->width || y >= this->height) return NULL;
-               return &(*(squares[x][y]));
+               return squares[y][x].get();
        }
 
        bool Field::GenerateTrap(std::map<TAG, boost::shared_ptr<TrapBase>>::iterator trapBaseIt, Coordinates *position)
index 4a6fd6d..f7ddd24 100644 (file)
@@ -229,10 +229,10 @@ namespace Deeangband
                {
                        int fx = focusPoint.GetX() - (mapDrawingSize.GetX() / 2);
                        int fy = focusPoint.GetY() - (mapDrawingSize.GetY() / 2);
-                       if(fx < 0) fx = 0;
-                       if(fy < 0) fy = 0;
                        if(fx > viewFieldPtr->GetWidth() - mapDrawingSize.GetX()) fx = viewFieldPtr->GetWidth() - mapDrawingSize.GetX();
                        if(fy > viewFieldPtr->GetHeight() - mapDrawingSize.GetY()) fy = viewFieldPtr->GetHeight() - mapDrawingSize.GetY();
+                       if(fx < 0) fx = 0;
+                       if(fy < 0) fy = 0;
 
                        this->drawField(subjectCreatureIt, gameWorld, viewFieldPtr, rectMainMapDst, fx, fy, mapDrawingSize.GetX(), mapDrawingSize.GetY());
                }