From 09f8630b682190a575acd5c18ec7da2052da4de6 Mon Sep 17 00:00:00 2001 From: BeaR Date: Tue, 21 Oct 2014 12:07:09 +0200 Subject: [PATCH] Add editor icon for audio source --- data/editor/audio_source.png | Bin 0 -> 6288 bytes datasrc/content.py | 6 ++++++ src/game/editor/layer_sounds.cpp | 15 +++++++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 data/editor/audio_source.png diff --git a/data/editor/audio_source.png b/data/editor/audio_source.png new file mode 100644 index 0000000000000000000000000000000000000000..6504e4303dcfdbd1e79e4fbef733fce8a681bf37 GIT binary patch literal 6288 zcmX|G2UrtLx88&RiL?;9w9t!m5fFh8dIu4uLl8d&=@P040V6daMFEwn2>1yCf|LN# zyCPK(2wiDXf(oJEc>n+2eV(0po-;dV&pC5;-t*2TSXme{ojZRH001UqBRy+skNbN= z>8NdomfHXTaN8Q|p>0BQHl1Oq*Yz_Wn0SRuWA}$F_RX+ZH48(_-%9+N>h2dyOC=9q zOPX++-jZr#N;NNp*qdr=qivkNK_ItS?QdPZ8VhDOWu=v|(M|>1(@Jp#w8vXmcC`K?|Kcy z5`cd4g$E@A#-pi{3sgx4pwd6VgE9k)nouP&RLKhREkuBwvOvAysh|nPg+{~C(M7b6SgvVWgC0%-aW9Cj5GA5XvHU5 zJQ2TzU&D9Jwvd{?L~*VJQhgO_-G(MZ5Afl5S4cUHVe!n2lLQKdGKtZKc#w!60{@KL z(!bM|jt-}jxt27PwR5?RqcV3#p)fdgW%@iS7O-W_6Dkwp+Z}gfSqRdx)yWMF!ft+; zFfhjDA>p8@S|46nzGcJLh*A-F!KWyABFq;k6LHGKAD-nX$Z2b8iOg_+X|$=ZDu)&j z1aSZpj2?X6b-{m`fWLl*V*T24^|49&{CP{9-I5~$neVS`v2=k?)QL~$B+6XUv{LTT zrA#1l$q^28qn;JCb0|dQWNDv#5&FbbC{O~;q7MuCfCTPD(13g;Y>fK7hYF${TOuE1 zi8l^MRW$rKfAv6hHgw4cB4JUJmY19$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OjBu_~j_hTH)dB2gH^ z(NVH1KXjhJbMXh7+dvpSrDitOgVt*_R8{wpv9zSJxgUqzP^HIsF;@(I zVX(Ov?qcLIB~s!2yDljNK|pgV5%8bDLJIad7IUjG(0Mp0=fTn539+bXnMmbBAIln5 z0mC*Ua0MW>5PP6M9ZGP`h0dGhs8v}xd&#E(is4c%0!pDfm`y3(J?d9u%?Vdx;d(8EHoF5iV zlzzWfP@zu&sDzpJR69uh4Fk`{;;G$cX9#{SP)0&xMV@@VMIF)l?2^}4&ENYbQm!nb ztv8d;iu@?wbYmIa99u%9do9+}qfGpdci37>MjbY%>*jj9wuV21Y)*YJ85FUAw*~!H z58=wc=BE+^h1ZeaUI68Yn?GkC3bELL0vJNv(W4@UvVkx8C=@ZaB2c#Z(y4w9Sr$6a z&dF)9&|W7!3fnkSTVTjCiOHex;TOaor(GnS5vi2HN!#E1Y6cXy{Xvv3%cx+a(G57h zK%1rE&H?A+*9I20FOO6YkH2D;p6;F3x!JHkg6!_mYJF}16euo~7Eu5@PDPpb+|>E; zUOb>7-tFp3TDxan(jcI>5W*3ey5lD_cB0c>3)$GcD>`4+GQ|o&wSfXHH`knVXDR-= z@j+)^qNmNAeg;K82gKiTK+1XmEFHnLkS;oQqKbb8S`SE65Jg~eQEuQGU(!@z zUt0YeBpVzDP$Fe@{Mv7SxMTTn6Yqv+NH@lWM+UZo+bxQjOPazhgvOG3c7XE%zP`Tx z;Q6}&l)=)j2M5O< zM9ndc8N9ll&J6B+Rb9g?>s^!%6cecpdHupBohh9)8ki;)#Q+Jb(wp5Toax3mg>?ic z2r+(bis`8d0*}Vouql}de^mohIPxVyBk11B1iK|D{4GTfnkuIw{xJSh3SdGeBapdx zGfq}7J`gSxn!0r;+9=?uYNC$O#hJaad_R{P?0zfF + #include "editor.h" -static const float s_SourceVisualSize = 50.0f; +static const float s_SourceVisualSize = 32.0f; CLayerSounds::CLayerSounds() { @@ -41,9 +43,15 @@ void CLayerSounds::Render() m_pEditor->RenderTools()->DrawCircle(fx2f(pSource->m_Position.x)+OffsetX, fx2f(pSource->m_Position.y)+OffsetY, pSource->m_FalloffDistance, 32); } + Graphics()->QuadsEnd(); + // draw handles - Graphics()->SetColor(1.0f, 0.0f, 1.0f, 1.0f); + Graphics()->TextureSet(g_pData->m_aImages[IMAGE_AUDIO_SOURCE].m_Id); + Graphics()->QuadsBegin(); + + Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); + m_pEditor->RenderTools()->SelectSprite(SPRITE_AUDIO_SOURCE); for(int i = 0; i < m_lSources.size(); i++) { CSoundSource *pSource = &m_lSources[i]; @@ -59,8 +67,7 @@ void CLayerSounds::Render() OffsetY = aChannels[1]; } - IGraphics::CQuadItem QuadItem(fx2f(pSource->m_Position.x)+OffsetX, fx2f(pSource->m_Position.y)+OffsetY, s_SourceVisualSize, s_SourceVisualSize); - Graphics()->QuadsDraw(&QuadItem, 1); + m_pEditor->RenderTools()->DrawSprite(fx2f(pSource->m_Position.x)+OffsetX, fx2f(pSource->m_Position.y)+OffsetY, s_SourceVisualSize*m_pEditor->m_WorldZoom); } Graphics()->QuadsEnd();