OSDN Git Service

Surface から Texture へのグラフィックリソース移行中。 In moving of graphic resource from Surface to...
authorDeskull <desull@users.sourceforge.jp>
Sun, 11 Jan 2015 06:02:08 +0000 (15:02 +0900)
committerDeskull <desull@users.sourceforge.jp>
Sun, 11 Jan 2015 06:02:08 +0000 (15:02 +0900)
Deeangband/GameSurfaceSDL.cpp

index 8f353bb..2d50ba4 100644 (file)
@@ -200,7 +200,7 @@ namespace Deeangband
                        SDL_FreeSurface(symbolSurface);
 
                        floorSurfaces.insert(std::map<TAG, SDL_Surface*>::value_type(floorIt->first, surface));
-                       SDL_FreeSurface(surface);
+                       //SDL_FreeSurface(surface);
                }
 
        }
@@ -238,8 +238,10 @@ namespace Deeangband
                this->fpsProcess();
                SDL_Delay(16 - frameDeltaTime > 0 ? 16 - frameDeltaTime : 0);
 
-               SDL_UpdateWindowSurfaceRects(window, &rect, 1);
-               SDL_UpdateWindowSurface(window);
+
+//             SDL_UpdateWindowSurfaceRects(window, &rect, 1);
+//             SDL_UpdateWindowSurface(window);
+               SDL_RenderPresent(renderer);
 
                return;
        }
@@ -616,6 +618,7 @@ void GameSurfaceSDL::drawField(const CREATURE_IT &subjectCreatureIt, GameWorld *
                                SDL_Rect checkRect4 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 1, 30 + (py - y) * squareGraphicHeight - 6 + 12, 2, 12};
                                */
 
+/*
                                if(subJectCreaturePtr->GetLore()->GetFieldLore(0, px, py) > 0)
                                {
                                        TAG tag = fieldPtr->GetSquare(px, py)->GetFloorTag();
@@ -632,21 +635,21 @@ void GameSurfaceSDL::drawField(const CREATURE_IT &subjectCreatureIt, GameWorld *
                                        SDL_Rect fieldRect = {blitRect.x % 128, blitRect.y % 128, squareGraphicWidth, squareGraphicHeight};
 //                                     SDL_RenderCopy(this->renderer, unknownFieldTexture, &fieldRect, &blitRect);
                                }
-/*
-
+*/
                                if(subJectCreaturePtr->InSight(px, py))
                                {
-                                       TAG tag = fieldPtr->GetSquare(px, py)->GetFloorTag();
-                                       SDL_BlitSurface(floorSurfaces[tag], &symbolRect, windowSurface, &blitRect);
+                                       //TAG tag = fieldPtr->GetSquare(px, py)->GetFloorTag();
+                                       //SDL_BlitSurface(floorSurfaces[tag], &symbolRect, windowSurface, &blitRect);
+                                       SDL_Rect fieldRect = {blitRect.x % 128, blitRect.y % 128, squareGraphicWidth, squareGraphicHeight};
+                                       SDL_RenderCopy(this->renderer, unseenFieldTexture, &fieldRect, &blitRect);
                                }
                                else
                                {
-                                       //SDL_Rect fieldRect = {blitRect.x % 128, blitRect.y % 128, squareGraphicWidth, squareGraphicHeight};
-                                       //SDL_FillRect(windowSurface, &fieldRect, SDL_MapRGBA(windowSurface->format, 255, 0, 0, 255));
-                                       //SDL_BlitSurface(unknownFieldSurface, &fieldRect, windowSurface, &blitRect); 
+                                       SDL_Rect fieldRect = {blitRect.x % 128, blitRect.y % 128, squareGraphicWidth, squareGraphicHeight};
+                                       SDL_RenderCopy(this->renderer, unknownFieldTexture, &fieldRect, &blitRect);
                                }
 
-                       
+/*                     
                                else
                                {
                                        SDL_Rect fieldRect = {blitRect.x % 128, blitRect.y % 128, blitRect.x % 128 + squareGraphicWidth, blitRect.y % 128 + squareGraphicHeight};