mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Render sound shapes
This commit is contained in:
parent
9996751161
commit
a045a20fba
|
@ -40,7 +40,23 @@ void CLayerSounds::Render()
|
|||
OffsetY = aChannels[1];
|
||||
}
|
||||
|
||||
m_pEditor->RenderTools()->DrawCircle(fx2f(pSource->m_Position.x)+OffsetX, fx2f(pSource->m_Position.y)+OffsetY, 2500.0f, 32); // fix
|
||||
switch(pSource->m_Shape.m_Type)
|
||||
{
|
||||
case CSoundShape::SHAPE_CIRCLE:
|
||||
{
|
||||
m_pEditor->RenderTools()->DrawCircle(fx2f(pSource->m_Position.x)+OffsetX, fx2f(pSource->m_Position.y)+OffsetY,
|
||||
pSource->m_Shape.m_Circle.m_Radius, 32);
|
||||
break;
|
||||
}
|
||||
case CSoundShape::SHAPE_RECTANGLE:
|
||||
{
|
||||
float Width = fx2f(pSource->m_Shape.m_Rectangle.m_Width);
|
||||
float Height = fx2f(pSource->m_Shape.m_Rectangle.m_Height);
|
||||
m_pEditor->RenderTools()->DrawRoundRect(fx2f(pSource->m_Position.x)+OffsetX - Width/2, fx2f(pSource->m_Position.y)+OffsetY - Height/2,
|
||||
Width, Height, 0.0f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Graphics()->QuadsEnd();
|
||||
|
@ -90,6 +106,16 @@ CSoundSource *CLayerSounds::NewSource()
|
|||
pSource->m_SoundEnv = -1;
|
||||
pSource->m_SoundEnvOffset = 0;
|
||||
|
||||
pSource->m_Falloff = 255;
|
||||
/*
|
||||
pSource->m_Shape.m_Type = CSoundShape::SHAPE_CIRCLE;
|
||||
pSource->m_Shape.m_Circle.m_Radius = 1500;
|
||||
*/
|
||||
|
||||
pSource->m_Shape.m_Type = CSoundShape::SHAPE_RECTANGLE;
|
||||
pSource->m_Shape.m_Rectangle.m_Width = f2fx(1500.0f);
|
||||
pSource->m_Shape.m_Rectangle.m_Height = f2fx(1000.0f);
|
||||
|
||||
return pSource;
|
||||
}
|
||||
|
||||
|
|
|
@ -341,14 +341,12 @@ struct CSoundShape
|
|||
|
||||
struct CRectangle
|
||||
{
|
||||
int m_PosX, m_PosY; // fxp 22.10
|
||||
int m_Width, m_Height; // fxp 22.10
|
||||
};
|
||||
|
||||
struct CCircle
|
||||
{
|
||||
int m_PosX, m_PosY; // fxp 22.10
|
||||
int m_Radius; // fxp 22.10
|
||||
int m_Radius;
|
||||
};
|
||||
|
||||
int m_Type;
|
||||
|
|
Loading…
Reference in a new issue