This commit is contained in:
aozhiwei 2023-11-04 19:34:30 +08:00
parent 3cb4c5160d
commit b9a99c15ba
2 changed files with 0 additions and 48 deletions

View File

@ -71,13 +71,6 @@
#include "mt/SafeAreaPos.h" #include "mt/SafeAreaPos.h"
#include "mt/MapThingGroup.h" #include "mt/MapThingGroup.h"
struct FrameCallNode
{
FrameCallCb cb = nullptr;
void* context = nullptr;
FrameCallNode* next = nullptr;
};
const int SHUA_RANGE = 580; const int SHUA_RANGE = 580;
static long long RoomXGetTickCount(void* context) static long long RoomXGetTickCount(void* context)
@ -161,7 +154,6 @@ void Room::Init()
void Room::UnInit() void Room::UnInit()
{ {
destorying_ = true; destorying_ = true;
UpdateFrameCall();
incubator_->UnInit(); incubator_->UnInit();
#ifdef DEBUG #ifdef DEBUG
UnInitDebugInfo(); UnInitDebugInfo();
@ -214,7 +206,6 @@ void Room::Update(int delta_time)
long long end_tick = a8::XGetTickCount(); long long end_tick = a8::XGetTickCount();
#endif #endif
room_agent_->Exec(); room_agent_->Exec();
UpdateFrameCall();
if (GetFrameNo() % 2 == 0) { if (GetFrameNo() % 2 == 0) {
UpdateGas(); UpdateGas();
} }
@ -3473,37 +3464,6 @@ void Room::AddReportBullet(int bullet_uniid)
&xtimer_attacher_); &xtimer_attacher_);
} }
void Room::AddFrameCall(FrameCallCb cb, void* context)
{
FrameCallNode *p = new FrameCallNode;
p->cb = cb;
p->context = context;
if (bot_node_) {
bot_node_->next = p;
bot_node_ = p;
} else {
top_node_ = p;
bot_node_ = p;
}
}
void Room::UpdateFrameCall()
{
if (!work_node_ && top_node_) {
work_node_ = top_node_;
top_node_ = nullptr;
bot_node_ = nullptr;
}
while (work_node_) {
FrameCallNode *pdelnode = work_node_;
work_node_ = pdelnode->next;
if (pdelnode->cb) {
pdelnode->cb(pdelnode->context);
}
delete pdelnode;
}//end while
}
int Room::GetReportRoomMode() int Room::GetReportRoomMode()
{ {
return IsPveRoom() ? 1 : 0; return IsPveRoom() ? 1 : 0;

View File

@ -67,8 +67,6 @@ enum RoomSwitch_e
kRoomSwitchDisableShot, kRoomSwitchDisableShot,
}; };
typedef void (*FrameCallCb)(void*);
struct FrameCallNode;
class MatchTeam; class MatchTeam;
class Room class Room
{ {
@ -250,7 +248,6 @@ public:
bool FindWalkablePointWithOutHouse(const glm::vec3& center, int try_count, int step, glm::vec3& out_point); bool FindWalkablePointWithOutHouse(const glm::vec3& center, int try_count, int step, glm::vec3& out_point);
void AddReportBullet(int bullet_uniid); void AddReportBullet(int bullet_uniid);
bool IsDestorying() { return destorying_; } bool IsDestorying() { return destorying_; }
void AddFrameCall(FrameCallCb cb, void* context);
void SetVictoryTeam(Team* team) { victory_team_ = team;}; void SetVictoryTeam(Team* team) { victory_team_ = team;};
Team* GetVictoryTeam() { return victory_team_;}; Team* GetVictoryTeam() { return victory_team_;};
int GetReportRoomMode(); int GetReportRoomMode();
@ -351,7 +348,6 @@ private:
bool IsAllRealDead(); bool IsAllRealDead();
void AutoJump(); void AutoJump();
void UpdateFrameCall();
void FillCustomBattleHuman(); void FillCustomBattleHuman();
private: private:
@ -422,10 +418,6 @@ private:
std::shared_ptr<AirRaid> air_raid_; std::shared_ptr<AirRaid> air_raid_;
std::shared_ptr<BatchSync> batch_sync_; std::shared_ptr<BatchSync> batch_sync_;
FrameCallNode* top_node_ = nullptr;
FrameCallNode* bot_node_ = nullptr;
FrameCallNode* work_node_ = nullptr;
Team* victory_team_ = nullptr; Team* victory_team_ = nullptr;
bool force_over_ = false; bool force_over_ = false;
bool lock_room_ = false; bool lock_room_ = false;