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


C++ SCP_map::begin方法代码示例

本文整理汇总了C++中SCP_map::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ SCP_map::begin方法的具体用法?C++ SCP_map::begin怎么用?C++ SCP_map::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SCP_map的用法示例。


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

示例1: batching_load_buffers

void batching_load_buffers(bool distortion)
{
	GR_DEBUG_SCOPE("Batching load buffers");
	TRACE_SCOPE(tracing::LoadBatchingBuffers);

	SCP_map<batch_info, primitive_batch>::iterator bi;
	SCP_map<batch_buffer_key, primitive_batch_buffer>::iterator buffer_iter;

	for ( buffer_iter = Batching_buffers.begin(); buffer_iter != Batching_buffers.end(); ++buffer_iter ) {
		// zero out the buffers
		buffer_iter->second.desired_buffer_size = 0;
	}

	// assign primitive batch items
	for ( bi = Batching_primitives.begin(); bi != Batching_primitives.end(); ++bi ) {
		if ( bi->first.mat_type == batch_info::DISTORTION ) {
			if ( !distortion ) {
				continue;
			}
		} else {
			if ( distortion ) {
				continue;
			}
		}

		size_t num_verts = bi->second.num_verts();

		if ( num_verts > 0 ) {
			batch_info render_info = bi->second.get_render_info();
			uint vertex_mask = batching_determine_vertex_layout(&render_info);

			primitive_batch_buffer *buffer = batching_find_buffer(vertex_mask, render_info.prim_type);
			primitive_batch_item draw_item;

			draw_item.batch_item_info = render_info;
			draw_item.offset = 0;
			draw_item.n_verts = num_verts;
			draw_item.batch = &bi->second;

			buffer->desired_buffer_size += num_verts * sizeof(batch_vertex);
			buffer->items.push_back(draw_item);
		}
	}

	for ( buffer_iter = Batching_buffers.begin(); buffer_iter != Batching_buffers.end(); ++buffer_iter ) {
		batching_allocate_and_load_buffer(&buffer_iter->second);
	}
}
开发者ID:DahBlount,项目名称:fs2open.github.com,代码行数:48,代码来源:batching.cpp

示例2: batch_get_size

int batch_get_size()
{
	int n_to_render = 0;
	SCP_map<int, batch_item>::iterator bi;

	for (bi = geometry_map.begin(); bi != geometry_map.end(); ++bi) {
		n_to_render += bi->second.batch.need_to_render();
	}

	for (bi = distortion_map.begin(); bi != distortion_map.end(); ++bi) {
		if ( bi->second.laser )
			continue;

		n_to_render += bi->second.batch.need_to_render();
	}

	return n_to_render * 3;
}
开发者ID:RandomTiger,项目名称:fs2open.github.com,代码行数:18,代码来源:grbatch.cpp

示例3: geometry_batch_get_size

int geometry_batch_get_size()
{
	int n_to_render = 0;
	SCP_map<int, g_sdr_batch_item>::iterator bi;

	for (bi = geometry_shader_map.begin(); bi != geometry_shader_map.end(); ++bi) {
		n_to_render += bi->second.batch.need_to_render();
	}

	return n_to_render;
}
开发者ID:RandomTiger,项目名称:fs2open.github.com,代码行数:11,代码来源:grbatch.cpp

示例4: batch_load_buffer_distortion_map_bitmaps

void batch_load_buffer_distortion_map_bitmaps(effect_vertex* buffer, int *n_verts)
{
	for (SCP_map<int, batch_item>::iterator bi = distortion_map.begin(); bi != distortion_map.end(); ++bi) {

		if ( bi->second.laser )
			continue;

		if ( !bi->second.batch.need_to_render() )
			continue;

		Assert( bi->second.texture >= 0 );
		bi->second.batch.load_buffer(buffer, n_verts);
	}
}
开发者ID:RandomTiger,项目名称:fs2open.github.com,代码行数:14,代码来源:grbatch.cpp

示例5: batch_load_buffer_geometry_shader_map_bitmaps

void batch_load_buffer_geometry_shader_map_bitmaps(particle_pnt* buffer, int *n_verts)
{
	for (SCP_map<int, g_sdr_batch_item>::iterator bi = geometry_shader_map.begin(); bi != geometry_shader_map.end(); ++bi) {

		if ( bi->second.laser )
			continue;

		if ( !bi->second.batch.need_to_render() )
			continue;

		Assert( bi->second.texture >= 0 );
		bi->second.batch.load_buffer(buffer, n_verts);
	}
}
开发者ID:RandomTiger,项目名称:fs2open.github.com,代码行数:14,代码来源:grbatch.cpp

示例6: batch_render_geometry_shader_map_bitmaps

void batch_render_geometry_shader_map_bitmaps(int buffer_handle)
{
	for (SCP_map<int, g_sdr_batch_item>::iterator bi = geometry_shader_map.begin(); bi != geometry_shader_map.end(); ++bi) {

		if ( bi->second.laser )
			continue;

		if ( !bi->second.batch.need_to_render() )
			continue;

		Assert( bi->second.texture >= 0 );
		gr_set_bitmap(bi->second.texture, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, bi->second.alpha);
		bi->second.batch.render_buffer(buffer_handle, bi->second.tmap_flags);
	}
}
开发者ID:RandomTiger,项目名称:fs2open.github.com,代码行数:15,代码来源:grbatch.cpp

示例7: batch_render_lasers

void batch_render_lasers(int buffer_handle)
{
	for (SCP_map<int, batch_item>::iterator bi = geometry_map.begin(); bi != geometry_map.end(); ++bi) {

		if ( !bi->second.laser )
			continue;

		if ( !bi->second.batch.need_to_render() )
			continue;

		Assert( bi->second.texture >= 0 );
		gr_set_bitmap(bi->second.texture, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.99999f);
		if ( buffer_handle >= 0 ) {
			bi->second.batch.render_buffer(buffer_handle, TMAP_FLAG_TEXTURED | TMAP_FLAG_XPARENT | TMAP_HTL_3D_UNLIT | TMAP_FLAG_RGB | TMAP_FLAG_GOURAUD | TMAP_FLAG_CORRECT);
		} else {
			bi->second.batch.render(TMAP_FLAG_TEXTURED | TMAP_FLAG_XPARENT | TMAP_HTL_3D_UNLIT | TMAP_FLAG_RGB | TMAP_FLAG_GOURAUD | TMAP_FLAG_CORRECT);
		}
	}
}
开发者ID:RandomTiger,项目名称:fs2open.github.com,代码行数:19,代码来源:grbatch.cpp

示例8: batch_render_distortion_map_bitmaps

void batch_render_distortion_map_bitmaps(int buffer_handle)
{
	for (SCP_map<int,batch_item>::iterator bi = distortion_map.begin(); bi != distortion_map.end(); ++bi) {

		if ( bi->second.laser )
			continue;

		if ( !bi->second.batch.need_to_render() )
			continue;

		Assert( bi->second.texture >= 0 );
		gr_set_bitmap(bi->second.texture, GR_ALPHABLEND_NONE, GR_BITBLT_MODE_NORMAL, bi->second.alpha);

		if ( buffer_handle >= 0 ) {
			bi->second.batch.render_buffer(buffer_handle, bi->second.tmap_flags);
		} else {
			bi->second.batch.render( bi->second.tmap_flags);
		}
	}
}
开发者ID:RandomTiger,项目名称:fs2open.github.com,代码行数:20,代码来源:grbatch.cpp


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