Esempio n. 1
0
void delete_dungeon(dungeon_t *d)
{
  free(d->rooms);
  heap_delete(&d->events);
  memset(d->character_map, 0, sizeof (d->character_map));
  destroy_objects(d);
}
Esempio n. 2
0
static void destroy(struct gl_hwdec *hw)
{
    struct priv *p = hw->priv;

    destroy_objects(hw);
    mp_vdpau_mixer_destroy(p->mixer);
    mp_vdpau_destroy(p->ctx);
}
Esempio n. 3
0
// Called at program exit to cleanly shut everything down.
void handle_deinit() {
#ifdef MAKE_CHRONOGRAPH
  save_chrono_data();
#endif  // MAKE_CHRONOGRAPH
  tick_timer_service_unsubscribe();

  destroy_objects();
}
static void
destroy_texture_unlocked (GstVaapiTexture * texture)
{
  const guint texture_id = GST_VAAPI_TEXTURE_ID (texture);

  destroy_objects (GST_VAAPI_TEXTURE_GLX (texture));

  if (texture_id) {
    if (!texture->is_wrapped)
      glDeleteTextures (1, &texture_id);
    GST_VAAPI_TEXTURE_ID (texture) = 0;
  }
}
Esempio n. 5
0
static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
{
    struct priv *p = hw->priv;
    GL *gl = hw->gl;
    struct vdp_functions *vdp = &p->ctx->vdp;
    VdpStatus vdp_st;

    destroy_objects(hw);

    assert(params->imgfmt == hw->driver->imgfmt);
    p->image_params = *params;

    if (mp_vdpau_handle_preemption(p->ctx, &p->preemption_counter) < 0)
        return -1;

    gl->VDPAUInitNV(BRAINDEATH(p->ctx->vdp_device), p->ctx->get_proc_address);

    p->vdpgl_initialized = true;

    vdp_st = vdp->output_surface_create(p->ctx->vdp_device,
                                        VDP_RGBA_FORMAT_B8G8R8A8,
                                        params->w, params->h, &p->vdp_surface);
    CHECK_VDP_ERROR(p, "Error when calling vdp_output_surface_create");

    gl->GenTextures(1, &p->gl_texture);
    gl->BindTexture(GL_TEXTURE_2D, p->gl_texture);
    gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    gl->BindTexture(GL_TEXTURE_2D, 0);

    p->vdpgl_surface = gl->VDPAURegisterOutputSurfaceNV(BRAINDEATH(p->vdp_surface),
                                                        GL_TEXTURE_2D,
                                                        1, &p->gl_texture);
    if (!p->vdpgl_surface)
        return -1;

    gl->VDPAUSurfaceAccessNV(p->vdpgl_surface, GL_READ_ONLY);

    glCheckError(gl, hw->log, "After initializing vdpau OpenGL interop");

    return 0;
}
Esempio n. 6
0
bool TDoodad::load_Data(Data& data, bool destroyExisting)
{
	std::vector<TCreep*> tc = data.getTCreeps();
	std::vector<TTower*> tt = data.getTTowers();
	std::vector<Animation*> anim = data.getAnimations();
	if(destroyExisting)
	{
		destroy_objects();
	}
	for(uint32_t i = 0; i < tc.size(); ++i)
	{
		m_tcreep[tc[i]->getId()] = tc[i];
	}
	for(uint32_t i = 0; i < tt.size(); ++i)
	{
		m_ttower[tt[i]->getId()] = tt[i];
	}
	for(uint32_t i = 0; i < anim.size(); ++i)
	{
		m_animation[anim[i]->getId()] = anim[i];
	}
	return true;
}
Esempio n. 7
0
void reset_memory_panic() {
  // The memory_panic_flag was set, indicating that something
  // somewhere failed to allocate memory.  Destory and recreate
  // everything, in the hopes this will clear out memory
  // fragmentation.

  memory_panic_flag = false;
  ++memory_panic_count;

  app_log(APP_LOG_LEVEL_INFO, __FILE__, __LINE__, "reset_memory_panic begin, count = %d", memory_panic_count);

  destroy_objects();
  create_objects();

  // Start resetting some options if the memory panic count grows too high.
  if (memory_panic_count > 1) {
    config.battery_gauge = IM_off;
    config.bluetooth_indicator = IM_off;
  }
  if (memory_panic_count > 2) {
    config.second_hand = false;
  } 
  if (memory_panic_count > 3) {
    for (int i = 0; i < NUM_DATE_WINDOWS; ++i) {
      config.date_windows[i] = DWM_off;
    }
  } 
  if (memory_panic_count > 4) {
    config.chrono_dial = 0;
  } 
  if (memory_panic_count > 5) {
    // At this point we hide the clock face.  Drastic!
  }

  app_log(APP_LOG_LEVEL_INFO, __FILE__, __LINE__, "reset_memory_panic done, count = %d", memory_panic_count);
}
Esempio n. 8
0
vogl_context_snapshot::~vogl_context_snapshot()
{
    VOGL_FUNC_TRACER

    destroy_objects();
}
Esempio n. 9
0
void MainControl::on_exit_thread()
{
#if defined(DEBUG)
	cout << "MainControl exit thread!\n";
#endif

////////////////////////////////////////////////////////////////
// stop timer thread
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start timer exit thread!\n";
	timer_thread(CLS_STOP);
	cout << "finish timer exit thread!\n";
#else
	timer_thread(CLS_STOP);
#endif
 
////////////////////////////////////////////////////////////////
// stop market socket listen
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start socket listen exit thread!\n";
	mkt_socket_listen(CLS_STOP);
	cout << "Socket Listener stop thread!\n";
#else
	mkt_socket_listen(CLS_STOP);
#endif
 
////////////////////////////////////////////////////////////////
// stop idx socket data thread
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start socket data exit thread!\n";
	idx_socket_data(CLS_STOP);
	cout << "socket data stop thread!\n";
#else
	idx_socket_data(CLS_STOP);
#endif
    
////////////////////////////////////////////////////////////////
// stop idx data manager thread
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start data manager exit thread!\n";
	idx_data_manager(CLS_STOP);
	cout << "data manager stop thread!\n";
#else
	idx_data_manager(CLS_STOP);
#endif
    
////////////////////////////////////////////////////////////////
// stop market client manager thread
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start mkt client mgr exit thread!\n";
	mkt_client_manager(CLS_STOP);
	cout << "Client Manager stop thread!\n";
#else
	mkt_client_manager(CLS_STOP);
#endif

////////////////////////////////////////////////////////////////
// stop data storage manager thread
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start data storage exit thread!\n";
#endif
	data_storage(CLS_STOP);
#if defined(DEBUG)
	cout << "Data Storage stop thread!\n";
#endif

	destroy_objects();
}