Example #1
0
        public static ScummEngine Create(GameSettings settings, IGraphicsManager gfxManager, IInputManager inputManager, IAudioOutput output, bool debugMode = false)
        {
            ScummEngine engine = null;
            var         game   = (GameInfo)settings.Game;
            var         mixer  = new Mixer(44100);

            output.SetSampleProvider(mixer);

            if (game.Version == 0)
            {
                engine = new ScummEngine0(settings, gfxManager, inputManager, mixer);
            }
            else if ((game.Version == 1) || (game.Version == 2))
            {
                engine = new ScummEngine2(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 3)
            {
                engine = new ScummEngine3(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 4)
            {
                engine = new ScummEngine4(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 5)
            {
                engine = new ScummEngine5(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 6)
            {
                engine = new ScummEngine6(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 7)
            {
                engine = new ScummEngine7(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 8)
            {
                engine = new ScummEngine8(settings, gfxManager, inputManager, mixer);
            }
            Instance         = engine;
            engine.DebugMode = debugMode;
            engine.InitOpCodes();
            engine.SetupVars();
            engine.ResetScummVars();
            return(engine);
        }
Example #2
0
        public static ScummEngine Create(GameSettings settings, IGraphicsManager gfxManager, IInputManager inputManager, IAudioOutput output, bool debugMode = false)
        {
            ScummEngine engine = null;
            var game = (GameInfo)settings.Game;
            var mixer = new Mixer(44100);
            output.SetSampleProvider(mixer);

            if (game.Version == 0)
            {
                engine = new ScummEngine0(settings, gfxManager, inputManager, mixer);
            }
            else if ((game.Version == 1) || (game.Version == 2))
            {
                engine = new ScummEngine2(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 3)
            {
                engine = new ScummEngine3(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 4)
            {
                engine = new ScummEngine4(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 5)
            {
                engine = new ScummEngine5(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 6)
            {
                engine = new ScummEngine6(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 7)
            {
                engine = new ScummEngine7(settings, gfxManager, inputManager, mixer);
            }
            else if (game.Version == 8)
            {
                engine = new ScummEngine8(settings, gfxManager, inputManager, mixer);
            }
            Instance = engine;
            engine.DebugMode = debugMode;
            engine.InitOpCodes();
            engine.SetupVars();
            engine.ResetScummVars();
            return engine;
        }