Revert "Mesh rendering + music nerd font icon"

This reverts commit 69ba03ba8a.
This commit is contained in:
mars 2022-07-14 15:13:43 -06:00
parent 69ba03ba8a
commit 4e01c3937d
4 changed files with 1 additions and 25 deletions

View File

@ -8,10 +8,8 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
bitflags = "^1"
glam = { version = "^0.21", features = ["serde"] }
glam = "^0.21"
keyframe = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
wee_alloc = "^0.4"
[profile.release]

View File

@ -23,12 +23,6 @@ bitflags! {
}
}
#[derive(serde::Deserialize)]
pub struct Mesh {
pub vertices: Vec<Vec2>,
pub indices: Vec<usize>,
}
#[derive(Copy, Clone)]
pub struct ColoredTriangle {
pub v1: Vec2,
@ -138,15 +132,6 @@ impl DrawContext {
self.panel.draw_triangle(v1, v2, v3, color);
}
pub fn draw_mesh(&self, mesh: &Mesh, offset: Vec2, color: Color) {
for indices in mesh.indices.chunks_exact(3) {
let v1 = mesh.vertices[indices[0]] + offset;
let v2 = mesh.vertices[indices[1]] + offset;
let v3 = mesh.vertices[indices[2]] + offset;
self.draw_triangle(v1, v2, v3, color);
}
}
pub fn draw_circle(&self, center: Vec2, radius: f32, color: Color) {
use std::f32::consts::PI;

View File

@ -1 +0,0 @@
{"vertices":[[0.857,0.764],[0.857,0.138],[0.857,0.138],[0.8561097,0.12644352],[0.8534764,0.11554065],[0.8490894,0.105145335],[0.8428491,0.09513964],[0.8345723,0.08543988],[0.824,0.076],[0.824,0.076],[0.8103651,0.06613773],[0.7964395,0.05776733],[0.7821856,0.05081819],[0.76755714,0.045239307],[0.7525,0.041],[0.7525,0.041],[0.72669864,0.035916265],[0.7022397,0.032960363],[0.679,0.032],[0.679,0.032],[0.6623966,0.032628637],[0.64443797,0.03458781],[0.625,0.038],[0.625,0.038],[0.6058083,0.042518143],[0.5864839,0.048173793],[0.567,0.055],[0.567,0.055],[0.5529146,0.061296906],[0.5403062,0.06888353],[0.5290359,0.07776734],[0.519,0.088],[0.519,0.088],[0.5120517,0.09720578],[0.5067641,0.10672293],[0.50302047,0.11662596],[0.5007639,0.12701267],[0.5,0.138],[0.5,0.138],[0.5007639,0.14898734],[0.50302047,0.15937404],[0.5067641,0.16927707],[0.5120517,0.17879422],[0.519,0.188],[0.519,0.188],[0.5290078,0.19826856],[0.54027134,0.20733768],[0.5528916,0.215247],[0.567,0.222],[0.567,0.222],[0.5865236,0.22939889],[0.6058443,0.23538227],[0.625,0.24],[0.625,0.24],[0.64443797,0.24341218],[0.6623966,0.24537137],[0.679,0.246],[0.679,0.246],[0.6997432,0.24533594],[0.7191984,0.24339588],[0.7374632,0.24024731],[0.7546295,0.23594297],[0.77078253,0.23052008],[0.786,0.224],[0.786,0.224],[0.786,0.524],[0.786,0.524],[0.357,0.392],[0.357,0.392],[0.357,-0.004],[0.357,-0.004],[0.35610968,-0.015556473],[0.3534764,-0.026459347],[0.34908935,-0.03685467],[0.34284905,-0.04686036],[0.33457235,-0.056560114],[0.324,-0.066],[0.324,-0.066],[0.31038743,-0.075888604],[0.29646844,-0.08437982],[0.28220937,-0.091535],[0.26756915,-0.097399086],[0.2525,-0.102],[0.2525,-0.102],[0.23299406,-0.10646925],[0.21428217,-0.10958004],[0.19630387,-0.111403584],[0.179,-0.112],[0.179,-0.112],[0.16239662,-0.11137137],[0.144438,-0.10941219],[0.125,-0.106],[0.125,-0.106],[0.10584429,-0.10138228],[0.08652364,-0.095398895],[0.067,-0.088],[0.067,-0.088],[0.052891623,-0.081247],[0.040271387,-0.073337674],[0.029007807,-0.06426857],[0.019,-0.054],[0.019,-0.054],[0.012051679,-0.044794224],[0.006764118,-0.035277065],[0.0030204544,-0.025374046],[0.0007638805,-0.014987332],[0.0,-0.004],[0.0,-0.004],[0.0007638805,0.006987331],[0.0030204544,0.017374046],[0.006764118,0.027277065],[0.012051679,0.036794223],[0.019,0.046],[0.019,0.046],[0.02903592,0.056232657],[0.040306207,0.06511647],[0.052914634,0.07270309],[0.067,0.079],[0.067,0.079],[0.08648392,0.08582621],[0.105808295,0.09148186],[0.125,0.096],[0.125,0.096],[0.144438,0.099412195],[0.16239662,0.10137137],[0.179,0.102],[0.179,0.102],[0.20380187,0.10112933],[0.22675078,0.098600164],[0.24800436,0.094518915],[0.2677093,0.08896708],[0.286,0.082],[0.286,0.082],[0.286,0.62],[0.286,0.62],[0.28668752,0.6288126],[0.2887271,0.6371812],[0.2921362,0.6452143],[0.297,0.653],[0.297,0.653],[0.303001,0.6600001],[0.3094596,0.66539663],[0.31642708,0.66936475],[0.324,0.672],[0.324,0.672],[0.788,0.814],[0.788,0.814],[0.7961116,0.8170277],[0.804,0.818],[0.804,0.818],[0.8126266,0.8173466],[0.8205804,0.8154332],[0.8279841,0.81228024],[0.83493483,0.80783993],[0.8415,0.802],[0.8415,0.802],[0.8471521,0.7952598],[0.8514568,0.78816694],[0.8545147,0.7806567],[0.8563683,0.77263826],[0.857,0.764],[0.857,0.764],[0.857,0.764]],"indices":[159,158,157,153,152,151,142,141,140,137,136,135,130,129,128,116,115,114,111,110,109,105,104,103,99,98,97,86,85,84,81,80,79,75,74,73,73,72,71,62,61,60,60,59,58,47,46,45,42,41,40,36,35,34,30,29,28,13,12,11,7,6,5,5,4,3,159,157,156,153,151,150,130,128,127,111,109,108,105,103,102,81,79,78,75,73,71,62,60,58,42,40,39,36,34,33,13,11,10,7,5,3,13,10,8,8,7,3,3,1,160,160,159,156,156,154,153,153,150,148,148,147,145,145,143,142,142,140,138,138,137,135,135,133,131,131,130,127,127,125,124,124,123,121,121,120,119,119,117,116,116,114,112,112,111,108,108,106,105,105,102,100,100,99,97,97,95,94,94,93,91,91,90,89,89,87,86,86,84,82,82,81,78,78,76,75,75,71,69,63,62,58,58,56,55,55,54,52,52,51,50,50,48,47,47,45,43,43,42,39,39,37,36,36,33,31,31,30,28,28,26,25,25,24,22,22,21,20,20,18,17,17,16,14,14,13,8,8,3,160,160,156,153,153,148,145,145,142,138,138,135,131,131,127,124,124,121,119,119,116,112,112,108,105,105,100,97,97,94,91,91,89,86,86,82,78,78,75,69,63,58,55,55,52,50,50,47,43,43,39,36,36,31,28,28,25,22,22,20,17,17,14,8,8,160,153,153,145,138,131,124,119,119,112,105,105,97,91,91,86,78,78,69,67,63,55,50,50,43,36,36,28,22,22,17,8,131,119,105,105,91,78,63,50,36,36,22,8,131,105,78,63,36,8,138,131,78,65,63,8,138,78,67,65,8,153,153,138,67,67,65,153]}

View File

@ -15,17 +15,13 @@ use widgets::Widget;
pub struct DummyPanel {
panel: UiPanel,
menu: widgets::MainMenu,
icon: draw::Mesh,
}
impl DummyPanel {
fn bind(panel: UiPanel) -> Self {
let icon = serde_json::from_slice(include_bytes!("icon_glyph.json")).unwrap();
Self {
panel,
menu: widgets::MainMenu::default(),
icon,
}
}
}
@ -36,8 +32,6 @@ impl abi::PanelImpl for DummyPanel {
let ctx = draw::DrawContext::new(self.panel);
self.menu.draw(&ctx);
ctx.draw_mesh(&self.icon, Vec2::ZERO, Color::WHITE);
}
fn on_cursor_event(&mut self, kind: CursorEventKind, at: Vec2) {