//
// Generated by dtk
// Translation Unit: d_a_obj_vmsdz.cpp
//

#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_obj_vmsdz.h"
#include "d/d_com_inf_game.h"
#include "res/Object/VmsDZ.h"

const char daObjVmsdz_c::M_arcname[6] = "VmsDZ";

/* 00000078-00000098       .text solidHeapCB__12daObjVmsdz_cFP10fopAc_ac_c */
BOOL daObjVmsdz_c::solidHeapCB(fopAc_ac_c* i_this) {
    return ((daObjVmsdz_c*)i_this)->create_heap();
}

/* 00000098-0000015C       .text create_heap__12daObjVmsdz_cFv */
BOOL daObjVmsdz_c::create_heap() {
    J3DModelData* mdl_data;
    BOOL ret = FALSE;

    mdl_data = (J3DModelData*)dComIfG_getObjectRes(M_arcname, dRes_INDEX_VMSDZ_BDL_VMSDZ_e);
    JUT_ASSERT(0x59, mdl_data != NULL);

    if (mdl_data != NULL) {
        mModel = mDoExt_J3DModel__create(mdl_data, 0, 0x11020203);
        if (mModel != NULL) {
            ret = TRUE;
        }
    }

    return ret;
}

/* 0000015C-00000208       .text _create__12daObjVmsdz_cFv */
cPhs_State daObjVmsdz_c::_create() {
    cPhs_State ret = cPhs_ERROR_e;

    fopAcM_ct(this, daObjVmsdz_c);

    ret = dComIfG_resLoad(&mPhs, M_arcname);
    if (ret == cPhs_COMPLEATE_e) {
        ret = cPhs_ERROR_e;
        if (fopAcM_entrySolidHeap(this, solidHeapCB, 0)) {
            fopAcM_SetMtx(this, mModel->getBaseTRMtx());
            init_mtx();
            ret = cPhs_COMPLEATE_e;
        }
    }

    return ret;
}

/* 00000208-00000238       .text _delete__12daObjVmsdz_cFv */
bool daObjVmsdz_c::_delete() {
    dComIfG_resDeleteDemo(&mPhs, M_arcname);
    return true;
}

/* 00000238-00000258       .text init_mtx__12daObjVmsdz_cFv */
void daObjVmsdz_c::init_mtx() {
    mModel->setBaseScale(scale);
}

/* 00000258-00000260       .text _execute__12daObjVmsdz_cFv */
bool daObjVmsdz_c::_execute() {
    return true;
}

/* 00000260-00000300       .text _draw__12daObjVmsdz_cFv */
bool daObjVmsdz_c::_draw() {
    g_env_light.settingTevStruct(TEV_TYPE_BG0, &current.pos, &tevStr);
    g_env_light.setLightTevColorType(mModel, &tevStr);
    dComIfGd_setListBG();
    mDoExt_modelUpdateDL(mModel);
    dComIfGd_setList();
    return true;
}

namespace {
/* 00000300-00000320       .text Mthd_Create__27@unnamed@d_a_obj_vmsdz_cpp@FPv */
cPhs_State Mthd_Create(void* i_this) {
    return ((daObjVmsdz_c*)i_this)->_create();
}

/* 00000320-00000344       .text Mthd_Delete__27@unnamed@d_a_obj_vmsdz_cpp@FPv */
BOOL Mthd_Delete(void* i_this) {
    return ((daObjVmsdz_c*)i_this)->_delete();
}

/* 00000344-00000368       .text Mthd_Execute__27@unnamed@d_a_obj_vmsdz_cpp@FPv */
BOOL Mthd_Execute(void* i_this) {
    return ((daObjVmsdz_c*)i_this)->_execute();
}

/* 00000368-0000038C       .text Mthd_Draw__27@unnamed@d_a_obj_vmsdz_cpp@FPv */
BOOL Mthd_Draw(void* i_this) {
    return ((daObjVmsdz_c*)i_this)->_draw();
}

/* 0000038C-00000394       .text Mthd_IsDelete__27@unnamed@d_a_obj_vmsdz_cpp@FPv */
BOOL Mthd_IsDelete(void* i_this) {
    UNUSED(i_this);
    return TRUE;
}

static actor_method_class Vmsdz_Mthd_Table = {
    (process_method_func)Mthd_Create,
    (process_method_func)Mthd_Delete,
    (process_method_func)Mthd_Execute,
    (process_method_func)Mthd_IsDelete,
    (process_method_func)Mthd_Draw,
};
}; // namespace

actor_process_profile_definition g_profile_Obj_Vmsdz = {
    /* Layer ID     */ fpcLy_CURRENT_e,
    /* List ID      */ 0x0003,
    /* List Prio    */ fpcPi_CURRENT_e,
    /* Proc Name    */ fpcNm_Obj_Vmsdz_e,
    /* Proc SubMtd  */ &g_fpcLf_Method.base,
    /* Size         */ sizeof(daObjVmsdz_c),
    /* Size Other   */ 0,
    /* Parameters   */ 0,
    /* Leaf SubMtd  */ &g_fopAc_Method.base,
    /* Draw Prio    */ fpcDwPi_Obj_Vmsdz_e,
    /* Actor SubMtd */ &Vmsdz_Mthd_Table,
    /* Status       */ fopAcStts_UNK40000_e,
    /* Group        */ fopAc_ACTOR_e,
    /* Cull Type    */ fopAc_CULLBOX_CUSTOM_e,
};
