C
C#3mo ago
BlyZe

2D array doesn't initialize the correct size (Checked with breakpoints)

In the ConsoleGraphic ctor I initialize a new 2D Glyph array. When the _console.Buffer.Width is 960 and _console.Buffer.Height is 360 the array gets initialized as 256, 144. Why could this happen?
internal ConsoleGraphic(CmdConsole console, ConsoleGameSettings settings)
{
_console = console;
_settings = settings;

glyphBuffer = new Glyph[_console.Buffer.Width, _console.Buffer.Height];

BackgroundIndex = 0;
}
internal ConsoleGraphic(CmdConsole console, ConsoleGameSettings settings)
{
_console = console;
_settings = settings;

glyphBuffer = new Glyph[_console.Buffer.Width, _console.Buffer.Height];

BackgroundIndex = 0;
}
You can find the file with the code on Github: https://github.com/BlyZeYT/ConsoleNexus-Engine/blob/master/ConsoleGraphic.cs
GitHub
ConsoleNexus-Engine/ConsoleGraphic.cs at master · BlyZeYT/ConsoleNe...
A Console Game Engine for C#. Contribute to BlyZeYT/ConsoleNexus-Engine development by creating an account on GitHub.
1 Reply
canton7
canton73mo ago
It can't. Please provide evidence