コード例 #1
0
        public RoomObjectsView()
        {
            InitializeComponent();
            imageComposer = new ImageComposerGDI <RoomObject>();

            // attach handler when gamebitmap changes (animation)
            imageComposer.NewImageAvailable += gameBitmap_NewBitmap;
        }
コード例 #2
0
        public ObjectBaseView()
        {
            InitializeComponent();

            // recreate gamebitmap
            gameBitmap        = new ImageComposerGDI <ObjectBase>();
            gameBitmap.Width  = (uint)picImage.Width;
            gameBitmap.Height = (uint)picImage.Height;
            //, false, picImage.Width, picImage.Height, false);
        }
コード例 #3
0
        public ObjectBaseView()
        {
            InitializeComponent();

            // recreate gamebitmap
            gameBitmap = new ImageComposerGDI<ObjectBase>();
            gameBitmap.Width = (uint)picImage.Width;
            gameBitmap.Height = (uint)picImage.Height;
            //, false, picImage.Width, picImage.Height, false);
        }
        public InventoryObjectView()
        {
            InitializeComponent();

            // recreate gamebitmap
            gameBitmap = new ImageComposerGDI<ObjectBase>();
            gameBitmap.Width = (uint)picImage.Width;
            gameBitmap.Height = (uint)picImage.Height;

            // attach handler when gamebitmap changes (animation)
            gameBitmap.NewImageAvailable += gameBitmap_NewBitmap;
        }
コード例 #5
0
        public InventoryObjectView()
        {
            InitializeComponent();

            // recreate gamebitmap
            gameBitmap        = new ImageComposerGDI <ObjectBase>();
            gameBitmap.Width  = (uint)picImage.Width;
            gameBitmap.Height = (uint)picImage.Height;

            // attach handler when gamebitmap changes (animation)
            gameBitmap.NewImageAvailable += gameBitmap_NewBitmap;
        }
コード例 #6
0
        static void Main()
        {
            // .net stuff
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // initialize color palettes
            PalettesGDI.Initialize();

            // init bgf data model
            CurrentFile = new BgfFile();
            CurrentFile.Frames.AllowEdit = true;

            // init roomobject model for viewer
            RoomObject          = new RoomObject();
            RoomObject.Resource = CurrentFile;

            // init imagecomposer for this roomobject
            ImageComposer = new ImageComposerGDI <RoomObject>();
            ImageComposer.UseViewerFrame = true;
            ImageComposer.DataSource     = RoomObject;

            // init mainform
            MainForm             = new MainForm();
            MainForm.FormClosed += OnMainFormFormClosed;
            MainForm.Show();

            // init shrinkform
            SettingsForm = new SettingsForm();
            SettingsForm.DataBindings.Add("Version", CurrentFile, "Version");
            SettingsForm.DataBindings.Add("ShrinkFactor", CurrentFile, "ShrinkFactor");
            SettingsForm.DataBindings.Add("Name", CurrentFile, "Name");

            // init addframsetindexform
            AddFrameSetIndexForm = new AddFrameSetIndexForm();

            // init ticker
            stopWatch = new Stopwatch();
            stopWatch.Start();

            // set running
            IsRunning = true;

            // start mainthread loop
            while (IsRunning)
            {
                long oldTick = Tick;

                // update current tick
                Tick = stopWatch.ElapsedTicks / MSTICKDIVISOR;

                long span = Tick - oldTick;

                // update roomobject
                if (IsPlaying)
                {
                    RoomObject.Tick(Tick, span);
                }

                // process window messages / events
                Application.DoEvents();

                // sleep
                Thread.Sleep(1);
            }
        }
コード例 #7
0
        static void Main()
        {
            // .net stuff
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // initialize color palettes
            PalettesGDI.Initialize();

            // init bgf data model
            CurrentFile = new BgfFile();
            CurrentFile.Frames.AllowEdit = true;

            // init roomobject model for viewer
            RoomObject = new RoomObject();
            RoomObject.Resource = CurrentFile;

            // init imagecomposer for this roomobject
            ImageComposer = new ImageComposerGDI<RoomObject>();
            ImageComposer.UseViewerFrame = true;
            ImageComposer.DataSource = RoomObject;

            // init mainform
            MainForm = new MainForm();
            MainForm.FormClosed += OnMainFormFormClosed;
            MainForm.Show();

            // init shrinkform
            SettingsForm = new SettingsForm();
            SettingsForm.DataBindings.Add("Version", CurrentFile, "Version");
            SettingsForm.DataBindings.Add("ShrinkFactor", CurrentFile, "ShrinkFactor");
            SettingsForm.DataBindings.Add("Name", CurrentFile, "Name");

            // init addframsetindexform
            AddFrameSetIndexForm = new AddFrameSetIndexForm();

            // init ticker
            stopWatch = new Stopwatch();
            stopWatch.Start();

            // set running
            IsRunning = true;

            // start mainthread loop
            while (IsRunning)
            {
                long oldTick = Tick;

                // update current tick
                Tick = stopWatch.ElapsedTicks / MSTICKDIVISOR;

                long span = Tick - oldTick;

                // update roomobject
                if (IsPlaying)
                    RoomObject.Tick(Tick, span);

                // process window messages / events
                Application.DoEvents();

                // sleep
                Thread.Sleep(1);
            }
        }