public static void Init() { KiloUtrechtTango.INIT(); JCR6_lzma.Init(); JCR6_zlib.Init(); new JCR6_RealDir(); new JCR_JCR5(); new JCR_QuickLink(); new JCR_QuakePack(); SBubble.Init("NALA", Error.GoError); }
static void Main(string[] args) { JCR6_lzma.Init(); JCR6_zlib.Init(); JCR6_jxsrcca.Init(); SBubble.Init("CLI", ErrorHandler); var mainfile = ""; foreach (string e in SBubble.ResFiles) { var ce = e.ToUpper(); if (ce == "MAIN.LUA" || qstr.Suffixed(ce, "/MAIN.LUA")) { mainfile = e; } } if (mainfile == "") { ErrorHandler("Bubble", "No main script could be found", ""); } SBubble.NewState("MAIN", mainfile); object[] r = null; string cmd = ""; try { cmd = $"assert(main and type(main)==\"function\",\"No 'main' function found!\")\nreturn main({SBubble.StringArray2Lua(args)},\"{MKL.MyExe.Replace("\\", "/")}\")"; r = SBubble.State("MAIN").DoString(cmd); } catch (Exception e) { ErrorHandler("Main call", e.Message, cmd); } long exitcode = 0; try { if (r != null && r[0] != null) { exitcode = (long)(r[0]); } } catch (Exception e) { ErrorHandler("Main Function", "Main function must either return 'nil' or an integer value!", $"{e.Message}\n\n{r[0].GetType()}"); } Environment.Exit((int)exitcode); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here // JCR6 JCR6_lzma.Init(); JCR6_zlib.Init(); JCR6_jxsrcca.Init(); // I want 800x600 graphics.PreferredBackBufferWidth = 800; // set this value to the desired width of your window graphics.PreferredBackBufferHeight = 600; // set this value to the desired height of your window graphics.ApplyChanges(); // Bubble // TODO: Link the error handler! SBubble.Init("MONOGAME", Error.GoError); this.Window.Title = SBubble.Title; base.Initialize(); }