Updated Toy
This commit is contained in:
@@ -35,7 +35,6 @@
|
|||||||
<None Include="assets\scripts\gameplay\text.toy" />
|
<None Include="assets\scripts\gameplay\text.toy" />
|
||||||
<None Include="assets\scripts\gameplay\tilemap.toy" />
|
<None Include="assets\scripts\gameplay\tilemap.toy" />
|
||||||
<None Include="assets\scripts\init.toy" />
|
<None Include="assets\scripts\init.toy" />
|
||||||
<None Include="assets\scripts\sorting_test.toy" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<VCProjectVersion>17.0</VCProjectVersion>
|
<VCProjectVersion>17.0</VCProjectVersion>
|
||||||
|
|||||||
2
Toy
2
Toy
Submodule Toy updated: 2157b2f540...f6ec6a8c73
@@ -1,11 +1,13 @@
|
|||||||
#include "box_engine.h"
|
#include "box_engine.h"
|
||||||
|
|
||||||
#include "lib_engine.h"
|
#include "lib_about.h"
|
||||||
#include "lib_input.h"
|
|
||||||
#include "lib_node.h"
|
|
||||||
#include "lib_standard.h"
|
#include "lib_standard.h"
|
||||||
#include "lib_random.h"
|
#include "lib_random.h"
|
||||||
#include "lib_runner.h"
|
#include "lib_runner.h"
|
||||||
|
#include "lib_engine.h"
|
||||||
|
#include "lib_node.h"
|
||||||
|
#include "lib_input.h"
|
||||||
|
|
||||||
#include "repl_tools.h"
|
#include "repl_tools.h"
|
||||||
|
|
||||||
#include "toy_memory.h"
|
#include "toy_memory.h"
|
||||||
@@ -62,6 +64,7 @@ void Box_initEngine() {
|
|||||||
|
|
||||||
//init Toy
|
//init Toy
|
||||||
Toy_initInterpreter(&engine.interpreter);
|
Toy_initInterpreter(&engine.interpreter);
|
||||||
|
Toy_injectNativeHook(&engine.interpreter, "about", Toy_hookAbout);
|
||||||
Toy_injectNativeHook(&engine.interpreter, "standard", Toy_hookStandard);
|
Toy_injectNativeHook(&engine.interpreter, "standard", Toy_hookStandard);
|
||||||
Toy_injectNativeHook(&engine.interpreter, "random", Toy_hookRandom);
|
Toy_injectNativeHook(&engine.interpreter, "random", Toy_hookRandom);
|
||||||
Toy_injectNativeHook(&engine.interpreter, "runner", Toy_hookRunner);
|
Toy_injectNativeHook(&engine.interpreter, "runner", Toy_hookRunner);
|
||||||
@@ -72,6 +75,11 @@ void Box_initEngine() {
|
|||||||
//run the init
|
//run the init
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
const unsigned char* source = Toy_readFile("./assets/scripts/init.toy", &size);
|
const unsigned char* source = Toy_readFile("./assets/scripts/init.toy", &size);
|
||||||
|
|
||||||
|
if (!source) {
|
||||||
|
fatalError("Couldn't read /assets/scripts/init.toy");
|
||||||
|
}
|
||||||
|
|
||||||
const unsigned char* tb = Toy_compileString((const char*)source, &size);
|
const unsigned char* tb = Toy_compileString((const char*)source, &size);
|
||||||
free((void*)source);
|
free((void*)source);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user