Ejemplo n.º 1
0
// DECL: static void setEnabled(Level level, bool enabled);
void hx_Logger_static_setEnabled(value level, value enabled)
{
    Logger::Level _level;
    bool _enabled = val_get_bool(enabled);
    ValueToEnum(level, _level);
    Logger::setEnabled(_level, _enabled);
}
Ejemplo n.º 2
0
// DECL: static void log(Level level, const char* message, ...);
void hx_Logger_static_log(value level, value message)
{
    Logger::Level _level;
    const char *_message = ValueToString(message);
    ValueToEnum(level, _level);
    Logger::log(_level, _message);
}
Ejemplo n.º 3
0
// DECL: static void set(Level level, void (*logFunction) (Level, const char*));
void hx_Logger_static_set_Int_Func(value level, value _logFunction)
{
    Logger::Level _level;
    ValueToEnum(level, _level);

    // Obtain a pointer to the callback wrapper.
    //

    void (*func) (Logger::Level, const char*) = NULL;
    if (!val_is_null(_logFunction))
        func = logFunction;

    // Clear or set the GC root for the Haxe callback.
    //

    if (func == NULL && clbkLogFunction != NULL)
    {
        SAFE_DELETE(clbkLogFunction);
        clbkLogFunction = NULL;
    }
    if (func != NULL)
    {
        if (clbkLogFunction == NULL)
            clbkLogFunction = new AutoGCRoot(_logFunction);
        else
            clbkLogFunction->set(_logFunction);
    }

    Logger::set(_level, func);
}
Ejemplo n.º 4
0
// DECL: Animation* createAnimation(const char* id, int propertyId, unsigned int keyCount, unsigned int* keyTimes, float* keyValues, float* keyInValue, float* keyOutValue, Curve::InterpolationType type);
value hx_AnimationTarget_createAnimation_Str_IntX2_DatX4_Int(value *args, int nargs)
{
    const value& thisObj = *args++;
    const value& id = *args++;
    const value& propertyId = *args++;
    const value& keyCount = *args++;
    const value& keyTimes = *args++;
    const value& keyValues = *args++;
    const value& keyInValue = *args++;
    const value& keyOutValue = *args++;
    const value& type = *args;

    AnimationTarget *_thisObj;
    const char *_id = ValueToString(id);
    int _propertyId = val_get_int(propertyId);
    unsigned int _keyCount = ValueToUint(keyCount);
    unsigned int *_keyTimes;
    float *_keyValues;
    float *_keyInValue;
    float *_keyOutValue;
    Curve::InterpolationType _type;
    ValueToObject(thisObj, _thisObj);
    ValueToBuffer(keyTimes, _keyTimes);
    ValueToBuffer(keyValues, _keyValues);
    ValueToBuffer(keyInValue, _keyInValue);
    ValueToBuffer(keyOutValue, _keyOutValue);
    ValueToEnum(type, _type);
    return ReferenceToValue(_thisObj->createAnimation(_id, _propertyId, _keyCount, _keyTimes, _keyValues, _keyInValue, _keyOutValue, _type));
}
Ejemplo n.º 5
0
// DECL: bool isButtonDown(ButtonMapping button) const;
value hx_Gamepad_isButtonDown(value thisObj, value button)
{
    Gamepad *_thisObj;
    Gamepad::ButtonMapping _button;
    ValueToObject(thisObj, _thisObj);
    ValueToEnum(button, _button);
    return alloc_bool(_thisObj->isButtonDown(_button));
}
Ejemplo n.º 6
0
// DECL: void unregisterGesture(Gesture::GestureEvent evt);
void hx_Game_unregisterGesture(value thisObj, value evt)
{
    Game *_thisObj;
    Gesture::GestureEvent _evt;
    ValueToObject(thisObj, _thisObj);
    ValueToEnum(evt, _evt);
    _thisObj->unregisterGesture(_evt);
}
Ejemplo n.º 7
0
// DECL: bool isGestureSupported(Gesture::GestureEvent evt);
value hx_Game_isGestureSupported(value thisObj, value evt)
{
    Game *_thisObj;
    Gesture::GestureEvent _evt;
    ValueToObject(thisObj, _thisObj);
    ValueToEnum(evt, _evt);
    return alloc_bool(_thisObj->isGestureSupported(_evt));
}
Ejemplo n.º 8
0
// DECL: void setParameterAutoBinding(const char* name, AutoBinding autoBinding);
void hx_RenderState_setParameterAutoBinding_Str_Int(value thisObj, value name, value autoBinding)
{
    RenderState *_thisObj;
    const char *_name = ValueToString(name);
    RenderState::AutoBinding _autoBinding;
    ValueToObject(thisObj, _thisObj);
    ValueToEnum(autoBinding, _autoBinding);
    _thisObj->setParameterAutoBinding(_name, _autoBinding);
}
Ejemplo n.º 9
0
// DECL: void clear(ClearFlags flags, const Vector4& clearColor, float clearDepth, int clearStencil);
void hx_Game_clear_Int_V4_Flt_Int(value thisObj, value flags, value clearColor, value clearDepth, value clearStencil)
{
    Game *_thisObj;
    Game::ClearFlags _flags;
    Vector4 *_clearColor;
    float _clearDepth = ValueToFloat(clearDepth);
    int _clearStencil = val_get_int(clearStencil);
    ValueToObject(thisObj, _thisObj);
    ValueToEnum(flags, _flags);
    ValueToObject(clearColor, _clearColor);
    _thisObj->clear(_flags, *_clearColor, _clearDepth, _clearStencil);
}
Ejemplo n.º 10
0
// DECL: static void set(Level level, const char* logFunction);
void hx_Logger_static_set_Int_Str(value level, value logFunction)
{
    Logger::Level _level;
    const char *_logFunction = ValueToString(logFunction);
    ValueToEnum(level, _level);

    if (clbkLogFunction != NULL)
    {
        SAFE_DELETE(clbkLogFunction);
        clbkLogFunction = NULL;
    }

    Logger::set(_level, _logFunction);
}
Ejemplo n.º 11
0
// DECL: void clear(ClearFlags flags, float red, float green, float blue, float alpha, float clearDepth, int clearStencil);
void hx_Game_clear_Int_FltX5_Int(value *args, int nargs)
{
    const value& thisObj = *args++;
    const value& flags = *args++;
    const value& red = *args++;
    const value& green = *args++;
    const value& blue = *args++;
    const value& alpha = *args++;
    const value& clearDepth = *args++;
    const value& clearStencil = *args;

    Game *_thisObj;
    Game::ClearFlags _flags;
    float _red = ValueToFloat(red);
    float _green = ValueToFloat(green);
    float _blue = ValueToFloat(blue);
    float _alpha = ValueToFloat(alpha);
    float _clearDepth = ValueToFloat(clearDepth);
    int _clearStencil = val_get_int(clearStencil);
    ValueToObject(thisObj, _thisObj);
    ValueToEnum(flags, _flags);
    _thisObj->clear(_flags, _red, _green, _blue, _alpha, _clearDepth, _clearStencil);
}
Ejemplo n.º 12
0
// DECL: Animation* createAnimationFromBy(const char* id, int propertyId, float* from, float* by, Curve::InterpolationType type, unsigned long duration);
value hx_AnimationTarget_createAnimationFromBy(value *args, int nargs)
{
    const value& thisObj = *args++;
    const value& id = *args++;
    const value& propertyId = *args++;
    const value& from = *args++;
    const value& by = *args++;
    const value& type = *args++;
    const value& duration = *args;

    AnimationTarget *_thisObj;
    const char *_id = ValueToString(id);
    int _propertyId = val_get_int(propertyId);
    float *_from;
    float *_by;
    Curve::InterpolationType _type;
    unsigned long _duration = ValueToUlong(duration);
    ValueToObject(thisObj, _thisObj);
    ValueToBuffer(from, _from);
    ValueToBuffer(by, _by);
    ValueToEnum(type, _type);
    return ReferenceToValue(_thisObj->createAnimationFromBy(_id, _propertyId, _from, _by, _type, _duration));
}
Ejemplo n.º 13
0
// DECL: static bool isEnabled(Level level);
value hx_Logger_static_isEnabled(value level)
{
    Logger::Level _level;
    ValueToEnum(level, _level);
    return alloc_bool(Logger::isEnabled(_level));
}