mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
SDL1 wipe, part 3. Untested.
This commit is contained in:
@@ -47,9 +47,6 @@ public:
|
|||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <SDL_video.h>
|
#include <SDL_video.h>
|
||||||
#if SDL_VERSION_ATLEAST(1,3,0) && !SDL_VERSION_ATLEAST(2,0,0)
|
|
||||||
#include <SDL_compat.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
|
|||||||
@@ -398,13 +398,10 @@ void CGuiHandler::renderFrame()
|
|||||||
// draw the mouse cursor and update the screen
|
// draw the mouse cursor and update the screen
|
||||||
CCS->curh->render();
|
CCS->curh->render();
|
||||||
|
|
||||||
#ifndef VCMI_SDL1
|
|
||||||
if(0 != SDL_RenderCopy(mainRenderer, screenTexture, nullptr, nullptr))
|
if(0 != SDL_RenderCopy(mainRenderer, screenTexture, nullptr, nullptr))
|
||||||
logGlobal->errorStream() << __FUNCTION__ << " SDL_RenderCopy " << SDL_GetError();
|
logGlobal->errorStream() << __FUNCTION__ << " SDL_RenderCopy " << SDL_GetError();
|
||||||
|
|
||||||
SDL_RenderPresent(mainRenderer);
|
SDL_RenderPresent(mainRenderer);
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if(curInt)
|
if(curInt)
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include <SDL_version.h>
|
#include <SDL_version.h>
|
||||||
|
|
||||||
#if (SDL_MAJOR_VERSION == 2)
|
#if (SDL_MAJOR_VERSION == 2)
|
||||||
#define VCMI_SDL2
|
|
||||||
|
|
||||||
#include <SDL_keycode.h>
|
#include <SDL_keycode.h>
|
||||||
typedef int SDLX_Coord;
|
typedef int SDLX_Coord;
|
||||||
@@ -25,11 +24,6 @@ typedef SDL_Keycode SDLKey;
|
|||||||
|
|
||||||
#define SDL_FULLSCREEN SDL_WINDOW_FULLSCREEN
|
#define SDL_FULLSCREEN SDL_WINDOW_FULLSCREEN
|
||||||
|
|
||||||
#elif (SDL_MAJOR_VERSION == 1)
|
|
||||||
#define VCMI_SDL1
|
|
||||||
//SDL 1.x
|
|
||||||
typedef Sint16 SDLX_Coord;
|
|
||||||
typedef Uint16 SDLX_Size;
|
|
||||||
#else
|
#else
|
||||||
#error "unknown or unsupported SDL version"
|
#error "unknown or unsupported SDL version"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ const SDL_Color Colors::METALLIC_GOLD = { 173, 142, 66, 0 };
|
|||||||
const SDL_Color Colors::GREEN = { 0, 255, 0, 0 };
|
const SDL_Color Colors::GREEN = { 0, 255, 0, 0 };
|
||||||
const SDL_Color Colors::DEFAULT_KEY_COLOR = {0, 255, 255, 0};
|
const SDL_Color Colors::DEFAULT_KEY_COLOR = {0, 255, 255, 0};
|
||||||
|
|
||||||
#if (SDL_MAJOR_VERSION == 2)
|
|
||||||
void SDL_UpdateRect(SDL_Surface *surface, int x, int y, int w, int h)
|
void SDL_UpdateRect(SDL_Surface *surface, int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
Rect rect(x,y,w,h);
|
Rect rect(x,y,w,h);
|
||||||
@@ -27,7 +26,6 @@ void SDL_UpdateRect(SDL_Surface *surface, int x, int y, int w, int h)
|
|||||||
SDL_RenderPresent(mainRenderer);
|
SDL_RenderPresent(mainRenderer);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif // VCMI_SDL1
|
|
||||||
|
|
||||||
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 * CSDL_Ext::newSurface(int w, int h, SDL_Surface * mod) //creates new surface, with flags/format same as in surface given
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,13 +27,6 @@
|
|||||||
#define STRONG_INLINE inline
|
#define STRONG_INLINE inline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SDL_VERSION_ATLEAST(1,3,0)
|
|
||||||
#define SDL_GetKeyState SDL_GetKeyboardState
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//SDL2 support
|
|
||||||
#if (SDL_MAJOR_VERSION == 2)
|
|
||||||
|
|
||||||
extern SDL_Window * mainWindow;
|
extern SDL_Window * mainWindow;
|
||||||
extern SDL_Renderer * mainRenderer;
|
extern SDL_Renderer * mainRenderer;
|
||||||
extern SDL_Texture * screenTexture;
|
extern SDL_Texture * screenTexture;
|
||||||
@@ -49,7 +42,6 @@ inline void SDL_WarpMouse(int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SDL_UpdateRect(SDL_Surface *surface, int x, int y, int w, int h);
|
void SDL_UpdateRect(SDL_Surface *surface, int x, int y, int w, int h);
|
||||||
#endif
|
|
||||||
|
|
||||||
inline bool isCtrlKeyDown()
|
inline bool isCtrlKeyDown()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user