Esempio n. 1
0
 virtual bool get_mouse_coords(int32_t *x, int32_t *y)
 {
     copy_fields(this, real_renderer);
     bool res = real_renderer->get_mouse_coords(x, y);
     copy_fields(real_renderer, this);
     return res;
 };
Esempio n. 2
0
 virtual bool uses_opengl()
 {
     copy_fields(this, real_renderer);
     bool res = real_renderer->uses_opengl();
     copy_fields(real_renderer, this);
     return res;
 }
Esempio n. 3
0
void copy_mesh_subset(stk::mesh::BulkData &inputBulk, stk::mesh::Selector selectedElems, stk::mesh::BulkData &outputBulk)
{
    ThrowRequireMsg(&inputBulk != &outputBulk, "Can't copy to same mesh.");
    stk::mesh::MetaData &inputMeta = inputBulk.mesh_meta_data();
    stk::mesh::MetaData &outputMeta = outputBulk.mesh_meta_data();
    outputMeta.initialize(inputMeta.spatial_dimension(), inputMeta.entity_rank_names());
    copy_parts(inputMeta, outputMeta);
    copy_fields(inputMeta, outputMeta);
}
Esempio n. 4
0
    virtual void zoom(df::zoom_commands)
    {
        copy_fields(this, real_renderer);

        enabler->renderer = real_renderer;

        LOCKSTEP_DEBUG("lockstep_loop started");
        lockstep_loop();
        LOCKSTEP_DEBUG("lockstep_loop ended");

        lockstep_ready_for_shutdown = true;
    }
Esempio n. 5
0
/**
 * Update the next thread's AVCodecContext with values set by the user.
 *
 * @param dst The destination context.
 * @param src The source context.
 * @return 0 on success, negative error code on failure
 */
static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
{
#define copy_fields(s, e) memcpy(&dst->s, &src->s, (char*)&dst->e - (char*)&dst->s);
    dst->flags          = src->flags;

    dst->draw_horiz_band= src->draw_horiz_band;
    dst->get_buffer2    = src->get_buffer2;
#if FF_API_GET_BUFFER
FF_DISABLE_DEPRECATION_WARNINGS
    dst->get_buffer     = src->get_buffer;
    dst->release_buffer = src->release_buffer;
FF_ENABLE_DEPRECATION_WARNINGS
#endif

    dst->opaque   = src->opaque;
    dst->debug    = src->debug;
    dst->debug_mv = src->debug_mv;

    dst->slice_flags = src->slice_flags;
    dst->flags2      = src->flags2;

    copy_fields(skip_loop_filter, subtitle_header);

    dst->frame_number     = src->frame_number;
    dst->reordered_opaque = src->reordered_opaque;
    dst->thread_safe_callbacks = src->thread_safe_callbacks;

    if (src->slice_count && src->slice_offset) {
        if (dst->slice_count < src->slice_count) {
            int *tmp = av_realloc(dst->slice_offset, src->slice_count *
                                  sizeof(*dst->slice_offset));
            if (!tmp) {
                av_free(dst->slice_offset);
                return AVERROR(ENOMEM);
            }
            dst->slice_offset = tmp;
        }
        memcpy(dst->slice_offset, src->slice_offset,
               src->slice_count * sizeof(*dst->slice_offset));
    }
    dst->slice_count = src->slice_count;
    return 0;
#undef copy_fields
}
Esempio n. 6
0
/**
 * Update the next thread's AVCodecContext with values set by the user.
 *
 * @param dst The destination context.
 * @param src The source context.
 * @return 0 on success, negative error code on failure
 */
static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
{
#define copy_fields(s, e) memcpy(&dst->s, &src->s, (char*)&dst->e - (char*)&dst->s);
    dst->flags          = src->flags;

    dst->draw_horiz_band= src->draw_horiz_band;
    dst->get_buffer     = src->get_buffer;
    dst->release_buffer = src->release_buffer;

    dst->opaque   = src->opaque;
    dst->dsp_mask = src->dsp_mask;
    dst->debug    = src->debug;
    dst->debug_mv = src->debug_mv;

    dst->slice_flags = src->slice_flags;
    dst->flags2      = src->flags2;

    copy_fields(skip_loop_filter, bidir_refine);

    dst->frame_number     = src->frame_number;
    dst->reordered_opaque = src->reordered_opaque;
    dst->thread_safe_callbacks = src->thread_safe_callbacks;

    if (src->slice_count && src->slice_offset) {
        if (dst->slice_count < src->slice_count) {
            int *tmp = av_realloc(dst->slice_offset, src->slice_count *
                                  sizeof(*dst->slice_offset));
            if (!tmp) {
                av_free(dst->slice_offset);
                return AVERROR(ENOMEM);
            }
            dst->slice_offset = tmp;
        }
        memcpy(dst->slice_offset, src->slice_offset,
               src->slice_count * sizeof(*dst->slice_offset));
    }
    dst->slice_count = src->slice_count;
    return 0;
#undef copy_fields
}
Esempio n. 7
0
 virtual void grid_resize(int32_t w, int32_t h)
 {
     copy_fields(this, real_renderer);
     real_renderer->grid_resize(w, h);
     copy_fields(real_renderer, this);
 }
Esempio n. 8
0
 virtual void set_fullscreen()
 {
     copy_fields(this, real_renderer);
     real_renderer->set_fullscreen();
     copy_fields(real_renderer, this);
 }
Esempio n. 9
0
 virtual void render()
 {
     copy_fields(this, real_renderer);
     real_renderer->render();
     copy_fields(real_renderer, this);
 }
Esempio n. 10
0
 virtual void update_all()
 {
     copy_fields(this, real_renderer);
     real_renderer->update_all();
     copy_fields(real_renderer, this);
 }
Esempio n. 11
0
 virtual void update_tile(int32_t x, int32_t y)
 {
     copy_fields(this, real_renderer);
     real_renderer->update_tile(x, y);
     copy_fields(real_renderer, this);
 }
Esempio n. 12
0
 df_ai_renderer(df::renderer *real) : real_renderer(real)
 {
     copy_fields(real_renderer, this);
 }
Esempio n. 13
0
    /**
     * Update Win32 window object from fields in the fake window.
     *
     * Fields can be set in the wrapper before the Win32 window is created.
     * This window pushes those values out to the real window once it is
     * created.
     *
     * Call this method before receiving the WM_DESTROY message so that
     * @c copy_fields() can rely on the integrity of the window fields.
     */
    void push()
    {
        assert(m_real_window); // must not call this method unless attached

        copy_fields(fake(), real());
    }