diff --git a/CMakeLists.txt b/CMakeLists.txt index b4bffc9244..71bed12c0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -642,7 +642,6 @@ find_package(SDL2_mixer REQUIRED) find_package(SDL2_image REQUIRED) find_package(Tolua++ REQUIRED) find_package(ZLIB REQUIRED) -find_package(OpenMP) if(WIN32) find_package(MakeNSIS) @@ -654,9 +653,6 @@ find_package(MNG) find_package(OggVorbis) find_package(Theora) -find_package(X11) - -find_package(Sqlite) find_package(Doxygen) find_package(SelfPackers) @@ -691,8 +687,6 @@ option(WITH_OGGVORBIS "Compile Stratagus with OGG/Vorbis sound library" ON) option(WITH_THEORA "Compile Stratagus with Theroa video library" ON) option(WITH_STACKTRACE "Compile Stratagus with StackTrace library" ON) -option(WITH_X11 "Compile Stratagus with X11 clipboard pasting support" ON) - option(ENABLE_DOC "Generate Stratagus source code documentation with Doxygen" OFF) option(ENABLE_DEV "Install Stratagus game development headers files" OFF) option(ENABLE_UPX "Compress Stratagus executable binary with UPX packer" OFF) @@ -764,12 +758,6 @@ if(WITH_STACKTRACE AND STACKTRACE_FOUND) set(stratagus_LIBS ${stratagus_LIBS} ${STACKTRACE_LIBRARY}) endif() -if(WITH_X11 AND X11_FOUND) - add_definitions(-DUSE_X11) - include_directories(${X11_INCLUDE_DIR}) - set(stratagus_LIBS ${stratagus_LIBS} ${X11_X11_LIB}) -endif() - # Platform definitions if(WIN32) @@ -1024,7 +1012,6 @@ log_package("Mng" "MNG") log_package("Ogg/Vorbis" "OGGVORBIS") log_package("StackTrace" "STACKTRACE") log_package("Theora" "THEORA") -log_package("X11" "X11") message("==================================") @@ -1076,11 +1063,6 @@ else () endif () target_link_libraries(stratagus ${stratagus_LIBS}) -if(OpenMP_CXX_FOUND) - target_compile_options(stratagus PRIVATE ${OpenMP_CXX_FLAGS}) - target_link_libraries(stratagus OpenMP::OpenMP_CXX) -endif() - if(CMAKE_BUILD_TYPE STREQUAL "Debug") set_target_properties(stratagus PROPERTIES OUTPUT_NAME stratagus-dbg) endif() diff --git a/HOWTO-NEW-RELEASE b/HOWTO-NEW-RELEASE index 6d54953c7c..cdb9fa688b 100644 --- a/HOWTO-NEW-RELEASE +++ b/HOWTO-NEW-RELEASE @@ -13,6 +13,9 @@ Increase version and update changelog for debian: Update copyright information for Debian: debian/copyright +It's a good idea to ensure the debian build works before taggging: + gbp buildpackage + Tag the new release in https://github.com/Wargus/win32-stratagus-dependencies and wait for it to run through on the Appveyor CI. This will automatically cause a release with the tag name to be created, and the windows dependencies diff --git a/debian/compat b/debian/compat index 7f8f011eb7..ec635144f6 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +9 diff --git a/debian/control b/debian/control index df660830ef..637539ee19 100644 --- a/debian/control +++ b/debian/control @@ -4,11 +4,9 @@ Priority: optional Maintainer: cybermind Build-Depends: debhelper (>= 7), cmake (>= 2.6), doxygen, imagemagick, sharutils, liblua5.1-dev | liblua5.1-0-dev, libtolua++5.1-dev, - zlib1g-dev, libbz2-dev, libpng12-dev (>= 1.2.5) | libpng-dev (>= 1.2.5), - libmng-dev, libmikmod2-dev, libogg-dev, libvorbis-dev, libtheora-dev, - libsdl1.2-dev (>> 1.2.2), libx11-dev, libsqlite3-dev, - libgles1-sgx-img-dev | libglu1-mesa-dev | libglu-dev | libgles1-mesa-dev, - libsdl-gles1.2-dev | libglu1-mesa-dev | libglu-dev, libfluidsynth-dev + zlib1g-dev, libbz2-dev, libsdl2-dev, libsdl2-image-dev, libsdl2-mixer-dev, + libogg-dev, libvorbis-dev, libtheora-dev, libmng-dev, + libpng12-dev (>= 1.2.5) | libpng-dev (>= 1.2.5) Standards-Version: 3.9.6 Homepage: https://github.com/Wargus/stratagus Vcs-Browser: https://github.com/Wargus/stratagus diff --git a/debian/source/format b/debian/source/format index 163aaf8d82..89ae9db8f8 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff --git a/src/stratagus/mainloop.cpp b/src/stratagus/mainloop.cpp index c9f248d762..3b08a9814d 100644 --- a/src/stratagus/mainloop.cpp +++ b/src/stratagus/mainloop.cpp @@ -357,12 +357,6 @@ static void DisplayLoop() // program, as we now still have a game on the background and // need to go through the game-menu or supply a map file UpdateDisplay(); - - // - // If double-buffered mode, we will display the contains of - // VideoMemory. If direct mode this does nothing. In X11 it does - // XFlush - // RealizeVideoMemory(); } #ifdef REALVIDEO diff --git a/src/stratagus/stratagus.cpp b/src/stratagus/stratagus.cpp index 805201e456..7b302014eb 100644 --- a/src/stratagus/stratagus.cpp +++ b/src/stratagus/stratagus.cpp @@ -342,9 +342,6 @@ static void PrintHeader() #endif #ifdef USE_MAC "MAC " -#endif -#ifdef USE_X11 - "X11 " #endif ""; diff --git a/src/stratagus/util.cpp b/src/stratagus/util.cpp index d961cffeb0..eafee8288e 100644 --- a/src/stratagus/util.cpp +++ b/src/stratagus/util.cpp @@ -31,6 +31,8 @@ #include "util.h" +#include "SDL.h" + #include #include #include @@ -49,11 +51,6 @@ #include "st_backtrace.h" #endif -#ifdef USE_X11 -#include -#include -#endif - /*---------------------------------------------------------------------------- -- Random ----------------------------------------------------------------------------*/ @@ -384,92 +381,14 @@ int getopt(int argc, char *const *argv, const char *opts) */ int GetClipboard(std::string &str) { -#if defined(USE_WIN32) || defined(USE_X11) - int i; - unsigned char *clipboard; -#ifdef USE_WIN32 - HGLOBAL handle; -#elif defined(USE_X11) - Display *display; - Window window; - Atom rettype; - unsigned long nitem; - unsigned long dummy; - int retform; - XEvent event; -#endif - -#ifdef USE_WIN32 - if (!IsClipboardFormatAvailable(CF_TEXT) || !OpenClipboard(NULL)) { - return -1; - } - handle = GetClipboardData(CF_TEXT); - if (!handle) { - CloseClipboard(); - return -1; - } - clipboard = (unsigned char *)GlobalLock(handle); - if (!clipboard) { - CloseClipboard(); - return -1; - } -#elif defined(USE_X11) - if (!(display = XOpenDisplay(NULL))) { - return -1; - } - - // Creates a non maped temporary X window to hold the selection - if (!(window = XCreateSimpleWindow(display, - DefaultRootWindow(display), 0, 0, 1, 1, 0, 0, 0))) { - XCloseDisplay(display); - return -1; - } - - XConvertSelection(display, XA_PRIMARY, XA_STRING, XA_STRING, - window, CurrentTime); - - XNextEvent(display, &event); - - if (event.type != SelectionNotify || event.xselection.property != XA_STRING) { - return -1; - } - - XGetWindowProperty(display, window, XA_STRING, 0, 1024, False, - XA_STRING, &rettype, &retform, &nitem, &dummy, &clipboard); - - XDestroyWindow(display, window); - XCloseDisplay(display); - - if (rettype != XA_STRING || retform != 8) { - if (clipboard != NULL) { - XFree(clipboard); - } - clipboard = NULL; - } - - if (clipboard == NULL) { + char* txt = SDL_GetClipboardText(); + if (txt) { + str = txt; + free(txt); + return 0; + } else { return -1; } -#endif - // Only allow ascii characters - for (i = 0; clipboard[i] != '\0'; ++i) { - if (clipboard[i] < 32 || clipboard[i] > 126) { - return -1; - } - } - str = (char *)clipboard; -#ifdef USE_WIN32 - GlobalUnlock(handle); - CloseClipboard(); -#elif defined(USE_X11) - if (clipboard != NULL) { - XFree(clipboard); - } -#endif - return 0; -#else - return -1; -#endif } diff --git a/tools/genversion.cpp b/tools/genversion.cpp index 0d62f20db6..f589e057f9 100644 --- a/tools/genversion.cpp +++ b/tools/genversion.cpp @@ -66,7 +66,7 @@ int main(int argc, char * argv[]) { if ( file ) { git_rev = (char*)calloc(sizeof(char), 1024); if (fscanf(file, "ref: %s", git_rev) != 1 ) { - fscanf(file, "%s", git_rev); + int ignored = fscanf(file, "%s", git_rev); } fclose(file); gitrevfile = (char*)calloc(sizeof(char), strlen(git_rev) + 6); @@ -75,7 +75,7 @@ int main(int argc, char * argv[]) { free(gitrevfile); if (file) { git_rev = (char*)calloc(sizeof(char), 1024); - fscanf(file, "%s", git_rev); + int ignored = fscanf(file, "%s", git_rev); fclose(file); } } else {