1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

Removed some instances of access to screen surface

This commit is contained in:
Ivan Savenko
2023-02-03 18:23:53 +02:00
parent 00c1a4ef76
commit 7c58a46279
20 changed files with 102 additions and 103 deletions

View File

@@ -14,6 +14,7 @@
#include "../render/Graphics.h"
#include "../render/Colors.h"
#include "../CMT.h"
#include <SDL_render.h>
@@ -97,6 +98,11 @@ void CSDL_Ext::updateRect(SDL_Surface *surface, const Rect & rect )
}
SDL_Surface * CSDL_Ext::newSurface(int w, int h)
{
return newSurface(w, h, screen);
}
SDL_Surface * CSDL_Ext::newSurface(int w, int h, SDL_Surface * mod) //creates new surface, with flags/format same as in surface given
{
SDL_Surface * ret = SDL_CreateRGBSurface(0,w,h,mod->format->BitsPerPixel,mod->format->Rmask,mod->format->Gmask,mod->format->Bmask,mod->format->Amask);