本文整理汇总了C++中SCP_map::end方法的典型用法代码示例。如果您正苦于以下问题:C++ SCP_map::end方法的具体用法?C++ SCP_map::end怎么用?C++ SCP_map::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SCP_map
的用法示例。
在下文中一共展示了SCP_map::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: batch_add_laser
float batch_add_laser(int texture, vec3d *p0, float width1, vec3d *p1, float width2, int r, int g, int b)
{
if (texture < 0) {
Int3();
return 1;
}
batch_item *item = NULL;
SCP_map<int, batch_item>::iterator it = geometry_map.find(texture);
if ( !geometry_map.empty() && it != geometry_map.end() ) {
item = &it->second;
} else {
item = &geometry_map[texture];
item->texture = texture;
}
item->laser = true;
item->batch.add_allocate(1);
float num = item->batch.draw_laser(p0, width1, p1, width2, r, g, b);
return num;
}
示例2: batch_add_bitmap_rotated
int batch_add_bitmap_rotated(int texture, int tmap_flags, vertex *pnt, float angle, float rad, float alpha, float depth)
{
if (texture < 0) {
Int3();
return 1;
}
if ( tmap_flags & TMAP_FLAG_SOFT_QUAD && ( !Cmdline_softparticles || GLSL_version <= 120 ) ) {
// don't render this as a soft particle if we don't support soft particles
tmap_flags &= ~(TMAP_FLAG_SOFT_QUAD);
}
batch_item *item = NULL;
SCP_map<int, batch_item>::iterator it = geometry_map.find(texture);
if ( !geometry_map.empty() && it != geometry_map.end() ) {
item = &it->second;
} else {
item = &geometry_map[texture];
item->texture = texture;
}
Assertion( (item->laser == false), "Particle effect %s used as laser glow or laser bitmap\n", bm_get_filename(texture) );
item->tmap_flags = tmap_flags;
item->alpha = alpha;
item->batch.add_allocate(1);
item->batch.draw_bitmap(pnt, rad, angle, depth);
return 0;
}
示例3: geometry_batch_add_bitmap
int geometry_batch_add_bitmap(int texture, int tmap_flags, vertex *pnt, int orient, float rad, float alpha, float depth)
{
if (texture < 0) {
Int3();
return 1;
}
g_sdr_batch_item *item = NULL;
SCP_map<int, g_sdr_batch_item>::iterator it = geometry_shader_map.find(texture);
if ( !geometry_shader_map.empty() && it != geometry_shader_map.end() ) {
item = &it->second;
} else {
item = &geometry_shader_map[texture];
item->texture = texture;
}
Assertion( (item->laser == false), "Particle effect %s used as laser glow or laser bitmap\n", bm_get_filename(texture) );
item->tmap_flags = tmap_flags;
item->alpha = alpha;
item->batch.draw_bitmap(pnt, orient, rad, depth);
return 0;
}
示例4: distortion_add_beam
int distortion_add_beam(int texture, int tmap_flags, vec3d *start, vec3d *end, float width, float intensity, float offset)
{
if (texture < 0) {
Int3();
return 1;
}
batch_item *item = NULL;
SCP_map<int, batch_item>::iterator it = distortion_map.find(texture);
if ( !distortion_map.empty() && it != distortion_map.end() ) {
item = &it->second;
} else {
item = &distortion_map[texture];
item->texture = texture;
}
Assertion( (item->laser == false), "Distortion particle effect %s used as laser glow or laser bitmap\n", bm_get_filename(texture) );
item->tmap_flags = tmap_flags;
item->alpha = intensity;
item->batch.add_allocate(1);
item->batch.draw_beam(start,end,width,intensity,offset);
return 0;
}
示例5: distortion_add_bitmap_rotated
int distortion_add_bitmap_rotated(int texture, int tmap_flags, vertex *pnt, float angle, float rad, float alpha, float depth)
{
if (texture < 0) {
Int3();
return 1;
}
batch_item *item = NULL;
SCP_map<int, batch_item>::iterator it = distortion_map.find(texture);
if ( !distortion_map.empty() && it != distortion_map.end() ) {
item = &it->second;
} else {
item = &distortion_map[texture];
item->texture = texture;
}
Assertion( (item->laser == false), "Distortion particle effect %s used as laser glow or laser bitmap\n", bm_get_filename(texture) );
item->tmap_flags = tmap_flags;
item->alpha = alpha;
item->batch.add_allocate(1);
item->batch.draw_bitmap(pnt, rad, angle, depth);
return 0;
}
示例6: batch_add_quad
int batch_add_quad(int texture, int tmap_flags, vertex *verts, float alpha)
{
if (texture < 0) {
Int3();
return 1;
}
batch_item *item = NULL;
SCP_map<int, batch_item>::iterator it = geometry_map.find(texture);
if ( !geometry_map.empty() && it != geometry_map.end() ) {
item = &it->second;
} else {
item = &geometry_map[texture];
item->texture = texture;
}
Assertion( (item->laser == false), "Particle effect %s used as laser glow or laser bitmap\n", bm_get_filename(texture) );
item->tmap_flags = tmap_flags;
item->alpha = alpha;
item->batch.add_allocate(1);
item->batch.draw_quad(verts);
return 0;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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);
}
}
示例10: 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);
}
}
}
示例11: batch_render_geometry_map_bitmaps
void batch_render_geometry_map_bitmaps(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, 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);
}
}
}
示例12: batching_find_batch
primitive_batch* batching_find_batch(int texture, batch_info::material_type material_id, primitive_type prim_type, bool thruster)
{
// Use the base texture for finding the batch item since all items can reuse the same texture array
auto base_tex = bm_get_base_frame(texture);
batch_info query(material_id, base_tex, prim_type, thruster);
SCP_map<batch_info, primitive_batch>::iterator iter = Batching_primitives.find(query);
if ( iter == Batching_primitives.end() ) {
primitive_batch* batch = &Batching_primitives[query];
*batch = primitive_batch(query);
return batch;
} else {
return &iter->second;
}
}
示例13: batch_add_bitmap
int batch_add_bitmap(int texture, int tmap_flags, vertex *pnt, int orient, float rad, float alpha, float depth)
{
if (texture < 0) {
Int3();
return 1;
}
if ( tmap_flags & TMAP_FLAG_SOFT_QUAD && ( !Cmdline_softparticles || GLSL_version <= 120 ) ) {
// don't render this as a soft particle if we don't support soft particles
tmap_flags &= ~(TMAP_FLAG_SOFT_QUAD);
}
if ( GLSL_version > 120 && Cmdline_softparticles && !Cmdline_no_geo_sdr_effects && Is_Extension_Enabled(OGL_EXT_GEOMETRY_SHADER4) && (tmap_flags & TMAP_FLAG_VERTEX_GEN) ) {
geometry_batch_add_bitmap(texture, tmap_flags, pnt, orient, rad, alpha, depth);
return 0;
} else if ( tmap_flags & TMAP_FLAG_VERTEX_GEN ) {
tmap_flags &= ~(TMAP_FLAG_VERTEX_GEN);
}
batch_item *item = NULL;
SCP_map<int, batch_item>::iterator it = geometry_map.find(texture);
if ( !geometry_map.empty() && it != geometry_map.end() ) {
item = &it->second;
} else {
item = &geometry_map[texture];
item->texture = texture;
}
Assertion( (item->laser == false), "Particle effect %s used as laser glow or laser bitmap\n", bm_get_filename(texture) );
item->tmap_flags = tmap_flags;
item->alpha = alpha;
item->batch.add_allocate(1);
item->batch.draw_bitmap(pnt, orient, rad, depth);
return 0;
}
示例14: parse_everything_else
void parse_everything_else(const char *filename)
{
Assertion(filename != NULL, "parse_everything_else() called on NULL; get a coder!\n");
read_file_text(filename, CF_TYPE_TABLES);
int err_code;
if ((err_code = setjmp(parse_abort)) != 0) {
mprintf(("TABLES: Unable to parse '%s'! Error code = %d.\n", filename, err_code));
return;
}
reset_parse();
int rgba[4] = {0,0,0,0};
// reusable temp vars
int i, j;
SCP_string temp;
if (optional_string("#Start Colors")) {
// Skip this section; we already parsed it in every file.
skip_to_string("#End", NULL);
}
//Team coloring
if (optional_string("#Team Colors")) {
while (required_string_either("#End", "$Team Name:")) {
required_string("$Team Name:"); // required to move the parse pointer forward
team_color temp_color;
char temp2[NAME_LENGTH];
stuff_string(temp2, F_NAME, NAME_LENGTH);
temp = temp2;
if (!stricmp(temp2, "none")) {
Warning(LOCATION, "Team color in '%s' defined with a name of '%s'; this won't be usable due to 'None' being used for a lack of a team color by the engine.\n", filename, temp2);
}
if (required_string("$Team Stripe Color:")) {
int rgb[3];
stuff_int_list(rgb, 3, RAW_INTEGER_TYPE);
for (i = 0; i < 3; i++) {
CLAMP(rgb[i], 0, 255);
}
temp_color.stripe.r = rgb[0] / 255.0f;
temp_color.stripe.g = rgb[1] / 255.0f;
temp_color.stripe.b = rgb[2] / 255.0f;
}
if (required_string("$Team Base Color:")) {
int rgb[3];
stuff_int_list(rgb, 3, RAW_INTEGER_TYPE);
for (i = 0; i < 3; i++) {
CLAMP(rgb[i], 0, 255);
}
temp_color.base.r = rgb[0] / 255.0f;
temp_color.base.g = rgb[1] / 255.0f;
temp_color.base.b = rgb[2] / 255.0f;
}
if (Team_Colors.find(temp) == Team_Colors.end()) { // Only push to the vector if the team isn't already defined.
Team_Names.push_back(temp);
}
Team_Colors[temp] = temp_color;
}
required_string("#End");
}
// Previously-hardcoded interface colors
if (optional_string("#Interface Colors")) {
char *color_names[INTERFACE_COLORS] = {
"$Text Normal:",
"$Text Subselected:",
"$Text Selected:",
"$Text Error:",
"$Text Error Highlighted:",
"$Text Active:",
"$Text Active Highlighted:",
"$Text Heading:",
"$More Indicator:",
"$Bright More Indicator:",
"$Bright:",
"$Normal:",
};
// now for each color, check if its corresponding string is there
for (i = 0; i < INTERFACE_COLORS; i++) {
if (optional_string(color_names[i])) {
// if so, get its rgba values and initialise it using them
mprintf(("'%s' has been redefined.\n", color_names[i]));
if ( check_for_string("(") ) {
// If we have a list of integers, use them.
stuff_int_list(rgba, 4, RAW_INTEGER_TYPE);
for (j = 0; j < 4; j++) {
if (rgba[j] < 0)
{
Warning(LOCATION, "RGBA value for '%s' in %s too low (%d), capping to 0.\n", color_names[i], filename, rgba[j]);
//.........这里部分代码省略.........
示例15: 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);
}
}