src.h = 200;
title.x = 0;
title.y = 0;
- title.w = 512;
- title.h = 512;
+ title.w = 256;
+ title.h = 256;
color.r = 255;
color.g = 223;
color.b = 200;
rwop = SDL_RWFromFile("img\\Title.png", "rb");
error = IMG_GetError();
- titleSurface = IMG_LoadPNG_RW(rwop);
+ tempSurface = IMG_LoadPNG_RW(rwop);
+ titleTexture = SDL_CreateTextureFromSurface(renderer, tempSurface);
+ SDL_FreeSurface(tempSurface);
//! @note \96¢\92m\92n\8c`\83O\83\89\83t\83B\83b\83N\82Ì\93Ç\82Ý\8d\9e\82Ý
rwop = SDL_RWFromFile("img\\UnknownField.png", "rb");
+ error = IMG_GetError();
tempSurface = IMG_LoadPNG_RW(rwop);
unknownFieldTexture = SDL_CreateTextureFromSurface(renderer, tempSurface);
SDL_FreeSurface(tempSurface);
//! @note \8e\8b\8aE\8aO\92n\8c`\83O\83\89\83t\83B\83b\83N\82Ì\93Ç\82Ý\8d\9e\82Ý
rwop = SDL_RWFromFile("img\\UnseenField.png", "rb");
+ error = IMG_GetError();
tempSurface = IMG_LoadPNG_RW(rwop);
unseenFieldTexture = SDL_CreateTextureFromSurface(renderer, tempSurface);
SDL_FreeSurface(tempSurface);
//SDL_FreeSurface(surface);
}
+ SDL_GetWindowSurface(this->window);
+ this->windowSurface = SDL_GetWindowSurface(this->window);
}
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};
Coordinates mapDrawingSize;
this->calcMapDrawingSize(&mapDrawingSize);
- SDL_GetWindowSurface(this->window);
- this->windowSurface = SDL_GetWindowSurface(this->window);
+ SDL_RenderClear(renderer);
+
SDL_GetWindowSize(window, &rect.w, &rect.h);
- SDL_SetRenderDrawColor(renderer, 100, 80, 0, 255);
+ SDL_SetRenderDrawColor(renderer, 50, 50, 0, 255);
SDL_FillRect(windowSurface, &rect, SDL_MapRGBA(windowSurface->format, 50, 20, 10, 255));
- SDL_BlitSurface(titleSurface, &title, windowSurface, &title);
+ //SDL_RenderCopy(renderer, titleTexture, &rectTitleSrc, &rectTitleDst);
+ SDL_RenderCopy(renderer, titleTexture, &rectTitleSrc, &rectTitleDst);
if(this->viewFieldPtr)
{
*/
if(subJectCreaturePtr->InSight(px, py))
{
- //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);
}