OSDN Git Service

floorSurfaces の SDL_Texture 移行。 / Change floorSurfaces to SDL_Texture.
authorDeskull <desull@users.sourceforge.jp>
Sun, 11 Jan 2015 06:46:55 +0000 (15:46 +0900)
committerDeskull <desull@users.sourceforge.jp>
Sun, 11 Jan 2015 06:46:55 +0000 (15:46 +0900)
Deeangband/GameSurfaceSDL.cpp
Deeangband/GameSurfaceSDL.h

index fe78943..89ae15f 100644 (file)
@@ -206,7 +206,8 @@ namespace Deeangband
                        SDL_BlitSurface(symbolSurface, &symbolRect, surface, &blitRect);
                        SDL_FreeSurface(symbolSurface);
 
-                       floorSurfaces.insert(std::map<TAG, SDL_Surface*>::value_type(floorIt->first, surface));
+                       floorSurfaces.insert(std::map<TAG, SDL_Texture*>::value_type(floorIt->first, SDL_CreateTextureFromSurface(renderer, surface)));
+                       
                        //SDL_FreeSurface(surface);
                }
 
@@ -646,10 +647,15 @@ void GameSurfaceSDL::drawField(const CREATURE_IT &subjectCreatureIt, GameWorld *
 //                                     SDL_RenderCopy(this->renderer, unknownFieldTexture, &fieldRect, &blitRect);
                                }
 */
-                               if(subJectCreaturePtr->InSight(px, py))
+                               if(subJectCreaturePtr->GetLore()->GetFieldLore(0, px, py) > 0)
                                {
-                                       SDL_Rect fieldRect = {blitRect.x % 128, blitRect.y % 128, squareGraphicWidth, squareGraphicHeight};
-                                       SDL_RenderCopy(this->renderer, unseenFieldTexture, &fieldRect, &blitRect);
+                                       TAG tag = fieldPtr->GetSquare(px, py)->GetFloorTag();
+                                       SDL_RenderCopy(renderer, floorSurfaces[tag], &symbolRect, &blitRect);
+                                       if(!subJectCreaturePtr->InSight(px, py))
+                                       {
+                                               SDL_Rect fieldRect = {blitRect.x % 128, blitRect.y % 128, squareGraphicWidth, squareGraphicHeight};
+                                               SDL_RenderCopy(this->renderer, unseenFieldTexture, &fieldRect, &blitRect);
+                                       }
                                }
                                else
                                {
index a4d5772..494286d 100644 (file)
@@ -58,7 +58,7 @@ namespace Deeangband
 
                SDL_Surface *windowSurface;  //!< \83Q\81[\83\80\83E\83B\83\93\83h\83E\82ÌSurface\8eQ\8fÆ
 
-               SDL_Texture *titleTexture;   //!< \83Q\81[\83\80\83^\83C\83g\83\8b\83O\83\89\83t\83B\83b\83N\82ÌSurface\8eQ\8fÆ
+               SDL_Texture *titleTexture;   //!< \83Q\81[\83\80\83^\83C\83g\83\8b\83O\83\89\83t\83B\83b\83N\82ÌTexture\8eQ\8fÆ
                SDL_Texture *unknownFieldTexture; //!< \96¢\92m\83t\83B\81[\83\8b\83h\83O\83\89\83t\83B\83b\83N\82ÌTexture\8eQ\8fÆ
                SDL_Texture *unseenFieldTexture; //!< \8e\8b\8aE\8aO\83t\83B\81[\83\8b\83h\83O\83\89\83t\83B\83b\83N\82ÌTexture\8eQ\8fÆ
 
@@ -70,7 +70,7 @@ namespace Deeangband
                SDL_Texture *fpsTexture;
 
 
-               std::map<TAG, SDL_Surface*> floorSurfaces; //!< \83t\83\8d\83A\83O\83\89\83t\83B\83b\83N\82ÌSurface\8eQ\8fÆ\83\8a\83X\83g
+               std::map<TAG, SDL_Texture*> floorSurfaces; //!< \83t\83\8d\83A\83O\83\89\83t\83B\83b\83N\82ÌSurface\8eQ\8fÆ\83\8a\83X\83g
                std::map<ID, SDL_Surface*> creatureSurfaces; //!< \83N\83\8a\81[\83`\83\83\81[\83O\83\89\83t\83B\83b\83N\82ÌSurface\8eQ\8fÆ\83\8a\83X\83g
 
                void GameSurfaceSDL::pushAnyKey(const CREATURE_IT &subjectCreatureIt);