runtime error - Not enough storage is available to process this command - C# -
i'm new c# programming , keep running following runtime error :
"an unhandled exception of type 'system.componentmodel.win32exception' occurred in system.drawing.dll"
i post relevant code down below :
public static tile[,] tile = new tile[maxtilesx, maxtilesy]; public static int netmode = 0; public game1() { threadpool.queueuserworkitem(new waitcallback(worldgencallback), 1); } public static void worldgencallback(object threadcontext) { clearworld(); generateworld(-1); } public static void clearworld() { if (netmode != 1) { (int k = 0; k < maxtilesx; k++) { (int l = 0; l < maxtilesy; l++) { tile[k, l] = new tile(); //the error occurs on line } } } }
i've done console testing , error occurs after couple thousand loops through second for-loop.
edit : relevant code tile-class :
public class tile : microsoft.xna.framework.game { public bool active; public byte type; }
in worldgeneration process, following code used tile
while ((double)num11 < num3) //main output { tile[i, num11].active = false; tile[i, num11].framex = -1; tile[i, num11].framey = -1; num11++; } (int j = (int)num3; j < maxtilesy; j++) { if ((double)j < num4) { tile[i, j].active = true; tile[i, j].type = 0; tile[i, j].framex = -1; tile[i, j].framey = -1; } else { tile[i, j].active = true; tile[i, j].type = 1; tile[i, j].framex = -1; tile[i, j].framey = -1; } }
anyone able out?
Comments
Post a Comment