Updated world synch logging so we can better compare exact results every 40 frames
This commit is contained in:
parent
6d4838f470
commit
cfe7d8cec8
|
@ -275,6 +275,8 @@ public:
|
|||
static Shadows strToShadows(const string &s);
|
||||
static string shadowsToStr(Shadows shadows);
|
||||
|
||||
const Game * getGame() { return game; }
|
||||
|
||||
private:
|
||||
//private misc
|
||||
float computeSunAngle(float time);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "skill_type.h"
|
||||
#include "core_data.h"
|
||||
#include "renderer.h"
|
||||
#include "game.h"
|
||||
|
||||
#ifndef WIN32
|
||||
#include <cmath>
|
||||
|
@ -406,7 +407,7 @@ void Unit::setPos(const Vec2i &pos){
|
|||
this->pos= pos;
|
||||
this->meetingPos= pos - Vec2i(1);
|
||||
|
||||
logSynchData(string(__FILE__) + string("::") + string(__FUNCTION__) + string(" Line: ") + intToStr(__LINE__));
|
||||
//logSynchData(string(__FILE__) + string("::") + string(__FUNCTION__) + string(" Line: ") + intToStr(__LINE__));
|
||||
}
|
||||
|
||||
void Unit::setTargetPos(const Vec2i &targetPos){
|
||||
|
@ -418,7 +419,7 @@ void Unit::setTargetPos(const Vec2i &targetPos){
|
|||
|
||||
this->targetPos= targetPos;
|
||||
|
||||
logSynchData(string(__FILE__) + string("::") + string(__FUNCTION__) + string(" Line: ") + intToStr(__LINE__));
|
||||
//logSynchData(string(__FILE__) + string("::") + string(__FUNCTION__) + string(" Line: ") + intToStr(__LINE__));
|
||||
}
|
||||
|
||||
void Unit::setVisible(const bool visible){
|
||||
|
@ -996,7 +997,10 @@ void Unit::updateTarget(){
|
|||
//update target vec
|
||||
targetVec= target->getCurrVector();
|
||||
|
||||
if(getFrameCount() % 40 == 0) {
|
||||
//logSynchData(string(__FILE__) + string("::") + string(__FUNCTION__) + string(" Line: ") + intToStr(__LINE__));
|
||||
logSynchData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1161,12 +1165,22 @@ void Unit::startDamageParticles(){
|
|||
|
||||
void Unit::setTargetVec(const Vec3f &targetVec) {
|
||||
this->targetVec= targetVec;
|
||||
logSynchData(string(__FILE__) + string("::") + string(__FUNCTION__) + string(" Line: ") + intToStr(__LINE__));
|
||||
//logSynchData(string(__FILE__) + string("::") + string(__FUNCTION__) + string(" Line: ") + intToStr(__LINE__));
|
||||
}
|
||||
|
||||
void Unit::setMeetingPos(const Vec2i &meetingPos) {
|
||||
this->meetingPos= meetingPos;
|
||||
logSynchData(string(__FILE__) + string("::") + string(__FUNCTION__) + string(" Line: ") + intToStr(__LINE__));
|
||||
//logSynchData(string(__FILE__) + string("::") + string(__FUNCTION__) + string(" Line: ") + intToStr(__LINE__));
|
||||
}
|
||||
|
||||
int Unit::getFrameCount() {
|
||||
int frameCount = 0;
|
||||
const Game *game = Renderer::getInstance().getGame();
|
||||
if(game != NULL && game->getWorld() != NULL) {
|
||||
frameCount = game->getWorld()->getFrameCount();
|
||||
}
|
||||
|
||||
return frameCount;
|
||||
}
|
||||
|
||||
void Unit::logSynchData(string source) {
|
||||
|
@ -1175,7 +1189,8 @@ void Unit::logSynchData(string source) {
|
|||
char szBuf[1024]="";
|
||||
sprintf(szBuf,
|
||||
//"Unit = %d [%s] [%s] pos = %s, lastPos = %s, targetPos = %s, targetVec = %s, meetingPos = %s, lastRotation [%f], targetRotation [%f], rotation [%f], progress [%f], progress2 [%f]\n",
|
||||
"Unit = %d [%s] pos = %s, lastPos = %s, targetPos = %s, targetVec = %s, meetingPos = %s, lastRotation [%f], targetRotation [%f], rotation [%f], progress [%f], progress2 [%d]\n",
|
||||
"FrameCount [%d] Unit = %d [%s] pos = %s, lastPos = %s, targetPos = %s, targetVec = %s, meetingPos = %s, lastRotation [%f], targetRotation [%f], rotation [%f], progress [%f], progress2 [%d]\n",
|
||||
getFrameCount(),
|
||||
id,
|
||||
getFullName().c_str(),
|
||||
//getDesc().c_str(),
|
||||
|
@ -1194,7 +1209,7 @@ void Unit::logSynchData(string source) {
|
|||
lastSynchDataString = string(szBuf);
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugWorldSynch,
|
||||
"%s %s\n",
|
||||
"%s %s",
|
||||
source.c_str(),
|
||||
szBuf);
|
||||
}
|
||||
|
|
|
@ -316,7 +316,9 @@ private:
|
|||
CommandResult undoCommand(Command *command);
|
||||
void stopDamageParticles();
|
||||
void startDamageParticles();
|
||||
|
||||
void logSynchData(string source="");
|
||||
int getFrameCount();
|
||||
};
|
||||
|
||||
}}// end namespace
|
||||
|
|
Loading…
Reference in New Issue
Block a user