Skip to content

Commit

Permalink
Log4net change recommit
Browse files Browse the repository at this point in the history
now it compiles, and log4net should be disable-able, unless I've missed
something.
  • Loading branch information
NathanH- committed Oct 27, 2014
1 parent 4051353 commit 5fe6f50
Show file tree
Hide file tree
Showing 21 changed files with 147 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Pulsar4X/Pulsar4X.Lib/Entities/Faction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ public void RemoveContactList(FactionSystemDetection ContactList)
/// <param name="YearTickValue">The second count for the current year.</param>
public void SensorSweep(int YearTickValue)
{
/// <summary
/// <summary>
/// clear the fleet preempt list.
/// </summary>
GameState.SE.ClearFleetPreemptList();
Expand Down
3 changes: 2 additions & 1 deletion Pulsar4X/Pulsar4X.Lib/Helpers/OrbitTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public void FindPolarPosition(OrbitingEntity theOrbit, long DaysSinceEpoch, out
/// <summary>
/// orbitFraction is essentially mean Anomaly
/// </summary>
double orbitFraction = 1.0 * ((DaysSinceEpoch + theOrbit.TimeSinceApogee) % orbitPeriod) / orbitPeriod;
//double orbitFraction = 1.0 * ((DaysSinceEpoch + theOrbit.TimeSinceApogee) % orbitPeriod) / orbitPeriod;
double orbitFraction = 1.0 * theOrbit.TimeSinceApogee / orbitPeriod;

#warning how can this orbit code be made more efficient?

Expand Down
4 changes: 2 additions & 2 deletions Pulsar4X/Pulsar4X.UI/GLUtilities/GLCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ private void InitOpenGL30()
#if LOG4NET_ENABLED
logger.Info("OpenGL Pre State Config Error Check: " + m_eGLError.ToString());
#endif
}
#endif
}
#endif
//GL.ShadeModel(ShadingModel.Smooth);
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
GL.ReadBuffer(ReadBufferMode.Back);
Expand Down
2 changes: 2 additions & 0 deletions Pulsar4X/Pulsar4X.UI/GLUtilities/GLCircle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
#if LOG4NET_ENABLED
using log4net.Config;
using log4net;
#endif
using Pulsar4X.Entities;
using Pulsar4X.Lib;

Expand Down
5 changes: 5 additions & 0 deletions Pulsar4X/Pulsar4X.UI/GLUtilities/GLEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@
using Pulsar4X.UI;
using OpenTK.Graphics.OpenGL;
using OpenTK;

#if LOG4NET_ENABLED
using log4net.Config;
using log4net;
#endif

namespace Pulsar4X.UI.GLUtilities
{
public class GLEffect
{
#if LOG4NET_ENABLED
public static readonly ILog logger = LogManager.GetLogger(typeof(GLEffect));
#endif

/// <summary> Used for getting the last OpenGL Error. </summary>
protected ErrorCode m_eGLError;
Expand Down
12 changes: 12 additions & 0 deletions Pulsar4X/Pulsar4X.UI/GLUtilities/GLEffectBasic21.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
using OpenTK.Graphics.OpenGL;
using OpenTK;
using Pulsar4X.UI;
#if LOG4NET_ENABLED
using log4net.Config;
using log4net;
#endif

namespace Pulsar4X.UI.GLUtilities
{
Expand Down Expand Up @@ -49,7 +51,9 @@ public GLEffectBasic21(string a_szVertShaderFile, string a_szFragShaderFile)
GL.GetShaderInfoLog(iGLVertexShader, out szShaderError);
if (iShaderError != 1)
{
#if LOG4NET_ENABLED
logger.Error("Error " + iShaderError.ToString() + " Compiling Vertex Shader: " + szShaderError); // Log Result!
#endif
iShaderError = 1;
}

Expand All @@ -61,7 +65,9 @@ public GLEffectBasic21(string a_szVertShaderFile, string a_szFragShaderFile)
GL.GetShaderInfoLog(iGLPixelShader, out szShaderError);
if (iShaderError != 1)
{
#if LOG4NET_ENABLED
logger.Error("Error " + iShaderError.ToString() + " Compiling Fragment/Pixel Shader: " + szShaderError); // Log Result!
#endif
iShaderError = 1;
}

Expand All @@ -79,11 +85,15 @@ public GLEffectBasic21(string a_szVertShaderFile, string a_szFragShaderFile)
GL.GetShaderInfoLog(iGLPixelShader, out szShaderError);
if (iShaderError != 1)
{
#if LOG4NET_ENABLED
logger.Error("Error " + iShaderError.ToString() + " Creating Shader Program: " + szShaderError); // Log Result!
#endif
iShaderError = 1;
}

#if LOG4NET_ENABLED
logger.Info("OpenGL Pre Bind Matricies to Shader Code: " + GL.GetError().ToString());
#endif
// The Following Bind our Projection, view (camera) and model Matricies in c# to the corosponding vars in the shader program
// it is what allows us to update a matrix in c# and have the GPU do all the calculations for Transformations on next render.
m_aiShaderMatrixLocations = new int[3]; // create memory.
Expand All @@ -94,7 +104,9 @@ public GLEffectBasic21(string a_szVertShaderFile, string a_szFragShaderFile)
m_eGLError = GL.GetError();
if (m_eGLError != ErrorCode.NoError)
{
#if LOG4NET_ENABLED
logger.Info("OpenGL Bind Matricies to Shader Code: " + m_eGLError.ToString());
#endif
}
// This tells OpenGL to delete the shader objects.
// Note that OpenGL wont delete them until all shader programs currently useing them are deleted also.
Expand Down
10 changes: 10 additions & 0 deletions Pulsar4X/Pulsar4X.UI/GLUtilities/GLEffectBasic30.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
using OpenTK.Graphics.OpenGL;
using OpenTK;
using Pulsar4X.UI;
#if LOG4NET_ENABLED
using log4net.Config;
using log4net;
#endif

namespace Pulsar4X.UI.GLUtilities
{
Expand Down Expand Up @@ -49,7 +51,9 @@ public GLEffectBasic30(string a_szVertShaderFile, string a_szFragShaderFile)
GL.GetShaderInfoLog(iGLVertexShader, out szShaderError);
if (iShaderError != 1)
{
#if LOG4NET_ENABLED
logger.Error("Error " + iShaderError.ToString() + " Compiling Vertex Shader: " + szShaderError); // Log Result!
#endif
iShaderError = 1;
}

Expand All @@ -61,7 +65,9 @@ public GLEffectBasic30(string a_szVertShaderFile, string a_szFragShaderFile)
GL.GetShaderInfoLog(iGLPixelShader, out szShaderError);
if (iShaderError != 1)
{
#if LOG4NET_ENABLED
logger.Error("Error " + iShaderError.ToString() + " Compiling Fragment/Pixel Shader: " + szShaderError); // Log Result!
#endif
iShaderError = 1;
}

Expand All @@ -80,7 +86,9 @@ public GLEffectBasic30(string a_szVertShaderFile, string a_szFragShaderFile)
GL.GetShaderInfoLog(iGLPixelShader, out szShaderError);
if (iShaderError != 1)
{
#if LOG4NET_ENABLED
logger.Error("Error " + iShaderError.ToString() + " Creating Shader Program: " + szShaderError); // Log Result!
#endif
iShaderError = 1;
}

Expand All @@ -94,7 +102,9 @@ public GLEffectBasic30(string a_szVertShaderFile, string a_szFragShaderFile)
m_eGLError = GL.GetError();
if (m_eGLError != ErrorCode.NoError)
{
#if LOG4NET_ENABLED
logger.Info("OpenGL Bind Matricies to Shader Code: " + m_eGLError.ToString());
#endif
}
// This tells OpenGL to delete the shader objects.
// Note that OpenGL wont delete them until all shader programs currently useing them are deleted also.
Expand Down
4 changes: 3 additions & 1 deletion Pulsar4X/Pulsar4X.UI/GLUtilities/GLFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
#if LOG4NET_ENABLED
using log4net.Config;
using log4net;
#endif

namespace Pulsar4X.UI.GLUtilities
{
Expand All @@ -19,7 +21,7 @@ public class GLFont
{
#if LOG4NET_ENABLED
/// <summary>
/// TG Logger:
/// GLFONT Logger:
/// </summary>
public static readonly ILog logger = LogManager.GetLogger(typeof(GLFont));
#endif
Expand Down
2 changes: 2 additions & 0 deletions Pulsar4X/Pulsar4X.UI/GLUtilities/GLLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
#if LOG4NET_ENABLED
using log4net.Config;
using log4net;
#endif

namespace Pulsar4X.UI.GLUtilities
{
Expand Down
4 changes: 4 additions & 0 deletions Pulsar4X/Pulsar4X.UI/GLUtilities/GLPrimitive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
using Pulsar4X.UI;
using OpenTK.Graphics.OpenGL;
using OpenTK;
#if LOG4NET_ENABLED
using log4net.Config;
using log4net;
#endif

namespace Pulsar4X.UI.GLUtilities
{
Expand All @@ -18,7 +20,9 @@ namespace Pulsar4X.UI.GLUtilities
public abstract class GLPrimitive
{
// Note: for AU/KM conversions: Constants.Units.KM_PER_AU
#if LOG4NET_ENABLED
public static readonly ILog logger = LogManager.GetLogger(typeof(GLPrimitive));
#endif

/// <summary>
/// Array of verticies that make up this primative.
Expand Down
2 changes: 2 additions & 0 deletions Pulsar4X/Pulsar4X.UI/GLUtilities/GLQuad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
#if LOG4NET_ENABLED
using log4net.Config;
using log4net;
#endif

namespace Pulsar4X.UI.GLUtilities
{
Expand Down
19 changes: 18 additions & 1 deletion Pulsar4X/Pulsar4X.UI/Handlers/ClassDesign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
using Pulsar4X.UI.ViewModels;
using Pulsar4X.Entities;
using Pulsar4X.Stargen;

#if LOG4NET_ENABLED
using log4net.Config;
using log4net;
#endif

using Newtonsoft.Json;
using Pulsar4X.Entities.Components;

Expand Down Expand Up @@ -70,7 +74,9 @@ public ShipClassTN CurrentShipClass
/// <summary>
/// Class Design Logger:
/// </summary>
#if LOG4NET_ENABLED
public static readonly ILog logger = LogManager.GetLogger(typeof(TaskGroup));
#endif

//Panels.ClassDes_DesignAndInfo m_oDesignAndInformationPanel;
Panels.ClassDes_Options m_oOptionsPanel;
Expand Down Expand Up @@ -1418,6 +1424,7 @@ private void BuildDesignTab()

/// <summary>
/// Almost exactly the same as the above design tab builder, but this one gets the component selected from the grouped list.
/// maybe this should be commented. I'll have to get around to that if/when I refactor this.
/// </summary>
/// <param name="LineIndex">Line we want to find</param>
/// <param name="CType">Component type to be "returned"</param>
Expand Down Expand Up @@ -1755,8 +1762,8 @@ private void SetupComponentDataGrid()
Column.SortMode = DataGridViewColumnSortMode.NotSortable;
}

#warning These are needed for debug for right now.
/*
* These are needed for debug for right now.
m_oOptionsPanel.ComponentDataGrid.Columns[m_oOptionsPanel.ComponentDataGrid.Columns.Count - 1].Visible = false;
m_oOptionsPanel.ComponentDataGrid.Columns[m_oOptionsPanel.ComponentDataGrid.Columns.Count - 2].Visible = false;
m_oOptionsPanel.ComponentDataGrid.Columns[m_oOptionsPanel.ComponentDataGrid.Columns.Count - 3].Visible = false;
Expand All @@ -1765,7 +1772,9 @@ private void SetupComponentDataGrid()
}
catch
{
#if LOG4NET_ENABLED
logger.Error("Something went wrong Creating Columns for Class Design ComponentGrid screen...");
#endif
}
}

Expand Down Expand Up @@ -2723,7 +2732,9 @@ private void BuildComponentDataGrid()
}
catch
{
#if LOG4NET_ENABLED
logger.Error("Something went wrong Creating Rows for Class Design ComponentGrid screen...");
#endif
}
}
else if( TotalComponents != List.TotalComponents)
Expand Down Expand Up @@ -3968,7 +3979,9 @@ private void BuildComponentDataGrid()
}
catch
{
#if LOG4NET_ENABLED
logger.Error("Something went wrong with updating rows for class design componentGrid screen...");
#endif
}
}
}
Expand Down Expand Up @@ -4871,7 +4884,9 @@ private void SetupMissileDataGrid()
}
catch
{
#if LOG4NET_ENABLED
logger.Error("Something went wrong Creating Columns for Class Design MissileGrid screen...");
#endif
}
}

Expand Down Expand Up @@ -5020,7 +5035,9 @@ private void BuildMissileDataGrid()
}
catch
{
#if LOG4NET_ENABLED
logger.Error("Something went wrong Creating Rows for Class Design MissileGrid screen..");
#endif
}
}
#endregion
Expand Down
6 changes: 6 additions & 0 deletions Pulsar4X/Pulsar4X.UI/Handlers/Components.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@
using Pulsar4X.Entities;
using Pulsar4X.Stargen;
using Newtonsoft.Json;

#if LOG4NET_ENABLED
using log4net.Config;
using log4net;
#endif

using Pulsar4X.Entities.Components;
using System.Runtime.InteropServices;

namespace Pulsar4X.UI.Handlers
{
public class Components
{
#if LOG4NET_ENABLED
public static readonly ILog logger = LogManager.GetLogger(typeof(Components));
#endif

Panels.Component_Design m_oComponentDesignPanel;

Expand Down
13 changes: 12 additions & 1 deletion Pulsar4X/Pulsar4X.UI/Handlers/Economics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@
using WeifenLuo.WinFormsUI.Docking;
using Pulsar4X.UI.ViewModels;
using Pulsar4X.Entities;

#if LOG4NET_ENABLED
using log4net.Config;
using log4net;
#endif

namespace Pulsar4X.UI.Handlers
{
public class Economics
{
// System Map Logger:
/// <summary>
/// Economics Logger:
/// </summary>
#if LOG4NET_ENABLED
public static readonly ILog logger = LogManager.GetLogger(typeof(Economics));
#endif

/// <summary>
/// Panel that contains the list of populated systems.
Expand Down Expand Up @@ -210,7 +217,9 @@ private void SetupSummaryDataGrid()
}
catch
{
#if LOG4NET_ENABLED
logger.Error("Something whent wrong Creating Colums for Economics summary screen...");
#endif
}
}

Expand Down Expand Up @@ -260,7 +269,9 @@ public void RefreshSummaryCells()
}
catch
{
#if LOG4NET_ENABLED
logger.Error("Something whent wrong Refreshing Cells for Economics summary screen...");
#endif
}
}

Expand Down
Loading

0 comments on commit 5fe6f50

Please sign in to comment.