当前位置: 首页>>代码示例>>C++>>正文


C++ BLI_remlink函数代码示例

本文整理汇总了C++中BLI_remlink函数的典型用法代码示例。如果您正苦于以下问题:C++ BLI_remlink函数的具体用法?C++ BLI_remlink怎么用?C++ BLI_remlink使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了BLI_remlink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BLI_end_threads

void VideoFFmpeg::stopCache()
{
	if (m_cacheStarted)
	{
		m_stopThread = true;
		BLI_end_threads(&m_thread);
		// now delete the cache
		CacheFrame *frame;
		CachePacket *packet;
		while ((frame = (CacheFrame *)m_frameCacheBase.first) != NULL)
		{
			BLI_remlink(&m_frameCacheBase, frame);
			MEM_freeN(frame->frame->data[0]);
			av_free(frame->frame);
			delete frame;
		}
		while ((frame = (CacheFrame *)m_frameCacheFree.first) != NULL)
		{
			BLI_remlink(&m_frameCacheFree, frame);
			MEM_freeN(frame->frame->data[0]);
			av_free(frame->frame);
			delete frame;
		}
		while ((packet = (CachePacket *)m_packetCacheBase.first) != NULL)
		{
			BLI_remlink(&m_packetCacheBase, packet);
			av_free_packet(&packet->packet);
			delete packet;
		}
		while ((packet = (CachePacket *)m_packetCacheFree.first) != NULL)
		{
			BLI_remlink(&m_packetCacheFree, packet);
			delete packet;
		}
		m_cacheStarted = false;
	}
}
开发者ID:jonntd,项目名称:blender,代码行数:37,代码来源:VideoFFmpeg.cpp

示例2: wm_window_close

/* this is event from ghost, or exit-blender op */
void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
{
	wmWindow *tmpwin;
	bScreen *screen = win->screen;
	
	/* first check if we have any non-temp remaining windows */
	if ((U.uiflag & USER_QUIT_PROMPT) && !wm->file_saved) {
		if (wm->windows.first) {
			for (tmpwin = wm->windows.first; tmpwin; tmpwin = tmpwin->next) {
				if (tmpwin == win)
					continue;
				if (tmpwin->screen->temp == 0)
					break;
			}
			if (tmpwin == NULL) {
				if (!GHOST_confirmQuit(win->ghostwin))
					return;
			}
		}
	}

	BLI_remlink(&wm->windows, win);
	
	wm_draw_window_clear(win);
	CTX_wm_window_set(C, win);  /* needed by handlers */
	WM_event_remove_handlers(C, &win->handlers);
	WM_event_remove_handlers(C, &win->modalhandlers);
	ED_screen_exit(C, win, win->screen); 
	
	wm_window_free(C, wm, win);
	
	/* if temp screen, delete it after window free (it stops jobs that can access it) */
	if (screen->temp) {
		Main *bmain = CTX_data_main(C);
		BKE_libblock_free(&bmain->screen, screen);
	}
	
	/* check remaining windows */
	if (wm->windows.first) {
		for (win = wm->windows.first; win; win = win->next)
			if (win->screen->temp == 0)
				break;
		/* in this case we close all */
		if (win == NULL)
			WM_exit(C);
	}
	else
		WM_exit(C);
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:50,代码来源:wm_window.c

示例3: pthread_mutex_lock

void VideoFFmpeg::releaseFrame(AVFrame *frame)
{
	if (frame == m_frameRGB)
	{
		// this is not a frame from the cache, ignore
		return;
	}
	// this frame MUST be the first one of the queue
	pthread_mutex_lock(&m_cacheMutex);
	CacheFrame *cacheFrame = (CacheFrame *)m_frameCacheBase.first;
	assert (cacheFrame != NULL && cacheFrame->frame == frame);
	BLI_remlink(&m_frameCacheBase, cacheFrame);
	BLI_addtail(&m_frameCacheFree, cacheFrame);
	pthread_mutex_unlock(&m_cacheMutex);
}
开发者ID:Ichthyostega,项目名称:blender,代码行数:15,代码来源:VideoFFmpeg.cpp

示例4: sensor_remove_exec

static int sensor_remove_exec(bContext *C, wmOperator *op)
{
    Object *ob = NULL;
    bSensor *sens = edit_sensor_property_get(C, op, &ob);

    if (!sens)
        return OPERATOR_CANCELLED;

    BLI_remlink(&(ob->sensors), sens);
    free_sensor(sens);

    WM_event_add_notifier(C, NC_LOGIC, NULL);

    return OPERATOR_FINISHED;
}
开发者ID:244xiao,项目名称:blender,代码行数:15,代码来源:logic_ops.c

示例5: wm_window_close

/* this is event from ghost, or exit-blender op */
void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
{
    wmWindow *tmpwin;
    bool do_exit = false;

    /* first check if we have to quit (there are non-temp remaining windows) */
    for (tmpwin = wm->windows.first; tmpwin; tmpwin = tmpwin->next) {
        if (tmpwin == win)
            continue;
        if (tmpwin->screen->temp == 0)
            break;
    }

    if (tmpwin == NULL)
        do_exit = 1;

    if ((U.uiflag & USER_QUIT_PROMPT) && !wm->file_saved) {
        if (do_exit) {
            if (!GHOST_confirmQuit(win->ghostwin))
                return;
        }
    }

    /* let WM_exit do all freeing, for correct quit.blend save */
    if (do_exit) {
        WM_exit(C);
    }
    else {
        bScreen *screen = win->screen;

        BLI_remlink(&wm->windows, win);

        wm_draw_window_clear(win);

        CTX_wm_window_set(C, win);  /* needed by handlers */
        WM_event_remove_handlers(C, &win->handlers);
        WM_event_remove_handlers(C, &win->modalhandlers);
        ED_screen_exit(C, win, win->screen);

        wm_window_free(C, wm, win);

        /* if temp screen, delete it after window free (it stops jobs that can access it) */
        if (screen->temp) {
            Main *bmain = CTX_data_main(C);
            BKE_libblock_free(bmain, screen);
        }
    }
}
开发者ID:JasonWilkins,项目名称:blender-viewport_fx,代码行数:49,代码来源:wm_window.c

示例6: controller_remove_exec

static int controller_remove_exec(bContext *C, wmOperator *op)
{
    Object *ob = NULL;
    bController *cont = edit_controller_property_get(C, op, &ob);

    if (!cont)
        return OPERATOR_CANCELLED;

    BLI_remlink(&(ob->controllers), cont);
    unlink_controller(cont);
    free_controller(cont);

    WM_event_add_notifier(C, NC_LOGIC, NULL);

    return OPERATOR_FINISHED;
}
开发者ID:244xiao,项目名称:blender,代码行数:16,代码来源:logic_ops.c

示例7: actuator_remove_exec

static int actuator_remove_exec(bContext *C, wmOperator *op)
{
    Object *ob = NULL;
    bActuator *act = edit_actuator_property_get(C, op, &ob);

    if (!act)
        return OPERATOR_CANCELLED;

    BLI_remlink(&(ob->actuators), act);
    unlink_actuator(act);
    free_actuator(act);

    WM_event_add_notifier(C, NC_LOGIC, NULL);

    return OPERATOR_FINISHED;
}
开发者ID:244xiao,项目名称:blender,代码行数:16,代码来源:logic_ops.c

示例8: BLI_callback_global_finalize

/* call on application exit */
void BLI_callback_global_finalize(void)
{
	eCbEvent evt;
	for (evt = 0; evt < BLI_CB_EVT_TOT; evt++) {
		ListBase *lb = &callback_slots[evt];
		bCallbackFuncStore *funcstore;
		bCallbackFuncStore *funcstore_next;
		for (funcstore = (bCallbackFuncStore *)lb->first; funcstore; funcstore = funcstore_next) {
			funcstore_next = (bCallbackFuncStore *)funcstore->next;
			BLI_remlink(lb, funcstore);
			if (funcstore->alloc) {
				MEM_freeN(funcstore);
			}
		}
	}
}
开发者ID:244xiao,项目名称:blender,代码行数:17,代码来源:callbacks.c

示例9: freeMetaElemlist

/* free all MetaElems from ListBase */
static void freeMetaElemlist(ListBase *lb)
{
	MetaElem *ml, *next;

	if (lb == NULL) return;

	ml = lb->first;
	while (ml) {
		next = ml->next;
		BLI_remlink(lb, ml);
		MEM_freeN(ml);
		ml = next;
	}

	lb->first = lb->last = NULL;
}
开发者ID:danielmarg,项目名称:blender-main,代码行数:17,代码来源:mball_edit.c

示例10: unpackImage

int unpackImage(ReportList *reports, Image *ima, int how)
{
	int ret_value = RET_ERROR;

	if (ima != NULL) {
		while (ima->packedfiles.last) {
			char localname[FILE_MAX], absname[FILE_MAX];
			char *newname;
			ImagePackedFile *imapf = ima->packedfiles.last;

			unpack_generate_paths(imapf->filepath, (ID *)ima, absname, localname, sizeof(absname), sizeof(localname));
			newname = unpackFile(reports, absname, localname, imapf->packedfile, how);

			if (newname != NULL) {
				ImageView *iv;

				ret_value = ret_value == RET_ERROR ? RET_ERROR : RET_OK;
				freePackedFile(imapf->packedfile);
				imapf->packedfile = NULL;

				/* update the new corresponding view filepath */
				iv = BLI_findstring(&ima->views, imapf->filepath, offsetof(ImageView, filepath));
				if (iv) {
					BLI_strncpy(iv->filepath, newname, sizeof(imapf->filepath));
				}

				/* keep the new name in the image for non-pack specific reasons */
				if (how != PF_REMOVE) {
					BLI_strncpy(ima->name, newname, sizeof(imapf->filepath));
				}
				MEM_freeN(newname);
			}
			else {
				ret_value = RET_ERROR;
			}

			BLI_remlink(&ima->packedfiles, imapf);
			MEM_freeN(imapf);
		}
	}

	if (ret_value == RET_OK) {
		BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
	}

	return(ret_value);
}
开发者ID:Bforartists,项目名称:Bforartists,代码行数:47,代码来源:packedFile.c

示例11: RE_engines_exit

void RE_engines_exit(void)
{
	RenderEngineType *type, *next;

	for (type = R_engines.first; type; type = next) {
		next = type->next;

		BLI_remlink(&R_engines, type);

		if (!(type->flag & RE_INTERNAL)) {
			if (type->ext.free)
				type->ext.free(type->ext.data);

			MEM_freeN(type);
		}
	}
}
开发者ID:akonneker,项目名称:blensor,代码行数:17,代码来源:external_engine.c

示例12: wm_window_match_init

/* To be able to read files without windows closing, opening, moving
 * we try to prepare for worst case:
 * - active window gets active screen from file
 * - restoring the screens from non-active windows
 * Best case is all screens match, in that case they get assigned to proper window
 */
static void wm_window_match_init(bContext *C, ListBase *wmlist)
{
	wmWindowManager *wm;
	wmWindow *win, *active_win;
	
	*wmlist = G.main->wm;
	BLI_listbase_clear(&G.main->wm);
	
	active_win = CTX_wm_window(C);

	/* first wrap up running stuff */
	/* code copied from wm_init_exit.c */
	for (wm = wmlist->first; wm; wm = wm->id.next) {
		
		WM_jobs_kill_all(wm);
		
		for (win = wm->windows.first; win; win = win->next) {
		
			CTX_wm_window_set(C, win);  /* needed by operator close callbacks */
			WM_event_remove_handlers(C, &win->handlers);
			WM_event_remove_handlers(C, &win->modalhandlers);
			ED_screen_exit(C, win, win->screen);
		}
	}
	
	/* reset active window */
	CTX_wm_window_set(C, active_win);

	ED_editors_exit(C);

	/* just had return; here from r12991, this code could just get removed?*/
#if 0
	if (wm == NULL) return;
	if (G.fileflags & G_FILE_NO_UI) return;
	
	/* we take apart the used screens from non-active window */
	for (win = wm->windows.first; win; win = win->next) {
		BLI_strncpy(win->screenname, win->screen->id.name, MAX_ID_NAME);
		if (win != wm->winactive) {
			BLI_remlink(&G.main->screen, win->screen);
			//BLI_addtail(screenbase, win->screen);
		}
	}
#endif
}
开发者ID:ChunHungLiu,项目名称:blender,代码行数:51,代码来源:wm_files.c

示例13: blf_font_free

void blf_font_free(FontBLF *font)
{
	GlyphCacheBLF *gc;

	font->glyph_cache = NULL;
	while (font->cache.first) {
		gc = font->cache.first;
		BLI_remlink(&font->cache, gc);
		blf_glyph_cache_free(gc);
	}

	FT_Done_Face(font->face);
	if (font->filename)
		MEM_freeN(font->filename);
	if (font->name)
		MEM_freeN(font->name);
	MEM_freeN(font);
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:18,代码来源:blf_font.c

示例14: blf_glyph_cache_clear

void blf_glyph_cache_clear(FontBLF *font)
{
	GlyphCacheBLF *gc;
	GlyphBLF *g;
	int i;

	for (gc = font->cache.first; gc; gc = gc->next) {
		for (i = 0; i < 257; i++) {
			while (gc->bucket[i].first) {
				g = gc->bucket[i].first;
				BLI_remlink(&(gc->bucket[i]), g);
				blf_glyph_free(g);
			}
		}

		memset(gc->glyph_ascii_table, 0, sizeof(gc->glyph_ascii_table));
	}
}
开发者ID:nttputus,项目名称:blensor,代码行数:18,代码来源:blf_glyph.c

示例15: blf_glyph_cache_free

void blf_glyph_cache_free(GlyphCacheBLF *gc)
{
	GlyphBLF *g;
	int i;

	for (i = 0; i < 257; i++) {
		while (gc->bucket[i].first) {
			g = gc->bucket[i].first;
			BLI_remlink(&(gc->bucket[i]), g);
			blf_glyph_free(g);
		}
	}

	if (gc->cur_tex+1 > 0)
		glDeleteTextures(gc->cur_tex+1, gc->textures);
	free((void *)gc->textures);
	MEM_freeN(gc);
}
开发者ID:nttputus,项目名称:blensor,代码行数:18,代码来源:blf_glyph.c


注:本文中的BLI_remlink函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。