Windows 2000 support, part 1
This commit is contained in:
parent
f5a6a9ed6c
commit
1ec49d3557
|
@ -188,7 +188,7 @@ list(APPEND DEPENDENCIES_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
|||
if (WIN32)
|
||||
# support Windows XP
|
||||
if (SUPPORT_XP)
|
||||
list(APPEND DEPENDENCIES_DEFINES "_WIN32_WINNT=0x0501")
|
||||
list(APPEND DEPENDENCIES_DEFINES "_WIN32_WINNT=0x0500")
|
||||
list(APPEND DEPENDENCIES_DEFINES "SUPPORT_XP")
|
||||
else()
|
||||
# support Windows Vista
|
||||
|
|
|
@ -16,7 +16,7 @@ fi
|
|||
cd xpbuild
|
||||
|
||||
# TODO: potential Arch-ism?
|
||||
i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS="-O2" -DCMAKE_CXX_FLAGS="-O2 -Wall -Wextra -Wno-unused-parameter -Wno-cast-function-type" -DBUILD_SHARED_LIBS=OFF -DSUPPORT_XP=ON -DWITH_RENDER_DX11=OFF -DSDL_SSE=OFF -DSDL_SSE2=OFF -DSDL_SSE3=OFF -DENABLE_SSE=OFF -DENABLE_SSE2=OFF -DENABLE_AVX=OFF -DENABLE_AVX2=OFF -DUSE_BACKWARD=ON -DCONSOLE_SUBSYSTEM=OFF -DWITH_LOCALE=ON -DUSE_MOMO=ON -DFORCE_CODEVIEW=ON .. || exit 1
|
||||
i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS="-O2" -DCMAKE_CXX_FLAGS="-O2 -Wall -Wextra -Wno-unused-parameter -Wno-cast-function-type" -DBUILD_SHARED_LIBS=OFF -DSUPPORT_XP=ON -DWITH_RENDER_DX11=OFF -DSDL_SSE=OFF -DSDL_SSE2=OFF -DSDL_SSE3=OFF -DENABLE_SSE=OFF -DENABLE_SSE2=OFF -DENABLE_AVX=OFF -DENABLE_AVX2=OFF -DUSE_BACKWARD=OFF -DCONSOLE_SUBSYSTEM=OFF -DWITH_LOCALE=ON -DUSE_MOMO=ON -DFORCE_CODEVIEW=OFF .. || exit 1
|
||||
make -j8 || exit 1
|
||||
|
||||
cd ..
|
||||
|
|
|
@ -35,7 +35,7 @@ String getWinConfigPath() {
|
|||
if (!PathIsDirectoryW(configPath.c_str())) {
|
||||
logI("creating config dir...");
|
||||
int mkdirRet;
|
||||
if ((mkdirRet=SHCreateDirectory(NULL,configPath.c_str()))!=ERROR_SUCCESS) {
|
||||
if ((mkdirRet=SHCreateDirectoryExW(NULL,configPath.c_str(),NULL))!=ERROR_SUCCESS) {
|
||||
logW("could not make config dir! (%.8x)",mkdirRet);
|
||||
configPath=L".";
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ bool dirExists(const char* what) {
|
|||
|
||||
bool makeDir(const char* path) {
|
||||
#ifdef _WIN32
|
||||
return (SHCreateDirectory(NULL,utf8To16(path).c_str())==ERROR_SUCCESS);
|
||||
return (SHCreateDirectoryExW(NULL,utf8To16(path).c_str(),NULL)==ERROR_SUCCESS);
|
||||
#else
|
||||
return (mkdir(path,0755)==0);
|
||||
#endif
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <nfd.h>
|
||||
#elif defined(ANDROID)
|
||||
#include <SDL.h>
|
||||
#else
|
||||
#elif (!defined(SUPPORT_XP) || !defined(_WIN32))
|
||||
#include "../../extern/pfd-fixed/portable-file-dialogs.h"
|
||||
#endif
|
||||
|
||||
|
@ -176,9 +176,12 @@ bool FurnaceGUIFileDialog::openLoad(String header, std::vector<String> filter, S
|
|||
jniEnv->DeleteLocalRef(class_);
|
||||
jniEnv->DeleteLocalRef(activity);
|
||||
return true;
|
||||
#else
|
||||
#elif (!defined(SUPPORT_XP) || !defined(_WIN32))
|
||||
dialogO=new pfd::open_file(header,path,filter,allowMultiple?(pfd::opt::multiselect):(pfd::opt::none));
|
||||
hasError=!pfd::settings::available();
|
||||
#else
|
||||
hasError=true;
|
||||
return false;
|
||||
#endif
|
||||
} else {
|
||||
hasError=false;
|
||||
|
@ -268,9 +271,12 @@ bool FurnaceGUIFileDialog::openSave(String header, std::vector<String> filter, S
|
|||
jniEnv->DeleteLocalRef(class_);
|
||||
jniEnv->DeleteLocalRef(activity);
|
||||
return true;
|
||||
#else
|
||||
#elif (!defined(SUPPORT_XP) || !defined(_WIN32))
|
||||
dialogS=new pfd::save_file(header,path,filter);
|
||||
hasError=!pfd::settings::available();
|
||||
#else
|
||||
hasError=true;
|
||||
return false;
|
||||
#endif
|
||||
} else {
|
||||
hasError=false;
|
||||
|
@ -312,9 +318,12 @@ bool FurnaceGUIFileDialog::openSelectDir(String header, String path, double dpiS
|
|||
#elif defined(ANDROID)
|
||||
hasError=true;
|
||||
return false;
|
||||
#else
|
||||
#elif (!defined(SUPPORT_XP) || !defined(_WIN32))
|
||||
dialogF=new pfd::select_folder(header,path);
|
||||
hasError=!pfd::settings::available();
|
||||
#else
|
||||
hasError=true;
|
||||
return false;
|
||||
#endif
|
||||
} else {
|
||||
hasError=false;
|
||||
|
@ -407,7 +416,7 @@ bool FurnaceGUIFileDialog::render(const ImVec2& min, const ImVec2& max) {
|
|||
#elif defined(ANDROID)
|
||||
// TODO: detect when file picker is closed
|
||||
return false;
|
||||
#else
|
||||
#elif (!defined(SUPPORT_XP) || !defined(_WIN32))
|
||||
if (dialogType==2) {
|
||||
if (dialogF!=NULL) {
|
||||
if (dialogF->ready(0)) {
|
||||
|
@ -455,6 +464,8 @@ bool FurnaceGUIFileDialog::render(const ImVec2& min, const ImVec2& max) {
|
|||
logE("what!");
|
||||
}
|
||||
return false;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
} else {
|
||||
return ImGuiFileDialog::Instance()->Display("FileDialog",ImGuiWindowFlags_NoCollapse|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoScrollWithMouse,min,max);
|
||||
|
|
|
@ -19,12 +19,14 @@
|
|||
|
||||
#elif defined(ANDROID)
|
||||
#include <jni.h>
|
||||
#else
|
||||
#elif (!defined(SUPPORT_XP) || !defined(_WIN32))
|
||||
namespace pfd {
|
||||
class open_file;
|
||||
class save_file;
|
||||
class select_folder;
|
||||
}
|
||||
#else
|
||||
// nothing
|
||||
#endif
|
||||
|
||||
typedef std::function<void(const char*)> FileDialogSelectCallback;
|
||||
|
@ -48,10 +50,14 @@ class FurnaceGUIFileDialog {
|
|||
void* dialogO;
|
||||
void* dialogS;
|
||||
void* dialogF;
|
||||
#else
|
||||
#elif (!defined(SUPPORT_XP) || !defined(_WIN32))
|
||||
pfd::open_file* dialogO;
|
||||
pfd::save_file* dialogS;
|
||||
pfd::select_folder* dialogF;
|
||||
#else
|
||||
unsigned char* dialogO;
|
||||
unsigned char* dialogS;
|
||||
unsigned char* dialogF;
|
||||
#endif
|
||||
|
||||
void convertFilterList(std::vector<String>& filter);
|
||||
|
|
|
@ -545,12 +545,14 @@ int main(int argc, char** argv) {
|
|||
// Windows console thing - thanks dj.tuBIG/MaliceX
|
||||
#ifdef _WIN32
|
||||
#ifndef TA_SUBSYSTEM_CONSOLE
|
||||
#ifndef SUPPORT_XP
|
||||
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
freopen("CONIN$", "r", stdin);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
srand(time(NULL));
|
||||
|
|
Loading…
Reference in a new issue