Пример #1
0
int main(void){
	Console_Init();
	printf("Test Test\n");
	Console_Clear();
	printf("Testen Testen\n");
	Sleep(2000);
	return 0;
}
Пример #2
0
void gameinit() {
	Console_Init();
	Console_DispCursor(false);

	Print("■シューティング\n", 30, 15);
	Print("= plz any keys to start game. =\n", 25, 16);
	Console_Flip();

	_getch();
	Console_HOME();
	Console_Flip();
	start = clock();
}
Пример #3
0
void InitApp(void) {
  PICLIB_Init(SYS_FREQ);
  InitIO();
  Console_Init();
}
Пример #4
0
static void Lua_runScript(void *Data, const char *FileName)
{
	if(Lua_State)
		Lua_Close(NULL);

    log_info("Loading Lua script");
	Lua_Init();

    log_info("Loading console");
	Console_Init();
	log_info("Console loaded");

	if(luaL_loadfile(Lua_State, FileName))
	{
		const char *Error = lua_tostring(Lua_State, -1);
		fprintf(Log, "Error loading file : %s\n", Error);
	}
	log_info("Done loading in script");

	if(lua_pcall(Lua_State, 0, 0, 0) != 0)
	{
    	const char *Error = lua_tostring(Lua_State, -1);
    	fprintf(Log, "Error on load script : %s\n", Error);
    	Console_Show = true;
    	Lua_hasClose = false;
    	Lua_Close(NULL);
    	return;
	}
	log_info("Done initializing script");

    Lua_hasInit = Lua_checkFunctionExists("init");
    Lua_hasRender = Lua_checkFunctionExists("render");
    Lua_hasClose = Lua_checkFunctionExists("close");
    Lua_hasMouseInput = Lua_checkFunctionExists("mouse_action");
    Lua_hasResize = Lua_checkFunctionExists("resize");

    Lua_giveMouseX = Lua_checkNumberExists("mouse_x");
    Lua_giveMouseY = Lua_checkNumberExists("mouse_y");

    Lua_giveWidth = Lua_checkNumberExists("Screen_Width");
    Lua_giveHeight = Lua_checkNumberExists("Screen_Height");

    App_UsingDisplay = Lua_checkBooleanExistsAndTrue("useDisplay");
    App_UseFullScreen = Lua_checkBooleanExistsAndTrue("useFullScreen");

    Lua_requestClose = false;

    if(App_UseFullScreen)
    {
    	Lua_Window = Vector4_Create(0, 0, Game_Width, Game_Height);
    	Console_Show = false;
    } else if(App_UsingDisplay)
    {
    	Lua_Window = Vector4_Create(0, Game_Height / 20.0f * 9.0f, Game_Width, Game_Height / 20.0f * 11.0f);
    }

    log_info("Calling init if script has one");
    if(Lua_hasInit)
    {
		if(Lua_giveWidth)
		{
			lua_pushnumber(Lua_State, Lua_Window.z);
			lua_setglobal(Lua_State, "Screen_Width");
		}

		if(Lua_giveHeight)
		{
			lua_pushnumber(Lua_State, Lua_Window.w);
			lua_setglobal(Lua_State, "Screen_Height");
		}

    	lua_getglobal(Lua_State, "init");

        if(lua_pcall(Lua_State, 0, 0, 0) != 0)
        {
        	const char *Error = lua_tostring(Lua_State, -1);
        	fprintf(Log, "Error init : %s\n", Error);
        	Console_Show = true;
        	Lua_Close(NULL);
        	return;
        }
    }
    log_info("Done calling init");

	if(OnScreen_Keyboard)
		Engine_closeKeyboard();

	if(!App_UseFullScreen)
	{
		Console_Show = true;
	}
	log_info("Done loading script");
}