修改底层渲染为OpenGL
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
#include "Scene_Test.h"
|
||||
#include <memory>
|
||||
#include <EngineCore/Game.h>
|
||||
#include <EngineFrame/Component/AnimationManager.h>
|
||||
#include "EngineCore/Game.h"
|
||||
#include "EngineFrame/Component/AnimationManager.h"
|
||||
#include "EngineFrame/Component/Text.h"
|
||||
#include "EngineFrame/Component/Canvas.h"
|
||||
#include "Global/Global_Game.h"
|
||||
Scene_Test::Scene_Test()
|
||||
{
|
||||
}
|
||||
@@ -13,44 +16,55 @@ Scene_Test::~Scene_Test()
|
||||
|
||||
void Scene_Test::Enter()
|
||||
{
|
||||
map = new GameMap;
|
||||
map->LoadMap("map/cataclysm/town/elvengard/new_elvengard.map");
|
||||
map->Enter(this);
|
||||
// SetScale(VecFPos(1.2f, 1.2f));
|
||||
// map = new GameMap;
|
||||
// map->LoadMap("map/cataclysm/town/elvengard/new_elvengard.map");
|
||||
// map->Enter(this);
|
||||
|
||||
RefPtr<CharacterObject> obj = new CharacterObject();
|
||||
obj->SetPosition({1000, 300, 0});
|
||||
obj->Construction(0);
|
||||
// RefPtr<CharacterObject> obj = new CharacterObject();
|
||||
// obj->SetPosition({1000, 300, 0});
|
||||
// obj->Construction(0);
|
||||
|
||||
RefPtr<MonsterObject> monster = new MonsterObject();
|
||||
monster->SetPosition({1200, 301, 0});
|
||||
monster->Construction(1);
|
||||
monster->SetDirection(1);
|
||||
// RefPtr<MonsterObject> monster = new MonsterObject();
|
||||
// monster->SetPosition({1200, 301, 0});
|
||||
// monster->Construction(1);
|
||||
// monster->SetDirection(1);
|
||||
|
||||
map->AddObject(obj);
|
||||
map->AddObject(monster);
|
||||
// map->AddObject(obj);
|
||||
// map->AddObject(monster);
|
||||
|
||||
_camera = new GameMapCamera;
|
||||
_camera->SetFromActor(obj.Get());
|
||||
return;
|
||||
// _camera = new GameMapCamera;
|
||||
// _camera->SetFromActor(obj.Get());
|
||||
// return;
|
||||
|
||||
// SDL_Log("Scene_Test::进入测试场景!");
|
||||
// // SDL_Log("Scene_Test::进入测试场景!");
|
||||
RefPtr<Actor> actor = new Actor;
|
||||
AddChild(actor);
|
||||
// RefPtr<Sprite> sprite = new Sprite("ImagePacks2/test_white_background.png");
|
||||
// actor->AddComponent(sprite);
|
||||
|
||||
// RefPtr<Sprite> chr = new Sprite("sprite/character/swordman/equipment/avatar/skin/sm_body0000.img", 90);
|
||||
RefPtr<Sprite> sprite = new Sprite("ImagePacks2/test_white_background.png");
|
||||
|
||||
RefPtr<Sprite> chr = new Sprite("sprite/interface2/hud/hud.img", 0);
|
||||
// chr->SetPos(VecFPos{200, 100});
|
||||
// chr->SetAlpha(0.5);
|
||||
// chr->SetShadow();
|
||||
// actor->AddComponent(chr);
|
||||
actor->AddComponent(chr);
|
||||
|
||||
RefPtr<AnimationManager> Am = new AnimationManager;
|
||||
RefPtr<Animation> ani4 = new Animation("map/cataclysm/town/hendonmyre/animation/object/gateall_02.ani");
|
||||
Am->AddAnimation(ani4);
|
||||
// RefPtr<Canvas> canvas = new Canvas(VecSize{1280, 720});
|
||||
// actor->AddChild(canvas);
|
||||
|
||||
// Am->SetPos(VecFPos{200, 100});
|
||||
actor->AddChild(Am);
|
||||
// canvas->AddChild(chr);
|
||||
|
||||
// RefPtr<AnimationManager> Am = new AnimationManager;
|
||||
// RefPtr<Animation> ani4 = new Animation("map/cataclysm/town/hendonmyre/animation/object/gateall_02.ani");
|
||||
// Am->AddAnimation(ani4);
|
||||
|
||||
// // Am->SetPos(VecFPos{200, 100});
|
||||
// actor->AddChild(Am);
|
||||
|
||||
// RefPtr<Text> text = new Text();
|
||||
// text->Init("测试文本", Global_Game::GetInstance().Fonts[0], SDL_Color{255, 255, 255, 255});
|
||||
// text->SetPos(VecFPos{200, 100});
|
||||
// actor->AddChild(text);
|
||||
|
||||
// // sprite2->UnsetClipRect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user