Commit 32068822 authored by Gerhard Stein's avatar Gerhard Stein

Slimmed down SDL Extensions

parent d9090787
Subproject commit c9f7a925b5280d4199d73413f5d49bb3602b9b09
Subproject commit 72ddd7f220e5e11abf8c5a845ac6deb0b636056d
......@@ -211,7 +211,7 @@ target_link_libraries (CGeniusExe engine)
target_link_libraries (CGeniusExe GsKit)
# Link our SDL Extensions
target_link_libraries(CGeniusExe sdl_extensions)
target_link_libraries(CGeniusExe sdl_extensions_audio sdl_extensions_sys)
# Link zlib
target_link_libraries( CGeniusExe ${ZLIB_LIBRARIES} )
......
......@@ -10,7 +10,6 @@
#include <base/CInput.h>
#include "CTextViewer.h"
#include "graphics/GsGraphics.h"
#include "sdl/extensions.h"
#include <base/video/CVideoDriver.h>
#include <base/utils/FindFile.h>
#include <base/GsLogging.h>
......
......@@ -9,7 +9,6 @@
#include "engine/core/CCamera.h"
#include "engine/core/CBehaviorEngine.h"
#include <base/video/CVideoDriver.h>
#include "sdl/extensions.h"
#include "graphics/GsGraphics.h"
#include <base/utils/StringUtils.h>
......
......@@ -12,15 +12,15 @@
#ifndef CHUD_H_
#define CHUD_H_
#include <SDL.h>
#include <string>
#include <functional>
#include <memory>
#include <graphics/GsSprite.h>
#include <graphics/GsSurface.h>
#include "Playerdefines.h"
#include "engine/core/spritedefines.h"
#include "graphics/GsSprite.h"
#include "sdl/extensions.h"
#include <graphics/GsSurface.h>
class CHUD
......
......@@ -5,4 +5,4 @@ FILE(GLOB_RECURSE srcs *.cpp *.h)
add_library(engine_core ${srcs})
target_link_libraries(engine_core sdl_extensions)
target_link_libraries(engine_core sdl_extensions_audio sdl_extensions_sys)
......@@ -7,7 +7,7 @@
#include "CResourceLoader.h"
#include "graphics/GsGraphics.h"
#include "sdl/extensions.h"
#include <base/video/CVideoDriver.h>
#include <base/GsTimer.h>
#include <base/utils/StringUtils.h>
......
......@@ -14,7 +14,7 @@
#include "CPassive.h"
#include "graphics/GsGraphics.h"
#include "graphics/effects/CPixelate.h"
#include "sdl/extensions.h"
#include "menu/MainMenu.h"
#include "sdl/audio/music/CMusic.h"
......
......@@ -13,7 +13,7 @@
#include "engine/core/CBehaviorEngine.h"
#include "fileio/KeenFiles.h"
#include "sdl/extensions.h"
CStatusScreenGalaxy::CStatusScreenGalaxy(const stItemGalaxy& Item) :
m_showstatus(false),
......
......@@ -7,7 +7,7 @@
#include "CMessageBoxBitmapGalaxy.h"
#include <base/video/CVideoDriver.h>
#include "sdl/extensions.h"
#include "dialog/CMessageBox.h"
namespace galaxy
......
......@@ -13,7 +13,7 @@
#include <base/video/CVideoDriver.h>
#include <base/CInput.h>
#include "graphics/GsGraphics.h"
#include "sdl/extensions.h"
#include <base/utils/StringUtils.h>
#include <memory>
......
......@@ -14,7 +14,7 @@
#include <base/video/CVideoDriver.h>
#include "CVorticonMapLoader.h"
#include "fileio/ResourceMgmt.h"
#include "sdl/extensions.h"
#include <fileio/KeenFiles.h>
......
......@@ -10,7 +10,7 @@
#include <base/video/CVideoDriver.h>
#include "graphics/GsGraphics.h"
#include "CVorticonMapLoader.h"
#include "sdl/extensions.h"
#include <fileio/KeenFiles.h>
......
......@@ -16,7 +16,7 @@
#include <base/utils/FindFile.h>
#include <base/video/CVideoDriver.h>
#include "CVorticonMapLoader.h"
#include "sdl/extensions.h"
#include "fileio/KeenFiles.h"
......
......@@ -13,7 +13,7 @@
#include "fileio/CExeFile.h"
#include "CVorticonMapLoader.h"
#include "sdl/extensions.h"
#include "fileio/KeenFiles.h"
......
......@@ -13,7 +13,7 @@
#include <base/video/CVideoDriver.h>
#include <base/CInput.h>
#include "engine/CGameLauncher.h"
#include "sdl/extensions.h"
#include "engine/core/mode/CGameMode.h"
#include "engine/core/VGamepads/vgamepadsimple.h"
......
......@@ -11,7 +11,7 @@
#include <base/utils/FindFile.h>
#include <base/CInput.h>
#include "CVorticonMapLoader.h"
#include "sdl/extensions.h"
#include "fileio/KeenFiles.h"
#include "fileio/ResourceMgmt.h"
......
......@@ -14,7 +14,7 @@
#include "CStatusScreen.h"
#include "graphics/GsGraphics.h"
#include "sdl/extensions.h"
#include "engine/core/Playerdefines.h"
#include "engine/core/CBehaviorEngine.h"
#include "ai/CAnkhShield.h"
......
......@@ -13,7 +13,7 @@
#include "CMessageBoxVort.h"
#include "graphics/GsGraphics.h"
#include "sdl/extensions.h"
CMessageBoxVort::CMessageBoxVort(const std::string& Text,
......
......@@ -20,7 +20,7 @@
#include "../CVorticonMapLoader.h"
#include "graphics/GsGraphics.h"
#include "../ai/CTeleporter.h"
#include "sdl/extensions.h"
#include "../finale/CEndingEp1.h"
#include "../finale/CEndingEp2.h"
#include "../finale/CEndingEp3.h"
......
add_subdirectory(audio)
add_subdirectory(sys)
include_directories(${SDL_INCLUDE_DIR})
add_library(sdl_extensions extensions.cpp extensions.h)
target_link_libraries(sdl_extensions sdl_extensions_audio sdl_extensions_sys)
/*
* extensions.cpp
*
* Created on: 31.01.2012
* Author: gerstrong
*
* Extensions for SDL
*/
#include "extensions.h"
#include <base/video/CVideoDriver.h>
#include <base/GsLogging.h>
#include <cstring>
#include <cstdio>
#if SDL_VERSION_ATLEAST(2, 0, 0)
#endif
/*
GsSurface sfc;
sfc.createRGBSurface(rect);
*/
SDL_Surface *CG_CreateRGBSurface( const SDL_Rect rect )
{
auto *blit = gVideoDriver.getBlitSurface();
SDL_PixelFormat *format = blit->format;
SDL_Surface *sfc = SDL_CreateRGBSurface( SDL_SWSURFACE,
rect.w,
rect.h,
RES_BPP,
format->Rmask,
format->Gmask,
format->Bmask,
format->Amask );
return sfc;
}
/*
* extensions.h
*
* Created on: 31.01.2012
* Author: gerstrong
* Extensions for SDL
*/
#ifndef SDL_EXTENSIONS_H_
#define SDL_EXTENSIONS_H_
#include <SDL.h>
/*
struct Colormask
{
Uint32 r,g,b,a;
};
*/
//Uint32 getPixel(SDL_Surface *surface, int x, int y);
//inline Colormask getColourMask32bit();
SDL_Surface *CG_CreateRGBSurface( const SDL_Rect rect );
//void drawEmptyRect(SDL_Surface *sfc, SDL_Rect *pRect, Uint32 color);
#endif /* SDL_EXTENSIONS_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment