Browse Source

Adding platform detection for shadow renderer

Josh Engebretson 11 years ago
parent
commit
1d7141539d
2 changed files with 16 additions and 0 deletions
  1. 5 0
      Bin/CoreData/AtomicModules/AtomicGame.js
  2. 11 0
      Source/Atomic/Javascript/JSAtomic.cpp

+ 5 - 0
Bin/CoreData/AtomicModules/AtomicGame.js

@@ -9,6 +9,11 @@ function Game() {
 	this.graphics = Atomic.GetGraphics();
 	this.input = Atomic.GetInput();
 
+    if (Atomic.platform == "Android") {
+        this.renderer.reuseShadowMaps = false;
+        this.renderer.shadowQuality = Atomic.SHADOWQUALITY_LOW_16BIT;
+    }
+
 }
 
 Game.prototype.init = function(start, update) {

+ 11 - 0
Source/Atomic/Javascript/JSAtomic.cpp

@@ -207,6 +207,17 @@ void jsapi_init_atomic(JSVM* vm)
     // Atomic
     duk_get_global_string(ctx, "Atomic");
 
+#ifdef ATOMIC_PLATFORM_OSX
+    duk_push_string(ctx, "Mac");
+    duk_put_prop_string(ctx, -2, "platform");
+#elif ATOMIC_PLATFORM_WINDOWS
+    duk_push_string(ctx, "Windows");
+    duk_put_prop_string(ctx, -2, "platform");
+#elif ATOMIC_PLATFORM_ANDROID
+    duk_push_string(ctx, "Android");
+    duk_put_prop_string(ctx, -2, "platform");
+#endif
+
     // Node registry
     duk_push_global_stash(ctx);
     duk_push_object(ctx);