Backported vsync changes from new-netcode, WIP hull visibility culling
The hull culling functions are there, they just aren't being used right now because there are some annoying bugs.
This commit is contained in:
@@ -40,6 +40,8 @@ namespace Barotrauma
|
||||
|
||||
public Hull CurrentHull;
|
||||
|
||||
public bool Visible = true;
|
||||
|
||||
public SpriteEffects SpriteEffects = SpriteEffects.None;
|
||||
|
||||
//components that determine the functionality of the item
|
||||
@@ -806,9 +808,9 @@ namespace Barotrauma
|
||||
{
|
||||
base.FlipX();
|
||||
|
||||
if (prefab.CanSpriteFlipX)
|
||||
{
|
||||
SpriteEffects ^= SpriteEffects.FlipHorizontally;
|
||||
if (prefab.CanSpriteFlipX)
|
||||
{
|
||||
SpriteEffects ^= SpriteEffects.FlipHorizontally;
|
||||
}
|
||||
|
||||
foreach (ItemComponent component in components)
|
||||
@@ -819,10 +821,11 @@ namespace Barotrauma
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, bool editing, bool back = true)
|
||||
{
|
||||
if (!Visible) return;
|
||||
Color color = (isSelected && editing) ? color = Color.Red : spriteColor;
|
||||
if (isHighlighted) color = Color.Orange;
|
||||
|
||||
SpriteEffects oldEffects = prefab.sprite.effects;
|
||||
SpriteEffects oldEffects = prefab.sprite.effects;
|
||||
prefab.sprite.effects ^= SpriteEffects;
|
||||
|
||||
if (prefab.sprite != null)
|
||||
@@ -1076,6 +1079,21 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void UpdateHUD(Character character)
|
||||
{
|
||||
if (condition <= 0.0f)
|
||||
{
|
||||
FixRequirement.UpdateHud(this, character);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
foreach (ItemComponent ic in components)
|
||||
{
|
||||
ic.UpdateHUD(character);
|
||||
}
|
||||
}
|
||||
|
||||
public List<T> GetConnectedComponents<T>(bool recursive = false)
|
||||
{
|
||||
List<T> connectedComponents = new List<T>();
|
||||
|
||||
Reference in New Issue
Block a user