Exemplo n.º 1
0
EXPORT_C void CHuiTexture::SetSize(const TSize& aSize)
    {
    // if there are multiple
    // segments already defined we have to recalculate (rescale)
    // the logical sizes and offsets for the individual segments
    // to match the new logical size
    if (SegmentCount()>0 && iSize.iWidth > 0 && iSize.iHeight > 0)
        {
        for (TInt s = 0; s < SegmentCount(); s++)
            {
            TSize oldSize(SegmentSize(s));
            TSize newSize(oldSize.iWidth * aSize.iWidth / iSize.iWidth,
                          oldSize.iHeight * aSize.iHeight / iSize.iHeight);
            TPoint oldOffset(SegmentOffset(s));
            TPoint newOffset(oldOffset.iX * aSize.iWidth / iSize.iWidth,
                             oldOffset.iY * aSize.iHeight / iSize.iHeight);
            SetSegmentSize(s, newSize);
            SetSegmentOffset(s, newOffset);
            }
        }

    // assign new logical size
    iSize = aSize;

    }
Exemplo n.º 2
0
void DirectSoundDriver::SetFrequency(uint32_t Frequency, uint32_t BufferSize)
{
    WriteTrace(TraceAudioDriver, TraceDebug, "Start (Frequency: 0x%08X)", Frequency);
    StopAudio();
    m_LOCK_SIZE = (BufferSize * 2);
    SetSegmentSize(m_LOCK_SIZE, Frequency);

    StartAudio();
    WriteTrace(TraceAudioDriver, TraceDebug, "Done");
}
Exemplo n.º 3
0
/**
 * Set segment data.
 */
EXPORT_C void CHuiTexture::SetSegment(TInt aSegment,
                             const TSize & aSize,
                             const TPoint & aOffset,
                             const TSize & aTextureSize)
    {
    SetSegmentSize(aSegment, aSize);
    SetSegmentOffset(aSegment, aOffset);
    SetSegmentTextureSize(aSegment, aTextureSize);

    // Note: segment name is assigned by the GL specialization class during InitSegment()!
    }