mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Merge cursor alignment fixes into default.
This commit is contained in:
@ -55,14 +55,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
|
|
||||||
#include "../plPipeline/plPlates.h"
|
#include "../plPipeline/plPlates.h"
|
||||||
#include "../plPipeline/plDebugText.h"
|
#include "../plPipeline/plDebugText.h"
|
||||||
|
#include "../plGImage/plMipmap.h"
|
||||||
|
|
||||||
#include "hsWindows.h"
|
#include "hsWindows.h"
|
||||||
#include "../NucleusLib/inc/plPipeline.h"
|
#include "../NucleusLib/inc/plPipeline.h"
|
||||||
|
|
||||||
// base size of the cursor
|
|
||||||
#define CURSOR_SIZE_X 0.0675f
|
|
||||||
#define CURSOR_SIZE_Y 0.09f
|
|
||||||
|
|
||||||
// The resolution that uses the base size of the cursor.
|
// The resolution that uses the base size of the cursor.
|
||||||
// All other resolutions will scale the cursor size to keep the same physical size.
|
// All other resolutions will scale the cursor size to keep the same physical size.
|
||||||
#define BASE_WIDTH 1024
|
#define BASE_WIDTH 1024
|
||||||
@ -470,7 +467,7 @@ void plMouseDevice::IUpdateCursorSize()
|
|||||||
if(fCursor)
|
if(fCursor)
|
||||||
{
|
{
|
||||||
// set the size of the cursor based on resolution.
|
// set the size of the cursor based on resolution.
|
||||||
fCursor->SetSize( CURSOR_SIZE_X * BASE_WIDTH / fWidth, CURSOR_SIZE_Y * BASE_HEIGHT / fHeight );
|
fCursor->SetSize( 2*fCursor->GetMipmap()->GetWidth()/fWidth, 2*fCursor->GetMipmap()->GetHeight()/fHeight );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11680,7 +11680,11 @@ void plDXPlateManager::IDrawToDevice( plPipeline *pipe )
|
|||||||
fD3DDevice->SetFVF(dxPipe->fSettings.fCurrFVFFormat = PLD3D_PLATEFVF);
|
fD3DDevice->SetFVF(dxPipe->fSettings.fCurrFVFFormat = PLD3D_PLATEFVF);
|
||||||
fD3DDevice->SetStreamSource( 0, fVertBuffer, 0, sizeof( plPlateVertex ) );
|
fD3DDevice->SetStreamSource( 0, fVertBuffer, 0, sizeof( plPlateVertex ) );
|
||||||
plProfile_Inc(VertexChange);
|
plProfile_Inc(VertexChange);
|
||||||
fD3DDevice->SetTransform( D3DTS_VIEW, &d3dIdentityMatrix );
|
// To get plates properly pixel-aligned, we need to compensate for D3D9's weird half-pixel
|
||||||
|
// offset (see http://drilian.com/2008/11/25/understanding-half-pixel-and-half-texel-offsets/
|
||||||
|
// or http://msdn.microsoft.com/en-us/library/bb219690(VS.85).aspx).
|
||||||
|
D3DXMatrixTranslation(&mat, -0.5f/scrnWidthDiv2, -0.5f/scrnHeightDiv2, 0.0f);
|
||||||
|
fD3DDevice->SetTransform( D3DTS_VIEW, &mat );
|
||||||
oldCullMode = dxPipe->fCurrCullMode;
|
oldCullMode = dxPipe->fCurrCullMode;
|
||||||
|
|
||||||
for( plate = fPlates; plate != nil; plate = plate->GetNext() )
|
for( plate = fPlates; plate != nil; plate = plate->GetNext() )
|
||||||
|
@ -126,6 +126,7 @@ class plPlate
|
|||||||
hsMatrix44 &GetTransform( void ) { return fXformMatrix; }
|
hsMatrix44 &GetTransform( void ) { return fXformMatrix; }
|
||||||
const char *GetTitle( void ) { return fTitle; }
|
const char *GetTitle( void ) { return fTitle; }
|
||||||
UInt32 GetFlags( void ) { return fFlags; }
|
UInt32 GetFlags( void ) { return fFlags; }
|
||||||
|
const plMipmap *GetMipmap( void ) { return fMipmap; }
|
||||||
|
|
||||||
void SetVisible( hsBool vis ) { if( vis ) fFlags |= kFlagVisible; else fFlags &= ~kFlagVisible; }
|
void SetVisible( hsBool vis ) { if( vis ) fFlags |= kFlagVisible; else fFlags &= ~kFlagVisible; }
|
||||||
hsBool IsVisible( void );
|
hsBool IsVisible( void );
|
||||||
|
Reference in New Issue
Block a user