Add editor icon for audio source

This commit is contained in:
BeaR 2014-10-21 12:07:09 +02:00
parent 749143c45a
commit 09f8630b68
3 changed files with 17 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View file

@ -235,6 +235,7 @@ image_guibuttons = Image("guibuttons", "gui_buttons.png")
image_guiicons = Image("guiicons", "gui_icons.png")
image_arrow = Image("arrow", "arrow.png")
image_demobuttons2 = Image("demobuttons2", "demo_buttons2.png")
image_audio_source = Image("audio_source", "editor/audio_source.png")
container.images.Add(image_null)
container.images.Add(image_game)
@ -252,6 +253,7 @@ container.images.Add(image_guibuttons)
container.images.Add(image_guiicons)
container.images.Add(image_arrow)
container.images.Add(image_demobuttons2)
container.images.Add(image_audio_source)
container.pickups.Add(Pickup("health"))
container.pickups.Add(Pickup("armor"))
@ -269,6 +271,7 @@ set_fileicons = SpriteSet("fileicons", image_fileicons, 8, 1)
set_guibuttons = SpriteSet("guibuttons", image_guibuttons, 12, 4)
set_guiicons = SpriteSet("guiicons", image_guiicons, 8, 2)
set_demobuttons2 = SpriteSet("demobuttons2", image_demobuttons2, 3, 1)
set_audio_source = SpriteSet("audio_source", image_audio_source, 1, 1)
container.spritesets.Add(set_particles)
container.spritesets.Add(set_game)
@ -281,6 +284,7 @@ container.spritesets.Add(set_fileicons)
container.spritesets.Add(set_guibuttons)
container.spritesets.Add(set_guiicons)
container.spritesets.Add(set_demobuttons2)
container.spritesets.Add(set_audio_source)
container.sprites.Add(Sprite("part_slice", set_particles, 0,0,1,1))
container.sprites.Add(Sprite("part_ball", set_particles, 1,0,1,1))
@ -416,6 +420,8 @@ container.sprites.Add(Sprite("guibutton_hover", set_guibuttons, 8,0,4,4))
container.sprites.Add(Sprite("guiicon_mute", set_guiicons, 0,0,4,2))
container.sprites.Add(Sprite("guiicon_friend", set_guiicons, 4,0,4,2))
container.sprites.Add(Sprite("audio_source", set_audio_source, 0,0,1,1))
anim = Animation("base")
anim.body.frames.Add(AnimKeyframe(0, 0, -4, 0))
anim.back_foot.frames.Add(AnimKeyframe(0, 0, 10, 0))

View file

@ -1,7 +1,9 @@
#include <game/generated/client_data.h>
#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();