Fix some snafus on windows

This commit is contained in:
Pavel Krajcevski 2013-09-25 14:30:48 -04:00
parent e0ec005ac8
commit 79d2ad79ac
2 changed files with 9 additions and 4 deletions

View File

@ -56,6 +56,11 @@
#include <cstring>
#include <cstdio>
#if _MSC_VER
# define _CRT_SECURE_NO_WARNINGS
# define snprintf _snprintf
#endif
#include "Pixel.h"
#include "Core/include/Image.h"
@ -303,8 +308,8 @@ const Pixel & Image::operator()(uint32 i, uint32 j) const {
void Image::DebugOutput(const char *filename) const {
uint32 *outPixels = new uint32[m_Width * m_Height];
const uint8 fullDepth[4] = { 8, 8, 8, 8 };
for(int j = 0; j < m_Height; j++) {
for(int i = 0; i < m_Width; i++) {
for(uint32 j = 0; j < m_Height; j++) {
for(uint32 i = 0; i < m_Width; i++) {
uint32 idx = j * m_Width + i;
Pixel p = m_Pixels[idx];
p.ChangeBitDepth(fullDepth);

View File

@ -73,7 +73,7 @@ class ImageTester {
pvrtexture::CPVRTexture pvrTex(filename);
const uint8 *data = static_cast<const uint8 *>(pvrTex.getDataPtr());
ASSERT_TRUE(data);
assert(data);
const pvrtexture::CPVRTextureHeader &hdr = pvrTex.getHeader();
const uint32 w = hdr.getWidth();
@ -96,7 +96,7 @@ class ImageTester {
uint32 *libPixels = static_cast<uint32 *>(pvrTex.getDataPtr());
for(int i = 0; i < w*h; i++) {
for(uint32 i = 0; i < w*h; i++) {
EXPECT_EQ(PixelPrinter(libPixels[i]), PixelPrinter(outPixels[i]));
}