Fixed compilation with SDL/mingw

This commit is contained in:
xawotihs
2025-05-11 17:08:37 +02:00
parent 0023c4a086
commit 00e076fca4
5 changed files with 57 additions and 12 deletions

View File

@@ -198,7 +198,17 @@ elseif(backend_sdl)
${Boost_INCLUDE_DIRS} ${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
add_executable(wagic ${MTG_generic_src} ${MTG_sdl_src} src/TestSuiteAI.cpp src/AIPlayerBakaB.cpp)
link_directories(${Boost_LIBRARY_DIR} ${SDL2_LIBRARY_DIR})
target_link_libraries(wagic ${JGE_LIBRARY} ${SDL2_LIBRARY} ${OPENGL_LIBRARIES} ${TINYXML_LIBRARIES} ${BOOST_date_time} ${HGE_LIBRARY} ${ZLIB_LIBRARIES})
target_link_libraries(wagic PRIVATE
${JGE_LIBRARY}
${PNG_LIBRARIES} # Explicitly link libpng
${ZIPFS_LIBRARY} # Explicitly link libzipFS
${SDL2_LIBRARY}
${OPENGL_LIBRARIES}
${TINYXML_LIBRARIES}
${HGE_LIBRARY}
${BOOST_date_time}
${ZLIB_LIBRARIES} # Ensure zlib is linked
)
endif()
elseif(backend_psp)
if(PSP)

View File

@@ -804,7 +804,7 @@ bool SdlApp::OnInit()
return true;
};
#if (defined ANDROID)
#if (defined ANDROID) || (defined WIN32)
int SDL_main(int argc, char * argv[])
#else
int main(int argc, char* argv[])

View File

@@ -5,6 +5,7 @@
#include "Translate.h"
#include "PriceList.h"
#include "Subtypes.h"
#include <random>
//WSyncable
bool WSyncable::Hook(WSyncable* s)
@@ -285,7 +286,10 @@ bool WSrcCards::setOffset(int pos)
void WSrcCards::Shuffle()
{
std::random_shuffle(cards.begin(), cards.end());
std::random_device rd;
std::mt19937 g(rd());
std::shuffle (cards.begin(), cards.end(), g);
validate();
}