1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Fixing FBInfo build on gcc (5.2.1)

There was a conflict between signed and unsigned types to std::min.
Explicitly setting the literal as unsigned keeps all math as unsigned,
which I think is the best case here (assuming that 1 + y0 - y1 will never
be negative).
Also adding std:: prefix to make it clearer where these functions come from.
This commit is contained in:
Sergey Lipskiy 2016-02-03 22:36:41 +06:00
parent 148349a00a
commit 646a88139c
5 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,4 @@
#include <algorithm>
#include <assert.h>
#include "GLideN64.h"
#include "Debug.h"

View File

@ -1,3 +1,4 @@
#include <algorithm>
#include <assert.h>
#include <math.h>
#include "OpenGL.h"
@ -1161,7 +1162,7 @@ void FrameBufferToRDRAM::_copy(u32 _startAddress, u32 _endAddress, bool _sync)
const GLint x0 = 0;
const GLint y0 = max_height - (_endAddress - m_pCurFrameBuffer->m_startAddress) / stride;
const GLint y1 = max_height - (_startAddress - m_pCurFrameBuffer->m_startAddress) / stride;
const GLsizei height = min(max_height, 1 + y1 - y0);
const GLsizei height = std::min(max_height, 1u + y1 - y0);
GLenum colorFormat, colorType, colorFormatBytes;
if (m_pCurFrameBuffer->m_size > G_IM_SIZ_8b) {
@ -1410,7 +1411,7 @@ bool DepthBufferToRDRAM::_copy(u32 _startAddress, u32 _endAddress)
const GLint x0 = 0;
const GLint y0 = max_height - (_endAddress - m_pCurDepthBuffer->m_address) / stride;
const GLint y1 = max_height - (_startAddress - m_pCurDepthBuffer->m_address) / stride;
const GLsizei height = min(max_height, 1 + y1 - y0);
const GLsizei height = std::min(max_height, 1u + y1 - y0);
PBOBinder binder(GL_PIXEL_PACK_BUFFER, m_PBO);
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_FBO);

View File

@ -1,3 +1,4 @@
#include <algorithm>
#include <assert.h>
#include <stdio.h>
#include <string>

View File

@ -1,3 +1,4 @@
#include <algorithm>
#include <assert.h>
#include <stdio.h>
#include <math.h>

View File

@ -4,6 +4,7 @@
#include <vector>
#ifdef OS_WINDOWS
#define NOMINMAX
#include <windows.h>
#else
#include "winlnxdefs.h"