This repository was archived by the owner on Jun 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathProgram.cs
More file actions
64 lines (59 loc) · 1.42 KB
/
Copy pathProgram.cs
File metadata and controls
64 lines (59 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using Cornifer;
using System;
using System.IO;
//PSDFile psd = new()
//{
// Height = 1,
// Width = 4,
// Layers =
// {
// new()
// {
// Data = new byte[]
// {
// 0xFF, 0xFF, 0xFF, 0xFF,
// 0x00, 0x00, 0x00, 0x00,
// 0xff, 0x00, 0x00, 0xff,
// 0x00, 0xff, 0x00, 0xff
// },
// Name = "layername1",
// Opacity = 128,
// Visible = true,
// },
// //new()
// //{
// // Data = new byte[] { 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF },
// // Name = "layername2",
// // Opacity = 255,
// // Visible = false,
// //}
// }
//};
//using var fs = System.IO.File.Create("test.psd");
//psd.Write(fs);
//return;
Platform.Start(args);
var game = new Main();
#if DEBUG
game.Run();
#else
try
{
game.Run();
}
catch (Exception ex)
{
Platform.DetachWindow();
await Platform.MessageBox(
$"Uncaught exception!\n" +
$"After clicking Ok you will be prompted to save map state.\n" +
$"Don't overwrite your existing state as it may be corrupted.\n" +
$"Send this error when asking for help\n" +
$"{ex.GetType().Name}: {ex.Message}\n{ex.StackTrace}", "Cornifer has crashed!");
await Main.SaveStateAs();
Platform.Stop();
Environment.Exit(1);
}
#endif
Platform.Stop();
Environment.Exit(0);