Indent fixes

This commit is contained in:
archshift 2014-05-19 13:51:59 -07:00
parent 603ef89dad
commit 71b8789803
3 changed files with 61 additions and 61 deletions

View file

@ -23,7 +23,7 @@ pkg_search_module(GLFW REQUIRED glfw3)
IF (APPLE) IF (APPLE)
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation) FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
SET(CMAKE_CXX_FLAGS "-stdlib=libc++") SET(CMAKE_CXX_FLAGS "-stdlib=libc++")
SET(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++") SET(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++")
ENDIF (APPLE) ENDIF (APPLE)
#external includes #external includes

View file

@ -8,40 +8,40 @@
# #
IF (WIN32) IF (WIN32)
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
$ENV{PROGRAMFILES}/GLEW/include $ENV{PROGRAMFILES}/GLEW/include
${PROJECT_SOURCE_DIR}/src/nvgl/glew/include ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
DOC "The directory where GL/glew.h resides") DOC "The directory where GL/glew.h resides")
FIND_LIBRARY( GLEW_LIBRARY FIND_LIBRARY( GLEW_LIBRARY
NAMES glew GLEW glew32 glew32s NAMES glew GLEW glew32 glew32s
PATHS PATHS
$ENV{PROGRAMFILES}/GLEW/lib $ENV{PROGRAMFILES}/GLEW/lib
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
DOC "The GLEW library") DOC "The GLEW library")
ELSE (WIN32) ELSE (WIN32)
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
/usr/include /usr/include
/usr/local/include /usr/local/include
/sw/include /sw/include
/opt/local/include /opt/local/include
DOC "The directory where GL/glew.h resides") DOC "The directory where GL/glew.h resides")
FIND_LIBRARY( GLEW_LIBRARY FIND_LIBRARY( GLEW_LIBRARY
NAMES GLEW glew NAMES GLEW glew
PATHS PATHS
/usr/lib64 /usr/lib64
/usr/lib /usr/lib
/usr/local/lib64 /usr/local/lib64
/usr/local/lib /usr/local/lib
/sw/lib /sw/lib
/opt/local/lib /opt/local/lib
DOC "The GLEW library") DOC "The GLEW library")
ENDIF (WIN32) ENDIF (WIN32)
IF (GLEW_INCLUDE_PATH) IF (GLEW_INCLUDE_PATH)
SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise") SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
ELSE (GLEW_INCLUDE_PATH) ELSE (GLEW_INCLUDE_PATH)
SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise") SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
ENDIF (GLEW_INCLUDE_PATH) ENDIF (GLEW_INCLUDE_PATH)
MARK_AS_ADVANCED( GLEW_FOUND ) MARK_AS_ADVANCED( GLEW_FOUND )

View file

@ -8,37 +8,37 @@
#include "video_core/utils.h" #include "video_core/utils.h"
namespace VideoCore { namespace VideoCore {
/** /**
* Dumps a texture to TGA * Dumps a texture to TGA
* @param filename String filename to dump texture to * @param filename String filename to dump texture to
* @param width Width of texture in pixels * @param width Width of texture in pixels
* @param height Height of texture in pixels * @param height Height of texture in pixels
* @param raw_data Raw RGBA8 texture data to dump * @param raw_data Raw RGBA8 texture data to dump
* @todo This should be moved to some general purpose/common code * @todo This should be moved to some general purpose/common code
*/ */
void DumpTGA(std::string filename, int width, int height, u8* raw_data) { void DumpTGA(std::string filename, int width, int height, u8* raw_data) {
TGAHeader hdr; TGAHeader hdr;
FILE* fout; FILE* fout;
u8 r, g, b; u8 r, g, b;
memset(&hdr, 0, sizeof(hdr)); memset(&hdr, 0, sizeof(hdr));
hdr.datatypecode = 2; // uncompressed RGB hdr.datatypecode = 2; // uncompressed RGB
hdr.bitsperpixel = 24; // 24 bpp hdr.bitsperpixel = 24; // 24 bpp
hdr.width = width; hdr.width = width;
hdr.height = height; hdr.height = height;
fout = fopen(filename.c_str(), "wb"); fout = fopen(filename.c_str(), "wb");
fwrite(&hdr, sizeof(TGAHeader), 1, fout); fwrite(&hdr, sizeof(TGAHeader), 1, fout);
for (int i = 0; i < height; i++) { for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) { for (int j = 0; j < width; j++) {
b = raw_data[(3 * (i * width)) + (3 * j) + 0]; b = raw_data[(3 * (i * width)) + (3 * j) + 0];
g = raw_data[(3 * (i * width)) + (3 * j) + 1]; g = raw_data[(3 * (i * width)) + (3 * j) + 1];
r = raw_data[(3 * (i * width)) + (3 * j) + 2]; r = raw_data[(3 * (i * width)) + (3 * j) + 2];
putc(b, fout); putc(b, fout);
putc(g, fout); putc(g, fout);
putc(r, fout); putc(r, fout);
}
} }
fclose(fout);
} }
fclose(fout);
}
} // namespace } // namespace