mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Fix compile warning
Fix warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
This commit is contained in:
parent
1ae05bab71
commit
dd88f8b4b1
|
@ -209,7 +209,7 @@ void Font::setFontHint(FontHint hint)
|
||||||
TTF_SetFontHinting(_get(),v);
|
TTF_SetFontHinting(_get(),v);
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect Font::sizeText(const std::string& Text) const throw (ErrorViewer)
|
Rect Font::sizeText(const std::string& Text) const
|
||||||
{
|
{
|
||||||
int w=0,h=0;
|
int w=0,h=0;
|
||||||
if(TTF_SizeText(_get(),Text.c_str(),&w,&h)!=0)
|
if(TTF_SizeText(_get(),Text.c_str(),&w,&h)!=0)
|
||||||
|
@ -222,7 +222,7 @@ Rect Font::sizeText(const std::string& Text) const throw (ErrorViewer)
|
||||||
return Rect(0,0,w,h);
|
return Rect(0,0,w,h);
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect Font::sizeUTF8(const std::string& Text) const throw (ErrorViewer)
|
Rect Font::sizeUTF8(const std::string& Text) const
|
||||||
{
|
{
|
||||||
int w=0,h=0;
|
int w=0,h=0;
|
||||||
if(TTF_SizeUTF8(_get(),Text.c_str(),&w,&h)!=0)
|
if(TTF_SizeUTF8(_get(),Text.c_str(),&w,&h)!=0)
|
||||||
|
@ -235,7 +235,7 @@ Rect Font::sizeUTF8(const std::string& Text) const throw (ErrorViewer)
|
||||||
return Rect(0,0,w,h);
|
return Rect(0,0,w,h);
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect Font::sizeUnicode(const uint16_t* Text) const throw (ErrorViewer)
|
Rect Font::sizeUnicode(const uint16_t* Text) const
|
||||||
{
|
{
|
||||||
int w=0,h=0;
|
int w=0,h=0;
|
||||||
if(TTF_SizeUNICODE(_get(),Text,&w,&h)!=0)
|
if(TTF_SizeUNICODE(_get(),Text,&w,&h)!=0)
|
||||||
|
|
|
@ -61,9 +61,9 @@ public:
|
||||||
void setFontHint(FontHint hint);
|
void setFontHint(FontHint hint);
|
||||||
|
|
||||||
|
|
||||||
Rect sizeText(const std::string& Text) const throw (ErrorViewer);
|
Rect sizeText(const std::string& Text) const;
|
||||||
Rect sizeUTF8(const std::string& Text) const throw (ErrorViewer);
|
Rect sizeUTF8(const std::string& Text) const;
|
||||||
Rect sizeUnicode(const uint16_t* Text) const throw (ErrorViewer);
|
Rect sizeUnicode(const uint16_t* Text) const;
|
||||||
|
|
||||||
/// Surface Rendering Functions.
|
/// Surface Rendering Functions.
|
||||||
Surface renderText(const std::string& Text, const RGBA& fg) const;
|
Surface renderText(const std::string& Text, const RGBA& fg) const;
|
||||||
|
|
|
@ -54,7 +54,7 @@ Uint32 Renderer::_rendertype_caster(RendererType Type)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Renderer::Renderer(Window& wnd,std::initializer_list<RendererType> RendererFlags) throw (ErrorViewer)
|
Renderer::Renderer(Window& wnd,std::initializer_list<RendererType> RendererFlags)
|
||||||
{
|
{
|
||||||
if(createRenderer(wnd,RendererFlags)!=0)
|
if(createRenderer(wnd,RendererFlags)!=0)
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ Renderer::Renderer(Window& wnd,std::initializer_list<RendererType> RendererFlags
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Renderer::Renderer(Surface& surf) throw (ErrorViewer)
|
Renderer::Renderer(Surface& surf)
|
||||||
{
|
{
|
||||||
if(createSoftRenderer(surf)!=0)
|
if(createSoftRenderer(surf)!=0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,9 +13,9 @@ class Renderer
|
||||||
public:
|
public:
|
||||||
Renderer() = default;
|
Renderer() = default;
|
||||||
/// Create a Renderer associated with Window
|
/// Create a Renderer associated with Window
|
||||||
Renderer(Window& wnd,std::initializer_list<RendererType> RendererFlags = { RendererType::Accelerated,RendererType::TargetTexture }) throw (ErrorViewer);
|
Renderer(Window& wnd,std::initializer_list<RendererType> RendererFlags = { RendererType::Accelerated,RendererType::TargetTexture });
|
||||||
/// Create a software Renderer
|
/// Create a software Renderer
|
||||||
Renderer(Surface& surf) throw (ErrorViewer);
|
Renderer(Surface& surf);
|
||||||
~Renderer() = default;
|
~Renderer() = default;
|
||||||
|
|
||||||
/// If Renderer is current not ready, setRenderer will create Renderer.
|
/// If Renderer is current not ready, setRenderer will create Renderer.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "_caster.h"
|
#include "_caster.h"
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
// private
|
// private
|
||||||
void SDLSystem::_init(Uint32 sdl_flag, Uint32 img_flag, Uint32 mix_flag, bool init_ttf) throw (ErrorViewer)
|
void SDLSystem::_init(Uint32 sdl_flag, Uint32 img_flag, Uint32 mix_flag, bool init_ttf)
|
||||||
{
|
{
|
||||||
int ret=SDL_Init(sdl_flag);
|
int ret=SDL_Init(sdl_flag);
|
||||||
if(ret!=0)
|
if(ret!=0)
|
||||||
|
@ -44,7 +44,7 @@ void SDLSystem::_init(Uint32 sdl_flag, Uint32 img_flag, Uint32 mix_flag, bool in
|
||||||
SDLSystem::SDLSystem(const std::initializer_list<SDLInitFlag>& flag_sdl,
|
SDLSystem::SDLSystem(const std::initializer_list<SDLInitFlag>& flag_sdl,
|
||||||
const std::initializer_list<IMGInitFlag>& flag_img,
|
const std::initializer_list<IMGInitFlag>& flag_img,
|
||||||
const std::initializer_list<MixInitFlag>& flag_mix,
|
const std::initializer_list<MixInitFlag>& flag_mix,
|
||||||
bool init_ttf ) throw (ErrorViewer)
|
bool init_ttf )
|
||||||
{
|
{
|
||||||
Uint32 sdl_flag=0;
|
Uint32 sdl_flag=0;
|
||||||
for(auto& v:flag_sdl)
|
for(auto& v:flag_sdl)
|
||||||
|
@ -72,7 +72,7 @@ SDLSystem::SDLSystem(const std::initializer_list<SDLInitFlag>& flag_sdl,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SDLSystem::SDLSystem(Uint32 sdl_flag, Uint32 img_flag, Uint32 mix_flag, bool init_ttf) throw (ErrorViewer)
|
SDLSystem::SDLSystem(Uint32 sdl_flag, Uint32 img_flag, Uint32 mix_flag, bool init_ttf)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,9 +18,9 @@ public:
|
||||||
SDLSystem(const std::initializer_list<SDLInitFlag>& flag_sdl = {SDLInitFlag::All} ,
|
SDLSystem(const std::initializer_list<SDLInitFlag>& flag_sdl = {SDLInitFlag::All} ,
|
||||||
const std::initializer_list<IMGInitFlag>& flag_img = {IMGInitFlag::JPG,IMGInitFlag::PNG} ,
|
const std::initializer_list<IMGInitFlag>& flag_img = {IMGInitFlag::JPG,IMGInitFlag::PNG} ,
|
||||||
const std::initializer_list<MixInitFlag>& flag_mix = {MixInitFlag::MP3} ,
|
const std::initializer_list<MixInitFlag>& flag_mix = {MixInitFlag::MP3} ,
|
||||||
bool init_ttf = true ) throw (ErrorViewer);
|
bool init_ttf = true );
|
||||||
/// Experimental Constructor
|
/// Experimental Constructor
|
||||||
SDLSystem(Uint32 sdl_flag, Uint32 img_flag, Uint32 mix_flag, bool init_ttf) throw (ErrorViewer);
|
SDLSystem(Uint32 sdl_flag, Uint32 img_flag, Uint32 mix_flag, bool init_ttf);
|
||||||
~SDLSystem();
|
~SDLSystem();
|
||||||
|
|
||||||
static void Delay(int ms);
|
static void Delay(int ms);
|
||||||
|
@ -70,7 +70,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _init(Uint32,Uint32,Uint32,bool) throw (ErrorViewer);
|
void _init(Uint32,Uint32,Uint32,bool);
|
||||||
void _quit();
|
void _quit();
|
||||||
};
|
};
|
||||||
#include "end_code.h"
|
#include "end_code.h"
|
||||||
|
|
|
@ -57,7 +57,7 @@ Channel::Channel()
|
||||||
_id=-1;
|
_id=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Channel& Channel::playSound(Sound sound, int loops) throw (ErrorViewer)
|
Channel& Channel::playSound(Sound sound, int loops)
|
||||||
{
|
{
|
||||||
int cret=Mix_PlayChannel(_get(),sound._get(),loops);
|
int cret=Mix_PlayChannel(_get(),sound._get(),loops);
|
||||||
if(cret==-1)
|
if(cret==-1)
|
||||||
|
@ -70,7 +70,7 @@ Channel& Channel::playSound(Sound sound, int loops) throw (ErrorViewer)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Channel& Channel::fadeIn(Sound sound, int loops, int ms) throw (ErrorViewer)
|
Channel& Channel::fadeIn(Sound sound, int loops, int ms)
|
||||||
{
|
{
|
||||||
int cret=Mix_FadeInChannel(_get(),sound._get(),loops,ms);
|
int cret=Mix_FadeInChannel(_get(),sound._get(),loops,ms);
|
||||||
if(cret==-1)
|
if(cret==-1)
|
||||||
|
|
|
@ -28,8 +28,8 @@ private:
|
||||||
class Channel
|
class Channel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Channel& playSound(Sound sound,int loops) throw (ErrorViewer);
|
Channel& playSound(Sound sound,int loops);
|
||||||
Channel& fadeIn(Sound sound,int loops,int ms) throw (ErrorViewer);
|
Channel& fadeIn(Sound sound,int loops,int ms);
|
||||||
|
|
||||||
int fadeOut(int ms);
|
int fadeOut(int ms);
|
||||||
void pause();
|
void pause();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user