Skip to content

Commit

Permalink
style: Remove commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
johanhelsing committed Aug 16, 2022
1 parent 750dccb commit 8d220f6
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 61 deletions.
3 changes: 0 additions & 3 deletions assets/vertex.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ fn vertex(
let c = vertex.rotation.x;
let s = vertex.rotation.y;
let rotated = vec2<f32>(x * c - y * s, x * s + y * c);
// let rotated = vec2<f32>(x, y);
// let w = 400.;
// let w = 80.;
let pos = vertex.position + vec3<f32>(rotated * vertex.scale * vertex.frame, vertex.position.z);
// Project the world position of the mesh into screen position
out.clip_position = view.view_proj * vec4<f32>(pos, 1.);
Expand Down
3 changes: 1 addition & 2 deletions src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ pub struct UiShapeBundle {
pub node: Node,
/// Describes the style including flexbox settings
pub style: Style,
// /// Describes the color of the node
// pub color: UiColor,
/// Describes the actual shape and its fill
pub shape: SmudShape,
/// The transform of the node
pub transform: Transform,
Expand Down
55 changes: 0 additions & 55 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,35 +161,6 @@ impl<P: BatchedPhaseItem> RenderCommand<P> for DrawShapeBatch {
}
}

// struct DrawQuad;
// impl EntityRenderCommand for DrawQuad {
// type Param = SRes<SmudPipeline>;
// #[inline]
// fn render<'w>(
// _view: Entity,
// _item: Entity,
// pipeline: SystemParamItem<'w, '_, Self::Param>,
// pass: &mut TrackedRenderPass<'w>,
// ) -> RenderCommandResult {
// let gpu_mesh = &pipeline.into_inner().quad;
// pass.set_vertex_buffer(0, gpu_mesh.vertex_buffer.slice(..));
// match &gpu_mesh.buffer_info {
// GpuBufferInfo::Indexed {
// buffer,
// index_format,
// count,
// } => {
// pass.set_index_buffer(buffer.slice(..), 0, *index_format);
// pass.draw_indexed(0..*count, 0, 0..1);
// }
// GpuBufferInfo::NonIndexed { vertex_count } => {
// pass.draw(0..*vertex_count, 0..1);
// }
// }
// RenderCommandResult::Success
// }
// }

struct SmudPipeline {
view_layout: BindGroupLayout,
time_layout: BindGroupLayout,
Expand Down Expand Up @@ -227,28 +198,6 @@ impl FromWorld for SmudPipeline {
count: None,
}],
});
// let quad = {
// let mut mesh = Mesh::new(PrimitiveTopology::TriangleStrip);
// let w = 0.5;
// let v_pos = vec![[-w, -w], [w, -w], [-w, w], [w, w]];
// mesh.set_attribute(Mesh::ATTRIBUTE_POSITION, v_pos);
// let v_color = vec![[0.5, 0.3, 0.1, 1.0]; 4];
// mesh.set_attribute(Mesh::ATTRIBUTE_COLOR, v_color);

// let render_device = world.get_resource_mut::<RenderDevice>().unwrap();
// let vertex_buffer_data = mesh.get_vertex_buffer_data();
// let vertex_buffer = render_device.create_buffer_with_data(&BufferInitDescriptor {
// usage: BufferUsages::VERTEX,
// label: Some("Mesh Vertex Buffer"),
// contents: &vertex_buffer_data,
// });
// GpuMesh {
// vertex_buffer,
// buffer_info: GpuBufferInfo::NonIndexed { vertex_count: 4 },
// has_tangents: false,
// primitive_topology: mesh.primitive_topology(),
// }
// };

Self {
view_layout,
Expand Down Expand Up @@ -322,7 +271,6 @@ impl SpecializedRenderPipeline for SmudPipeline {
},
fragment: Some(FragmentState {
shader: shader.clone_weak(),
// shader: SMUD_SHADER_HANDLE.typed::<Shader>(),
entry_point: "fragment".into(),
shader_defs: Vec::new(),
targets: vec![Some(ColorTargetState {
Expand Down Expand Up @@ -575,8 +523,6 @@ fn queue_shapes(
continue; // skip shapes that are not ready yet
}

// let mesh_z = mesh2d_uniform.transform.w_axis.z;

// let color = extracted_shape.color.as_linear_rgba_f32();
// // encode color as a single u32 to save space
// let color = (color[0] * 255.0) as u32
Expand Down Expand Up @@ -667,7 +613,6 @@ struct ShapeVertex {
pub position: [f32; 3],
pub rotation: [f32; 2],
pub scale: f32,
// pub uv: [f32; 2],
}

pub struct ShapeMeta {
Expand Down
1 change: 0 additions & 1 deletion src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ fn prepare_ui_shapes(
let color = extracted_shape.color.as_linear_rgba_f32();

let position = position.into();
// let position = Vec3::ZERO.into();

let rotation_and_scale = extracted_shape
.transform
Expand Down

0 comments on commit 8d220f6

Please sign in to comment.