mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Compare commits
9 Commits
1.1.2
...
b9b7d91989
Author | SHA1 | Date | |
---|---|---|---|
|
b9b7d91989 | ||
|
3e13877788 | ||
|
53ff18d337 | ||
|
e33c01cc40 | ||
|
0c891d3117 | ||
|
e4d2d9f9a4 | ||
|
41c0312921 | ||
|
e78b01a5f3 | ||
|
d470bb5eeb |
@@ -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)
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -45,6 +45,7 @@ add_library(PortabilityLayer STATIC
|
||||
PortabilityLayer/BitmapImage.cpp
|
||||
PortabilityLayer/ByteSwap.cpp
|
||||
PortabilityLayer/CFileStream.cpp
|
||||
PortabilityLayer/CompositeRenderedFont.cpp
|
||||
PortabilityLayer/DeflateCodec.cpp
|
||||
PortabilityLayer/DialogManager.cpp
|
||||
PortabilityLayer/DisplayDeviceManager.cpp
|
||||
@@ -240,7 +241,8 @@ target_include_directories(GpApp PRIVATE
|
||||
target_link_libraries(GpApp PortabilityLayer)
|
||||
|
||||
if(CMAKE_HOST_UNIX)
|
||||
add_executable(${EXECNAME}
|
||||
set(EXEC_SOURCES )
|
||||
list(APPEND EXEC_SOURCES
|
||||
AerofoilPortable/GpSystemServices_POSIX.cpp
|
||||
AerofoilPortable/GpThreadEvent_Cpp11.cpp
|
||||
AerofoilPortable/GpAllocator_C.cpp
|
||||
@@ -258,7 +260,15 @@ if(CMAKE_HOST_UNIX)
|
||||
AerofoilX/GpFileSystem_X.cpp
|
||||
)
|
||||
|
||||
target_include_directories(${EXECNAME} PRIVATE
|
||||
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>
|
||||
@@ -267,8 +277,22 @@ if(CMAKE_HOST_UNIX)
|
||||
$<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")
|
||||
|
||||
target_link_libraries(${EXECNAME} ${SDL2_LIBRARIES} GpApp GpShell)
|
||||
add_executable(${EXECNAME} ${EXEC_SOURCES})
|
||||
target_include_directories(${EXECNAME} PRIVATE ${EXEC_INC_DIRS})
|
||||
target_link_libraries(${EXECNAME} ${EXEC_LIBS})
|
||||
endif()
|
||||
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user