Merge pull request #138 from bagedevimo/nix-fix

More *nix fixes.
This commit is contained in:
Alexandro Sánchez Bach 2014-03-29 16:26:08 +01:00
commit 7804c56584
3 changed files with 6 additions and 4 deletions

View file

@ -7,6 +7,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
#add_definitions(-Wfatal-errors)
add_definitions(-w) # TODO: remove me
add_definitions(-fpermissive) # TODO: remove me
add_definitions(-g) # Debugging!!
endif()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)

View file

@ -10,6 +10,10 @@ void InitProcTable()
#undef OPENGL_PROC
#undef OPENGL_PROC2
#endif
#ifdef __UNIX__
glewExperimental = true;
glewInit();
#endif
}
#ifdef _WIN32
@ -39,9 +43,6 @@ void OpenGL::Init()
#include "GLProcTable.tbl"
#undef OPENGL_PROC
#undef OPENGL_PROC2
#elif __UNIX__
glewExperimental = true;
glewInit();
#endif
}

View file

@ -155,7 +155,7 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
//Decode PNG file. (TODO: Is there any faster alternative? Can we do it without external libraries?)
int width, height, actual_components;
std::shared_ptr<unsigned char> image(stbi_load_from_memory(png, fileSize, &width, &height, &actual_components, 4));
std::shared_ptr<unsigned char> image(stbi_load_from_memory(png.GetPtr(), fileSize, &width, &height, &actual_components, 4));
if (!image) return CELL_PNGDEC_ERROR_STREAM_FORMAT;
uint image_size = width * height;