Linux/GCC Compat
This was SVN commit r1393.
This commit is contained in:
parent
7bf6d11d8c
commit
30ad195c0b
@ -1,7 +1,7 @@
|
||||
#ifndef __H_MESHMANAGER_H__
|
||||
#define __H_MESHMANAGER_H__
|
||||
|
||||
#include "singleton.h"
|
||||
#include "Singleton.h"
|
||||
#include "graphics/ModelDef.h"
|
||||
|
||||
#define g_MeshManager CMeshManager::GetSingleton()
|
||||
@ -20,4 +20,4 @@ private:
|
||||
mesh_map m_MeshMap;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -119,7 +119,7 @@ int cpu_smp = -1;
|
||||
// are there actually multiple physical processors,
|
||||
// not only logical hyperthreaded CPUs? relevant for wtime.
|
||||
|
||||
inline void get_cpu_info()
|
||||
void get_cpu_info()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
win_get_cpu_info();
|
||||
@ -138,9 +138,14 @@ inline void get_cpu_info()
|
||||
char snd_card[SND_CARD_LEN];
|
||||
char snd_drv_ver[SND_DRV_VER_LEN];
|
||||
|
||||
inline void get_snd_info()
|
||||
void get_snd_info()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
win_get_snd_info();
|
||||
#else
|
||||
// At least reset the values for unhandled platforms. Should perhaps do
|
||||
// something like storing the OpenAL version or similar.
|
||||
strcpy(snd_card, "Unknown");
|
||||
strcpy(snd_drv_ver, "Unknown");
|
||||
#endif
|
||||
}
|
||||
|
@ -882,7 +882,7 @@ static void hsd_list_free_all()
|
||||
|
||||
static void SndData_init(SndData* sd, va_list args)
|
||||
{
|
||||
sd->is_stream = va_arg(args, bool);
|
||||
sd->is_stream = va_arg(args, int);
|
||||
}
|
||||
|
||||
static void SndData_dtor(SndData* sd)
|
||||
@ -1003,7 +1003,7 @@ static Handle snd_data_load(const char* const fn, const bool stream)
|
||||
// (both references would read from the same file handle).
|
||||
const uint flags = stream? RES_UNIQUE : 0;
|
||||
|
||||
return h_alloc(H_SndData, fn, flags, stream);
|
||||
return h_alloc(H_SndData, fn, flags, (int)stream);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Mark Thompson (mark@wildfiregames.com / mot20@cam.ac.uk)
|
||||
|
||||
#include "Serialization.h"
|
||||
#include "Network/Serialization.h"
|
||||
#include "JSConversions.h"
|
||||
#include "CStr.h"
|
||||
|
||||
@ -131,4 +131,4 @@ public:
|
||||
}
|
||||
return( buffer );
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -48,6 +48,13 @@ public:
|
||||
bool m_AllowsInheritance;
|
||||
bool m_Inherited;
|
||||
bool m_Intrinsic;
|
||||
|
||||
// This is to make sure that all the fields are initialized at construction
|
||||
inline IJSProperty():
|
||||
m_AllowsInheritance(true),
|
||||
m_Inherited(true),
|
||||
m_Intrinsic(true)
|
||||
{}
|
||||
|
||||
virtual jsval Get( JSContext* cx ) = 0;
|
||||
virtual void Set( JSContext* cx, jsval Value ) = 0;
|
||||
|
@ -30,7 +30,7 @@ CBaseEntity::CBaseEntity()
|
||||
|
||||
// Initialize, make life a little easier on the scriptors
|
||||
m_speed = m_turningRadius = m_meleeRange = m_meleeRangeMin = 0.0f;
|
||||
m_extant = true; m_corpse = NULL;
|
||||
m_extant = true; m_corpse = CStrW();
|
||||
|
||||
m_bound_type = CBoundingObject::BOUND_NONE;
|
||||
m_bound_circle = NULL;
|
||||
@ -226,6 +226,7 @@ void CBaseEntity::XMLLoadProperty( const CXeromyces& XeroFile, const XMBElement&
|
||||
XMBAttribute Attribute = AttributeSet.item( AttributeID );
|
||||
CStrW AttributeName = PropertyName + CStr8( XeroFile.getAttributeString( Attribute.Name ) );
|
||||
Existing = HasProperty( AttributeName );
|
||||
|
||||
if( Existing )
|
||||
{
|
||||
Existing->Set( ToJSVal<CStrW>( Attribute.Value ) );
|
||||
@ -253,7 +254,7 @@ void CBaseEntity::XMLLoadProperty( const CXeromyces& XeroFile, const XMBElement&
|
||||
|
||||
void CBaseEntity::ScriptingInit()
|
||||
{
|
||||
AddMethod<jsval, ToString>( "toString", 0 );
|
||||
AddMethod<jsval, &CBaseEntity::ToString>( "toString", 0 );
|
||||
CJSObject<CBaseEntity>::ScriptingInit( "EntityTemplate" );
|
||||
}
|
||||
|
||||
|
@ -587,12 +587,12 @@ void CEntity::renderSelectionOutline( float alpha )
|
||||
|
||||
void CEntity::ScriptingInit()
|
||||
{
|
||||
AddMethod<jsval, ToString>( "toString", 0 );
|
||||
AddMethod<bool, OrderSingle>( "order", 1 );
|
||||
AddMethod<bool, OrderQueued>( "orderQueued", 1 );
|
||||
AddMethod<bool, Kill>( "kill", 0 );
|
||||
AddMethod<bool, Damage>( "damage", 1 );
|
||||
AddMethod<bool, IsIdle>( "isIdle", 0 );
|
||||
AddMethod<jsval, &CEntity::ToString>( "toString", 0 );
|
||||
AddMethod<bool, &CEntity::OrderSingle>( "order", 1 );
|
||||
AddMethod<bool, &CEntity::OrderQueued>( "orderQueued", 1 );
|
||||
AddMethod<bool, &CEntity::Kill>( "kill", 0 );
|
||||
AddMethod<bool, &CEntity::Damage>( "damage", 1 );
|
||||
AddMethod<bool, &CEntity::IsIdle>( "isIdle", 0 );
|
||||
CJSObject<CEntity>::ScriptingInit( "Entity", Construct, 2 );
|
||||
}
|
||||
|
||||
@ -745,7 +745,8 @@ bool CEntity::Damage( JSContext* cx, uintN argc, jsval* argv )
|
||||
|
||||
if( argc >= 3 )
|
||||
{
|
||||
Damage( CDamageType( ToPrimitive<float>( argv[0] ), ToPrimitive<float>( argv[1] ), ToPrimitive<float>( argv[2] ) ), inflictor );
|
||||
CDamageType dmgType( ToPrimitive<float>( argv[0] ), ToPrimitive<float>( argv[1] ), ToPrimitive<float>( argv[2] ) );
|
||||
Damage( dmgType, inflictor );
|
||||
return( true );
|
||||
}
|
||||
|
||||
@ -762,8 +763,10 @@ bool CEntity::Damage( JSContext* cx, uintN argc, jsval* argv )
|
||||
float dmgN;
|
||||
if( !ToPrimitive<float>( cx, argv[0], dmgN ) )
|
||||
return( false );
|
||||
|
||||
CDamageType dmgType( dmgN );
|
||||
|
||||
Damage( CDamageType( dmgN ), inflictor );
|
||||
Damage( dmgType, inflictor );
|
||||
return( true );
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ public:
|
||||
private:
|
||||
CEntity( CBaseEntity* base, CVector3D position, float orientation );
|
||||
|
||||
EGotoSituation processGotoHelper( CEntityOrder* current, size_t timestep_milli, HEntity& collide );
|
||||
/*EGotoSituation*/ uint processGotoHelper( CEntityOrder* current, size_t timestep_milli, HEntity& collide );
|
||||
bool processAttackMelee( CEntityOrder* current, size_t timestep_milli );
|
||||
bool processAttackMeleeNoPathing( CEntityOrder* current, size_t timestep_milli );
|
||||
bool processGotoNoPathing( CEntityOrder* current, size_t timestep_milli );
|
||||
|
@ -49,4 +49,4 @@ struct CMessageDamage : public CMessage
|
||||
}
|
||||
|
||||
#endif
|
||||
*/
|
||||
*/
|
||||
|
@ -25,7 +25,7 @@ enum EGotoSituation
|
||||
|
||||
// Does all the shared processing for line-of-sight gotos
|
||||
|
||||
EGotoSituation CEntity::processGotoHelper( CEntityOrder* current, size_t timestep_millis, HEntity& collide )
|
||||
uint CEntity::processGotoHelper( CEntityOrder* current, size_t timestep_millis, HEntity& collide )
|
||||
{
|
||||
float timestep=timestep_millis/1000.0f;
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
// Supporting data types for CEntity and related
|
||||
|
||||
class CEntityManager;
|
||||
enum EGotoSituation;
|
||||
|
||||
class CDamageType : public CJSObject<CDamageType>
|
||||
{
|
||||
|
@ -42,4 +42,4 @@ CEventOrderTransition::CEventOrderTransition( int orderPrevious, int orderCurren
|
||||
AddProperty( L"orderCurrent", &m_orderCurrent );
|
||||
AddProperty( L"target", m_target );
|
||||
AddProperty( L"position", m_worldPosition );
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,4 @@ void CPathfindEngine::requestMeleeAttackPath( HEntity entity, HEntity target )
|
||||
it->m_data[0].entity = target;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,4 +109,4 @@ JSBool JSI_Sound::Construct( JSContext* cx, JSObject* obj, unsigned int argc, js
|
||||
*rval = OBJECT_TO_JSVAL( newObject->GetScript() );
|
||||
|
||||
return( JS_TRUE );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user