mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 19:50:13 +02:00
DDSView fix and code review feedback
This commit is contained in:
parent
de51bd7fcf
commit
efc6c79d59
@ -6,12 +6,17 @@
|
|||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
#include <assert.h>
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#define NOMINMAX
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <dxgiformat.h>
|
#include <dxgiformat.h>
|
||||||
#include <d3d11.h>
|
#include <d3d11.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include <directxmath.h>
|
#include <directxmath.h>
|
||||||
|
|
||||||
#include "DirectXTex.h"
|
#include "DirectXTex.h"
|
||||||
@ -244,15 +249,15 @@ HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow, const TexMetadata& mdata
|
|||||||
|
|
||||||
int cxborder = GetSystemMetrics( SM_CXBORDER );
|
int cxborder = GetSystemMetrics( SM_CXBORDER );
|
||||||
int cxedge = GetSystemMetrics( SM_CXEDGE );
|
int cxedge = GetSystemMetrics( SM_CXEDGE );
|
||||||
int screenX = GetSystemMetrics( SM_CXSCREEN ) - max( cxborder, cxedge );
|
int screenX = GetSystemMetrics( SM_CXSCREEN ) - std::max( cxborder, cxedge );
|
||||||
if( rc.right < (LONG)mdata.width )
|
if( rc.right < (LONG)mdata.width )
|
||||||
rc.right = (LONG)mdata.height;
|
rc.right = (LONG)mdata.width;
|
||||||
if ( rc.right > screenX )
|
if ( rc.right > screenX )
|
||||||
rc.right = screenX;
|
rc.right = screenX;
|
||||||
|
|
||||||
int cyborder = GetSystemMetrics( SM_CYBORDER );
|
int cyborder = GetSystemMetrics( SM_CYBORDER );
|
||||||
int cyedge = GetSystemMetrics( SM_CYEDGE );
|
int cyedge = GetSystemMetrics( SM_CYEDGE );
|
||||||
int screenY = GetSystemMetrics( SM_CYSCREEN ) - max( cyborder, cyedge );
|
int screenY = GetSystemMetrics( SM_CYSCREEN ) - std::max( cyborder, cyedge );
|
||||||
if ( rc.bottom < (LONG)mdata.height )
|
if ( rc.bottom < (LONG)mdata.height )
|
||||||
rc.bottom = (LONG)mdata.height;
|
rc.bottom = (LONG)mdata.height;
|
||||||
if ( rc.bottom > screenY )
|
if ( rc.bottom > screenY )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user