/// <summary> /// Updates a single screen for level display from the corresponding screenMatrix. /// </summary> /// <param name="screenNr">The number of the screen to update.</param> /// <param name="pal">A tile palette to retrieve the graphics from.</param> public void update_screen(int screenNr, TilePalette pal) { Graphics g = Graphics.FromImage(screens[screenNr]); //Get graphics-object for requested screen. for (int i = 0; i < 20; i++) { for (int j = 0; j < 16; j++) { ushort cur_tile = tileMatrix[screenNr, i, j]; Bitmap tmpTile = pal.getTile(cur_tile); g.DrawImage(tmpTile, new System.Drawing.Rectangle(i * 17, j * 17, 16, 16)); } } }
public void update_all_screens(TilePalette pal) { for (int i = 0; i < screens.Length; i++) { update_screen(i, pal); } }