mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Fix building zilmar-spec with cmake with mingw
This commit is contained in:
parent
4a55160770
commit
1ad662092d
|
@ -135,7 +135,7 @@ set(GLideNUI_SOURCES
|
||||||
GLideNUI/icon.qrc
|
GLideNUI/icon.qrc
|
||||||
)
|
)
|
||||||
|
|
||||||
if(MUPENPLUSAPI_GLIDENUI)
|
if(MUPENPLUSAPI_GLIDENUI OR NOT MUPENPLUSAPI)
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
set(CMAKE_AUTOUIC ON)
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
@ -144,10 +144,16 @@ if(MUPENPLUSAPI_GLIDENUI)
|
||||||
set(GLIDENUI_LIBRARIES
|
set(GLIDENUI_LIBRARIES
|
||||||
Qt5::Widgets Qt5::Core Qt5::Gui
|
Qt5::Widgets Qt5::Core Qt5::Gui
|
||||||
)
|
)
|
||||||
list(APPEND GLideNUI_SOURCES
|
if (MUPENPLUSAPI)
|
||||||
GLideNUI/fullscreenresolutions_mupen64plus.cpp
|
list(APPEND GLideNUI_SOURCES
|
||||||
)
|
GLideNUI/fullscreenresolutions_mupen64plus.cpp
|
||||||
endif(MUPENPLUSAPI_GLIDENUI)
|
)
|
||||||
|
else()
|
||||||
|
list(APPEND GLideNUI_SOURCES
|
||||||
|
GLideNUI/fullscreenresolutions_windows.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
#check if we're running on Raspberry Pi
|
#check if we're running on Raspberry Pi
|
||||||
if(EXISTS "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/bcm_host.h" AND NOT MESA)
|
if(EXISTS "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/bcm_host.h" AND NOT MESA)
|
||||||
|
@ -208,15 +214,17 @@ else(MUPENPLUSAPI)
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
message(FATAL_ERROR "UNIX build requires MUPENPLUSAPI!")
|
message(FATAL_ERROR "UNIX build requires MUPENPLUSAPI!")
|
||||||
endif(UNIX)
|
endif(UNIX)
|
||||||
|
include_directories( . inc )
|
||||||
set(GLideN64_SOURCES_WIN
|
set(GLideN64_SOURCES_WIN
|
||||||
ZilmarPluginAPI.cpp
|
ZilmarPluginAPI.cpp
|
||||||
GLideNUI/Config_GLideNUI.cpp
|
GLideNUI/Config_GLideNUI.cpp
|
||||||
windows/CommonAPIImpl_windows.cpp
|
windows/CommonAPIImpl_windows.cpp
|
||||||
windows/GLideN64_windows.cpp
|
windows/GLideN64_windows.cpp
|
||||||
windows/MemoryStatus_windows.cpp
|
windows/MemoryStatus_windows.cpp
|
||||||
common/GLFunctions.cpp
|
|
||||||
windows/ZilmarAPIImpl_windows.cpp
|
windows/ZilmarAPIImpl_windows.cpp
|
||||||
Graphics/OpenGLContext/windows/windows_DisplayWindow.cpp
|
Graphics/OpenGLContext/windows/windows_DisplayWindow.cpp
|
||||||
|
Graphics/OpenGLContext/windows/WindowsWGL.cpp
|
||||||
|
${GLideNUI_SOURCES}
|
||||||
)
|
)
|
||||||
set(GLideN64_DLL_NAME GLideN64)
|
set(GLideN64_DLL_NAME GLideN64)
|
||||||
endif(MUPENPLUSAPI)
|
endif(MUPENPLUSAPI)
|
||||||
|
@ -253,6 +261,9 @@ if(MINGW)
|
||||||
add_definitions(
|
add_definitions(
|
||||||
-DMINGW
|
-DMINGW
|
||||||
)
|
)
|
||||||
|
if (NOT MUPENPLUSAPI)
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static")
|
||||||
|
endif()
|
||||||
endif(MINGW)
|
endif(MINGW)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
@ -362,6 +373,11 @@ if(ANDROID)
|
||||||
set(FREETYPE_LIBRARIES ANDROID_FREETYPE)
|
set(FREETYPE_LIBRARIES ANDROID_FREETYPE)
|
||||||
else(ANDROID)
|
else(ANDROID)
|
||||||
FIND_PACKAGE( Freetype REQUIRED )
|
FIND_PACKAGE( Freetype REQUIRED )
|
||||||
|
# presume a qt build linked to freetype
|
||||||
|
# will be used with mingw
|
||||||
|
if (NOT MUPENPLUSAPI AND MINGW)
|
||||||
|
set(FREETYPE_LIBRARIES "")
|
||||||
|
endif()
|
||||||
endif(ANDROID)
|
endif(ANDROID)
|
||||||
|
|
||||||
include_directories( ${FREETYPE_INCLUDE_DIRS} )
|
include_directories( ${FREETYPE_INCLUDE_DIRS} )
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <math.h>
|
||||||
#include "FullscreenResolutions.h"
|
#include "FullscreenResolutions.h"
|
||||||
#include "../Config.h"
|
#include "../Config.h"
|
||||||
|
|
||||||
|
|
|
@ -35,30 +35,30 @@ bool WindowsWGL::start()
|
||||||
hWnd = GetActiveWindow();
|
hWnd = GetActiveWindow();
|
||||||
|
|
||||||
if ((hDC = GetDC(hWnd)) == NULL) {
|
if ((hDC = GetDC(hWnd)) == NULL) {
|
||||||
MessageBox(hWnd, L"Error while getting a device context!", pluginNameW, MB_ICONERROR | MB_OK);
|
MessageBoxW(hWnd, L"Error while getting a device context!", pluginNameW, MB_ICONERROR | MB_OK);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pixelFormat = ChoosePixelFormat(hDC, &pfd)) == 0) {
|
if ((pixelFormat = ChoosePixelFormat(hDC, &pfd)) == 0) {
|
||||||
MessageBox(hWnd, L"Unable to find a suitable pixel format!", pluginNameW, MB_ICONERROR | MB_OK);
|
MessageBoxW(hWnd, L"Unable to find a suitable pixel format!", pluginNameW, MB_ICONERROR | MB_OK);
|
||||||
stop();
|
stop();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((SetPixelFormat(hDC, pixelFormat, &pfd)) == FALSE) {
|
if ((SetPixelFormat(hDC, pixelFormat, &pfd)) == FALSE) {
|
||||||
MessageBox(hWnd, L"Error while setting pixel format!", pluginNameW, MB_ICONERROR | MB_OK);
|
MessageBoxW(hWnd, L"Error while setting pixel format!", pluginNameW, MB_ICONERROR | MB_OK);
|
||||||
stop();
|
stop();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((hRC = wglCreateContext(hDC)) == NULL) {
|
if ((hRC = wglCreateContext(hDC)) == NULL) {
|
||||||
MessageBox(hWnd, L"Error while creating OpenGL context!", pluginNameW, MB_ICONERROR | MB_OK);
|
MessageBoxW(hWnd, L"Error while creating OpenGL context!", pluginNameW, MB_ICONERROR | MB_OK);
|
||||||
stop();
|
stop();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((wglMakeCurrent(hDC, hRC)) == FALSE) {
|
if ((wglMakeCurrent(hDC, hRC)) == FALSE) {
|
||||||
MessageBox(hWnd, L"Error while making OpenGL context current!", pluginNameW, MB_ICONERROR | MB_OK);
|
MessageBoxW(hWnd, L"Error while making OpenGL context current!", pluginNameW, MB_ICONERROR | MB_OK);
|
||||||
stop();
|
stop();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ void DisplayWindowWindows::_changeWindow()
|
||||||
fullscreenMode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
|
fullscreenMode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
|
||||||
|
|
||||||
if (ChangeDisplaySettings( &fullscreenMode, CDS_FULLSCREEN ) != DISP_CHANGE_SUCCESSFUL) {
|
if (ChangeDisplaySettings( &fullscreenMode, CDS_FULLSCREEN ) != DISP_CHANGE_SUCCESSFUL) {
|
||||||
MessageBox( NULL, L"Failed to change display mode", pluginNameW, MB_ICONERROR | MB_OK );
|
MessageBoxW( NULL, L"Failed to change display mode", pluginNameW, MB_ICONERROR | MB_OK );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ EXPORT int CALL osal_is_directory(const wchar_t* _name)
|
||||||
namelen = wcslen(DirName);
|
namelen = wcslen(DirName);
|
||||||
if (namelen > 0 && DirName[namelen - 1] == OSAL_DIR_SEPARATOR_CHAR)
|
if (namelen > 0 && DirName[namelen - 1] == OSAL_DIR_SEPARATOR_CHAR)
|
||||||
DirName[namelen - 1] = L'\0';
|
DirName[namelen - 1] = L'\0';
|
||||||
return (GetFileAttributes(DirName) & FILE_ATTRIBUTE_DIRECTORY);
|
return (GetFileAttributesW(DirName) & FILE_ATTRIBUTE_DIRECTORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT int CALL osal_mkdirp(const wchar_t * dirpath)
|
EXPORT int CALL osal_mkdirp(const wchar_t * dirpath)
|
||||||
|
@ -108,7 +108,7 @@ EXPORT int CALL osal_mkdirp(const wchar_t * dirpath)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
HANDLE hFind;
|
HANDLE hFind;
|
||||||
WIN32_FIND_DATA find_data;
|
WIN32_FIND_DATAW find_data;
|
||||||
} dir_search_info;
|
} dir_search_info;
|
||||||
|
|
||||||
EXPORT void * CALL osal_search_dir_open(const wchar_t *pathname)
|
EXPORT void * CALL osal_search_dir_open(const wchar_t *pathname)
|
||||||
|
@ -128,7 +128,7 @@ EXPORT void * CALL osal_search_dir_open(const wchar_t *pathname)
|
||||||
swprintf(SearchString, MAX_PATH, L"%ls%ls*", pathname, OSAL_DIR_SEPARATOR_STR);
|
swprintf(SearchString, MAX_PATH, L"%ls%ls*", pathname, OSAL_DIR_SEPARATOR_STR);
|
||||||
SearchString[MAX_PATH] = 0;
|
SearchString[MAX_PATH] = 0;
|
||||||
|
|
||||||
pInfo->hFind = FindFirstFile(SearchString, &pInfo->find_data);
|
pInfo->hFind = FindFirstFileW(SearchString, &pInfo->find_data);
|
||||||
return (void *) pInfo;
|
return (void *) pInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ EXPORT const wchar_t * CALL osal_search_dir_read_next(void * search_info)
|
||||||
|
|
||||||
wcscpy(last_filename, pInfo->find_data.cFileName);
|
wcscpy(last_filename, pInfo->find_data.cFileName);
|
||||||
|
|
||||||
if (FindNextFile(pInfo->hFind, &pInfo->find_data) == 0)
|
if (FindNextFileW(pInfo->hFind, &pInfo->find_data) == 0)
|
||||||
{
|
{
|
||||||
pInfo->find_data.cFileName[0] = 0;
|
pInfo->find_data.cFileName[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ void PluginAPI::FindPluginPath(wchar_t * _strPath)
|
||||||
{
|
{
|
||||||
if (_strPath == NULL)
|
if (_strPath == NULL)
|
||||||
return;
|
return;
|
||||||
::GetModuleFileName((HINSTANCE)&__ImageBase, _strPath, PLUGIN_PATH_SIZE);
|
::GetModuleFileNameW((HINSTANCE)&__ImageBase, _strPath, PLUGIN_PATH_SIZE);
|
||||||
std::wstring pluginPath(_strPath);
|
std::wstring pluginPath(_strPath);
|
||||||
std::replace(pluginPath.begin(), pluginPath.end(), L'\\', L'/');
|
std::replace(pluginPath.begin(), pluginPath.end(), L'\\', L'/');
|
||||||
std::wstring::size_type pos = pluginPath.find_last_of(L"/");
|
std::wstring::size_type pos = pluginPath.find_last_of(L"/");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user