mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
show/showAll methods now use Canvas instead of SDL_Surface
- added compatibility method to Canvas to allow SDL_Surface access - added drawBorder method to Canvas to replace CSDL_Ext method - added drawColor method to Canvas to replace CSDL_Ext method - minor changes to Tavern and Trade windows to adapt to new API
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "../CMT.h"
|
||||
#include "../CGameInfo.h"
|
||||
#include "../render/Canvas.h"
|
||||
#include "../render/Colors.h"
|
||||
#include "../renderSDL/SDL_Extensions.h"
|
||||
|
||||
@@ -92,8 +93,10 @@ void WindowHandler::totalRedraw()
|
||||
{
|
||||
CSDL_Ext::fillSurface(screen2, Colors::BLACK);
|
||||
|
||||
Canvas target = Canvas::createFromSurface(screen2);
|
||||
|
||||
for(auto & elem : windowsStack)
|
||||
elem->showAll(screen2);
|
||||
elem->showAll(target);
|
||||
CSDL_Ext::blitAt(screen2, 0, 0, screen);
|
||||
}
|
||||
|
||||
@@ -102,8 +105,11 @@ void WindowHandler::simpleRedraw()
|
||||
//update only top interface and draw background
|
||||
if(windowsStack.size() > 1)
|
||||
CSDL_Ext::blitAt(screen2, 0, 0, screen); //blit background
|
||||
|
||||
Canvas target = Canvas::createFromSurface(screen);
|
||||
|
||||
if(!windowsStack.empty())
|
||||
windowsStack.back()->show(screen); //blit active interface/window
|
||||
windowsStack.back()->show(target); //blit active interface/window
|
||||
}
|
||||
|
||||
void WindowHandler::onScreenResize()
|
||||
|
||||
Reference in New Issue
Block a user