misc...
	* fix scaling for doom3 brush format
	* Pointfile function: try to also load .pts leak line file (q1), if .lin isn't found
	* snap transform origin for flip commands
	* change light intensity save format from %f to %g to prevent .99999 on transforms
	* support 'stupid quake bug' (invert pitch in angles)(generic and miscmodel ents)(cfg: entities="quake" in .game)
	* clipper: place 1st and 2nd points far, 3rd near to ease 3 points clipping
This commit is contained in:
Garux
2017-08-02 09:44:51 +03:00
parent 0139fa9de6
commit 492f00b729
15 changed files with 92 additions and 20 deletions

View File

@@ -30,6 +30,8 @@
#include "angle.h"
#include "entity.h"
const Vector3 ANGLESKEY_IDENTITY = Vector3( 0, 0, 0 );
inline void default_angles( Vector3& angles ){
@@ -57,7 +59,7 @@ inline void read_angles( Vector3& angles, const char* value ){
}
else
{
angles = Vector3( angles[2], angles[0], angles[1] );
angles = Vector3( angles[2], g_stupidQuakeBug? -angles[0] : angles[0], angles[1] );
normalise_angles( angles );
}
}
@@ -71,14 +73,14 @@ inline void write_angles( const Vector3& angles, Entity* entity ){
else
{
if ( angles[0] == 0 && angles[1] == 0 ) {
float yaw = angles[2];
const float yaw = angles[2];
entity->setKeyValue( "angles", "" );
write_angle( yaw, entity );
}
else
{
char value[64];
sprintf( value, "%g %g %g", angles[1], angles[2], angles[0] );
sprintf( value, "%g %g %g", g_stupidQuakeBug? -angles[1] : angles[1], angles[2], angles[0] );
entity->setKeyValue( "angle", "" );
entity->setKeyValue( "angles", value );
}

View File

@@ -120,6 +120,9 @@ bool g_showTargetNames = false;
bool g_showAngles = true;
bool g_lightRadii = true;
bool g_stupidQuakeBug = false;
class ConnectEntities
{
public:
@@ -400,6 +403,10 @@ void Entity_Construct( EGameType gameType ){
Static<KeyIsName>::instance().m_nameKey = "targetname";
}
if( g_gameType == eGameTypeQuake1 ){
g_stupidQuakeBug = true;
}
GlobalPreferenceSystem().registerPreference( "SI_ShowNames", BoolImportStringCaller( g_showNames ), BoolExportStringCaller( g_showNames ) );
GlobalPreferenceSystem().registerPreference( "SI_ShowBboxes", BoolImportStringCaller( g_showBboxes ), BoolExportStringCaller( g_showBboxes ) );
GlobalPreferenceSystem().registerPreference( "SI_ShowNamesDist", IntImportStringCaller( g_showNamesDist ), IntExportStringCaller( g_showNamesDist ) );

View File

@@ -28,6 +28,7 @@ EntityCreator& GetEntityCreator();
enum EGameType
{
eGameTypeQuake3,
eGameTypeQuake1,
eGameTypeRTCW,
eGameTypeDoom3,
};
@@ -46,4 +47,6 @@ extern bool g_showTargetNames;
extern bool g_showAngles;
extern bool g_lightRadii;
extern bool g_stupidQuakeBug;
#endif

View File

@@ -673,7 +673,7 @@ void light_draw( const AABB& aabb_light, RenderStateFlags state ){
inline void write_intensity( const float intensity, Entity* entity ){
char value[64];
sprintf( value, "%f", intensity );
sprintf( value, "%g", intensity );
//primaryIntensity
if( !string_empty( entity->getKeyValue( "_light" ) ) ){

View File

@@ -86,6 +86,33 @@ typedef SingletonModule<EntityQ3API, EntityDependencies> EntityQ3Module;
EntityQ3Module g_EntityQ3Module;
class EntityQ1API : public TypeSystemRef
{
EntityCreator* m_entityq1;
public:
typedef EntityCreator Type;
STRING_CONSTANT( Name, "quake" );
EntityQ1API(){
Entity_Construct( eGameTypeQuake1);
m_entityq1 = &GetEntityCreator();
GlobalReferenceCache().setEntityCreator( *m_entityq1 );
}
~EntityQ1API(){
Entity_Destroy();
}
EntityCreator* getTable(){
return m_entityq1;
}
};
typedef SingletonModule<EntityQ1API, EntityDependencies> EntityQ1Module;
EntityQ1Module g_EntityQ1Module;
class EntityWolfAPI : public TypeSystemRef
{
EntityCreator* m_entitywolf;
@@ -144,6 +171,7 @@ extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules( ModuleServer& server
initialiseModule( server );
g_EntityQ3Module.selfRegister();
g_EntityQ1Module.selfRegister();
g_EntityWolfModule.selfRegister();
g_EntityDoom3Module.selfRegister();
Doom3ModelSkinCacheModule_selfRegister( server );