Skip to content

Commit

Permalink
Remove PNaCl support from Oryol
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Apr 13, 2017
1 parent b013835 commit 886412e
Show file tree
Hide file tree
Showing 56 changed files with 42 additions and 1,219 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A small, portable and extensible 3D coding framework written in C++:

- simple [Orthodox C++](https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b) coding style and APIs
- extensible through external code modules living in git repositories
- runs on OSX, Linux (incl RaspberryPi), Windows, iOS, Android, emscripten, PNaCl from the same C++ source
- runs on OSX, Linux (incl RaspberryPi), Windows, iOS, Android, emscripten, from the same C++ source
- renders through GL, GLES2, WebGL, Metal, D3D11 from same shader source
- produces small executables (e.g. emscripten WebGL demos starting at around 100 Kbytes)
- async data loading from web or disc
Expand Down
8 changes: 1 addition & 7 deletions code/Modules/Core/App.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include "Core/Trace.h"
#if ORYOL_EMSCRIPTEN
#include <emscripten/emscripten.h>
#elif ORYOL_PNACL
#include "Core/pnacl/pnaclInstance.h"
#elif ORYOL_IOS
#include "Core/ios/iosBridge.h"
#elif ORYOL_MACOS && ORYOL_METAL
Expand Down Expand Up @@ -82,8 +80,6 @@ App::StartMainLoop() {
// empty
}
this->androidBridge->onStop();
#elif ORYOL_PNACL
pnaclInstance::Instance()->startMainLoop(this);
#elif ORYOL_UWP
// do nothing here
#else
Expand All @@ -92,9 +88,7 @@ App::StartMainLoop() {
}
#endif

// NOTE: PNaCl and UWP are the only platform where StartMainLoop
// returns while the app continues running!
#if !(ORYOL_PNACL || ORYOL_UWP)
#if !ORYOL_UWP
Log::Info("<= App::StartMainLoop()\n");
Core::Discard();
#endif
Expand Down
7 changes: 0 additions & 7 deletions code/Modules/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,6 @@ fips_begin_module(Core)
fips_files(osxBridge.h osxBridge.mm osxInputDefs.h)
fips_frameworks_osx(Cocoa Metal MetalKit QuartzCore)
endif()
if (FIPS_PNACL)
fips_dir(pnacl)
fips_files(
pnaclInstance.cc pnaclInstance.h
pnaclModule.cc pnaclModule.h
)
endif()
fips_dir(.)
fips_files(Trace.h Trace.cc)
if (FIPS_PROFILING AND (FIPS_LINUX OR FIPS_MACOS OR FIPS_WINDOWS))
Expand Down
30 changes: 3 additions & 27 deletions code/Modules/Core/Log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
#if ORYOL_ANDROID
#include <android/log.h>
#endif
#if ORYOL_PNACL
#include "Core/pnacl/pnaclInstance.h"
#endif

#if ORYOL_WINDOWS || ORYOL_PNACL
#if ORYOL_WINDOWS
const int LogBufSize = 4 * 1024;
#endif

Expand Down Expand Up @@ -158,7 +155,7 @@ Log::vprint(Level lvl, const char* msg, va_list args) {
}
__android_log_vprint(pri, "oryol", msg, args);
#else
#if ORYOL_WINDOWS || ORYOL_PNACL
#if ORYOL_WINDOWS
va_list argsCopy;
va_copy(argsCopy, args);
#endif
Expand All @@ -167,25 +164,12 @@ Log::vprint(Level lvl, const char* msg, va_list args) {
// va_list, so we made a copy before if necessary
std::vprintf(msg, args);

#if ORYOL_WINDOWS || ORYOL_PNACL
#if ORYOL_WINDOWS
char buf[LogBufSize];
std::vsnprintf(buf, sizeof(buf), msg, argsCopy);
#if ORYOL_WINDOWS
buf[LogBufSize - 1] = 0;
OutputDebugStringA(buf);
#elif ORYOL_PNACL
// replace non-jsonable characters
char* p = buf;
do {
if (*p == '"') *p = '\'';
else if (*p == '\n') *p = ' ';
}
while (*p++);
char json[LogBufSize + 64];
std::snprintf(json, sizeof(json), "{\"msg\":\"log\",\"val\":\"%s\"}", buf);
if (pnaclInstance::HasInstance()) {
pnaclInstance::Instance()->putMsg(json);
}
#endif
#endif
#endif
Expand Down Expand Up @@ -217,14 +201,6 @@ Log::AssertMsg(const char* cond, const char* msg, const char* file, int line, co
cond, msg ? msg : "none", file, line, func, callstack);
buf[LogBufSize - 1] = 0;
OutputDebugStringA(buf);
#elif ORYOL_PNACL
if (pnaclInstance::HasInstance()) {
char buf[LogBufSize];
std::snprintf(buf, sizeof(buf), "{\"msg\":\"log\",\"val\":\"\n\n*** ORYOL ASSERT: %s\n msg=%s\n file=%s\n line=%d\n func=%s callstack:\n%s\n\"}",
cond, msg ? msg : "none", file, line, func, callstack);
buf[LogBufSize - 1] = 0;
pnaclInstance::Instance()->putMsg(buf);
}
#endif
#endif
}
Expand Down
15 changes: 0 additions & 15 deletions code/Modules/Core/Main.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include "Core/uwp/uwpBridge.h"
#elif ORYOL_ANDROID
#include "Core/android/android_native_app_glue.h"
#elif ORYOL_PNACL
#include "Core/pnacl/pnaclModule.h"
#endif
#include "Core/App.h"
#include "Core/String/WideString.h"
Expand Down Expand Up @@ -62,19 +60,6 @@ void android_main(struct android_app* app_) { \
app->StartMainLoop(); \
Oryol::Memory::Delete<clazz>(app); \
}
#elif ORYOL_PNACL
#define OryolMain(clazz) \
namespace pp \
{ \
Module* CreateModule() \
{ \
return Memory::New<Oryol::_priv::pnaclModule>(); \
}; \
} \
void PNaclAppCreator() {\
static clazz* app = Memory::New<clazz>(); \
app->StartMainLoop(); \
}
#else
#define OryolMain(clazz) \
Oryol::Args OryolArgs; \
Expand Down
2 changes: 1 addition & 1 deletion code/Modules/Core/StackTrace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#if !ORYOL_UWP
#define HAVE_STACKWALKER (1)
#endif
#elif ORYOL_EMSCRIPTEN||ORYOL_ANDROID||ORYOL_PNACL
#elif ORYOL_EMSCRIPTEN||ORYOL_ANDROID
#define HAVE_BACKTRACE (0)
#define HAVE_STACKWALKER (0)
#else
Expand Down
203 changes: 0 additions & 203 deletions code/Modules/Core/pnacl/pnaclInstance.cc

This file was deleted.

Loading

0 comments on commit 886412e

Please sign in to comment.