forked from elasota/Aerofoil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More Android stub-outs and bug fixes. Fix broken SDL fiber sync.
- Loading branch information
Showing
63 changed files
with
1,445 additions
and
635 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
AerofoilSDL | ||
Common | ||
FreeType | ||
GpApp | ||
GpCommon | ||
GpFontHandler_FreeType2 | ||
GpShell | ||
MacRomanConversion | ||
PortabilityLayer | ||
rapidjson | ||
SDL2 | ||
stb | ||
zlib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
struct GpAndroidGlobals | ||
{ | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#include "GpFileSystem_Android.h" | ||
|
||
GpFileSystem_Android::GpFileSystem_Android() | ||
{ | ||
} | ||
|
||
bool GpFileSystem_Android::FileExists(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path) | ||
{ | ||
return false; | ||
} | ||
|
||
bool GpFileSystem_Android::FileLocked(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool *exists) | ||
{ | ||
return false; | ||
} | ||
|
||
GpIOStream *GpFileSystem_Android::OpenFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool writeAccess, GpFileCreationDisposition_t createDisposition) | ||
{ | ||
return nullptr; | ||
} | ||
|
||
bool GpFileSystem_Android::DeleteFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool &existed) | ||
{ | ||
existed = false; | ||
return false; | ||
} | ||
|
||
PortabilityLayer::HostDirectoryCursor *GpFileSystem_Android::ScanDirectory(PortabilityLayer::VirtualDirectory_t virtualDirectory) | ||
{ | ||
return nullptr; | ||
} | ||
|
||
bool GpFileSystem_Android::ValidateFilePath(const char *path, size_t length) const | ||
{ | ||
for (size_t i = 0; i < length; i++) | ||
{ | ||
const char c = path[i]; | ||
if (c >= '0' && c <= '9') | ||
continue; | ||
|
||
if (c == '_' || c == '.' || c == '\'') | ||
continue; | ||
|
||
if (c == ' ' && i != 0 && i != length - 1) | ||
continue; | ||
|
||
if (c >= 'a' && c <= 'z') | ||
continue; | ||
|
||
if (c >= 'A' && c <= 'Z') | ||
continue; | ||
|
||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
bool GpFileSystem_Android::ValidateFilePathUnicodeChar(uint32_t c) const | ||
{ | ||
if (c >= '0' && c <= '9') | ||
return true; | ||
|
||
if (c == '_' || c == '\'') | ||
return true; | ||
|
||
if (c == ' ') | ||
return true; | ||
|
||
if (c >= 'a' && c <= 'z') | ||
return true; | ||
|
||
if (c >= 'A' && c <= 'Z') | ||
return true; | ||
|
||
return false; | ||
} | ||
|
||
GpFileSystem_Android *GpFileSystem_Android::GetInstance() | ||
{ | ||
return &ms_instance; | ||
} | ||
|
||
GpFileSystem_Android GpFileSystem_Android::ms_instance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#pragma once | ||
|
||
#include "HostFileSystem.h" | ||
|
||
#include "GpCoreDefs.h" | ||
|
||
class GpFileSystem_Android final : public PortabilityLayer::HostFileSystem | ||
{ | ||
public: | ||
GpFileSystem_Android(); | ||
|
||
bool FileExists(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path) override; | ||
bool FileLocked(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool *exists) override; | ||
GpIOStream *OpenFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool writeAccess, GpFileCreationDisposition_t createDisposition) override; | ||
bool DeleteFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool &existed) override; | ||
PortabilityLayer::HostDirectoryCursor *ScanDirectory(PortabilityLayer::VirtualDirectory_t virtualDirectory) override; | ||
|
||
bool ValidateFilePath(const char *path, size_t sz) const override; | ||
bool ValidateFilePathUnicodeChar(uint32_t ch) const override; | ||
|
||
static GpFileSystem_Android *GetInstance(); | ||
|
||
private: | ||
bool ResolvePath(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, wchar_t *outPath); | ||
|
||
static GpFileSystem_Android ms_instance; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.