Index: binaries/data/config/default.cfg
===================================================================
--- binaries/data/config/default.cfg
+++ binaries/data/config/default.cfg
@@ -61,6 +61,9 @@
; if false, actors won't be rendered but anything entity will be.
renderactors = true
+; "eyecandy" renders all props, "should" does not render purely eyecandy props, and "must" renders props minimally.
+renderprops = eyecandy
+
watereffects=true ; When disabled, force usage of the fixed pipeline water. This is faster, but really, really ugly.
waterfancyeffects = false
waterrealdepth = true
Index: binaries/data/mods/public/art/actors/actor.rnc
===================================================================
--- binaries/data/mods/public/art/actors/actor.rnc
+++ binaries/data/mods/public/art/actors/actor.rnc
@@ -53,7 +53,8 @@
attribute attachpoint { text } &
attribute minheight { xsd:float }? &
attribute maxheight { xsd:float }? &
- attribute selectable { "true" | "false" }?)
+ attribute selectable { "true" | "false" }? &
+ attribute renderprio { "must" | "should" | "eyecandy" }?)
}*
}?
}*
Index: binaries/data/mods/public/art/actors/actor.rng
===================================================================
--- binaries/data/mods/public/art/actors/actor.rng
+++ binaries/data/mods/public/art/actors/actor.rng
@@ -163,6 +163,15 @@
+
+
+
+ must
+ should
+ eyecandy
+
+
+
Index: binaries/data/mods/public/art/actors/props/structures/celts/barracks_props_01.xml
===================================================================
--- binaries/data/mods/public/art/actors/props/structures/celts/barracks_props_01.xml
+++ binaries/data/mods/public/art/actors/props/structures/celts/barracks_props_01.xml
@@ -5,54 +5,54 @@
props/gaul_barracks_props_01.dae
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: binaries/data/mods/public/art/actors/structures/celts/barracks.xml
===================================================================
--- binaries/data/mods/public/art/actors/structures/celts/barracks.xml
+++ binaries/data/mods/public/art/actors/structures/celts/barracks.xml
@@ -8,9 +8,9 @@
structural/gaul_barracks.dae
-
+
-
+
Index: source/graphics/Model.h
===================================================================
--- source/graphics/Model.h
+++ source/graphics/Model.h
@@ -214,7 +214,7 @@
/**
* Add a prop to the model on the given point.
*/
- void AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry, float minHeight = 0.f, float maxHeight = 0.f, bool selectable = true);
+ void AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry, float minHeight = 0.f, float maxHeight = 0.f, bool selectable = true, bool hidden = false);
/**
* Add a prop to the model on the given point, and treat it as the ammo prop.
Index: source/graphics/Model.cpp
===================================================================
--- source/graphics/Model.cpp
+++ source/graphics/Model.cpp
@@ -510,7 +510,7 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// AddProp: add a prop to the model on the given point
-void CModel::AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry, float minHeight, float maxHeight, bool selectable)
+void CModel::AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry, float minHeight, float maxHeight, bool selectable, bool hidden)
{
// position model according to prop point position
@@ -525,6 +525,7 @@
prop.m_MinHeight = minHeight;
prop.m_MaxHeight = maxHeight;
prop.m_Selectable = selectable;
+ prop.m_Hidden = hidden;
m_Props.push_back(prop);
}
@@ -606,7 +607,7 @@
if (m_AmmoPropPoint && i == m_AmmoLoadedProp)
clone->AddAmmoProp(m_Props[i].m_Point, m_Props[i].m_Model->Clone(), m_Props[i].m_ObjectEntry);
else
- clone->AddProp(m_Props[i].m_Point, m_Props[i].m_Model->Clone(), m_Props[i].m_ObjectEntry, m_Props[i].m_MinHeight, m_Props[i].m_MaxHeight, m_Props[i].m_Selectable);
+ clone->AddProp(m_Props[i].m_Point, m_Props[i].m_Model->Clone(), m_Props[i].m_ObjectEntry, m_Props[i].m_MinHeight, m_Props[i].m_MaxHeight, m_Props[i].m_Selectable, m_Props[i].m_Hidden);
}
return clone;
Index: source/graphics/ObjectBase.h
===================================================================
--- source/graphics/ObjectBase.h
+++ source/graphics/ObjectBase.h
@@ -31,6 +31,7 @@
#include "lib/file/vfs/vfs_path.h"
#include "ps/CStr.h"
#include "ps/CStrIntern.h"
+#include "renderer/RenderingOptions.h"
#include
@@ -62,15 +63,17 @@
struct Prop
{
// constructor
- Prop() : m_minHeight(0.f), m_maxHeight(0.f), m_selectable(true) {}
+ Prop() {}
// name of the prop point to attach to - "Prop01", "Prop02", "Head", "LeftHand", etc ..
CStr m_PropPointName;
// name of the model file - art/actors/props/sword.xml or whatever
CStrW m_ModelName;
// allow the prop to ajust the height from minHeight to maxHeight relative to the main model
- float m_minHeight;
- float m_maxHeight;
- bool m_selectable;
+ float m_minHeight = 0.0f;
+ float m_maxHeight = 0.0f;
+ bool m_selectable = false;
+
+ PropRenderPriority m_RenderPrio = PropRenderPriority::MUST;
};
struct Samp
Index: source/graphics/ObjectBase.cpp
===================================================================
--- source/graphics/ObjectBase.cpp
+++ source/graphics/ObjectBase.cpp
@@ -68,6 +68,7 @@
AT(offsetx);
AT(offsetz);
AT(selectable);
+ AT(renderprio);
AT(sound);
AT(speed);
AT(width);
@@ -201,6 +202,8 @@
prop.m_maxHeight = pe.Value.ToFloat();
else if (pe.Name == at_selectable)
prop.m_selectable = pe.Value != "false";
+ else if (pe.Name == at_renderprio)
+ prop.m_RenderPrio = PropRenderPriorityEnum::FromString(pe.Value);
}
currentVariant.m_Props.push_back(prop);
}
Index: source/graphics/ObjectEntry.cpp
===================================================================
--- source/graphics/ObjectEntry.cpp
+++ source/graphics/ObjectEntry.cpp
@@ -238,7 +238,10 @@
if (isAmmo)
model->AddAmmoProp(proppoint, propmodel, oe);
else
- model->AddProp(proppoint, propmodel, oe, prop.m_minHeight, prop.m_maxHeight, prop.m_selectable);
+ {
+ bool hidden = prop.m_RenderPrio > g_RenderingOptions.GetPropRenderPriority();
+ model->AddProp(proppoint, propmodel, oe, prop.m_minHeight, prop.m_maxHeight, prop.m_selectable, hidden);
+ }
if (propmodel->ToCModel())
propmodel->ToCModel()->SetAnimation(oe->GetRandomAnimation("idle"));
}