Begin work on Module support
This commit is contained in:
@@ -12,7 +12,7 @@ import flash.Lib;
|
||||
#end
|
||||
|
||||
|
||||
class Application {
|
||||
class Application extends Module {
|
||||
|
||||
|
||||
public static var onUpdate = new Event<Int->Void> ();
|
||||
@@ -30,6 +30,8 @@ class Application {
|
||||
|
||||
public function new () {
|
||||
|
||||
super ();
|
||||
|
||||
__instance = this;
|
||||
|
||||
windows = new Array ();
|
||||
|
||||
14
lime/app/Module.hx
Normal file
14
lime/app/Module.hx
Normal file
@@ -0,0 +1,14 @@
|
||||
package lime.app;
|
||||
|
||||
|
||||
class Module {
|
||||
|
||||
|
||||
public function new () {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
20
lime/vm/NekoVM.hx
Normal file
20
lime/vm/NekoVM.hx
Normal file
@@ -0,0 +1,20 @@
|
||||
package lime.vm;
|
||||
|
||||
|
||||
import lime.system.System;
|
||||
|
||||
|
||||
class NekoVM {
|
||||
|
||||
|
||||
public static function loadModule (path:String):Void {
|
||||
|
||||
lime_neko_execute (path);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static var lime_neko_execute = System.load ("lime", "lime_neko_execute", 1);
|
||||
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
<set name="ios" value="1" if="iphone" />
|
||||
|
||||
<set name="LIME_CURL" value="1" />
|
||||
<!-- <set name="LIME_NEKO" value="1" /> -->
|
||||
<set name="LIME_NEKO" value="1" if="linux" />
|
||||
<set name="LIME_OGG" value="1" />
|
||||
<set name="LIME_OPENAL" value="1" />
|
||||
<set name="LIME_OPENGL" value="1" />
|
||||
@@ -58,7 +58,7 @@
|
||||
<file name="src/ui/TouchEvent.cpp" />
|
||||
<file name="src/ui/WindowEvent.cpp" />
|
||||
<file name="src/utils/ByteArray.cpp" />
|
||||
<file name="src/vm/Neko.cpp" if="LIME_NEKO" />
|
||||
<file name="src/vm/NekoVM.cpp" if="LIME_NEKO" />
|
||||
|
||||
<compilerflag value="-DLIME_NEKO" if="LIME_NEKO" />
|
||||
|
||||
@@ -118,7 +118,6 @@
|
||||
|
||||
<lib name="-lgc" if="LIME_NEKO" />
|
||||
<lib name="-lm" if="LIME_NEKO" />
|
||||
<!-- <lib name="-Wl,--export-dynamic" if="LIME_NEKO" /> -->
|
||||
|
||||
</section>
|
||||
|
||||
@@ -139,7 +138,6 @@
|
||||
|
||||
<lib name="/opt/local/lib/libgc.a" if="LIME_NEKO" />
|
||||
<lib name="-lm" if="LIME_NEKO" />
|
||||
<lib name="-Wl,--export-dynamic" if="LIME_NEKO" />
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef LIME_VM_NEKO_H
|
||||
#define LIME_VM_NEKO_H
|
||||
#ifndef LIME_VM_NEKOVM_H
|
||||
#define LIME_VM_NEKOVM_H
|
||||
|
||||
|
||||
namespace lime {
|
||||
|
||||
|
||||
class Neko {
|
||||
class NekoVM {
|
||||
|
||||
public:
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <ui/TouchEvent.h>
|
||||
#include <ui/Window.h>
|
||||
#include <ui/WindowEvent.h>
|
||||
#include <vm/Neko.h>
|
||||
#include <vm/NekoVM.h>
|
||||
|
||||
|
||||
namespace lime {
|
||||
@@ -103,7 +103,7 @@ namespace lime {
|
||||
value lime_neko_execute (value module) {
|
||||
|
||||
#ifdef LIME_NEKO
|
||||
Neko::Execute (val_string (module));
|
||||
NekoVM::Execute (val_string (module));
|
||||
#endif
|
||||
return alloc_null ();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <vm/Neko.h>
|
||||
#include <vm/NekoVM.h>
|
||||
#include <stdio.h>
|
||||
#include <neko_vm.h>
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
void Neko::Execute (const char *modulePath) {
|
||||
void NekoVM::Execute (const char *modulePath) {
|
||||
|
||||
neko_vm *vm;
|
||||
|
||||
Reference in New Issue
Block a user