Browse Source

Merge pull request #291 from Deledrius/plPlate_resizing

Correct voice chat icon resizing.
Adam Johnson 12 years ago
parent
commit
804d197714
  1. 13
      Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp
  2. 4
      Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp

13
Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp

@ -56,7 +56,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plPipeline/plPlates.h"
#include "plAvatar/plAvatarMgr.h"
#include "plAvatar/plArmatureMod.h"
#include "hsQuat.h"
#include "plAudioCore/plAudioCore.h"
// DEBUG for printing to the console
@ -84,13 +83,13 @@ plVoiceRecorder::plVoiceRecorder()
plPlateManager::Instance().CreatePlate( &fDisabledIcon );
fDisabledIcon->CreateFromResource( MICROPHONE );
fDisabledIcon->SetPosition(-0.90, -0.90);
fDisabledIcon->SetSize(0.0675, 0.09);
fDisabledIcon->SetSize(0.064, 0.064, true);
fDisabledIcon->SetVisible(false);
plPlateManager::Instance().CreatePlate( &fTalkIcon );
fTalkIcon->CreateFromResource( TALKING );
fTalkIcon->SetPosition(-0.9,-0.9);
fTalkIcon->SetSize(0.0675, 0.09);
fTalkIcon->SetSize(0.064, 0.064, true);
fTalkIcon->SetVisible(false);
}
@ -208,14 +207,17 @@ void plVoiceRecorder::DrawDisabledIcon(bool b)
{
fDisabledIcon->CreateFromResource( MICROPHONE );
fDisabledIcon->SetPosition(-0.90, -0.90);
fDisabledIcon->SetSize(0.0675, 0.09);
fDisabledIcon->SetSize(0.064, 0.064, true);
fDisabledIcon->SetVisible(false);
}
}
if (fDisabledIcon)
{
fDisabledIcon->SetSize(0.064, 0.064, true); // Re-compute plate size in case the aspect ratio has changed.
fDisabledIcon->SetVisible(b);
}
}
void plVoiceRecorder::DrawTalkIcon(bool b)
{
@ -225,13 +227,14 @@ void plVoiceRecorder::DrawTalkIcon(bool b)
if (fTalkIcon)
{ fTalkIcon->CreateFromResource( TALKING );
fTalkIcon->SetPosition(-0.9,-0.9);
fTalkIcon->SetSize(0.0675, 0.09);
fTalkIcon->SetSize(0.064, 0.064, true);
fTalkIcon->SetVisible(false);
}
}
if (fTalkIcon)
{
fTalkIcon->SetSize(0.064, 0.064, true); // Re-compute plate size in case the aspect ratio has changed.
fTalkIcon->SetVisible(b);
}
}

4
Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp

@ -123,14 +123,14 @@ void plPlate::SetPosition( float x, float y, float z )
//// SetSize /////////////////////////////////////////////////////////////////
void plPlate::SetSize( float width, float height, bool adjustByAspectRation )
void plPlate::SetSize( float width, float height, bool adjustByAspectRatio )
{
hsVector3 size;
width *= fDepth / 1.0f;
height *= fDepth / 1.0f;
size.fX = adjustByAspectRation ? (width * ((float)plPlateManager::Instance().GetPipeHeight() / (float)plPlateManager::Instance().GetPipeWidth())) : width;
size.fX = adjustByAspectRatio ? (width * ((float)plPlateManager::Instance().GetPipeHeight() / (float)plPlateManager::Instance().GetPipeWidth())) : width;
size.fY = height;
size.fZ = 1.0f;

Loading…
Cancel
Save