예제 #1
0
    public void run1()
    {
        initdraw();


        //    run2();

        //実行(ループ)
        while (DX.ProcessMessage() == 0 && m1.end_flag == 0)
        {
            //    long stime = m1.get_time();

            //escapeで、終了確認
            if (DX.CheckHitKey(DX.KEY_INPUT_ESCAPE) != 0)
            {
                int nt = 1;

                if (s1.debug_on() == 0)
                {
                    DialogResult result = MessageBox.Show("ゲームを終了しますか?", "終了確認", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2);

                    //何が選択されたか調べる
                    if (result == DialogResult.Yes)
                    {
                        nt = 1;
                    }
                    else if (result == DialogResult.No)
                    {
                        nt = 0;
                    }
                }


                if (nt == 1)
                {
                    m1.end_flag = 1;
                    break;
                }
            }

            //他のスレッドに、ゲーム終了を知らせる
            if (DX.ProcessMessage() != 0)// || DX.CheckHitKey(DX.KEY_INPUT_ESCAPE) != 0)
            {
                m1.end_flag = 1;
            }



            long stime = m1.get_time();

            {
                long timer = m1.get_time();
                run2();
                wait_time[0] = m1.get_time() - timer;//wait_time[0];
            }



            fps = m1.FpsTimeFanction();

            int nnb = 1;
            if (s1.debug_frame_control_on() == 1)
            {
                if (DX.CheckHitKey(DX.KEY_INPUT_2) != 0)
                {
                    nnb = 5;//m1.end();
                }

                if (DX.CheckHitKey(DX.KEY_INPUT_3) != 0)
                {
                    m1.wait(50);
                    nnb = 0;
                }
            }



            //描画
            if (s1.draw_count >= s1.draw_count_max * nnb)
            {
                s1.draw_count = 0;



                long timer = m1.get_time();
                draw1();
                wait_time[1] = m1.get_time() - timer;//wait_time[0];
            }

            s1.draw_count += 1;



            int wait = 17;//(d.waitframe);//=32

            if (s1.debug_frame_control_on() == 1)
            {
                if (DX.CheckHitKey(DX.KEY_INPUT_2) != 0)
                {
                    wait /= 5;//m1.end();
                }
            }


            //	m1.wait(stime,m1.get_time(),33);//d.loop_wait_frame);//40
            m1.wait(stime, m1.get_time(), wait);
            //    m1.wait(stime, m1.get_time(), 17);

            wait_time[2] = m1.get_time() - stime;
        }



        m1.end_flag = 1;
    }
예제 #2
0
    /*
     * public void set1(Misc1 m1, MainCanvas1 g1)//, Input1 input1)
     * {
     *  this.m1 = m1;
     *  this.g1 = g1;
     *  //    this.input1 = input1;
     *
     *  input1 = new Input1();
     *  ic1 = new ImageControl1();
     *  touch_input = new TouchInput();
     * }
     */


    public void init_set1(Summary1 s1)
    {
        long time1 = m1.get_time();


        {
            s1.sound_effect1 = new SoundEffect1(s1);
            s1.sound_effect1.init1();

            s1.bgm1 = new BGM1(s1);
            s1.bgm1.init1();

            s1.input1 = new Input1();
            s1.input1.init_set1(s1);

            s1.ic1 = new ImageControl1();
            s1.ic1.init_set1(s1);

            s1.touch_input = new TouchInput();
            s1.touch_input.init_set1(s1);

            s1.sound_effect_operation = new SoundEffectOperation(s1);
            s1.sound_effect_operation.init1();

            s1.sound_effect_control1 = new SoundEffectControl(s1);
            s1.sound_effect_control1.init1();

            s1.bgm_operation = new BGMOperation(s1);
            s1.bgm_operation.init1();

            s1.bgm_control1 = new BGMControl(s1);
            s1.bgm_control1.init1();
        }

        {
            s1.dm1 = new DrawMisc();
            s1.dm1.init_set1(s1);

            s1.am1 = new ApplicationMisc();
            s1.am1.init_set1(s1);

            s1.sm1 = new SoundMisc(s1);
            s1.sm1.init1();
        }

        {
            s1.mr1 = new MainRun1(s1);

            s1.csv_manager     = new CsvManager(s1);
            s1.data_magagement = new DataManagement1(s1);

            //    s1.function_script_reader_control = new FunctionScriptReaderControl(s1);
            s1.image_save_character        = new ImageSaveCharacter(s1);
            s1.image_save_character_window = new ImageSaveCharacterWindow(s1);
            s1.image_save_equipment        = new ImageSaveEquipment(s1);
            s1.effect_group   = new EffectGroup(s1);
            s1.dialog_window1 = new DialogWindow(s1);
            s1.app_variable1  = new AppVariable1(s1);
            s1.fade_run       = new FadeRun(s1);
            s1.wait_action    = new WaitAction(s1);
            s1.cam_2d         = new Camera2D(s1);
            s1.scroll_bar1    = new ScrollBar1(s1);
            s1.scroll_bar2    = new ScrollBar2(s1);

            s1.character_group = new CharacterGroup(s1);
            s1.equipment_group = new EquipmentGroup(s1);

            s1.save_data_control = new SaveDataControl(s1);

            s1.character_group.init1();
            s1.equipment_group.init1();

            s1.character_group.init2();


            s1.csv_manager.init1();
            s1.data_magagement.init1();

            //36f

            //    s1.function_script_reader_control.init1();
            s1.image_save_character.init1();
            s1.image_save_character_window.init1();
            s1.image_save_equipment.init1();
            s1.effect_group.init1();
            s1.dialog_window1.init1();

            s1.app_variable1.init1();
            s1.fade_run.init1();
            s1.wait_action.init1();
            s1.cam_2d.init1();
            s1.scroll_bar1.init1();
            s1.scroll_bar2.init1();


            //39f

            s1.save_data_control.init1();

            s1.mr1.init1();

            //    m1.msbox((m1.get_time() - time1));
        }

        {
        }

        //  m1.msbox((m1.get_time()-time1));
    }//init_set1
예제 #3
0
    //    Input1 input1;
    //    ImageControl1 ic1;


    public MainFrame1()
    {
        s1 = new Summary1();

        s1.m1 = new Misc1();
        s1.g1 = new MainCanvas1();

        s1.m1.init1();
        s1.g1.init1();

        m1 = s1.m1;
        g1 = s1.g1;


        long timer = m1.get_time();


        //    s1.init1();
        s1.init_set1(s1);

        /*
         * s1.m1 = new Misc1();
         * s1.g1 = new MainCanvas1();
         *
         * s1.m1.init1();
         * s1.g1.init1();
         *
         *
         * {
         *  s1.input1 = new Input1();
         *  s1.input1.init_set1(s1);
         *
         *  s1.ic1 = new ImageControl1();
         *  s1.ic1.init_set1(s1);
         * }*/


        /*
         * s.so = new Sound();
         * s.so.set(m, g, im, input, s);
         * s.so.init();
         *
         *
         * s.gm = new GameMisc();
         * s.gm.set(m, g, im, input, s);
         * s.gm.init();
         *
         *
         * s.tc = new TagControl();
         * s.tc.set(m, g, im, input, s);
         * s.tc.init();
         *
         * s.ti = new TouchInput();
         * s.ti.set(m, g, im, input, s);
         * s.ti.init();
         */

        /*
         * {
         *  s1.mr1 = new MainRun1();
         *  s1.mr1.init_set1(s1);
         * }*/



        wait_time[4] = m1.get_time() - timer;
    }