Beispiel #1
0
        public override void update(bool skip_redraw)
        {
            base.update(skip_redraw);

            //System.Windows.Forms.Application.DoEvents();

            if (updateCount++ % 100 == 0)
                osd_printf_verbose("osd_interface.update() - {0}\n", updateCount);


            if (!skip_redraw)
            {
                render_primitive_list list = m_target.get_primitives();
                list.acquire_lock();

                UInt32 width = 400;  //640; //rect_width(&bounds);
                UInt32 height = 400; //480; //rect_height(&bounds);
                UInt32 pitch = (UInt32)((width + 3) & ~3);


                lock (osdlock)
                {
                    //software_renderer<typeof(UInt32), 0,0,0, 16,8,0>.draw_primitives(list, g_state.screenbuffer, width, height, pitch);
                    software_renderer<UInt32>.SetTemplateParams(32, 0,0,0, 16,8,0);
                    software_renderer<UInt32>.draw_primitives(list, screenbufferptr, width, height, pitch);
                }

                list.release_lock();
            }
        }
Beispiel #2
0
        // snapshot/movie helpers

        //-------------------------------------------------
        //  create_snapshot_bitmap - creates a
        //  bitmap containing the screenshot for the
        //  given screen
        //-------------------------------------------------
        //typedef software_renderer<UINT32, 0,0,0, 16,8,0, false, true> snap_renderer_bilinear;
        //typedef software_renderer<UINT32, 0,0,0, 16,8,0, false, false> snap_renderer;

        void create_snapshot_bitmap(screen_device screen)
        {
            // select the appropriate view in our dummy target
            if (m_snap_native && screen != null)
            {
                screen_device_enumerator iter = new screen_device_enumerator(machine().root_device());
                int view_index = iter.indexof(screen);
                assert(view_index != -1);
                m_snap_target.set_view((unsigned)view_index);
            }

            // get the minimum width/height and set it on the target and bitmap
            s32 width;
            s32 height;

            compute_snapshot_size(out width, out height);
            m_snap_target.set_bounds(width, height);
            if (width != m_snap_bitmap.width() || height != m_snap_bitmap.height())
            {
                m_snap_bitmap.resize(width, height);
            }

            // render the screen there
            render_primitive_list primlist = m_snap_target.get_primitives();

            primlist.acquire_lock();
            if (machine().options().snap_bilinear())
            {
                //typedef software_renderer<u32, 0,0,0, 16,8,0, false, true> snap_renderer_bilinear;
                //snap_renderer_bilinear::draw_primitives(primlist, &m_snap_bitmap.pix(0), width, height, m_snap_bitmap.rowpixels());
                software_renderer <u32, int_const_0, int_const_0, int_const_0, int_const_16, int_const_8, int_const_0, bool_const_false, bool_const_true> .draw_primitives(primlist, m_snap_bitmap.pix(0), (u32)width, (u32)height, (u32)m_snap_bitmap.rowpixels());
            }
            else
            {
                //typedef software_renderer<u32, 0,0,0, 16,8,0, false, false> snap_renderer;
                //snap_renderer::draw_primitives(primlist, &m_snap_bitmap.pix(0), width, height, m_snap_bitmap.rowpixels());
                software_renderer <u32, int_const_0, int_const_0, int_const_0, int_const_16, int_const_8, int_const_0, bool_const_false, bool_const_false> .draw_primitives(primlist, m_snap_bitmap.pix(0), (u32)width, (u32)height, (u32)m_snap_bitmap.rowpixels());
            }
            primlist.release_lock();
        }