コード例 #1
0
        public void LoadContent()
        {
            string   exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
            FileInfo exeInfo = new FileInfo(exePath);

            ContentFenja.Initialize(exeInfo.LastWriteTime);

#if DEBUG
            string contentPath = Path.Combine(new DirectoryInfo(Environment.CurrentDirectory).Parent.Parent.Parent.FullName, "Content");
#else
            string contentPath = Path.Combine(Environment.CurrentDirectory, @"Content");
#endif

#if DEBUG
            string[] files = null;
#else
            string filesFile;
            var    assembly     = Assembly.GetExecutingAssembly();
            var    resourceName = "LD48.Content.ContentListGenerated_do-not-edit.txt";
            using (Stream stream = assembly.GetManifestResourceStream(resourceName))
                using (StreamReader reader = new StreamReader(stream))
                {
                    filesFile = reader.ReadToEnd();
                }

            string[] files = filesFile.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
#endif

            Textures.LoadContent(gDevice, content, contentPath);
            Fonts.LoadContent(content);
            Sounds.LoadContent(content, contentPath, files);
            Music.LoadContent(content);
            DepthManager.Initialize(typeof(Depth));
            Paths.Initialize(contentPath);
        }
コード例 #2
0
ファイル: G.cs プロジェクト: bytinggames/EmptyGame
        public static bool replayRun; // if set to true once, it stays that way until game is restartet (prevents save file from being overridden)

        public static void Initialize(Int2 _res, GraphicsDevice graphicsDevice)
        {
            gDevice = graphicsDevice;
            res     = _res;
            resV    = _res.ToVector2();
            res2    = resV / 2f;

            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo("en-us");

            L.Initialize();

            DepthManager.Initialize(typeof(Depth), typeof(DepthScreen));

            graphicsRand = new Random();
        }