本文整理匯總了C++中EmAssert函數的典型用法代碼示例。如果您正苦於以下問題:C++ EmAssert函數的具體用法?C++ EmAssert怎麽用?C++ EmAssert使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EmAssert函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: EmAssert
void EmFileRef::SetEmulatorRef (const EmFileRef& ref)
{
EmAssert (ref.IsSpecified ());
EmAssert (!gEmulatorRef.IsSpecified ());
gEmulatorRef = ref;
}
示例2: EmAssert
void EmHAL::AddHandler (EmHALHandler* handler)
{
EmAssert (handler->fNextHandler == NULL);
EmAssert (handler->fPrevHandler == NULL);
EmAssert (fgRootHandler == NULL || fgRootHandler->fPrevHandler == NULL);
if (fgRootHandler != NULL)
{
fgRootHandler->fPrevHandler = handler;
handler->fNextHandler = fgRootHandler;
}
fgRootHandler = handler;
}
示例3: EmAssert
EmDocument* EmDocument::DoNewBound (void)
{
EmAssert (gApplication->IsBoundPartially ());
// Create the new document.
EmDocument* doc = EmDocument::HostCreateDocument ();
try
{
// Create the new session.
doc->fSession = new EmSession;
doc->fSession->CreateBound ();
doc->fSession->CreateThread (false); // !!! Created here, but destroyed in EmSession::~EmSession!
}
catch (...)
{
delete doc;
throw;
}
// If we got here, then everything worked. Open a window on the session.
doc->PrvOpenWindow ();
return doc;
}
示例4: EmApplication
EmApplicationFltk::EmApplicationFltk (void) :
EmApplication (),
fAppWindow (NULL)
{
EmAssert (gHostApplication == NULL);
gHostApplication = this;
}
示例5: EmAssert
void StateBehavior::StdOnSignal() {
EmAssert(this->getParent() != NULL, "Parent NULL");
if (p_CurrentStateItem == NULL && m_vStateItem.size() == 0) return;
// initialize origo, this is a ugle hack
if (m_iTick == 0) {
this->getParent()->getTranslation(m_vtxTr.x, m_vtxTr.y, m_vtxTr.z);
this->getParent()->getRotation(m_vtxRot.x, m_vtxRot.y, m_vtxRot.z);
}
#if EM_DEBUG
if (Loader::getInstance()->getSignal(GetSignal()) != NULL) {
EM_COUT("Got signal " << Loader::getInstance()->getSignal(GetSignal()), 0);
}
#endif
OnSignal( PBL_SIG_RESET_ALL) {
this->setState(m_vStateItem[0]);
// do a fast move
if (m_bMove) {
this->getParent()->setTransform(m_vtxTr.x + p_CurrentStateItem->m_vtxTr.x,
m_vtxTr.y + p_CurrentStateItem->m_vtxTr.y,
m_vtxTr.z + p_CurrentStateItem->m_vtxTr.z,
m_vtxRot.x + p_CurrentStateItem->m_vtxRot.x,
m_vtxRot.y + p_CurrentStateItem->m_vtxRot.y,
m_vtxRot.z + p_CurrentStateItem->m_vtxRot.z);
}
}
else {
示例6: EmAssert
EmApplicationFltk::~EmApplicationFltk (void)
{
delete fAppWindow;
EmAssert (gHostApplication == this);
gHostApplication = NULL;
}
示例7: while
void EmHAL::EnsureCoverage (void)
{
#if 0
// Rats...can't get this work...
Bool isHandled[20];
EmHALHandler* thisHandler = fgRootHandler;
EmHALHandler baseHandler;
while (thisHandler)
{
typedef void (EmHALHandler::*CycleHandler)(Bool);
CycleHandler p1 = (thisHandler->Cycle);
CycleHandler p2 = (baseHandler.Cycle);
if (p1 != p2)
{
isHandled[0] = true;
}
thisHandler = thisHandler->fNextHandler;
}
for (int ii = 0; ii < sizeof (isHandled); ++ii)
{
EmAssert (isHandled[ii]);
}
#endif
}
示例8: PrvHandleTrap12
Bool PrvHandleTrap12 (ExceptionNumber)
{
EmAssert (gSession);
gSession->ScheduleSuspendSubroutineReturn ();
return true;
}
示例9: EmActionHandler
EmDocument::EmDocument (void) :
EmActionHandler (),
fSession (NULL),
fFile ()
{
EmAssert (gDocument == NULL);
gDocument = this;
}
示例10: EmAssert
ATrap::~ATrap (void)
{
// Put things back the way they were.
EmPalmOS::ForgetStack (EmBankMapped::GetEmulatedAddress (this->GetStackBase ()));
EmAssert (gCPU68K);
gCPU68K->SetRegisters (fOldRegisters);
// Check to see if anything interesting was registered while we
// were making the Palm OS subroutine call. The "check after end
// of cycle" bit may have gotten cleared when restoring the old
// registers, so set it on the off chance that it was. Doing this
// is harmless if there really aren't any scheduled tasks.
EmAssert (gSession);
gCPU68K->CheckAfterCycle ();
}
示例11: EmAssert
void StdAnimation::onTick() {
EmAssert(this->getParent() != NULL, "Parent not allowed to be null");
float x, y, z;
float sX, sY, sZ;
float eX, eY, eZ;
float k=0.0;
int index;
int size = m_vVertex.size();
if (m_iTick >= size*m_iStep) {
m_iTick = 0;
}
index = (int)(m_iTick/m_iStep);
sX = m_vVertex[index].x;
sY = m_vVertex[index].y;
sZ = m_vVertex[index].z;
if (index + 1 < size) {
eX = m_vVertex[index+1].x;
eY = m_vVertex[index+1].y;
eZ = m_vVertex[index+1].z;
} else {
eX = m_vtxEnd.x;
eY = m_vtxEnd.y;
eZ = m_vtxEnd.z;
}
k = ((float)(m_iTick%m_iStep)/m_iStep);
x = (float)(sX + (eX - sX)*k);
y = (float)(sY + (eY - sY)*k);
z = (float)(sZ + (eZ - sZ)*k);
m_iTick++;
if (m_iAnimType & EM_TRANSLATION) {
this->getParent()->setTranslation(x, y, z);
} else if (m_iAnimType & EM_ROTATION) {
this->getParent()->setRotation(x, y, z);
} else if (m_iAnimType & EM_LIGHT) {
Light* l = this->getParent()->getLight();
if (l != NULL) {
l->setColor(x, y, z);
}
} else if (m_iAnimType & EM_BILLBOARD_SIZE) {
BillBoard * b = this->getParent()->getBillBoard();
if (b != NULL) {
b->setSize(x, y);
b->setZOffset(z);
}
}
}
示例12: EmAssert
void Memory::Save (SessionFile& f)
{
EmBankDummy::Save (f);
EmBankRegs::Save (f);
EmBankSRAM::Save (f);
EmBankDRAM::Save (f);
EmBankROM::Save (f);
EmBankMapped::Save (f);
EmAssert (gSession);
if (gSession->GetDevice ().HasFlash ())
EmBankFlash::Save (f);
MetaMemory::Save (f);
}
示例13: fNewRegisters
ATrap::ATrap (void) :
#if (__GNUC__ < 2)
/* Can't call the default constructor because there isn't one defined */
/* on a struct as there is with a class under GCC 2.8.1 */
fNewRegisters (),
#endif
fEmulatedStackMapper (this->GetStackBase (), kStackSize)
{
// Get the registers.
EmAssert (gCPU68K);
gCPU68K->GetRegisters (fOldRegisters);
fNewRegisters = fOldRegisters;
// Make sure the CPU is not stopped. I suppose that we could force the CPU
// to no longer be stopped, but I'd rather that the Palm OS itself woke up
// first before we try making calls into it. Therefore, anything making
// an out-of-the-blue Palm OS call via this class (that is, a call outside
// of the context of a Palm OS function head- or tailpatch) should first
// bring the CPU to a halt by calling EmSession::ExecuteUntilSysCall first.
EmAssert (fNewRegisters.stopped == 0);
// Give ourselves our own private stack. We'll want this in case
// we're in the debugger and the stack pointer is hosed.
m68k_areg (fNewRegisters, 7) = EmBankMapped::GetEmulatedAddress (
this->GetStackBase () + kStackSize - 4);
// Remember this as a stack so that our stack sniffer won't complain.
char* stackBase = this->GetStackBase ();
StackRange range ( EmBankMapped::GetEmulatedAddress (&stackBase[0]),
EmBankMapped::GetEmulatedAddress (&stackBase[kStackSize - 4]));
EmPalmOS::RememberStackRange (range);
}
示例14: EmAssert
void CollisionBounds::addIntersect(Polygon3D* p) {
EmAssert(p != NULL, "CollisionBounds::add polygon NULL");
EM_COUT("CollisionBounds::add" << endl, 0);
// add polygons only to leafs
if (m_vCollisionBounds.size() > 0) {
vector<CollisionBounds*>::iterator iter = m_vCollisionBounds.begin();
vector<CollisionBounds*>::iterator end = m_vCollisionBounds.end();
for (; iter != end; ++iter) {
(*iter)->addIntersect(p);
}
} else {
// add intersection polygon to bounds
if (this->intersect(p)) {
m_vPolygon.push_back(p);
}
}
}
示例15: memset
void Memory::Initialize ( EmStream& hROM,
RAMSizeType ramSize)
{
// Clear everything out.
memset (gEmMemBanks, 0, sizeof (gEmMemBanks));
// Initialize the valid memory banks.
EmBankDummy::Initialize ();
// Initialize the Hardware registers memory bank. Do this
// *before* initializing the other RAM banks so that we
// know how memory is laid out from the chip selects.
EmBankRegs::Initialize ();
// Initialize EmBankDRAM after initializing the EmBankSRAM. The order is
// important for DragonballEZ. On Dragonball devices, DRAM is
// at 0x00000000, and SRAM is at 0x10000000. But on EZ devices,
// both start at 0x00000000. By calling EmBankDRAM::Initialize
// second, we allow it to overwrite the EmAddressBank handlers
// for the part of memory where they overlap.
EmBankSRAM::Initialize (ramSize);
EmBankDRAM::Initialize ();
EmBankROM::Initialize (hROM);
EmBankMapped::Initialize ();
EmAssert (gSession);
if (gSession->GetDevice ().HasFlash ())
EmBankFlash::Initialize ();
MetaMemory::Initialize ();
// Memory::ResetBankHandlers (); // Can't do this yet. We can't set the
// bank handlers until we know how memory
// is laid out, and that information isn't
// determined until reset.
}