Quellcode durchsuchen

json sample and lua sample removed

mikymod vor 12 Jahren
Ursprung
Commit
434f43a12a
5 geänderte Dateien mit 0 neuen und 122 gelöschten Zeilen
  1. 0 11
      samples/json/CMakeLists.txt
  2. 0 36
      samples/json/json.cpp
  3. 0 14
      samples/lua/CMakeLists.txt
  4. 0 49
      samples/lua/lua.cpp
  5. 0 12
      samples/lua/lua/lua/game.lua

+ 0 - 11
samples/json/CMakeLists.txt

@@ -1,11 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (SRC
-	json.cpp
-)
-
-set (HEADERS
-)
-
-add_executable (json ${SRC} ${HEADERS})
-target_link_libraries(json crown)

+ 0 - 36
samples/json/json.cpp

@@ -1,36 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include "JSONParser.h"
-#include "Filesystem.h"
-#include "DiskFile.h"
-
-using namespace crown;
-
-// REMOVE JSON SAMPLE, ADD UNIT TEST
-int main(int argc, char** argv)
-{
-	// if (argc != 2)
-	// {
-	// 	printf("Configuration root path must be provided. Aborting!");
-	// 	return -1;
-	// }
-
-	// Filesystem conf_root(argv[1]);
-
-	// if (!conf_root.exists("json.json"))
-	// {
-	// 	printf("Configuration file does not exists. Aborting!\n");
-	// 	return -1;
-	// }
-	
-	// char dst[10][256];
-
-	// DiskFile* stream = (DiskFile*)conf_root.open("json.json", FOM_READ);
-
- // 	JSONParser* parser = new JSONParser(stream);
-
-
-	// conf_root.close(stream);
-
-	return 0;
-}

+ 0 - 14
samples/lua/CMakeLists.txt

@@ -1,14 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (SRC
-	lua.cpp
-)
-
-add_definitions(-Wl,-E)
-add_library (game-lua SHARED ${SRC})
-target_link_libraries(game-lua crown crownlua)
-
-set_target_properties (game-lua PROPERTIES OUTPUT_NAME game)
-
-install (DIRECTORY lua DESTINATION samples)
-install (TARGETS game-lua DESTINATION samples/lua)

+ 0 - 49
samples/lua/lua.cpp

@@ -1,49 +0,0 @@
-#include "Crown.h"
-#include "Game.h"
-
-
-namespace crown
-{
-
-StringSetting g_boot("boot_file", "lua main file", "lua/game.raw");
-
-lua_State* L;
-
-void init()
-{
-	L = luaL_newstate();
-	luaL_openlibs(L);
-
-	lua_cpcall(L, luaopen_libcrownlua, NULL);
-
-	const char* path = device()->filesystem()->os_path(g_boot.value());
-
-	if (luaL_loadfile(L, path) || lua_pcall(L, 0, 0, 0))
-	{
-		os::printf("error: %s", lua_tostring(L, -1));
-	}
-
-	lua_getglobal(L, "init");
-
-	lua_pcall(L, 0, 0, 0);
-}
-
-void shutdown()
-{
-	lua_getglobal(L, "shutdown");
-
-	lua_pcall(L, 0, 0, 0);
-
-	lua_close(L);
-}
-
-void frame(float dt)
-{
-	lua_getglobal(L, "frame");
-
-	lua_pushnumber(L, dt);
-
-	lua_pcall(L, 1, 0, 0);
-}
-
-}

+ 0 - 12
samples/lua/lua/lua/game.lua

@@ -1,12 +0,0 @@
-function init()
-	print("Hello from lua!!!")
-end
-
-function shutdown()
-end
-
-function frame(dt)
-	if Keyboard.key_pressed(65) then
-		Device.stop()
-	end
-end