float CUILines::GetVIndentByAlign() { switch(m_eVTextAlign) { case valTop: return 0; case valCenter: return (m_wndSize.y - GetVisibleHeight())/2; case valBotton: return m_wndSize.y - GetVisibleHeight(); default: NODEFAULT; } #ifdef DEBUG return 0; #endif }
void CSSE2Surface32Intrinsic::BlurBits() { int height = GetVisibleHeight(); ULONGLONG *pCur = (ULONGLONG *)GetPixelAddress(0,0); ASSERT((DWORD_PTR(pCur) & 0xF) == 0); CSSE2 cFader; CSSE2 cRight, cLeft; CSSE2 cUp, cDown, cCur; CSSE2 cResult; cFader.UnpackBytesLo( 0x0101010101010101u ); cLeft.Clear(); do { int width = m_width; ASSERT((DWORD_PTR(pCur) & 0xF) == 0); do { RGBQUAD *pdwCur = (RGBQUAD*)pCur; ULONGLONG *pNext = (ULONGLONG*)(pdwCur+1); // Load pixels and do the mmx unpack cCur.UnpackBytesLo( *pCur ); cRight.UnpackBytesLo( *pNext ); cUp.UnpackBytesLo( pCur[-m_qwpl] ); cDown.UnpackBytesLo( pCur[m_qwpl] ); // Actual math. Don't step on current, or right. // Sum the 4 around and double the middle // Do current pixel in this line cResult = (cDown+cUp+cLeft+cRight+(cCur<<2))>>3; // Do next pixel cLeft = cRight; // Slide left! cCur.UnpackBytesLo( pCur[1] ); cRight.UnpackBytesLo( pNext[1] ); cUp.UnpackBytesLo( pCur[-m_qwpl+1] ); cDown.UnpackBytesLo( pCur[m_qwpl+1] ); cCur = (cDown+cUp+cLeft+cRight+(cCur<<2))>>3; #if defined(TRIPPY) cCur += cFader; // increase the fade to white cResult += cFader; // increase the fade to white #elif defined (FAST_FADE) cCur -= cFader; // increase the fade to black cResult -= cFader; // increase the fade to black #endif cLeft = cRight; // Slide left! cResult.PackBytes(pCur, cCur); pCur += 2; } while (--width > 0); } while (--height > 0); }
void CSSE2Surface32Intrinsic::OnCreated() { ASSERT(GetBitDepth() == 32); ASSERT((GetPitch() & 0xF) == 0); ASSERT(GetVisibleWidth() && GetVisibleHeight()); ASSERT(sizeof(RGBQUAD) == 4); int width = GetVisibleWidth(); m_qwpl = GetPitch()/8; // qwords Per Line m_width = (width+3)/4; // 4 pixels at a time }
hsMatrix44 plDynamicTextMap::GetLayerTransform( void ) { hsMatrix44 xform; hsVector3 scale; scale.Set( (float)GetVisibleWidth() / (float)GetWidth(), (float)GetVisibleHeight() / (float)GetHeight(), 1.f ); xform.MakeScaleMat( &scale ); return xform; }