1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 03:33:48 +00:00

Support vs15

This commit is contained in:
fgenesis 2016-08-06 19:50:07 +02:00
parent d49531f486
commit 93ac73179f
7 changed files with 46 additions and 42 deletions

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef BBGE_BUILD_WINDOWS #ifdef BBGE_BUILD_WINDOWS
#define WIN32_NOMINMAX #define WIN32_NOMINMAX
#ifdef _MSC_VER #if defined(_MSC_VER) && _MSC_VER <= 1600
#define strtof (float)strtod #define strtof (float)strtod
#define snprintf _snprintf #define snprintf _snprintf
#endif #endif
@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(disable:4786) #pragma warning(disable:4786)
#pragma warning(disable:4005) //#pragma warning(disable:4005)
#pragma warning(disable:4305) #pragma warning(disable:4305)
#pragma warning(disable:4018) // signed/unsigned mismatch #pragma warning(disable:4018) // signed/unsigned mismatch

View file

@ -65,37 +65,10 @@ Core *core = 0;
static std::ofstream _logOut; static std::ofstream _logOut;
#ifdef BBGE_BUILD_WINDOWS
HICON icon_windows = 0;
#endif
#ifndef KMOD_GUI #ifndef KMOD_GUI
#define KMOD_GUI KMOD_META #define KMOD_GUI KMOD_META
#endif #endif
void Core::initIcon()
{
#ifdef BBGE_BUILD_WINDOWS
HINSTANCE handle = ::GetModuleHandle(NULL);
icon_windows = ::LoadIcon(handle, "icon");
SDL_SysWMinfo wminfo;
SDL_VERSION(&wminfo.version)
if (SDL_GetWindowWMInfo(gScreen, &wminfo) != 1)
{
}
HWND hwnd = wminfo.info.win.window;
::SetClassLong(hwnd, GCL_HICON, (LONG) icon_windows);
#endif
}
void Core::resetCamera() void Core::resetCamera()
{ {
cameraPos = Vector(0,0); cameraPos = Vector(0,0);
@ -783,7 +756,7 @@ bool Core::initGraphicsLibrary(int width, int height, bool fullscreen, int vsync
setWindowCaption(appName, appName); setWindowCaption(appName, appName);
initIcon(); initIcon(gScreen);
// Create window // Create window
setSDLGLAttributes(); setSDLGLAttributes();
@ -988,14 +961,7 @@ void Core::shutdownGraphicsLibrary(bool killVideo)
lib_graphics = false; lib_graphics = false;
#ifdef BBGE_BUILD_WINDOWS destroyIcon();
if (icon_windows)
{
::DestroyIcon(icon_windows);
icon_windows = 0;
}
#endif
} }
void Core::quit() void Core::quit()

View file

@ -478,8 +478,6 @@ protected:
int virtualOffX, virtualOffY; int virtualOffX, virtualOffY;
void initIcon();
float old_dt; float old_dt;
float current_dt; float current_dt;

View file

@ -5,7 +5,7 @@
#include "ttvfs_stdio.h" #include "ttvfs_stdio.h"
#ifdef BBGE_BUILD_WINDOWS #ifdef BBGE_BUILD_WINDOWS
# define WIN32_LEAN_AND_MEAN //# define WIN32_LEAN_AND_MEAN
# define WIN32_NOMINMAX # define WIN32_NOMINMAX
# include <windows.h> # include <windows.h>
# undef min # undef min
@ -49,6 +49,43 @@ static std::string _CFToStdString(CFStringRef cs)
#endif #endif
#include "SDL.h" #include "SDL.h"
#include "SDL_syswm.h"
#ifdef BBGE_BUILD_WINDOWS
static HICON icon_windows = 0;
#endif
void initIcon(void *screen)
{
#ifdef BBGE_BUILD_WINDOWS
HINSTANCE handle = ::GetModuleHandle(NULL);
if(!icon_windows)
icon_windows = ::LoadIcon(handle, "icon");
SDL_SysWMinfo wminfo;
SDL_VERSION(&wminfo.version)
#ifdef BBGE_BUILD_SDL2
SDL_GetWindowWMInfo((SDL_Window*)screen, &wminfo);
#else
SDL_GetWindowWMInfo((SDL_Surface*)screen, &wminfo);
#endif
HWND hwnd = wminfo.info.win.window;
::SetClassLongPtr(hwnd, -14, (LONG) icon_windows); // -14 is GCL_HICON (32bit) or GCLP_HICON (64bit)
#endif
}
void destroyIcon()
{
#ifdef BBGE_BUILD_WINDOWS
if (icon_windows)
{
::DestroyIcon(icon_windows);
icon_windows = 0;
}
#endif
}
void openURL(const std::string &url) void openURL(const std::string &url)

View file

@ -3,6 +3,8 @@
#include <string> #include <string>
void initIcon(void *screen);
void destroyIcon();
void messageBox(const std::string &title, const std::string& msg); void messageBox(const std::string &title, const std::string& msg);
void forEachFile(const std::string& inpath, std::string type, void callback(const std::string &filename, intptr_t param), intptr_t param); void forEachFile(const std::string& inpath, std::string type, void callback(const std::string &filename, intptr_t param), intptr_t param);
std::string adjustFilenameCase(const char *_buf); std::string adjustFilenameCase(const char *_buf);

View file

@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "MathFunctions.h" #include "MathFunctions.h"
#include "Base.h" #include "Base.h"
#include <float.h> #include <float.h>
#include <algorithm>
/*************************************************************************/ /*************************************************************************/

View file

@ -393,7 +393,6 @@ SET(AQUARIA_SRCS
${SRCDIR}/AquariaMenuItem.cpp ${SRCDIR}/AquariaMenuItem.cpp
${SRCDIR}/AquariaProgressBar.cpp ${SRCDIR}/AquariaProgressBar.cpp
${SRCDIR}/AquariaSaveSlot.cpp ${SRCDIR}/AquariaSaveSlot.cpp
${SRCDIR}/AutoMap.cpp
${SRCDIR}/Avatar.cpp ${SRCDIR}/Avatar.cpp
${SRCDIR}/Beam.cpp ${SRCDIR}/Beam.cpp
${SRCDIR}/BitBlotLogo.cpp ${SRCDIR}/BitBlotLogo.cpp
@ -482,6 +481,7 @@ SET(BBGE_SRCS
${BBGEDIR}/Event.cpp ${BBGEDIR}/Event.cpp
${BBGEDIR}/FrameBuffer.cpp ${BBGEDIR}/FrameBuffer.cpp
${BBGEDIR}/Gradient.cpp ${BBGEDIR}/Gradient.cpp
${BBGEDIR}/GLLoad.cpp
${BBGEDIR}/Joystick.cpp ${BBGEDIR}/Joystick.cpp
${BBGEDIR}/LensFlare.cpp ${BBGEDIR}/LensFlare.cpp
${BBGEDIR}/Localization.cpp ${BBGEDIR}/Localization.cpp