diff --git a/src/game/editor/layer_sounds.cpp b/src/game/editor/layer_sounds.cpp index 8b234e3c4..fea83c517 100644 --- a/src/game/editor/layer_sounds.cpp +++ b/src/game/editor/layer_sounds.cpp @@ -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; } diff --git a/src/game/mapitems.h b/src/game/mapitems.h index a23cc3f08..f41e6550d 100644 --- a/src/game/mapitems.h +++ b/src/game/mapitems.h @@ -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;