Skip to content

Commit

Permalink
Merge pull request Tayx94#71 from SuperPenguin/dev
Browse files Browse the repository at this point in the history
Fix null shader array when changing graphy mode
  • Loading branch information
SuperPenguin authored Nov 28, 2019
2 parents 6b0fad8 + db564ad commit c477b02
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ protected override void UpdateGraph()
protected override void CreatePoints()
{
// Init Arrays
if (m_graphArray == null || m_graphArray.Length != m_resolution)
if (m_shaderGraph.Array == null || m_shaderGraph.Array.Length != m_resolution)
{
m_graphArray = new float[m_resolution];
m_graphArrayHighestValue = new float[m_resolution];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ protected override void UpdateGraph()

m_highestFps = m_highestFps < 1 || m_highestFps <= currentMaxFps ? currentMaxFps : m_highestFps - 1;

if (m_shaderGraph.Array == null)
{
m_fpsArray = new int[m_resolution];
m_shaderGraph.Array = new float[m_resolution];
}

for (int i = 0; i <= m_resolution - 1; i++)
{
m_shaderGraph.Array[i] = m_fpsArray[i] / (float) m_highestFps;
Expand All @@ -143,7 +149,7 @@ protected override void UpdateGraph()

protected override void CreatePoints()
{
if (m_fpsArray == null || m_fpsArray.Length != m_resolution)
if (m_shaderGraph.Array == null || m_fpsArray.Length != m_resolution)
{
m_fpsArray = new int[m_resolution];
m_shaderGraph.Array = new float[m_resolution];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected override void UpdateGraph()

protected override void CreatePoints()
{
if (m_allocatedArray == null || m_allocatedArray.Length != m_resolution)
if (m_shaderGraphAllocated.Array == null || m_shaderGraphAllocated.Array.Length != m_resolution)
{
m_allocatedArray = new float[m_resolution];
m_reservedArray = new float[m_resolution];
Expand Down

0 comments on commit c477b02

Please sign in to comment.