|
From: Tapio V. <aa...@us...> - 2009-11-25 21:07:21
|
Module: performous
Branch: dance
Commit: 7d387e3d9aab4eef04e56e94b40bdce3b0df4340
Author: Tapio Vierros <tap...@gm...>
Date: Wed Nov 25 23:06:49 2009 +0200
Basic mine note displaying.
---
game/dancegraph.cc | 17 ++++++-
game/dancegraph.hh | 2 +
themes/default/mine.svg | 128 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 145 insertions(+), 2 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index c3fa6bf..094343c 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -40,6 +40,7 @@ DanceGraph::DanceGraph(Audio& audio, Song const& song):
m_song(song),
m_input(input::GUITAR), // TODO: to be replaced by DANCEPAD
m_arrow(getThemePath("arrow.svg")),
+ m_mine(getThemePath("mine.svg")),
m_arrow_hold(getThemePath("arrow_hold.svg")),
m_cx(0.0, 0.2),
m_width(0.5, 0.4),
@@ -160,7 +161,17 @@ void DanceGraph::drawArrow(int arrow_i, float x, float y, float scale) {
m_arrow.draw();
if (scale != 1.0) glScalef(1.0/scale, 1.0/scale, 1.0/scale);
glRotatef(-arrowRotations[arrow_i], 0.0f, 0.0f, 1.0f);
- glTranslatef(-x, -y, 0.0f);
+ glTranslatef(-x, -y, 0.0f);
+}
+
+void DanceGraph::drawMine(float x, float y, float rot, float scale) {
+ glTranslatef(x, y, 0.0f);
+ glRotatef(rot, 0.0f, 0.0f, 1.0f);
+ if (scale != 1.0) glScalef(scale, scale, scale);
+ m_mine.draw();
+ if (scale != 1.0) glScalef(1.0/scale, 1.0/scale, 1.0/scale);
+ glRotatef(-rot, 0.0f, 0.0f, 1.0f);
+ glTranslatef(-x, -y, 0.0f);
}
/// Draws the dance graph
@@ -212,6 +223,7 @@ void DanceGraph::draw(double time) {
if (tBeg > future) break;
int arrow_i = it->note.note;
+ bool mine = it->note.type == Note::MINE;
float x = -1.5f + arrow_i;
float s = arrowScale;
float yBeg = time2y(tBeg);
@@ -246,7 +258,8 @@ void DanceGraph::draw(double time) {
c.a = 1.0 - glow;
s = arrowScale + glow;
glColor4fv(c);
- drawArrow(arrow_i, x, yBeg, s);
+ if (mine) drawMine(x, yBeg, int(time*360) % 360, s);
+ else drawArrow(arrow_i, x, yBeg, s);
}
}
diff --git a/game/dancegraph.hh b/game/dancegraph.hh
index c8866b3..f26a87e 100644
--- a/game/dancegraph.hh
+++ b/game/dancegraph.hh
@@ -54,12 +54,14 @@ class DanceGraph {
void drawNote(int arrow_i, glutil::Color, float tBeg, float tEnd);
glutil::Color const& color(int arrow_i) const;
void drawArrow(int arrow_i, float x, float y, float scale = 1.0);
+ void drawMine(float x, float y, float rot = 0.0, float scale = 1.0);
Audio& m_audio;
Song const& m_song;
input::InputDev m_input;
DanceNotes m_notes;
DanceNotes::iterator m_notesIt;
Surface m_arrow;
+ Surface m_mine;
Texture m_arrow_hold;
AnimValue m_cx, m_width;
std::size_t m_stream;
diff --git a/themes/default/mine.svg b/themes/default/mine.svg
new file mode 100644
index 0000000..4463bbb
--- /dev/null
+++ b/themes/default/mine.svg
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="64"
+ height="64"
+ id="svg2463"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ version="1.0"
+ sodipodi:docname="mine.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2465">
+ <linearGradient
+ id="linearGradient3262">
+ <stop
+ style="stop-color:#f5f5f5;stop-opacity:0.22680412;"
+ offset="0"
+ id="stop3264" />
+ <stop
+ style="stop-color:#f5f5f5;stop-opacity:0.96078432;"
+ offset="1"
+ id="stop3266" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3751"
+ inkscape:collect="always">
+ <stop
+ id="stop3753"
+ offset="0"
+ style="stop-color:black;stop-opacity:1;" />
+ <stop
+ id="stop3755"
+ offset="1"
+ style="stop-color:black;stop-opacity:0;" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective2471" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3751"
+ id="linearGradient3272"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.3868046,0,0,0.3868046,40.335717,481.59837)"
+ x1="665.12128"
+ y1="684.16162"
+ x2="381.28015"
+ y2="449.80624" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3751"
+ id="linearGradient2406"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.3868046,0,0,0.3868046,43.114888,485.8841)"
+ x1="665.12128"
+ y1="684.16162"
+ x2="381.28015"
+ y2="449.80624" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#f5f5f5"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="5.6"
+ inkscape:cx="27.116923"
+ inkscape:cy="40.003406"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="860"
+ inkscape:window-height="806"
+ inkscape:window-x="568"
+ inkscape:window-y="26"
+ inkscape:window-maximized="0" />
+ <metadata
+ id="metadata2468">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-110.35967,-771.51188)">
+ <path
+ sodipodi:type="star"
+ style="fill:#1a1a1a;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.50462699;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path2824"
+ sodipodi:sides="10"
+ sodipodi:cx="30.892857"
+ sodipodi:cy="33.285713"
+ sodipodi:r1="32.142857"
+ sodipodi:r2="20.415771"
+ sodipodi:arg1="1.5707963"
+ sodipodi:arg2="2.5575682"
+ inkscape:flatsided="false"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="M 30.892857,65.42857 13.860991,44.54268 11.99976,59.289831 10.497109,32.381711 0.32318364,43.218403 14.92371,20.566041 0.32318311,23.353025 25.449981,13.608853 11.999759,7.2815965 38.055246,14.167557 30.892856,1.1428566 47.924722,22.028747 49.785953,7.2815955 51.288604,34.189715 61.46253,23.353023 46.862004,46.005386 61.46253,43.218401 36.335732,52.962574 49.785954,59.28983 23.730467,52.40387 l 7.16239,13.0247 z"
+ transform="matrix(1.0222549,0,0,0.97222224,110.7793,771.15077)" />
+ </g>
+</svg>
|