/// <summary>
 /// Initializes loading of resources.
 /// </summary>
 /// <param name="ScreenMgr">A ScreenManager instance, used to access a GraphicsDevice.</param>
 public static void InitLoading(ScreenManager ScreenMgr)
 {
     myLoadingScreenEWH = new EventWaitHandle(false, EventResetMode.ManualReset, "Go_Away_Stupid_Loading_Screen_GO_U_HEARD_ME_DONT_MAKE_ME_GET_MY_STICK_OUT");
     ThreadPool.QueueUserWorkItem(new WaitCallback(LoadContent), ScreenMgr);
 }
Esempio n. 2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            int Channel = Bass.BASS_StreamCreateFile("Sounds\\BUTTON.WAV", 0, 0, BASSFlag.BASS_DEFAULT);
            UISounds.AddSound(new UISound(0x01, Channel));

            ScreenMgr = new ScreenManager(this, Content.Load<SpriteFont>("ComicSans"),
                Content.Load<SpriteFont>("ComicSansSmall"));
            SceneMgr = new SceneManager(this);

            //Make the screenmanager, scenemanager and the startup path globally available to all Lua scripts.
            LuaInterfaceManager.ExportObject("ScreenManager", ScreenMgr);
            LuaInterfaceManager.ExportObject("ThreeDManager", SceneMgr);
            LuaInterfaceManager.ExportObject("StartupPath", GlobalSettings.Default.StartupPath);
            LuaInterfaceManager.ExportObject("GraphicsWidth", GlobalSettings.Default.GraphicsWidth);
            LuaInterfaceManager.ExportObject("GraphicsHeight", GlobalSettings.Default.GraphicsHeight);

            LoadStrings();
            ScreenMgr.TextDict = m_TextDict;

            if (GlobalSettings.Default.GraphicsWidth == 800)
                ScreenMgr.LoadInitialScreen("gamedata\\luascripts\\loading.lua");
            else
                ScreenMgr.LoadInitialScreen("gamedata\\luascripts\\loading_1024.lua");
            ContentManager.InitLoading();
        }
Esempio n. 3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new UISpriteBatch(GraphicsDevice, 3);

            // TODO: use this.Content to load your game content here
            int Channel = Bass.BASS_StreamCreateFile("Sounds\\BUTTON.WAV", 0, 0, BASSFlag.BASS_DEFAULT);
            UISounds.AddSound(new UISound(0x01, Channel));

            GameFacade.MainFont = new TSOClient.Code.UI.Framework.Font();
            GameFacade.MainFont.AddSize(10, Content.Load<SpriteFont>("Fonts/ProjectDollhouse_10px"));
            GameFacade.MainFont.AddSize(12, Content.Load<SpriteFont>("Fonts/ProjectDollhouse_12px"));
            GameFacade.MainFont.AddSize(14, Content.Load<SpriteFont>("Fonts/ProjectDollhouse_14px"));
            GameFacade.MainFont.AddSize(16, Content.Load<SpriteFont>("Fonts/ProjectDollhouse_16px"));

            GameFacade.SoundManager = new TSOClient.Code.Sound.SoundManager();
            GameFacade.GameThread = Thread.CurrentThread;

            ScreenMgr = new ScreenManager(this, Content.Load<SpriteFont>("ComicSans"),
                Content.Load<SpriteFont>("ComicSansSmall"));
            SceneMgr = new SceneManager(this);

            GameFacade.Controller = new GameController();
            GameFacade.Screens = ScreenMgr;
            GameFacade.Scenes = SceneMgr;
            GameFacade.GraphicsDevice = GraphicsDevice;

            /** Init any computed values **/
            GameFacade.Init();

            GameFacade.LastUpdateState = m_UpdateState;
            GameFacade.Strings = new ContentStrings();
            GameFacade.Controller.StartLoading();
        }
Esempio n. 4
0
 public GameScreen(ScreenManager ScreenMgr)
 {
     m_ScreenMgr = ScreenMgr;
 }