mirror of
https://github.com/elasota/Aerofoil.git
synced 2026-02-04 10:38:52 +00:00
Compare commits
15 Commits
1.1.2
...
549e1ec3e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
549e1ec3e6 | ||
|
|
141b176574 | ||
|
|
18a0d3a42a | ||
|
|
af6d18829e | ||
|
|
4182a1a107 | ||
|
|
5643f464cc | ||
|
|
a04c5f10df | ||
|
|
3e13877788 | ||
|
|
53ff18d337 | ||
|
|
e33c01cc40 | ||
|
|
0c891d3117 | ||
|
|
e4d2d9f9a4 | ||
|
|
41c0312921 | ||
|
|
e78b01a5f3 | ||
|
|
d470bb5eeb |
@@ -15,8 +15,8 @@ android {
|
||||
}
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 30
|
||||
versionCode 16
|
||||
versionName "1.1.2"
|
||||
versionCode 17
|
||||
versionName "1.1.3"
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
arguments "APP_PLATFORM=android-16"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "GpThreadEvent_Cpp11.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
GpThreadEvent_Cpp11::GpThreadEvent_Cpp11(bool autoReset, bool startSignaled)
|
||||
: m_flag(startSignaled)
|
||||
, m_autoReset(autoReset)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "UTF8.h"
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__MACOS__)
|
||||
#if defined(__CYGWIN__) || defined(__MACOS__) || defined(__linux)
|
||||
typedef off_t off64_t;
|
||||
#define fstat64 fstat
|
||||
#define fseek64 fseek
|
||||
@@ -305,6 +305,8 @@ GpIOStream *GpFileSystem_X::OpenFileNested(PortabilityLayer::VirtualDirectory_t
|
||||
FILE *f = fopen(resolvedPath.c_str(), mode);
|
||||
if (!f)
|
||||
{
|
||||
fprintf(stderr, "GpFileSystem_X: Cannot open \"%s\"\n",
|
||||
resolvedPath.c_str());
|
||||
free(objStorage);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "GpApplicationName.h"
|
||||
#include "GpIOStream.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
#include "IGpVOSEventQueue.h"
|
||||
|
||||
#include <string>
|
||||
#ifdef __MACOS__
|
||||
#include "MacInit.h"
|
||||
#endif
|
||||
|
||||
GpXGlobals g_gpXGlobals;
|
||||
|
||||
@@ -28,7 +30,7 @@ IGpDisplayDriver *GpDriver_CreateDisplayDriver_SDL_GL2(const GpDisplayDriverProp
|
||||
IGpAudioDriver *GpDriver_CreateAudioDriver_SDL(const GpAudioDriverProperties &properties);
|
||||
IGpInputDriver *GpDriver_CreateInputDriver_SDL2_Gamepad(const GpInputDriverProperties &properties);
|
||||
|
||||
#ifdef __MACOS__
|
||||
#ifndef _WIN32
|
||||
int main(int argc, char *argv[])
|
||||
#else
|
||||
SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[])
|
||||
|
||||
@@ -3,16 +3,13 @@
|
||||
#include "IGpClipboardContents.h"
|
||||
#include "IGpThreadEvent.h"
|
||||
|
||||
#ifdef __MACOS__
|
||||
#include <SDL.h>
|
||||
#include <pthread.h>
|
||||
#else
|
||||
#include "SDL2/SDL.h"
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
struct GpSystemServices_X_ThreadStartParams
|
||||
{
|
||||
@@ -52,13 +49,19 @@ void *GpSystemServices_X::CreateThread(ThreadFunc_t threadFunc, void *context)
|
||||
if (!evt)
|
||||
return nullptr;
|
||||
|
||||
pthread_t *threadPtr = static_cast<pthread_t*>(malloc(sizeof(pthread_t)));
|
||||
if (!threadPtr)
|
||||
{
|
||||
evt->Destroy();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GpSystemServices_X_ThreadStartParams startParams;
|
||||
startParams.m_threadContext = context;
|
||||
startParams.m_threadFunc = threadFunc;
|
||||
startParams.m_threadStartEvent = evt;
|
||||
|
||||
pthread_t thread = nullptr;
|
||||
if (pthread_create(&thread, nullptr, StaticStartThread, &startParams) != 0)
|
||||
if (pthread_create(threadPtr, nullptr, StaticStartThread, &startParams) != 0)
|
||||
{
|
||||
evt->Destroy();
|
||||
return nullptr;
|
||||
@@ -67,7 +70,7 @@ void *GpSystemServices_X::CreateThread(ThreadFunc_t threadFunc, void *context)
|
||||
evt->Wait();
|
||||
evt->Destroy();
|
||||
|
||||
return thread;
|
||||
return static_cast<void*>(threadPtr);
|
||||
}
|
||||
|
||||
bool GpSystemServices_X::Beep() const
|
||||
|
||||
574
CMakeLists.txt
574
CMakeLists.txt
@@ -1,275 +1,299 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project (Aerofoil)
|
||||
SET(PLATFORM "X" CACHE STRING "Defines the target platform")
|
||||
SET(EXECNAME "AerofoilX" CACHE STRING "Defines the exec name")
|
||||
|
||||
message(${CMAKE_BINARY_DIR})
|
||||
|
||||
find_package(SDL2 REQUIRED)
|
||||
|
||||
if(PLATFORM STREQUAL "MAC")
|
||||
SET(EXECNAME "AerofoilMac" CACHE STRING "Defines the exec name" FORCE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
add_definitions(-D__MACOS__)
|
||||
endif()
|
||||
|
||||
message("Building ${EXECNAME} for: ${PLATFORM}")
|
||||
|
||||
add_definitions(-DGP_DEBUG_CONFIG=0)
|
||||
add_definitions(-DNDEBUG=1)
|
||||
|
||||
|
||||
add_library(stb STATIC
|
||||
stb/stb_image_write.c
|
||||
)
|
||||
|
||||
add_library(zlib STATIC
|
||||
zlib/adler32.c
|
||||
zlib/crc32.c
|
||||
zlib/deflate.c
|
||||
zlib/inffast.c
|
||||
zlib/inflate.c
|
||||
zlib/inftrees.c
|
||||
zlib/trees.c
|
||||
zlib/zutil.c
|
||||
)
|
||||
|
||||
add_library(MacRomanConversion STATIC
|
||||
MacRomanConversion/MacRomanConversion.cpp
|
||||
)
|
||||
|
||||
add_library(PortabilityLayer STATIC
|
||||
PortabilityLayer/AntiAliasTable.cpp
|
||||
PortabilityLayer/AppEventHandler.cpp
|
||||
PortabilityLayer/BinHex4.cpp
|
||||
PortabilityLayer/BitmapImage.cpp
|
||||
PortabilityLayer/ByteSwap.cpp
|
||||
PortabilityLayer/CFileStream.cpp
|
||||
PortabilityLayer/DeflateCodec.cpp
|
||||
PortabilityLayer/DialogManager.cpp
|
||||
PortabilityLayer/DisplayDeviceManager.cpp
|
||||
PortabilityLayer/EllipsePlotter.cpp
|
||||
PortabilityLayer/FileBrowserUI.cpp
|
||||
PortabilityLayer/FileManager.cpp
|
||||
PortabilityLayer/FileSectionStream.cpp
|
||||
PortabilityLayer/FontFamily.cpp
|
||||
PortabilityLayer/FontManager.cpp
|
||||
PortabilityLayer/FontRenderer.cpp
|
||||
PortabilityLayer/GPArchive.cpp
|
||||
PortabilityLayer/HostSuspendHook.cpp
|
||||
PortabilityLayer/IconLoader.cpp
|
||||
PortabilityLayer/InflateStream.cpp
|
||||
PortabilityLayer/InputManager.cpp
|
||||
PortabilityLayer/LinePlotter.cpp
|
||||
PortabilityLayer/MacBinary2.cpp
|
||||
PortabilityLayer/MacFileInfo.cpp
|
||||
PortabilityLayer/MacFileMem.cpp
|
||||
PortabilityLayer/MemoryManager.cpp
|
||||
PortabilityLayer/MemReaderStream.cpp
|
||||
PortabilityLayer/MenuManager.cpp
|
||||
PortabilityLayer/MMHandleBlock.cpp
|
||||
PortabilityLayer/PLApplication.cpp
|
||||
PortabilityLayer/PLButtonWidget.cpp
|
||||
PortabilityLayer/PLControlDefinitions.cpp
|
||||
PortabilityLayer/PLCore.cpp
|
||||
PortabilityLayer/PLCTabReducer.cpp
|
||||
PortabilityLayer/PLDialogs.cpp
|
||||
PortabilityLayer/PLDrivers.cpp
|
||||
PortabilityLayer/PLEditboxWidget.cpp
|
||||
PortabilityLayer/PLEventQueue.cpp
|
||||
PortabilityLayer/PLHacks.cpp
|
||||
PortabilityLayer/PLHandle.cpp
|
||||
PortabilityLayer/PLIconWidget.cpp
|
||||
PortabilityLayer/PLImageWidget.cpp
|
||||
PortabilityLayer/PLInvisibleWidget.cpp
|
||||
PortabilityLayer/PLKeyEncoding.cpp
|
||||
PortabilityLayer/PLLabelWidget.cpp
|
||||
PortabilityLayer/PLMenus.cpp
|
||||
PortabilityLayer/PLMovies.cpp
|
||||
PortabilityLayer/PLNumberFormatting.cpp
|
||||
PortabilityLayer/PLPopupMenuWidget.cpp
|
||||
PortabilityLayer/PLQDOffscreen.cpp
|
||||
PortabilityLayer/PLQDraw.cpp
|
||||
PortabilityLayer/PLResourceManager.cpp
|
||||
PortabilityLayer/PLResources.cpp
|
||||
PortabilityLayer/PLScrollBarWidget.cpp
|
||||
PortabilityLayer/PLSound.cpp
|
||||
PortabilityLayer/PLStandardColors.cpp
|
||||
PortabilityLayer/PLStringCompare.cpp
|
||||
PortabilityLayer/PLSysCalls.cpp
|
||||
PortabilityLayer/PLTimeTaggedVOSEvent.cpp
|
||||
PortabilityLayer/PLWidgets.cpp
|
||||
PortabilityLayer/QDGraf.cpp
|
||||
PortabilityLayer/QDManager.cpp
|
||||
PortabilityLayer/QDPictDecoder.cpp
|
||||
PortabilityLayer/QDPictEmitContext.cpp
|
||||
PortabilityLayer/QDPictHeader.cpp
|
||||
PortabilityLayer/QDPixMap.cpp
|
||||
PortabilityLayer/QDPort.cpp
|
||||
PortabilityLayer/QDStandardPalette.cpp
|
||||
PortabilityLayer/RandomNumberGenerator.cpp
|
||||
PortabilityLayer/ResolveCachingColor.cpp
|
||||
PortabilityLayer/ResourceCompiledRef.cpp
|
||||
PortabilityLayer/ResourceFile.cpp
|
||||
PortabilityLayer/ScanlineMask.cpp
|
||||
PortabilityLayer/ScanlineMaskBuilder.cpp
|
||||
PortabilityLayer/ScanlineMaskConverter.cpp
|
||||
PortabilityLayer/ScanlineMaskIterator.cpp
|
||||
PortabilityLayer/SimpleGraphic.cpp
|
||||
PortabilityLayer/TextPlacer.cpp
|
||||
PortabilityLayer/UTF8.cpp
|
||||
PortabilityLayer/WindowDef.cpp
|
||||
PortabilityLayer/WindowManager.cpp
|
||||
PortabilityLayer/WorkerThread.cpp
|
||||
PortabilityLayer/XModemCRC.cpp
|
||||
PortabilityLayer/ZipFileProxy.cpp
|
||||
)
|
||||
|
||||
target_include_directories(PortabilityLayer PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Common>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GpCommon>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/PortabilityLayer>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/zlib>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/rapidjson/include>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/MacRomanConversion>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/stb>
|
||||
)
|
||||
|
||||
target_compile_options(PortabilityLayer PRIVATE -Wno-multichar)
|
||||
|
||||
target_link_libraries(PortabilityLayer zlib MacRomanConversion stb)
|
||||
|
||||
|
||||
add_library(GpShell STATIC
|
||||
GpShell/GpAppEnvironment.cpp
|
||||
GpShell/GpAudioDriverFactory.cpp
|
||||
GpShell/GpDisplayDriverFactory.cpp
|
||||
GpShell/GpFontHandlerFactory.cpp
|
||||
GpShell/GpGlobalConfig.cpp
|
||||
GpShell/GpInputDriverFactory.cpp
|
||||
GpShell/GpMain.cpp
|
||||
GpShell/GpVOSEventQueue.cpp
|
||||
)
|
||||
|
||||
target_include_directories(GpShell PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Common>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GpCommon>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/PortabilityLayer>
|
||||
)
|
||||
|
||||
add_library(GpApp STATIC
|
||||
GpApp/About.cpp
|
||||
GpApp/AnimCursor.cpp
|
||||
GpApp/AppleEvents.cpp
|
||||
GpApp/Banner.cpp
|
||||
GpApp/ColorUtils.cpp
|
||||
GpApp/Coordinates.cpp
|
||||
GpApp/DialogUtils.cpp
|
||||
GpApp/DynamicMaps.cpp
|
||||
GpApp/Dynamics.cpp
|
||||
GpApp/Dynamics2.cpp
|
||||
GpApp/Dynamics3.cpp
|
||||
GpApp/Environ.cpp
|
||||
GpApp/Events.cpp
|
||||
GpApp/FileError.cpp
|
||||
GpApp/GameOver.cpp
|
||||
GpApp/GpAppInterface.cpp
|
||||
GpApp/Grease.cpp
|
||||
GpApp/HighScores.cpp
|
||||
GpApp/House.cpp
|
||||
GpApp/HouseInfo.cpp
|
||||
GpApp/HouseIO.cpp
|
||||
GpApp/HouseLegal.cpp
|
||||
GpApp/Input.cpp
|
||||
GpApp/Interactions.cpp
|
||||
GpApp/InterfaceInit.cpp
|
||||
GpApp/Link.cpp
|
||||
GpApp/Main.cpp
|
||||
GpApp/MainMenuUI.cpp
|
||||
GpApp/MainWindow.cpp
|
||||
GpApp/Map.cpp
|
||||
GpApp/Marquee.cpp
|
||||
GpApp/Menu.cpp
|
||||
GpApp/Modes.cpp
|
||||
GpApp/Music.cpp
|
||||
GpApp/ObjectAdd.cpp
|
||||
GpApp/ObjectDraw.cpp
|
||||
GpApp/ObjectDraw2.cpp
|
||||
GpApp/ObjectDrawAll.cpp
|
||||
GpApp/ObjectEdit.cpp
|
||||
GpApp/ObjectInfo.cpp
|
||||
GpApp/ObjectRects.cpp
|
||||
GpApp/Objects.cpp
|
||||
GpApp/Play.cpp
|
||||
GpApp/Player.cpp
|
||||
GpApp/Prefs.cpp
|
||||
GpApp/RectUtils.cpp
|
||||
GpApp/Render.cpp
|
||||
GpApp/Room.cpp
|
||||
GpApp/RoomGraphics.cpp
|
||||
GpApp/RoomInfo.cpp
|
||||
GpApp/RubberBands.cpp
|
||||
GpApp/SavedGames.cpp
|
||||
GpApp/Scoreboard.cpp
|
||||
GpApp/Scrap.cpp
|
||||
GpApp/SelectHouse.cpp
|
||||
GpApp/Settings.cpp
|
||||
GpApp/Sound.cpp
|
||||
GpApp/SoundSync_Cpp11.cpp
|
||||
GpApp/SourceExport.cpp
|
||||
GpApp/StringUtils.cpp
|
||||
GpApp/StructuresInit.cpp
|
||||
GpApp/StructuresInit2.cpp
|
||||
GpApp/Tools.cpp
|
||||
GpApp/Transit.cpp
|
||||
GpApp/Transitions.cpp
|
||||
GpApp/Triggers.cpp
|
||||
GpApp/Trip.cpp
|
||||
GpApp/Utilities.cpp
|
||||
GpApp/WindowUtils.cpp
|
||||
)
|
||||
|
||||
target_compile_options(GpApp PRIVATE -Wno-multichar)
|
||||
|
||||
target_include_directories(GpApp PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Common>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GpCommon>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/PortabilityLayer>
|
||||
)
|
||||
|
||||
target_link_libraries(GpApp PortabilityLayer)
|
||||
|
||||
if(CMAKE_HOST_UNIX)
|
||||
add_executable(${EXECNAME}
|
||||
AerofoilPortable/GpSystemServices_POSIX.cpp
|
||||
AerofoilPortable/GpThreadEvent_Cpp11.cpp
|
||||
AerofoilPortable/GpAllocator_C.cpp
|
||||
AerofoilSDL/GpAudioDriver_SDL2.cpp
|
||||
AerofoilSDL/GpDisplayDriver_SDL_GL2.cpp
|
||||
AerofoilSDL/GpInputDriver_SDL_Gamepad.cpp
|
||||
AerofoilSDL/ShaderCode/CopyQuadP.cpp
|
||||
AerofoilSDL/ShaderCode/DrawQuad32P.cpp
|
||||
AerofoilSDL/ShaderCode/DrawQuadPaletteP.cpp
|
||||
AerofoilSDL/ShaderCode/DrawQuadV.cpp
|
||||
AerofoilSDL/ShaderCode/ScaleQuadP.cpp
|
||||
AerofoilX/GpMain_SDL_X.cpp
|
||||
AerofoilX/GpLogDriver_X.cpp
|
||||
AerofoilX/GpSystemServices_X.cpp
|
||||
AerofoilX/GpFileSystem_X.cpp
|
||||
)
|
||||
|
||||
target_include_directories(${EXECNAME} PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Common>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GpCommon>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GpShell>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/AerofoilSDL>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/AerofoilPortable>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/PortabilityLayer>
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(${EXECNAME} ${SDL2_LIBRARIES} GpApp GpShell)
|
||||
endif()
|
||||
|
||||
|
||||
install (TARGETS ${EXECNAME})
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project (Aerofoil)
|
||||
SET(PLATFORM "X" CACHE STRING "Defines the target platform")
|
||||
SET(EXECNAME "AerofoilX" CACHE STRING "Defines the exec name")
|
||||
|
||||
message(${CMAKE_BINARY_DIR})
|
||||
|
||||
find_package(SDL2 REQUIRED)
|
||||
|
||||
if(PLATFORM STREQUAL "MAC")
|
||||
SET(EXECNAME "AerofoilMac" CACHE STRING "Defines the exec name" FORCE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
add_definitions(-D__MACOS__)
|
||||
endif()
|
||||
|
||||
message("Building ${EXECNAME} for: ${PLATFORM}")
|
||||
|
||||
add_definitions(-DGP_DEBUG_CONFIG=0)
|
||||
add_definitions(-DNDEBUG=1)
|
||||
|
||||
|
||||
add_library(stb STATIC
|
||||
stb/stb_image_write.c
|
||||
)
|
||||
|
||||
add_library(zlib STATIC
|
||||
zlib/adler32.c
|
||||
zlib/crc32.c
|
||||
zlib/deflate.c
|
||||
zlib/inffast.c
|
||||
zlib/inflate.c
|
||||
zlib/inftrees.c
|
||||
zlib/trees.c
|
||||
zlib/zutil.c
|
||||
)
|
||||
|
||||
add_library(MacRomanConversion STATIC
|
||||
MacRomanConversion/MacRomanConversion.cpp
|
||||
)
|
||||
|
||||
add_library(PortabilityLayer STATIC
|
||||
PortabilityLayer/AntiAliasTable.cpp
|
||||
PortabilityLayer/AppEventHandler.cpp
|
||||
PortabilityLayer/BinHex4.cpp
|
||||
PortabilityLayer/BitmapImage.cpp
|
||||
PortabilityLayer/ByteSwap.cpp
|
||||
PortabilityLayer/CFileStream.cpp
|
||||
PortabilityLayer/CompositeRenderedFont.cpp
|
||||
PortabilityLayer/DeflateCodec.cpp
|
||||
PortabilityLayer/DialogManager.cpp
|
||||
PortabilityLayer/DisplayDeviceManager.cpp
|
||||
PortabilityLayer/EllipsePlotter.cpp
|
||||
PortabilityLayer/FileBrowserUI.cpp
|
||||
PortabilityLayer/FileManager.cpp
|
||||
PortabilityLayer/FileSectionStream.cpp
|
||||
PortabilityLayer/FontFamily.cpp
|
||||
PortabilityLayer/FontManager.cpp
|
||||
PortabilityLayer/FontRenderer.cpp
|
||||
PortabilityLayer/GPArchive.cpp
|
||||
PortabilityLayer/HostSuspendHook.cpp
|
||||
PortabilityLayer/IconLoader.cpp
|
||||
PortabilityLayer/InflateStream.cpp
|
||||
PortabilityLayer/InputManager.cpp
|
||||
PortabilityLayer/LinePlotter.cpp
|
||||
PortabilityLayer/MacBinary2.cpp
|
||||
PortabilityLayer/MacFileInfo.cpp
|
||||
PortabilityLayer/MacFileMem.cpp
|
||||
PortabilityLayer/MemoryManager.cpp
|
||||
PortabilityLayer/MemReaderStream.cpp
|
||||
PortabilityLayer/MenuManager.cpp
|
||||
PortabilityLayer/MMHandleBlock.cpp
|
||||
PortabilityLayer/PLApplication.cpp
|
||||
PortabilityLayer/PLButtonWidget.cpp
|
||||
PortabilityLayer/PLControlDefinitions.cpp
|
||||
PortabilityLayer/PLCore.cpp
|
||||
PortabilityLayer/PLCTabReducer.cpp
|
||||
PortabilityLayer/PLDialogs.cpp
|
||||
PortabilityLayer/PLDrivers.cpp
|
||||
PortabilityLayer/PLEditboxWidget.cpp
|
||||
PortabilityLayer/PLEventQueue.cpp
|
||||
PortabilityLayer/PLHacks.cpp
|
||||
PortabilityLayer/PLHandle.cpp
|
||||
PortabilityLayer/PLIconWidget.cpp
|
||||
PortabilityLayer/PLImageWidget.cpp
|
||||
PortabilityLayer/PLInvisibleWidget.cpp
|
||||
PortabilityLayer/PLKeyEncoding.cpp
|
||||
PortabilityLayer/PLLabelWidget.cpp
|
||||
PortabilityLayer/PLMenus.cpp
|
||||
PortabilityLayer/PLMovies.cpp
|
||||
PortabilityLayer/PLNumberFormatting.cpp
|
||||
PortabilityLayer/PLPopupMenuWidget.cpp
|
||||
PortabilityLayer/PLQDOffscreen.cpp
|
||||
PortabilityLayer/PLQDraw.cpp
|
||||
PortabilityLayer/PLResourceManager.cpp
|
||||
PortabilityLayer/PLResources.cpp
|
||||
PortabilityLayer/PLScrollBarWidget.cpp
|
||||
PortabilityLayer/PLSound.cpp
|
||||
PortabilityLayer/PLStandardColors.cpp
|
||||
PortabilityLayer/PLStringCompare.cpp
|
||||
PortabilityLayer/PLSysCalls.cpp
|
||||
PortabilityLayer/PLTimeTaggedVOSEvent.cpp
|
||||
PortabilityLayer/PLWidgets.cpp
|
||||
PortabilityLayer/QDGraf.cpp
|
||||
PortabilityLayer/QDManager.cpp
|
||||
PortabilityLayer/QDPictDecoder.cpp
|
||||
PortabilityLayer/QDPictEmitContext.cpp
|
||||
PortabilityLayer/QDPictHeader.cpp
|
||||
PortabilityLayer/QDPixMap.cpp
|
||||
PortabilityLayer/QDPort.cpp
|
||||
PortabilityLayer/QDStandardPalette.cpp
|
||||
PortabilityLayer/RandomNumberGenerator.cpp
|
||||
PortabilityLayer/ResolveCachingColor.cpp
|
||||
PortabilityLayer/ResourceCompiledRef.cpp
|
||||
PortabilityLayer/ResourceFile.cpp
|
||||
PortabilityLayer/ScanlineMask.cpp
|
||||
PortabilityLayer/ScanlineMaskBuilder.cpp
|
||||
PortabilityLayer/ScanlineMaskConverter.cpp
|
||||
PortabilityLayer/ScanlineMaskIterator.cpp
|
||||
PortabilityLayer/SimpleGraphic.cpp
|
||||
PortabilityLayer/TextPlacer.cpp
|
||||
PortabilityLayer/UTF8.cpp
|
||||
PortabilityLayer/WindowDef.cpp
|
||||
PortabilityLayer/WindowManager.cpp
|
||||
PortabilityLayer/WorkerThread.cpp
|
||||
PortabilityLayer/XModemCRC.cpp
|
||||
PortabilityLayer/ZipFileProxy.cpp
|
||||
)
|
||||
|
||||
target_include_directories(PortabilityLayer PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Common>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GpCommon>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/PortabilityLayer>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/zlib>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/rapidjson/include>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/MacRomanConversion>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/stb>
|
||||
)
|
||||
|
||||
target_compile_options(PortabilityLayer PRIVATE -Wno-multichar)
|
||||
|
||||
target_link_libraries(PortabilityLayer zlib MacRomanConversion stb)
|
||||
|
||||
|
||||
add_library(GpShell STATIC
|
||||
GpShell/GpAppEnvironment.cpp
|
||||
GpShell/GpAudioDriverFactory.cpp
|
||||
GpShell/GpDisplayDriverFactory.cpp
|
||||
GpShell/GpFontHandlerFactory.cpp
|
||||
GpShell/GpGlobalConfig.cpp
|
||||
GpShell/GpInputDriverFactory.cpp
|
||||
GpShell/GpMain.cpp
|
||||
GpShell/GpVOSEventQueue.cpp
|
||||
)
|
||||
|
||||
target_include_directories(GpShell PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Common>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GpCommon>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/PortabilityLayer>
|
||||
)
|
||||
|
||||
add_library(GpApp STATIC
|
||||
GpApp/About.cpp
|
||||
GpApp/AnimCursor.cpp
|
||||
GpApp/AppleEvents.cpp
|
||||
GpApp/Banner.cpp
|
||||
GpApp/ColorUtils.cpp
|
||||
GpApp/Coordinates.cpp
|
||||
GpApp/DialogUtils.cpp
|
||||
GpApp/DynamicMaps.cpp
|
||||
GpApp/Dynamics.cpp
|
||||
GpApp/Dynamics2.cpp
|
||||
GpApp/Dynamics3.cpp
|
||||
GpApp/Environ.cpp
|
||||
GpApp/Events.cpp
|
||||
GpApp/FileError.cpp
|
||||
GpApp/GameOver.cpp
|
||||
GpApp/GpAppInterface.cpp
|
||||
GpApp/Grease.cpp
|
||||
GpApp/HighScores.cpp
|
||||
GpApp/House.cpp
|
||||
GpApp/HouseInfo.cpp
|
||||
GpApp/HouseIO.cpp
|
||||
GpApp/HouseLegal.cpp
|
||||
GpApp/Input.cpp
|
||||
GpApp/Interactions.cpp
|
||||
GpApp/InterfaceInit.cpp
|
||||
GpApp/Link.cpp
|
||||
GpApp/Main.cpp
|
||||
GpApp/MainMenuUI.cpp
|
||||
GpApp/MainWindow.cpp
|
||||
GpApp/Map.cpp
|
||||
GpApp/Marquee.cpp
|
||||
GpApp/Menu.cpp
|
||||
GpApp/Modes.cpp
|
||||
GpApp/Music.cpp
|
||||
GpApp/ObjectAdd.cpp
|
||||
GpApp/ObjectDraw.cpp
|
||||
GpApp/ObjectDraw2.cpp
|
||||
GpApp/ObjectDrawAll.cpp
|
||||
GpApp/ObjectEdit.cpp
|
||||
GpApp/ObjectInfo.cpp
|
||||
GpApp/ObjectRects.cpp
|
||||
GpApp/Objects.cpp
|
||||
GpApp/Play.cpp
|
||||
GpApp/Player.cpp
|
||||
GpApp/Prefs.cpp
|
||||
GpApp/RectUtils.cpp
|
||||
GpApp/Render.cpp
|
||||
GpApp/Room.cpp
|
||||
GpApp/RoomGraphics.cpp
|
||||
GpApp/RoomInfo.cpp
|
||||
GpApp/RubberBands.cpp
|
||||
GpApp/SavedGames.cpp
|
||||
GpApp/Scoreboard.cpp
|
||||
GpApp/Scrap.cpp
|
||||
GpApp/SelectHouse.cpp
|
||||
GpApp/Settings.cpp
|
||||
GpApp/Sound.cpp
|
||||
GpApp/SoundSync_Cpp11.cpp
|
||||
GpApp/SourceExport.cpp
|
||||
GpApp/StringUtils.cpp
|
||||
GpApp/StructuresInit.cpp
|
||||
GpApp/StructuresInit2.cpp
|
||||
GpApp/Tools.cpp
|
||||
GpApp/Transit.cpp
|
||||
GpApp/Transitions.cpp
|
||||
GpApp/Triggers.cpp
|
||||
GpApp/Trip.cpp
|
||||
GpApp/Utilities.cpp
|
||||
GpApp/WindowUtils.cpp
|
||||
)
|
||||
|
||||
target_compile_options(GpApp PRIVATE -Wno-multichar)
|
||||
|
||||
target_include_directories(GpApp PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Common>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GpCommon>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/PortabilityLayer>
|
||||
)
|
||||
|
||||
target_link_libraries(GpApp PortabilityLayer)
|
||||
|
||||
if(CMAKE_HOST_UNIX)
|
||||
set(EXEC_SOURCES )
|
||||
list(APPEND EXEC_SOURCES
|
||||
AerofoilPortable/GpSystemServices_POSIX.cpp
|
||||
AerofoilPortable/GpThreadEvent_Cpp11.cpp
|
||||
AerofoilPortable/GpAllocator_C.cpp
|
||||
AerofoilSDL/GpAudioDriver_SDL2.cpp
|
||||
AerofoilSDL/GpDisplayDriver_SDL_GL2.cpp
|
||||
AerofoilSDL/GpInputDriver_SDL_Gamepad.cpp
|
||||
AerofoilSDL/ShaderCode/CopyQuadP.cpp
|
||||
AerofoilSDL/ShaderCode/DrawQuad32P.cpp
|
||||
AerofoilSDL/ShaderCode/DrawQuadPaletteP.cpp
|
||||
AerofoilSDL/ShaderCode/DrawQuadV.cpp
|
||||
AerofoilSDL/ShaderCode/ScaleQuadP.cpp
|
||||
AerofoilX/GpMain_SDL_X.cpp
|
||||
AerofoilX/GpLogDriver_X.cpp
|
||||
AerofoilX/GpSystemServices_X.cpp
|
||||
AerofoilX/GpFileSystem_X.cpp
|
||||
)
|
||||
|
||||
set(EXEC_LIBS )
|
||||
list(APPEND EXEC_LIBS
|
||||
${SDL2_LIBRARIES}
|
||||
GpApp
|
||||
GpShell
|
||||
)
|
||||
|
||||
set(EXEC_INC_DIRS )
|
||||
list(APPEND EXEC_INC_DIRS
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Common>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GpCommon>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GpShell>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/AerofoilSDL>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/AerofoilPortable>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/PortabilityLayer>
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
)
|
||||
if(PLATFORM STREQUAL "MAC")
|
||||
list(APPEND EXEC_SOURCES
|
||||
AerofoilMac/AerofoilMac/AerofoilApplication.mm
|
||||
AerofoilMac/AerofoilMac/MacInit.mm
|
||||
)
|
||||
list(APPEND EXEC_INC_DIRS
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/AerofoilMac/AerofoilMac>
|
||||
)
|
||||
list(APPEND EXEC_LIBS
|
||||
"-framework Cocoa"
|
||||
)
|
||||
endif(PLATFORM STREQUAL "MAC")
|
||||
|
||||
add_executable(${EXECNAME} ${EXEC_SOURCES})
|
||||
target_include_directories(${EXECNAME} PRIVATE ${EXEC_INC_DIRS})
|
||||
target_link_libraries(${EXECNAME} ${EXEC_LIBS})
|
||||
endif()
|
||||
|
||||
|
||||
install (TARGETS ${EXECNAME})
|
||||
|
||||
@@ -336,7 +336,7 @@ void DisposCursors (void)
|
||||
|
||||
void IncrementCursor (void)
|
||||
{
|
||||
if (animCursorH == 0)
|
||||
if (animCursorH == nullptr)
|
||||
InitAnimatedCursor(nil);
|
||||
if (animCursorH)
|
||||
{
|
||||
@@ -356,7 +356,7 @@ void IncrementCursor (void)
|
||||
|
||||
void DecrementCursor (void)
|
||||
{
|
||||
if (animCursorH == 0)
|
||||
if (animCursorH == nullptr)
|
||||
InitAnimatedCursor(nil);
|
||||
if (animCursorH)
|
||||
{
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#define GP_BUILD_VERSION_MAJOR 1
|
||||
#define GP_BUILD_VERSION_MINOR 1
|
||||
#define GP_BUILD_VERSION_UPDATE 2
|
||||
#define GP_BUILD_VERSION_UPDATE 3
|
||||
|
||||
#define GP_APPLICATION_VERSION_STRING "1.1.2"
|
||||
#define GP_APPLICATION_COPYRIGHT_STRING "2019-2021 Gale Force Games LLC"
|
||||
#define GP_APPLICATION_VERSION_STRING "1.1.3"
|
||||
#define GP_APPLICATION_COPYRIGHT_STRING "2019-2022 Gale Force Games LLC"
|
||||
#define GP_APPLICATION_WEBSITE_STRING "https://github.com/elasota/Aerofoil"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
struct MMHandleBlock;
|
||||
@@ -24,6 +26,7 @@ class THandle final : public THandleBase
|
||||
{
|
||||
public:
|
||||
THandle();
|
||||
THandle(std::nullptr_t);
|
||||
THandle(T **hdl);
|
||||
explicit THandle(PortabilityLayer::MMHandleBlock *hdl);
|
||||
THandle(const THandle<T> &other);
|
||||
@@ -46,6 +49,9 @@ public:
|
||||
bool operator==(T** other) const;
|
||||
bool operator!=(T** other) const;
|
||||
|
||||
bool operator==(std::nullptr_t) const;
|
||||
bool operator!=(std::nullptr_t) const;
|
||||
|
||||
static THandle<T> NullPtr();
|
||||
};
|
||||
|
||||
@@ -74,6 +80,12 @@ inline THandle<T>::THandle()
|
||||
{
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline THandle<T>::THandle(std::nullptr_t)
|
||||
: THandleBase(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline THandle<T>::THandle(T **hdl)
|
||||
: THandleBase(reinterpret_cast<PortabilityLayer::MMHandleBlock*>(hdl))
|
||||
@@ -107,17 +119,33 @@ inline bool THandle<T>::operator!=(const THandle<T> &other) const
|
||||
template<class T>
|
||||
inline bool THandle<T>::operator==(T** other) const
|
||||
{
|
||||
if (other == nullptr)
|
||||
return m_hdl == nullptr;
|
||||
return static_cast<void*>(&m_hdl->m_contents) == static_cast<void*>(other);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline bool THandle<T>::operator!=(T** other) const
|
||||
{
|
||||
if (other == nullptr)
|
||||
return m_hdl != nullptr;
|
||||
return static_cast<void*>(&m_hdl->m_contents) != static_cast<void*>(other);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
THandle<T> THandle<T>::NullPtr()
|
||||
inline bool THandle<T>::operator==(std::nullptr_t) const
|
||||
{
|
||||
return m_hdl == nullptr;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline bool THandle<T>::operator!=(std::nullptr_t) const
|
||||
{
|
||||
return m_hdl != nullptr;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline THandle<T> THandle<T>::NullPtr()
|
||||
{
|
||||
return THandle<T>(static_cast<PortabilityLayer::MMHandleBlock *>(nullptr));
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "DeflateCodec.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -323,6 +324,11 @@ namespace PortabilityLayer
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (numFiles != 0)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool failed = false;
|
||||
|
||||
|
||||
@@ -53,7 +53,12 @@ class HIDDeviceUSB implements HIDDevice {
|
||||
public String getSerialNumber() {
|
||||
String result = null;
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
result = mDevice.getSerialNumber();
|
||||
try {
|
||||
result = mDevice.getSerialNumber();
|
||||
}
|
||||
catch (SecurityException exception) {
|
||||
//Log.w(TAG, "App permissions mean we cannot get serial number for device " + getDeviceName() + " message: " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
if (result == null) {
|
||||
result = "";
|
||||
|
||||
Reference in New Issue
Block a user