Skip to content

Instantly share code, notes, and snippets.

//----------------------------------------------------------------//
// Copyright (c) 2016 CloudTeam, Inc
// All Rights Reserved.
//----------------------------------------------------------------//
#ifndef DOBA_MOVEMENT_COMPONENT_H
#define DOBA_MOVEMENT_COMPONENT_H
#include <components/DOBAComponentBase-impl.h>
@Vavius
Vavius / DOBAComponentBase-impl.h
Created June 20, 2017 06:44
Entityx moai bindings
//----------------------------------------------------------------//
// Copyright (c) 2016 CloudTeam, Inc
// All Rights Reserved.
//----------------------------------------------------------------//
#ifndef DOBA_DOBA_COMPONENT_BASE_IMPL_H
#define DOBA_DOBA_COMPONENT_BASE_IMPL_H
#include <components/DOBAComponentBase.h>
#include <doba-util/DOBAGetSetHelper.h>
local vsh = [=[
attribute vec4 position;
attribute vec2 uv;
attribute vec4 color;
varying MEDP vec4 colorVarying;
varying MEDP vec2 uvVarying;
void main () {
gl_Position = position;
function ResourceMgr:initAtlasDeck(luaFilePath)
local atlas = self:loadTable(luaFilePath)
local frames = atlas.frames
local deck = MOAIGfxQuadDeck2D.new()
local boundsDeck = MOAIBoundsDeck.new()
deck:setBoundsDeck(boundsDeck)
deck.boundsDeck = boundsDeck
boundsDeck:reserveBounds(#frames)
function ResourceMgr:loadTable(filePath)
local tbl = assert(loadfile(filePath))
setfenv(tbl, {})
return tbl()
end
--------------------------------------------------------------------------------
-- DynamicTexturePack.lua
--
--
--------------------------------------------------------------------------------
local DynamicTexturePack = class()
local Page = class()
local MAX_SIZE = MOAIGfxDevice.getMaxTextureSize() or 2048
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_C_INCLUDES += $(MOAI_LIB_ROOT)/include
LOCAL_MODULE := game
LOCAL_SRC_FILES := game.cpp
LOCAL_SHARED_LIBRARIES := moai
include $(BUILD_SHARED_LIBRARY)
#include <moai-core/host.h>
#include <moai-android/moaiext-jni.h>
#include <jni.h>
#include "game_script.h"
#include "crash_handler.h"
void AKURunGame () {
AKULoadFuncFromBuffer ( crash_handler, crash_handler_SIZE, AKU_DATA_STRING, AKU_DATA_ZIPPED );
AKUCallFunc ();
TracebackHandler = function(err)
local err = err or ''
local task = MOAIHttpTask.new()
local str = STP and STP.stacktrace() or debug.traceback()
local trace = err .. '\n' .. str
local params = {}
params.err = err
params.error = trace
params.os = MOAIEnvironment.osBrand
--------------------------------------------------------------------------------
-- JsonStorageEngine.lua
--
-- Store lua tables as json documents
--------------------------------------------------------------------------------
local JsonStorageEngine = {}
JsonStorageEngine.DOCUMENTS_DIR = MOAIEnvironment.documentDirectory or 'docs'