Switch to Barotrauma & too many misc changes to remember

This commit is contained in:
Regalis
2015-10-16 18:11:58 +03:00
parent 2bb5d41836
commit 838022fcd5
203 changed files with 540 additions and 419 deletions

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic;
using Lidgren.Network;
using Microsoft.Xna.Framework;
using Subsurface.Networking;
using Barotrauma.Networking;
namespace Subsurface
namespace Barotrauma
{
class Entity
{

View File

@@ -1,11 +1,11 @@
using FarseerPhysics;
using Microsoft.Xna.Framework;
using Subsurface.Lights;
using Barotrauma.Lights;
using System;
using System.Collections.Generic;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class Explosion
{
@@ -21,17 +21,6 @@ namespace Subsurface
private bool sparks, shockwave, flames;
//public Explosion(Vector2 position, float range, float damage, float structureDamage, float stun = 0.0f, float force = 0.0f)
//{
// this.position = position;
// attack = new Attack(,);
// this.force = force;
//}
public Explosion(XElement element)
{
attack = new Attack(element);
@@ -42,7 +31,7 @@ namespace Subsurface
shockwave = ToolBox.GetAttributeBool(element, "shockwave", true);
flames = ToolBox.GetAttributeBool(element, "flames", true);
CameraShake = attack.Range*10.0f;
CameraShake = ToolBox.GetAttributeFloat(element, "camerashake", attack.Range*10.0f);
}
public void Explode()

View File

@@ -6,7 +6,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.ObjectModel;
namespace Subsurface
namespace Barotrauma
{
class Gap : MapEntity
{

View File

@@ -7,7 +7,7 @@ using FarseerPhysics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Subsurface
namespace Barotrauma
{
class Hull : MapEntity

View File

@@ -1,6 +1,6 @@
using Microsoft.Xna.Framework;
namespace Subsurface
namespace Barotrauma
{
interface IDamageable
{

View File

@@ -10,7 +10,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using Voronoi2;
namespace Subsurface
namespace Barotrauma
{
class Level
{

View File

@@ -52,7 +52,7 @@
using FarseerPhysics.Dynamics;
using Microsoft.Xna.Framework;
using Subsurface;
using Barotrauma;
using System;
using System.Collections.Generic;

View File

@@ -3,7 +3,7 @@ using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using System.Linq;
namespace Subsurface.Lights
namespace Barotrauma.Lights
{
class CachedShadow
{

View File

@@ -3,7 +3,7 @@ using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using System.Diagnostics;
namespace Subsurface.Lights
namespace Barotrauma.Lights
{
class LightManager
{
@@ -124,18 +124,18 @@ namespace Subsurface.Lights
spriteBatch.End();
}
//ClearAlphaToOne(graphics, spriteBatch);
//spriteBatch.Begin(SpriteSortMode.Immediate, CustomBlendStates.MultiplyWithAlpha, null, null, null, null, cam.Transform);
ClearAlphaToOne(graphics, spriteBatch);
spriteBatch.Begin(SpriteSortMode.Immediate, CustomBlendStates.MultiplyWithAlpha, null, null, null, null, cam.Transform);
//foreach (LightSource light in lights)
//{
// if (light.hullsInRange.Count > 0 || light.Color.A < 0.01f || light.Range < 1.0f) continue;
// if (!MathUtils.CircleIntersectsRectangle(light.Position, light.Range, viewRect)) continue;
foreach (LightSource light in lights)
{
if (light.hullsInRange.Count > 0 || light.Color.A < 0.01f || light.Range < 1.0f) continue;
if (!MathUtils.CircleIntersectsRectangle(light.Position, light.Range, viewRect)) continue;
// light.Draw(spriteBatch);
//}
light.Draw(spriteBatch);
}
//spriteBatch.End();
spriteBatch.End();
//clear alpha, to avoid messing stuff up later
ClearAlphaToOne(graphics, spriteBatch);

View File

@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Subsurface.Lights
namespace Barotrauma.Lights
{
class LightSource
{

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Subsurface
namespace Barotrauma
{
class Location

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
class LocationType
{

View File

@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using Voronoi2;
namespace Subsurface
namespace Barotrauma
{
class Map
{

View File

@@ -8,7 +8,7 @@ using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System.Collections.ObjectModel;
namespace Subsurface
namespace Barotrauma
{
class MapEntity : Entity
{

View File

@@ -5,7 +5,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace Subsurface
namespace Barotrauma
{
class MapEntityPrefab
{

View File

@@ -4,7 +4,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
public class Md5Hash
{

View File

@@ -10,10 +10,10 @@ using FarseerPhysics.Factories;
using Lidgren.Network;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Subsurface.Networking;
using Subsurface.Lights;
using Barotrauma.Networking;
using Barotrauma.Lights;
namespace Subsurface
namespace Barotrauma
{
class WallSection
{

View File

@@ -6,7 +6,7 @@ using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System.Collections.Generic;
namespace Subsurface
namespace Barotrauma
{
class StructurePrefab : MapEntityPrefab
{

View File

@@ -5,7 +5,7 @@ using FarseerPhysics.Dynamics;
using Lidgren.Network;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Subsurface.Items.Components;
using Barotrauma.Items.Components;
using System;
using System.Collections.Generic;
using System.IO;
@@ -13,7 +13,7 @@ using System.Linq;
using System.Reflection;
using System.Xml.Linq;
namespace Subsurface
namespace Barotrauma
{
public enum Direction : byte
{
@@ -516,11 +516,17 @@ namespace Subsurface
}
catch
{
DebugConsole.ThrowError("Couldn't load submarine ''" + file + "! (Unrecognized file extension)");
return null;
//no file extension specified: try using the default one
file += ".sub";
}
if (extension == ".gz")
if (string.IsNullOrWhiteSpace(extension))
{
extension = ".sub";
file += ".sub";
}
if (extension == ".sub")
{
Stream stream = SaveUtil.DecompressFiletoStream(file);
if (stream == null)
@@ -580,8 +586,7 @@ namespace Subsurface
Type t;
try
{
// Get the type of a specified class.
t = Type.GetType("Subsurface." + typeName, true, true);
t = Type.GetType("Barotrauma." + typeName, true, true);
if (t == null)
{
DebugConsole.ThrowError("Error in " + filePath + "! Could not find a entity of the type ''" + typeName + "''.");

View File

@@ -12,7 +12,7 @@ using System.Linq;
using System.Text;
using Voronoi2;
namespace Subsurface
namespace Barotrauma
{
class SubmarineBody
{

View File

@@ -3,7 +3,7 @@ using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Subsurface
namespace Barotrauma
{
class WaterRenderer : IDisposable
{

View File

@@ -8,7 +8,7 @@ using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System.Collections.ObjectModel;
namespace Subsurface
namespace Barotrauma
{
public enum SpawnType { None, Human, Enemy, Cargo };
class WayPoint : MapEntity