Squash MSVC warnings

This commit is contained in:
Phillip 2015-11-13 22:12:39 -08:00
parent 83475b4b09
commit fe061b8d0a
3 changed files with 13 additions and 13 deletions

View File

@ -369,7 +369,7 @@ struct D3D11ShaderDataBinding : IShaderDataBinding
{ {
D3D11GraphicsBufferD* cbuf = static_cast<D3D11GraphicsBufferD*>(m_vbuf); D3D11GraphicsBufferD* cbuf = static_cast<D3D11GraphicsBufferD*>(m_vbuf);
ID3D11Buffer* buf[] = {cbuf->m_bufs[b].Get()}; ID3D11Buffer* buf[] = {cbuf->m_bufs[b].Get()};
UINT strides[] = {cbuf->m_stride}; UINT strides[] = {UINT(cbuf->m_stride)};
UINT offsets[] = {0}; UINT offsets[] = {0};
ctx->IASetVertexBuffers(0, 1, buf, strides, offsets); ctx->IASetVertexBuffers(0, 1, buf, strides, offsets);
} }
@ -377,7 +377,7 @@ struct D3D11ShaderDataBinding : IShaderDataBinding
{ {
D3D11GraphicsBufferS* cbuf = static_cast<D3D11GraphicsBufferS*>(m_vbuf); D3D11GraphicsBufferS* cbuf = static_cast<D3D11GraphicsBufferS*>(m_vbuf);
ID3D11Buffer* buf[] = {cbuf->m_buf.Get()}; ID3D11Buffer* buf[] = {cbuf->m_buf.Get()};
UINT strides[] = {cbuf->m_stride}; UINT strides[] = {UINT(cbuf->m_stride)};
UINT offsets[] = {0}; UINT offsets[] = {0};
ctx->IASetVertexBuffers(0, 1, buf, strides, offsets); ctx->IASetVertexBuffers(0, 1, buf, strides, offsets);
} }
@ -573,7 +573,7 @@ struct D3D11CommandQueue : IGraphicsCommandQueue
void setViewport(const SWindowRect& rect) void setViewport(const SWindowRect& rect)
{ {
D3D11_VIEWPORT vp = {rect.location[0], rect.location[1], rect.size[0], rect.size[1], 0.0, 1.0}; D3D11_VIEWPORT vp = {FLOAT(rect.location[0]), FLOAT(rect.location[1]), FLOAT(rect.size[0]), FLOAT(rect.size[1]), 0.0, 1.0};
m_deferredCtx->RSSetViewports(1, &vp); m_deferredCtx->RSSetViewports(1, &vp);
} }

View File

@ -140,7 +140,7 @@ struct Boo3DAppContext
D3D11Context::Window& win = m_ctx11.m_windows[window]; D3D11Context::Window& win = m_ctx11.m_windows[window];
BOOL isFScr; BOOL isFScr;
win.m_swapChain->GetFullscreenState(&isFScr, nullptr); win.m_swapChain->GetFullscreenState(&isFScr, nullptr);
return isFScr; return isFScr != 0;
} }
OGLContext::Window& win = m_ctxOgl.m_windows[window]; OGLContext::Window& win = m_ctxOgl.m_windows[window];
return win.m_fs; return win.m_fs;

View File

@ -404,11 +404,11 @@ static uint32_t translateKeysym(WPARAM sym, int& specialSym, int& modifierSym)
static int translateModifiers(UINT msg) static int translateModifiers(UINT msg)
{ {
int retval = 0; int retval = 0;
if (GetKeyState(VK_LSHIFT) & 0x8000 != 0 || GetKeyState(VK_RSHIFT) & 0x8000 != 0) if ((GetKeyState(VK_LSHIFT) & 0x8000) != 0 || (GetKeyState(VK_RSHIFT) & 0x8000) != 0)
retval |= MKEY_SHIFT; retval |= MKEY_SHIFT;
if (GetKeyState(VK_LCONTROL) & 0x8000 != 0 || GetKeyState(VK_RCONTROL) & 0x8000 != 0) if ((GetKeyState(VK_LCONTROL) & 0x8000) != 0 || (GetKeyState(VK_RCONTROL) & 0x8000) != 0)
retval |= MKEY_CTRL; retval |= MKEY_CTRL;
if (GetKeyState(VK_MENU) & 0x8000 != 0) if ((GetKeyState(VK_MENU) & 0x8000) != 0)
retval |= MKEY_ALT; retval |= MKEY_ALT;
if (msg == WM_SYSKEYDOWN || msg == WM_SYSKEYUP) if (msg == WM_SYSKEYDOWN || msg == WM_SYSKEYUP)
retval |= MKEY_ALT; retval |= MKEY_ALT;
@ -627,11 +627,11 @@ public:
uint32_t charCode = translateKeysym(e.wParam, specialKey, modifierKey); uint32_t charCode = translateKeysym(e.wParam, specialKey, modifierKey);
int modifierMask = translateModifiers(e.uMsg); int modifierMask = translateModifiers(e.uMsg);
if (charCode) if (charCode)
m_callback->charKeyDown(charCode, EModifierKey(modifierMask), e.lParam & 0xffff != 0); m_callback->charKeyDown(charCode, EModifierKey(modifierMask), (e.lParam & 0xffff) != 0);
else if (specialKey) else if (specialKey)
m_callback->specialKeyDown(ESpecialKey(specialKey), EModifierKey(modifierMask), e.lParam & 0xffff != 0); m_callback->specialKeyDown(ESpecialKey(specialKey), EModifierKey(modifierMask), (e.lParam & 0xffff) != 0);
else if (modifierKey) else if (modifierKey)
m_callback->modKeyDown(EModifierKey(modifierKey), e.lParam & 0xffff != 0); m_callback->modKeyDown(EModifierKey(modifierKey), (e.lParam & 0xffff) != 0);
} }
return; return;
} }
@ -793,11 +793,11 @@ public:
{ {
LONG sty = GetWindowLong(m_hwnd, GWL_STYLE); LONG sty = GetWindowLong(m_hwnd, GWL_STYLE);
unsigned retval = STYLE_NONE; unsigned retval = STYLE_NONE;
if (sty & WS_CAPTION != 0) if ((sty & WS_CAPTION) != 0)
retval |= STYLE_TITLEBAR; retval |= STYLE_TITLEBAR;
if (sty & WS_THICKFRAME != 0) if ((sty & WS_THICKFRAME) != 0)
retval |= STYLE_RESIZE; retval |= STYLE_RESIZE;
if (sty & WS_SYSMENU) if ((sty & WS_SYSMENU))
retval |= STYLE_CLOSE; retval |= STYLE_CLOSE;
return EWindowStyle(retval); return EWindowStyle(retval);
} }