Click here to Skip to main content
15,891,513 members
Articles / Mobile Apps / Android

One-Touch Casual 3D Game Based on OpenGL ES 2.0 3D Engine with Lua, Bullet, and Vorbis Support

Rate me:
Please Sign up or sign in to vote.
4.75/5 (7 votes)
8 Nov 2012CPOL5 min read 50.4K   3.3K   18  
Android-x86 native game-engine - without JNI
#include "Base.h"
#include "lua_ControlState.h"

namespace gameplay
{

static const char* enumStringEmpty = "";

static const char* luaEnumString_ControlState_NORMAL = "NORMAL";
static const char* luaEnumString_ControlState_FOCUS = "FOCUS";
static const char* luaEnumString_ControlState_ACTIVE = "ACTIVE";
static const char* luaEnumString_ControlState_DISABLED = "DISABLED";

Control::State lua_enumFromString_ControlState(const char* s)
{
    if (strcmp(s, luaEnumString_ControlState_NORMAL) == 0)
        return Control::NORMAL;
    if (strcmp(s, luaEnumString_ControlState_FOCUS) == 0)
        return Control::FOCUS;
    if (strcmp(s, luaEnumString_ControlState_ACTIVE) == 0)
        return Control::ACTIVE;
    if (strcmp(s, luaEnumString_ControlState_DISABLED) == 0)
        return Control::DISABLED;
    GP_ERROR("Invalid enumeration value '%s' for enumeration Control::State.", s);
    return Control::NORMAL;
}

const char* lua_stringFromEnum_ControlState(Control::State e)
{
    if (e == Control::NORMAL)
        return luaEnumString_ControlState_NORMAL;
    if (e == Control::FOCUS)
        return luaEnumString_ControlState_FOCUS;
    if (e == Control::ACTIVE)
        return luaEnumString_ControlState_ACTIVE;
    if (e == Control::DISABLED)
        return luaEnumString_ControlState_DISABLED;
    GP_ERROR("Invalid enumeration value '%d' for enumeration Control::State.", e);
    return enumStringEmpty;
}

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions