# OS X build fixes.

spidermonkey-tip script fix.
GCC 4.2 compatibility.
Remove redundant code in extern_libs.lua

This was SVN commit r7371.
This commit is contained in:
Ykkrosh 2010-03-20 16:26:25 +00:00
parent 901056e5b3
commit 23a702c335
9 changed files with 32 additions and 12 deletions

View File

@ -15,7 +15,7 @@ local function add_extern_lib_paths(extern_lib)
-- Often, the headers in libraries/ are windows-specific (always, except
-- for cxxtest and fcollada). So don't add the include dir unless on
-- windows or processing one of those libs.
if OS == "windows" or extern_lib == "cxxtest" or extern_lib == "fcollada" or extern_lib == "valgrind" or extern_lib == "spidermonkey" then
if OS == "windows" or extern_lib == "cxxtest" or extern_lib == "fcollada" or extern_lib == "valgrind" then
tinsert(package.includepaths, libraries_dir .. extern_lib .. "/include")
-- Insert libs at pos=1 (i.e. the front of the list) so they take
-- precedence over system libraries

View File

@ -57,7 +57,6 @@
#include "simulation/LOSManager.h"
#include "simulation/Projectile.h"
#include "simulation2/Simulation2.h"
#include "simulation2/MessageTypes.h"
float g_MaxZoomHeight=350.0f; //note: Max terrain height is this minus YMinOffset
float g_YMinOffset=15.0f;
@ -394,7 +393,7 @@ void CGameView::EnumerateObjects(const CFrustum& frustum, SceneCollector* c)
if (g_UseSimulation2)
{
PROFILE_START( "submit sim components" );
m->Game->GetSimulation2()->BroadcastMessage(CMessageRenderSubmit(*c, frustum, m->Culling));
m->Game->GetSimulation2()->RenderSubmit(*c, frustum, m->Culling);
PROFILE_END( "submit sim components" );
return;
}

View File

@ -38,7 +38,7 @@ public:
SColour() { SColourInit( 0.0f, 0.0f, 0.0f, 0.0f ); }
SColour( float r_, float g_, float b_ ) { SColourInit( r_, g_, b_, 1.0f ); }
SColour( float r_, float g_, float b_, float a_ ) { SColourInit( r_, g_, b_, a_ ); }
SColour( const SColour& other ) { SColourInit( other.r, other.g, other.b, other.a ); }
SColour( const SColour& other ) : CJSObject<SColour>() { SColourInit( other.r, other.g, other.b, other.a ); }
void SColourInit( float r, float g, float b, float a );
SColour &operator = (const SColour &o);

View File

@ -146,13 +146,15 @@ void CSimulation2Impl::Update(float frameTime)
CFixed_23_8 turnLengthFixed = CFixed_23_8::FromInt(TURN_LENGTH) / 1000;
m_DeltaTime -= turnLength;
m_ComponentManager.BroadcastMessage(CMessageTurnStart());
CMessageTurnStart msgTurnStart;
m_ComponentManager.BroadcastMessage(msgTurnStart);
CmpPtr<ICmpCommandQueue> cmpCommandQueue(m_SimContext, SYSTEM_ENTITY);
if (!cmpCommandQueue.null())
cmpCommandQueue->ProcessCommands();
m_ComponentManager.BroadcastMessage(CMessageUpdate(turnLengthFixed));
CMessageUpdate msgUpdate(turnLengthFixed);
m_ComponentManager.BroadcastMessage(msgUpdate);
// Clean up any entities destroyed during the simulation update
m_ComponentManager.FlushDestroyedComponents();
@ -164,7 +166,8 @@ void CSimulation2Impl::Interpolate(float frameTime)
// TODO: Use CTurnManager
double turnLength = TURN_LENGTH / 1000.0;
float offset = clamp(m_DeltaTime / turnLength + 1.0, 0.0, 1.0);
m_ComponentManager.BroadcastMessage(CMessageInterpolate(frameTime, offset));
CMessageInterpolate msg(frameTime, offset);
m_ComponentManager.BroadcastMessage(msg);
}
////////////////////////////////////////////////////////////////
@ -252,6 +255,12 @@ void CSimulation2::Interpolate(float frameTime)
m->Interpolate(frameTime);
}
void CSimulation2::RenderSubmit(SceneCollector& collector, const CFrustum& frustum, bool culling)
{
CMessageRenderSubmit msg(collector, frustum, culling);
m->m_ComponentManager.BroadcastMessage(msg);
}
bool CSimulation2::LoadScripts(const VfsPath& path)
{
return m->LoadScripts(path);

View File

@ -33,6 +33,8 @@ class IComponent;
class ScriptInterface;
class CMessage;
class CScriptVal;
class SceneCollector;
class CFrustum;
// Hopefully-temporary flag for transition to new simulation system
extern bool g_UseSimulation2;
@ -79,6 +81,7 @@ public:
void Update(float frameTime);
void Interpolate(float frameTime);
void RenderSubmit(SceneCollector& collector, const CFrustum& frustum, bool culling);
/**
* Construct a new entity and add it to the world.

View File

@ -352,9 +352,15 @@ public:
if (m_Dirty)
{
if (m_InWorld)
context.GetComponentManager().PostMessage(GetEntityId(), CMessagePositionChanged(true, m_X, m_Z, m_RotY));
{
CMessagePositionChanged msg(true, m_X, m_Z, m_RotY);
context.GetComponentManager().PostMessage(GetEntityId(), msg);
}
else
context.GetComponentManager().PostMessage(GetEntityId(), CMessagePositionChanged(false, entity_pos_t(), entity_pos_t(), entity_angle_t()));
{
CMessagePositionChanged msg(false, entity_pos_t(), entity_pos_t(), entity_angle_t());
context.GetComponentManager().PostMessage(GetEntityId(), msg);
}
m_Dirty = false;
}

View File

@ -86,7 +86,8 @@ public:
TS_ASSERT_EQUALS(cmp->GetInterpolatedTransform(1.0f).GetTranslation(), CVector3D(200, 60, 0));
// Latch new position for interpolation
test.HandleMessage(cmp, CMessageTurnStart(), false);
CMessageTurnStart msg;
test.HandleMessage(cmp, msg, false);
// Move smoothly to new position
cmp->MoveTo(entity_pos_t::FromInt(400), entity_pos_t::FromInt(300));

View File

@ -590,7 +590,8 @@ void CComponentManager::FlushDestroyedComponents()
{
entity_id_t ent = *it;
PostMessage(ent, CMessageDestroy(ent));
CMessageDestroy msg(ent);
PostMessage(ent, msg);
// Destroy the components, and remove from m_ComponentsByTypeId:
std::map<ComponentTypeId, std::map<entity_id_t, IComponent*> >::iterator iit = m_ComponentsByTypeId.begin();

View File

@ -120,7 +120,8 @@ public:
TS_ASSERT(sim.QueryInterface(ent3, IID_Test2) == NULL);
// Messages mustn't get sent to the destroyed components (else we'll crash)
sim.BroadcastMessage(CMessageTurnStart());
CMessageTurnStart msg;
sim.BroadcastMessage(msg);
}
void test_hotload_scripts()