From efc6c79d59f32430f8f0d7848edb63021fdbce32 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 31 May 2016 10:40:14 -0700 Subject: [PATCH] DDSView fix and code review feedback --- DDSView/ddsview.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/DDSView/ddsview.cpp b/DDSView/ddsview.cpp index 61b7f1b..bb4c1cc 100644 --- a/DDSView/ddsview.cpp +++ b/DDSView/ddsview.cpp @@ -6,12 +6,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. //-------------------------------------------------------------------------------------- -#include +#define WIN32_LEAN_AND_MEAN +#define NOMINMAX #include + +#include #include #include #include +#include + #include #include "DirectXTex.h" @@ -244,15 +249,15 @@ HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow, const TexMetadata& mdata int cxborder = GetSystemMetrics( SM_CXBORDER ); 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 ) - rc.right = (LONG)mdata.height; + rc.right = (LONG)mdata.width; if ( rc.right > screenX ) rc.right = screenX; int cyborder = GetSystemMetrics( SM_CYBORDER ); 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 ) rc.bottom = (LONG)mdata.height; if ( rc.bottom > screenY )