mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge branch 'travis' of https://github.com/anyc/OpenRCT2 into anyc-travis
This commit is contained in:
commit
72a615c530
39
.travis.yml
39
.travis.yml
|
@ -1,18 +1,33 @@
|
||||||
language: c
|
language: c
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- echo "yes" | sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
|
|
||||||
- echo "yes" | sudo apt-add-repository ppa:openmw/deps
|
|
||||||
- sudo apt-key update -qq
|
|
||||||
- sudo apt-get update -qq
|
- sudo apt-get update -qq
|
||||||
- sudo apt-get install -y --force-yes binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 libsdl2-static-dev libc6-dev-i386
|
- sudo apt-get install -y --force-yes binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686
|
||||||
- ls -al /usr/bin
|
|
||||||
- ls -al /usr/include/SDL2
|
# fetch precompiled SDL2 + headers for MinGW and push it into the expected directory
|
||||||
- sudo mv /usr/include/SDL2 /usr/include/sdl2
|
- export SDL2_PV=2.0.3
|
||||||
|
- wget http://libsdl.org/release/SDL2-devel-${SDL2_PV}-mingw.tar.gz
|
||||||
|
- tar -xzvf SDL2-devel-${SDL2_PV}-mingw.tar.gz
|
||||||
|
|
||||||
|
# but first fix SDL2 bug
|
||||||
|
- wget "https://github.com/anyc/anyc-overlay/raw/master/media-libs/libsdl2-mingw/files/libsdl2-mingw-2.0.3-fix-platform-detection-for-mingw.patch"
|
||||||
|
- pushd SDL2-${SDL2_PV}/i686-w64-mingw32/include/SDL2/ && patch -p2 < ../../../../libsdl2-mingw-2.0.3-fix-platform-detection-for-mingw.patch && popd
|
||||||
|
|
||||||
|
- sudo mkdir -p /usr/local/cross-tools/
|
||||||
|
- sudo mv SDL2-${SDL2_PV}/i686-w64-mingw32 /usr/local/cross-tools/
|
||||||
|
|
||||||
|
# build a wrapper that looks for the sdl2.pc file in the new directory
|
||||||
|
- echo -e "#! /bin/sh\\nexport PKG_CONFIG_LIBDIR=/usr/local/cross-tools/i686-w64-mingw32/lib/pkgconfig\\npkg-config \$@" > i686-w64-mingw32-pkg-config
|
||||||
|
- chmod +x i686-w64-mingw32-pkg-config
|
||||||
|
- sudo mv i686-w64-mingw32-pkg-config /usr/local/bin/
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- sudo find / -name SDL2 2>>/dev/null || true
|
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- pushd build && cmake -DCMAKE_TOOLCHAIN_FILE=../CMakeLists_mingw.txt -DCMAKE_BUILD_TYPE=Debug .. && popd
|
- pushd build
|
||||||
- sudo find / -name stubs-32.h 2>>/dev/null || true
|
- cmake -DCMAKE_TOOLCHAIN_FILE=../CMakeLists_mingw.txt -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
- pushd build && C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu/bits:/usr/include/sdl2:$C_INCLUDE_PATH make && popd
|
- make
|
||||||
|
#- make VERBOSE=1
|
||||||
|
- popd
|
||||||
|
|
||||||
#notifications:
|
#notifications:
|
||||||
#irc: "irc.freenode.net#openrct2"
|
#irc: "irc.freenode.net#openrct2"
|
|
@ -25,31 +25,33 @@ project(${PROJECT})
|
||||||
|
|
||||||
add_definitions(-DORCT2_RESOURCE_DIR="${ORCT2_RESOURCE_DIR}")
|
add_definitions(-DORCT2_RESOURCE_DIR="${ORCT2_RESOURCE_DIR}")
|
||||||
|
|
||||||
# include lodepng
|
# include lodepng header
|
||||||
include_directories("lodepng/")
|
include_directories("lodepng/")
|
||||||
|
# add source files
|
||||||
file(GLOB_RECURSE ORCT2_SOURCES "src/*.c" "lodepng/*.c")
|
file(GLOB_RECURSE ORCT2_SOURCES "src/*.c" "lodepng/*.c")
|
||||||
|
|
||||||
# build as library for now, replace with add_executable
|
|
||||||
add_library(${PROJECT} SHARED ${ORCT2_SOURCES})
|
|
||||||
|
|
||||||
# install into ${CMAKE_INSTALL_PREFIX}/bin/
|
|
||||||
install (TARGETS ${PROJECT} DESTINATION bin)
|
|
||||||
|
|
||||||
# libopenrct2.dll -> openrct2.dll
|
|
||||||
set_target_properties(${PROJECT} PROPERTIES PREFIX "")
|
|
||||||
|
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
# force 32bit build for now and set necessary flags to compile code as is
|
# force 32bit build for now and set necessary flags to compile code as is
|
||||||
set(CMAKE_C_FLAGS "-m32 -masm=intel -std=c99")
|
set(CMAKE_C_FLAGS "-m32 -masm=intel -std=gnu99")
|
||||||
set(CMAKE_LDFLAGS_FLAGS "-m32")
|
set(CMAKE_LDFLAGS_FLAGS "-m32")
|
||||||
|
|
||||||
# find and include SDL2
|
# find and include SDL2
|
||||||
INCLUDE(FindPkgConfig)
|
INCLUDE(FindPkgConfig)
|
||||||
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
|
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
|
||||||
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS})
|
||||||
TARGET_LINK_LIBRARIES(${PROJECT} ${SDL2_LIBRARIES})
|
|
||||||
endif (UNIX)
|
endif (UNIX)
|
||||||
|
|
||||||
|
LINK_DIRECTORIES(${SDL2_LIBRARY_DIRS})
|
||||||
|
|
||||||
|
# build as library for now, replace with add_executable
|
||||||
|
add_library(${PROJECT} SHARED ${ORCT2_SOURCES})
|
||||||
|
|
||||||
|
# install into ${CMAKE_INSTALL_PREFIX}/bin/
|
||||||
|
#install (TARGETS ${PROJECT} DESTINATION bin)
|
||||||
|
|
||||||
|
# libopenrct2.dll -> openrct2.dll
|
||||||
|
set_target_properties(${PROJECT} PROPERTIES PREFIX "")
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(${PROJECT} ${SDL2_LIBRARIES})
|
TARGET_LINK_LIBRARIES(${PROJECT} ${SDL2_LIBRARIES})
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
|
@ -16,14 +16,12 @@ set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc" CACHE STRING "" FORCE)
|
||||||
include_directories("/usr/include/wine/windows/")
|
include_directories("/usr/include/wine/windows/")
|
||||||
|
|
||||||
# find and include SDL2
|
# find and include SDL2
|
||||||
# INCLUDE(FindPkgConfig)
|
INCLUDE(FindPkgConfig)
|
||||||
# PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
|
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
|
||||||
INCLUDE_DIRECTORIES("/usr/include")
|
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS})
|
||||||
INCLUDE_DIRECTORIES("/usr/include/x86_64-linux-gnu")
|
|
||||||
INCLUDE_DIRECTORIES("/usr/include/sdl2")
|
|
||||||
|
|
||||||
# here is the target environment located
|
# here is the target environment located
|
||||||
SET(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX})
|
#SET(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX})
|
||||||
|
|
||||||
# adjust the default behaviour of the FIND_XXX() commands:
|
# adjust the default behaviour of the FIND_XXX() commands:
|
||||||
# search headers and libraries in the target environment, search
|
# search headers and libraries in the target environment, search
|
||||||
|
|
|
@ -52,6 +52,7 @@ typedef unsigned long long uint64;
|
||||||
#else
|
#else
|
||||||
#define RCT2_ERROR(format,...) fprintf(stderr, "ERROR %s:%s():%d: " format "\n", __FILE__, __func__, __LINE__, __VA_ARGS__);
|
#define RCT2_ERROR(format,...) fprintf(stderr, "ERROR %s:%s():%d: " format "\n", __FILE__, __func__, __LINE__, __VA_ARGS__);
|
||||||
#endif
|
#endif
|
||||||
|
#define RCT2_ERR(msg) RCT2_ERROR("%s",msg)
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
// use similar struct packing as MSVC for our structs
|
// use similar struct packing as MSVC for our structs
|
||||||
|
|
|
@ -169,7 +169,7 @@ static int scenario_scores_load()
|
||||||
// Try and load the scores file
|
// Try and load the scores file
|
||||||
file = fopen(get_file_path(PATH_ID_SCORES), "rb");
|
file = fopen(get_file_path(PATH_ID_SCORES), "rb");
|
||||||
if (file == NULL) {
|
if (file == NULL) {
|
||||||
RCT2_ERROR("Unable to load scenario scores.");
|
RCT2_ERR("Unable to load scenario scores.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ static int scenario_scores_load()
|
||||||
rct_scenario_scores_header header;
|
rct_scenario_scores_header header;
|
||||||
if (fread(&header, 16, 1, file) != 1) {
|
if (fread(&header, 16, 1, file) != 1) {
|
||||||
fclose(file);
|
fclose(file);
|
||||||
RCT2_ERROR("Invalid header in scenario scores file.");
|
RCT2_ERR("Invalid header in scenario scores file.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
gScenarioListCount = header.scenario_count;
|
gScenarioListCount = header.scenario_count;
|
||||||
|
@ -210,7 +210,7 @@ int scenario_scores_save()
|
||||||
|
|
||||||
file = fopen(get_file_path(PATH_ID_SCORES), "wb");
|
file = fopen(get_file_path(PATH_ID_SCORES), "wb");
|
||||||
if (file == NULL) {
|
if (file == NULL) {
|
||||||
RCT2_ERROR("Unable to save scenario scores.");
|
RCT2_ERR("Unable to save scenario scores.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,11 @@ static void window_map_close()
|
||||||
{
|
{
|
||||||
rct_window *w;
|
rct_window *w;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
__asm mov w, esi
|
__asm mov w, esi
|
||||||
|
#else
|
||||||
|
__asm__ ( "mov %[w], esi " : [w] "+m" (w) );
|
||||||
|
#endif
|
||||||
|
|
||||||
rct2_free(RCT2_GLOBAL(RCT2_ADDRESS_MAP_IMAGE_DATA, uint32*));
|
rct2_free(RCT2_GLOBAL(RCT2_ADDRESS_MAP_IMAGE_DATA, uint32*));
|
||||||
if ((RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3)) &&
|
if ((RCT2_GLOBAL(0x009DE518, uint32) & (1 << 3)) &&
|
||||||
|
|
Loading…
Reference in New Issue