修改底层渲染为OpenGL
This commit is contained in:
@@ -33,17 +33,17 @@ void Chr_Animation::CreateSkinmationBySlot(std::string actionName, std::string s
|
||||
// 构造好Ani以后 统一设置为不可见 然后放入ActionAnis表
|
||||
RefPtr<Animation> Ani = new Animation(path, FormatImgPath, Data);
|
||||
Ani->SetVisible(false);
|
||||
|
||||
Ani->SetRenderZOrder(Variation.Layer);
|
||||
this->AddChild(Ani);
|
||||
ActionAnis[actionName].push_back(Ani);
|
||||
|
||||
// 构造一下阴影对象
|
||||
RefPtr<Animation> ShadowAni = new Animation(path, FormatImgPath, Data);
|
||||
ShadowAni->SetVisible(false);
|
||||
// 皮肤统一设置阴影
|
||||
ShadowAni->SetShadow();
|
||||
chr_parent->_Shadow->AddChild(ShadowAni);
|
||||
chr_parent->_Shadow->ActionAnis[actionName].push_back(ShadowAni);
|
||||
// 构造一下阴影对象 //TODO
|
||||
// RefPtr<Animation> ShadowAni = new Animation(path, FormatImgPath, Data);
|
||||
// ShadowAni->SetVisible(false);
|
||||
|
||||
// chr_parent->_Shadow->AddChild(ShadowAni);
|
||||
// chr_parent->_Shadow->ActionAnis[actionName].push_back(ShadowAni);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ void Chr_Animation::Init(CharacterObject *parent)
|
||||
parent->AddChild(this);
|
||||
chr_parent = parent;
|
||||
GlobalCharacterScript::CharacterConfig Config = Global_Game::GetInstance().CharacterConfigs[parent->Job];
|
||||
|
||||
|
||||
// 遍历所有动作Ani路径
|
||||
for (const auto &pair : Config.animationPath)
|
||||
{
|
||||
@@ -116,5 +116,5 @@ void Chr_Animation::SetAction(std::string actionName)
|
||||
CurrentActionTag = actionName;
|
||||
|
||||
// 设置阴影的动作
|
||||
chr_parent->_Shadow->SetAction(actionName);
|
||||
if(chr_parent->_Shadow)chr_parent->_Shadow->SetAction(actionName);
|
||||
}
|
||||
|
||||
@@ -130,6 +130,23 @@ static SQInteger SQR_SetPos(HSQUIRRELVM v)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SQInteger SQR_GetWorldPos(HSQUIRRELVM v)
|
||||
{
|
||||
SQUserPointer A_obj;
|
||||
sq_getuserpointer(v, 2, &A_obj);
|
||||
Actor *Aobj = (Actor *)A_obj;
|
||||
VecFPos Pos = Aobj->GetWorldPos();
|
||||
|
||||
sq_newtable(v);
|
||||
sq_pushstring(v, _SC("x"), -1);
|
||||
sq_pushfloat(v, Pos.x);
|
||||
sq_newslot(v, 3, SQFalse);
|
||||
sq_pushstring(v, _SC("y"), -1);
|
||||
sq_pushfloat(v, Pos.y);
|
||||
sq_newslot(v, 3, SQFalse);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static SQInteger SQR_GetAlpha(HSQUIRRELVM v)
|
||||
{
|
||||
SQUserPointer A_obj;
|
||||
@@ -287,6 +304,16 @@ static SQInteger SQR_SetSize(HSQUIRRELVM v)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SQInteger SQR_SetVisible(HSQUIRRELVM v){
|
||||
SQUserPointer A_obj;
|
||||
sq_getuserpointer(v, 2, &A_obj);
|
||||
SQBool Value;
|
||||
sq_getbool(v, 3, &Value);
|
||||
Actor *Aobj = (Actor *)A_obj;
|
||||
Aobj->SetVisible(Value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SQInteger SQR_CreateSprite(HSQUIRRELVM v)
|
||||
{
|
||||
const SQChar *ImgPath;
|
||||
@@ -323,6 +350,7 @@ static void RegisterUI()
|
||||
RegisterUINutApi(_SC("sq_SetZOrder"), SQR_SetZOrder, v);
|
||||
RegisterUINutApi(_SC("sq_GetPos"), SQR_GetPos, v);
|
||||
RegisterUINutApi(_SC("sq_SetPos"), SQR_SetPos, v);
|
||||
RegisterUINutApi(_SC("sq_GetWorldPos"), SQR_GetWorldPos, v);
|
||||
RegisterUINutApi(_SC("sq_GetAlpha"), SQR_GetAlpha, v);
|
||||
RegisterUINutApi(_SC("sq_SetAlpha"), SQR_SetAlpha, v);
|
||||
RegisterUINutApi(_SC("sq_GetScale"), SQR_GetScale, v);
|
||||
@@ -331,6 +359,7 @@ static void RegisterUI()
|
||||
RegisterUINutApi(_SC("sq_SetRotation"), SQR_SetRotation, v);
|
||||
RegisterUINutApi(_SC("sq_GetSize"), SQR_GetSize, v);
|
||||
RegisterUINutApi(_SC("sq_SetSize"), SQR_SetSize, v);
|
||||
RegisterUINutApi(_SC("sq_SetVisible"), SQR_SetVisible, v);
|
||||
|
||||
RegisterUINutApi(_SC("sq_CreateSprite"), SQR_CreateSprite, v);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user