public void Start() { RuntimeConfiguration rtc = Program.GetRuntime(); Runtime.RGSSVersion = rtc.GetRGSSVersion(); Runtime.ResourcePaths = rtc.GetResourcePaths(); Runtime.DefaultResolutionWidth = rtc.GetDefaultResolutionWidth(); Runtime.DefaultResolutionHeight = rtc.GetDefaultResolutionHeight(); Graphics.initialize(Program.Window); engine.Execute(Window.ruby_helper(), scope); engine.Execute(CTilemap.ruby_helper(), scope); engine.Execute(Viewport.ruby_helper(), scope); engine.Execute(Rect.ruby_helper(), scope); engine.Execute(Sprite.ruby_helper(), scope); engine.Execute(Color.ruby_helper(), scope); engine.Execute(Tone.ruby_helper(), scope); engine.Execute(Bitmap.ruby_helper(), scope); Font.load_fonts(); engine.Execute(Font.ruby_helper(), scope); try { engine.Execute(@"rgss_start", scope); } catch (Exception e) { Program.Error(e.Message); } }
//This class is the program's entry point, which uses no DLL references so that we can //setup DLL resolution prior to starting the program. public static void Main(string[] args) { //Setup DLL resolution (so that it can see DLLs in the /System/ directory) AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(ResolveDLL); //Create the Runtime Configuration RuntimeConfiguration rtc = new RuntimeConfiguration(args); Program.Start(rtc); }
public void Start() { RuntimeConfiguration rtc = Program.GetRuntime(); OpenGame.Runtime.Runtime.RGSSVersion = rtc.GetRGSSVersion(); OpenGame.Runtime.Runtime.ResourcePaths = rtc.GetResourcePaths(); OpenGame.Runtime.Runtime.DefaultResolutionWidth = rtc.GetDefaultResolutionWidth(); OpenGame.Runtime.Runtime.DefaultResolutionHeight = rtc.GetDefaultResolutionHeight(); OG_Graphics.initialize(Program.Window); if (rtc.IsDebug() && rtc.IsPlayTest()) { engine.Execute("$DEBUG = $TEST = true", scope); } engine.Execute(OG_Graphics.ruby_helper(), scope); engine.Execute(OG_Input.ruby_helper(), scope); engine.Execute(Plane.ruby_helper(), scope); engine.Execute(Table.ruby_helper(), scope); engine.Execute(Window.ruby_helper(), scope); engine.Execute(CTilemap.ruby_helper(), scope); engine.Execute(Viewport.ruby_helper(), scope); engine.Execute(Rect.ruby_helper(), scope); engine.Execute(Sprite.ruby_helper(), scope); engine.Execute(Color.ruby_helper(), scope); engine.Execute(Tone.ruby_helper(), scope); engine.Execute(Bitmap.ruby_helper(), scope); Font.load_fonts(); engine.Execute(Font.ruby_helper(), scope); try { engine.Execute(@"$OPENGAME_EXE = true"); engine.Execute("$RGSS_SCRIPTS_PATH = '" + rtc.GetScriptsPath() + "'"); engine.Execute(@"rgss_start", scope); } catch (Exception e) { Program.Error(e.Message); } }
// The program's start point, entered from the Launcher // RuntimeConfiguration is provided public static void Start(RuntimeConfiguration rtc) { Runtime = rtc; //Create the Ruby instance Ruby = new Ruby(); //compensate for border and caption thickness int width = Runtime.GetDefaultResolutionWidth(); // + (GetSystemMetrics(SystemMetric.SM_CXFIXEDFRAME) << 1); int height = Runtime.GetDefaultResolutionHeight(); // + (GetSystemMetrics(SystemMetric.SM_CYFIXEDFRAME) << 1) + GetSystemMetrics(SystemMetric.SM_CYCAPTION); Window = new GameWindow(width, height); OG_Graphics.dpi_scale = Window.Width / (float)width; Window.Width = width; Window.Height = height; System.Drawing.Size client_size = Window.ClientSize; client_size.Width = width; client_size.Height = height; Window.ClientSize = client_size; Window.Icon = Properties.Resources.OpenGame; Window.Resize += (sender, e) => { OnResize(sender, e); }; Window.Closed += (sender, e) => { OnClose(sender, e); }; Window.Visible = true; OnLoad(); //Start the game Ruby.Start(); //Clean up the Ruby instance Ruby.Dispose(); }
// The program's start point, entered from the Launcher // RuntimeConfiguration is provided public static void Start(RuntimeConfiguration rtc) { Runtime = rtc; //Create the Ruby instance Ruby = new Ruby(); Window = new GameWindow(Runtime.GetDefaultResolutionWidth(), Runtime.GetDefaultResolutionHeight()); Window.Icon = Properties.Resources.OpenGame; Window.Resize += (sender, e) => { OnResize(sender, e); }; Window.Closed += (sender, e) => { OnClose(sender, e); }; Window.Visible = true; OnLoad(); //Start the game Ruby.Start(); //Clean up the Ruby instance Ruby.Dispose(); }