Skip to content

Commit

Permalink
Merge pull request #222 from scp-fs2open/revert-113-coverity/1298257
Browse files Browse the repository at this point in the history
Revert "Fix Coverity 1298257: Uninitialized scalar var"
  • Loading branch information
chief1983 committed Jun 28, 2015
2 parents 150a00a + 6a0e550 commit 0a9ae3e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
7 changes: 7 additions & 0 deletions code/model/modelrender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,18 @@ void draw_list::add_buffer_draw(vertex_buffer *buffer, int texi, uint tmap_flags
draw_data.texi = texi;
draw_data.flags = tmap_flags;

draw_data.clr = gr_screen.current_color;
draw_data.alpha = Current_alpha;
draw_data.blend_filter = Current_blend_filter;
draw_data.depth_mode = Current_depth_mode;

if ( tmap_flags & TMAP_FLAG_BATCH_TRANSFORMS ) {
draw_data.transformation = transform();

draw_data.scale.xyz.x = 1.0f;
draw_data.scale.xyz.y = 1.0f;
draw_data.scale.xyz.z = 1.0f;

draw_data.transform_buffer_offset = TransformBufferHandler.get_buffer_offset();
} else {
draw_data.transformation = Current_transform;
Expand Down
27 changes: 11 additions & 16 deletions code/model/modelrender.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,22 +250,17 @@ struct queued_buffer_draw

float thrust_scale;

queued_buffer_draw():
render_state_handle(0),
texture_maps{-1,-1,-1,-1,-1,-1},
transform_buffer_offset(0),
clr(gr_screen.current_color),
blend_filter(0),
alpha(0.0f),
depth_mode(GR_ZBUFF_FULL),
transformation(),
scale{ { {1.0f,1.0f,1.0f} } },
buffer(NULL),
texi(0),
flags(0),
sdr_flags(0),
thrust_scale(0.0f)
{}
queued_buffer_draw()
{
depth_mode = GR_ZBUFF_FULL;

texture_maps[TM_BASE_TYPE] = -1;
texture_maps[TM_GLOW_TYPE] = -1;
texture_maps[TM_HEIGHT_TYPE] = -1;
texture_maps[TM_MISC_TYPE] = -1;
texture_maps[TM_NORMAL_TYPE] = -1;
texture_maps[TM_SPECULAR_TYPE] = -1;
}
};

struct outline_draw
Expand Down

0 comments on commit 0a9ae3e

Please sign in to comment.