commit x64 compilation from lulu cause the other branch dont seems to compile properly at home
This commit is contained in:
63
include/engine/core/ace_unit.cpp
Normal file
63
include/engine/core/ace_unit.cpp
Normal file
@ -0,0 +1,63 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
GSFramework
|
||||
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#include "core/ace.h"
|
||||
#include "log/log.h"
|
||||
|
||||
using namespace GS::ACE;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void Unit::ResetCommandList()
|
||||
{
|
||||
list.Clear();
|
||||
|
||||
loop_pc = NULL;
|
||||
pc = NULL;
|
||||
|
||||
is_done = true;
|
||||
}
|
||||
void Unit::DumpCommandList()
|
||||
{
|
||||
for (uint n = 0; n < list.GetCount(); ++n)
|
||||
{
|
||||
Command &cmd = list.ObjectAt(n);
|
||||
__LOG__ << "Command [" << cmd.code << "] : " << cmd.duration << "s, parm = {" << cmd.parm[0] << ", " << cmd.parm[1] << ", " << cmd.parm[2] << "}.\n";
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Unit::ExecCommand(Command *cmd, float dt)
|
||||
{
|
||||
if (!cmd || !dt)
|
||||
return false;
|
||||
|
||||
switch (cmd->code)
|
||||
{
|
||||
case AceCommandNop:
|
||||
break;
|
||||
case AceCommandExec:
|
||||
__LOG_W__ << "ACE unit is executing exec opcode (?!).\n";
|
||||
break;
|
||||
|
||||
case AceCommandLoop:
|
||||
cmd->SetDone();
|
||||
loop_pc = pc;
|
||||
break;
|
||||
case AceCommandNext:
|
||||
cmd->SetDone();
|
||||
pc = loop_pc;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Unit::Unit()
|
||||
{
|
||||
ResetCommandList();
|
||||
}
|
||||
Reference in New Issue
Block a user