OSDN Git Service

視界範囲処理再実装中。 / Implementing processes of sight range.
authorDeskull <desull@users.sourceforge.jp>
Fri, 9 Jan 2015 04:04:06 +0000 (13:04 +0900)
committerDeskull <desull@users.sourceforge.jp>
Fri, 9 Jan 2015 04:04:06 +0000 (13:04 +0900)
Deeangband/Field.cpp
Deeangband/GameSurfaceSDL.cpp

index 02b3dd3..a76096a 100644 (file)
@@ -101,6 +101,12 @@ namespace Deeangband
                this->SightPass.resize((this->width * 2 + 1) * (this->height * 2 + 1));
                this->PhysicalPass.resize((this->width * 2 + 1) * (this->height * 2 + 1));
 
+               for(x = 0; x < this->height * this->width; x++)
+               {
+                       this->SightPass[x] = true;
+                       this->PhysicalPass[x] = true;
+               }
+
                for(y = 1; y < this->height * 2 + 1; y += 2)
                {
                        for(x = 1; x < this->width * 2 + 1; x += 2)
@@ -132,8 +138,8 @@ namespace Deeangband
                        }
                }
 
-               /*
 
+               /*
                for(y = 0; y < this->height * 2 + 1; y += 2)
                {
                        for(x = 1; x < this->width * 2 + 1; x += 2)
index 943be60..86a0c33 100644 (file)
@@ -572,8 +572,8 @@ void GameSurfaceSDL::drawField(const CREATURE_IT &subjectCreatureIt, GameWorld *
                        {
                                SDL_Rect checkRect1 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 2 + 12, 30 + (py - y) * squareGraphicHeight - 2 + 12, 4, 4};
                                SDL_Rect checkRect2 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 2, 30 + (py - y) * squareGraphicHeight - 2, 4, 4};
-                               SDL_Rect checkRect3 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 2, 30 + (py - y) * squareGraphicHeight - 2 + 12, 4, 4};
-                               SDL_Rect checkRect4 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 2 + 12, 30 + (py - y) * squareGraphicHeight - 2, 4, 4};
+                               SDL_Rect checkRect3 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 6 + 12, 30 + (py - y) * squareGraphicHeight - 1, 12, 2};
+                               SDL_Rect checkRect4 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 1, 30 + (py - y) * squareGraphicHeight - 6 + 12, 2, 12};
                                SDL_Rect blitRect = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth, 30 + (py - y) * squareGraphicHeight , squareGraphicWidth, squareGraphicHeight};
                                if(subJectCreaturePtr->GetLore()->GetFieldLore(0, px, py) > 0)
                                {
@@ -601,16 +601,15 @@ void GameSurfaceSDL::drawField(const CREATURE_IT &subjectCreatureIt, GameWorld *
                                else
                                        SDL_FillRect(windowSurface, &checkRect2, SDL_MapRGBA(windowSurface->format, 255, 0, 0, 255));
 
-                               /*
-                               if(fieldPtr->GetSightPass(px * 2, py * 2 + 1))
+                               if(fieldPtr->GetSightPass(px * 2 + 1, py * 2))
                                        SDL_FillRect(windowSurface, &checkRect3, SDL_MapRGBA(windowSurface->format, 255, 255, 255, 255));
                                else
                                        SDL_FillRect(windowSurface, &checkRect3, SDL_MapRGBA(windowSurface->format, 255, 0, 0, 255));
+
                                if(fieldPtr->GetSightPass(px * 2 + 1, py * 2))
                                        SDL_FillRect(windowSurface, &checkRect4, SDL_MapRGBA(windowSurface->format, 255, 255, 255, 255));
                                else
                                        SDL_FillRect(windowSurface, &checkRect4, SDL_MapRGBA(windowSurface->format, 255, 0, 0, 255));
-                               */
 
                        }
                }