diff --git a/.gitignore b/.gitignore index fcc31a31..b6bb069d 100644 --- a/.gitignore +++ b/.gitignore @@ -73,4 +73,6 @@ assets/testworld/tileset.png oldsrc node_modules -yarn.lock \ No newline at end of file +yarn.lock + +*.log \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f672bb3..15cd393a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ set(SETTING_GAME_POKER 1) set(SETTING_GAME_DAWN 2) set(SETTING_GAME_SANDBOX 3) -set(SETTING_GAME SETTING_GAME_SANDBOX) +set(SETTING_GAME SETTING_GAME_POKER) set(SETTING_GAME_NAME "DawnGame") ################################## Targets ##################################### diff --git a/package.json b/package.json deleted file mode 100644 index 4b45f6a6..00000000 --- a/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "dawn", - "version": "1.0.0", - "repository": "https://YourWishes@github.com/YourWishes/Dawn.git", - "author": "Dominic Masters ", - "license": "MIT", - "private": true, - "scripts": { - "build": "tsc -p ." - }, - "dependencies": { - "tsc": "^2.0.3", - "typescript": "^4.4.3" - } -} diff --git a/src/game/sandbox/sandboxscene.c b/src/game/sandbox/sandboxscene.c index f6486efc..4d8532b0 100644 --- a/src/game/sandbox/sandboxscene.c +++ b/src/game/sandbox/sandboxscene.c @@ -45,10 +45,8 @@ void sandboxSceneUpdate(sandboxscene_t *game, engine_t *engine) { shaderUseCamera(&game->shader, &game->camera); shaderUsePosition(&game->shader, 0,0,0, 0,0,0); shaderUseTexture(&game->shader, &game->texture); - scripterInvokeMethodSimple(&scripter, "update"); } void sandboxSceneDispose(sandboxscene_t *game) { - // scripterInvokeMethodSimple(&scripter, "dispose"); scripterDispose(&scripter); } \ No newline at end of file diff --git a/src/script/api/api.c b/src/script/api/api.c deleted file mode 100644 index 92062988..00000000 --- a/src/script/api/api.c +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "api.h" - -void scriptApiAdd(scripter_t *scripter) { - scriptsApiIo(scripter); - scriptsApiPrimitive(scripter); -} \ No newline at end of file diff --git a/src/script/api/api.h b/src/script/api/api.h deleted file mode 100644 index e3de9cae..00000000 --- a/src/script/api/api.h +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include -#include "primitive.h" -#include "io.h" - -void scriptApiAdd(scripter_t *scripter); \ No newline at end of file diff --git a/src/script/api/global.d.ts b/src/script/api/global.d.ts deleted file mode 100644 index 8a94b6a5..00000000 --- a/src/script/api/global.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare type Pointer = { 'POINTER':T }; \ No newline at end of file diff --git a/src/script/api/io.c b/src/script/api/io.c deleted file mode 100644 index b061b301..00000000 --- a/src/script/api/io.c +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "io.h" - -scripterreturn_t _scriptPrint(scriptercontext_t *ctx) { - duk_push_string(ctx, " "); - duk_insert(ctx, 0); - duk_join(ctx, duk_get_top(ctx) - 1); - printf("%s\n", duk_safe_to_string(ctx, -1)); - return 0; -} - -void scriptsApiIo(scripter_t *scripter) { - scripterDefineMethod(scripter, - SCRIPT_IO_PRINT_NAME, - SCRIPT_IO_PRINT_ARGS, - &_scriptPrint - ); -} \ No newline at end of file diff --git a/src/script/api/io.d.ts b/src/script/api/io.d.ts deleted file mode 100644 index 6dd9d205..00000000 --- a/src/script/api/io.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare function print(...args:any):void; \ No newline at end of file diff --git a/src/script/api/io.h b/src/script/api/io.h deleted file mode 100644 index 09cd628b..00000000 --- a/src/script/api/io.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2021 Dominic Masters -// -// This software is released under the MIT License. -// https://opensource.org/licenses/MIT - -#pragma once -#include -#include "../scripter.h" - -#define SCRIPT_IO_PRINT_NAME "print" -#define SCRIPT_IO_PRINT_ARGS SCRIPTER_VARIABLE_ARGUMENT_COUNT - -void scriptsApiIo(scripter_t *scripter); \ No newline at end of file diff --git a/src/script/api/primitive.c b/src/script/api/primitive.c deleted file mode 100644 index 18b814a5..00000000 --- a/src/script/api/primitive.c +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "primitive.h" - -scripterreturn_t _scriptPrimitiveDraw(scriptercontext_t *context) { - primitive_t *primitive = duk_to_pointer(context, 0); - int32_t start = duk_to_number(context, 1); - int32_t count = duk_to_number(context, 2); - primitiveDraw(primitive, start, count); - return 0; -} - -scripterreturn_t _scriptCubeInit(scriptercontext_t *context) { - primitive_t *primitive = malloc(sizeof(primitive_t)); - cubeInit(primitive, 1, 1, 1); - duk_push_pointer(context, primitive); - return 1; -} - -void scriptsApiPrimitive(scripter_t *scripter) { - scripterDefineMethod(scripter, - SCRIPT_PRIMITIVE_DRAW_NAME, - SCRIPT_PRIMITIVE_DRAW_ARGS, - &_scriptPrimitiveDraw - ); - scripterDefineMethod(scripter, - SCRIPT_CUBE_INIT_NAME, - SCRIPT_CUBE_INIT_ARGS, - &_scriptCubeInit - ); -} \ No newline at end of file diff --git a/src/script/api/primitive.d.ts b/src/script/api/primitive.d.ts deleted file mode 100644 index 82b79597..00000000 --- a/src/script/api/primitive.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare type PointerPrimitive = Pointer<'PRIMITIVE'>; - -declare function primitiveDraw(primitive:PointerPrimitive, start:number, count:number); - -declare function cubeCreate():PointerPrimitive; \ No newline at end of file diff --git a/src/script/api/primitive.h b/src/script/api/primitive.h deleted file mode 100644 index c37d2a10..00000000 --- a/src/script/api/primitive.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include -#include "../scripter.h" -#include "../../display/primitive.h" -#include "../../display/primitives/cube.h" - -#define SCRIPT_PRIMITIVE_DRAW_NAME "primitiveDraw" -#define SCRIPT_PRIMITIVE_DRAW_ARGS 3 - -#define SCRIPT_CUBE_INIT_NAME "cubeCreate" -#define SCRIPT_CUBE_INIT_ARGS 0 - -void scriptsApiPrimitive(scripter_t *scripter); \ No newline at end of file diff --git a/src/script/scripter.c b/src/script/scripter.c index 48e0e653..b39d7373 100644 --- a/src/script/scripter.c +++ b/src/script/scripter.c @@ -17,7 +17,6 @@ void scripterInit(scripter_t *scripter, engine_t *engine) { duk_put_global_string(scripter->context, SCRIPTER_SELF_NAME); // Inject API - scriptApiAdd(scripter); } void scripterDispose(scripter_t *scripter) { diff --git a/src/script/scripter.h b/src/script/scripter.h index 5c5b8e87..a5e9413a 100644 --- a/src/script/scripter.h +++ b/src/script/scripter.h @@ -7,7 +7,6 @@ #pragma once #include -#include "api/api.h" /** * Initialize the scripter engine. diff --git a/src/scripts/main.ts b/src/scripts/main.ts deleted file mode 100644 index 7c709856..00000000 --- a/src/scripts/main.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Primitive } from "./primitive"; - -let cube:PointerPrimitive; -let prim = new Primitive(); - -const init = () => { - cube = cubeCreate(); - print("Created cube", cube); -} - -const update = () => { - primitiveDraw(cube, 0, -1); -} - -const dispose = () => { -} \ No newline at end of file diff --git a/src/scripts/primitive.ts b/src/scripts/primitive.ts deleted file mode 100644 index 9a9a3008..00000000 --- a/src/scripts/primitive.ts +++ /dev/null @@ -1,5 +0,0 @@ -export class Primitive { - constructor() { - print('Hello Class!'); - } -} \ No newline at end of file diff --git a/test.png b/test.png deleted file mode 100644 index a2846f73..00000000 Binary files a/test.png and /dev/null differ diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index f7fe6588..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "target": "ES3", - "lib": [ "esnext" ], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "esModuleInterop": true, - "module": "esnext", - "jsx": "preserve", - "baseUrl": ".", - "outDir": "build/assets/scripts", - "alwaysStrict": false, - "noImplicitUseStrict": true - }, - "exclude": [ - "node_modules" - ], - "include": [ - "**/*.ts", "**/*.tsx", "**/*.d.ts" - ] -}