diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index e59e5ba24..0cf80f466 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/projects/linux/ee.files b/projects/linux/ee.files index e363f21a8..c1dfc669e 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -569,3 +569,15 @@ ../../src/eepp/graphics/cframebufferfbo.hpp ../../src/eepp/graphics/renderer/rendererhelper.hpp ../../include/eepp/graphics/packerhelper.hpp +../../src/eepp/helper/SOIL/stbi_DDS_c.h +../../src/eepp/helper/SOIL/stbi_DDS.h +../../src/eepp/helper/SOIL/stb_image_write.h +../../src/eepp/helper/SOIL/stb_image.h +../../src/eepp/helper/SOIL/image_helper.h +../../src/eepp/helper/SOIL/image_DXT.h +../../src/eepp/helper/SOIL/SOIL.h +../../src/eepp/helper/SOIL/stb_image_write.c +../../src/eepp/helper/SOIL/stb_image.c +../../src/eepp/helper/SOIL/image_helper.c +../../src/eepp/helper/SOIL/image_DXT.c +../../src/eepp/helper/SOIL/SOIL.c diff --git a/src/eepp/helper/.hgsub b/src/eepp/helper/.hgsub new file mode 100644 index 000000000..4b8e52225 --- /dev/null +++ b/src/eepp/helper/.hgsub @@ -0,0 +1 @@ +SOIL2 = https://SpartanJ@bitbucket.org/SpartanJ/soil2 diff --git a/src/eepp/helper/SOIL/SOIL.c b/src/eepp/helper/SOIL/SOIL.c index 18d5dc24e..ac9647368 100755 --- a/src/eepp/helper/SOIL/SOIL.c +++ b/src/eepp/helper/SOIL/SOIL.c @@ -1,8 +1,11 @@ /* + Fork by Martin Lucas Golini + + Original author Jonathan Dummer 2007-07-26-10.36 - Simple OpenGL Image Library + Simple OpenGL Image Library 2 Public Domain using Sean Barret's stb_image as a base @@ -202,7 +205,7 @@ unsigned int ) { /* variables */ - unsigned char* img; + unsigned char* img = NULL; int width, height, channels; unsigned int tex_id; /* no direct uploading of the image as a DDS file */ @@ -214,8 +217,14 @@ unsigned int result_string_pointer = "Invalid fake HDR format specified"; return 0; } - /* try to load the image (only the HDR type) */ - img = stbi_load( filename, &width, &height, &channels, 4 ); + + /* check if the image is HDR */ + if ( stbi_is_hdr( filename ) ) + { + /* try to load the image (only the HDR type) */ + img = stbi_load( filename, &width, &height, &channels, 4 ); + } + /* channels holds the original number of channels, which may have been forced */ if( NULL == img ) { diff --git a/src/eepp/helper/SOIL/SOIL.h b/src/eepp/helper/SOIL/SOIL.h index 54da535e7..199ed71aa 100755 --- a/src/eepp/helper/SOIL/SOIL.h +++ b/src/eepp/helper/SOIL/SOIL.h @@ -1,10 +1,12 @@ /** - @mainpage SOIL + @mainpage SOIL2 - Jonathan Dummer + Fork by Martin Lucas Golini + + Original author Jonathan Dummer 2007-07-26-10.36 - Simple OpenGL Image Library + Simple OpenGL Image Library 2 A tiny c library for uploading images as textures into OpenGL. Also saving and @@ -21,8 +23,11 @@ - BMP load & save - TGA load & save - DDS load & save - - PNG load + - PNG load & save - JPG load + - PSD load + - HDR load + - PIC load OpenGL Texture Features: - resample to power-of-two sizes @@ -111,6 +116,7 @@ enum (TGA supports uncompressed RGB / RGBA) (BMP supports uncompressed RGB) (DDS supports DXT1 and DXT5) + (PNG supports RGB / RGBA) **/ enum { @@ -306,8 +312,8 @@ unsigned int Creates a 2D OpenGL texture from raw image data. Note that the raw data is _NOT_ freed after the upload (so the user can load various versions). \param data the raw data to be uploaded as an OpenGL texture - \param width the width of the image in pixels - \param height the height of the image in pixels + \param width the pointer of the width of the image in pixels ( if the texture size change, width will be overrided with the new width ) + \param height the pointer of the height of the image in pixels ( if the texture size change, height will be overrided with the new height ) \param channels the number of channels: 1-luminous, 2-luminous/alpha, 3-RGB, 4-RGBA \param reuse_texture_ID 0-generate a new texture ID, otherwise reuse the texture ID (overwriting the old texture) \param flags can be any of SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_MIPMAPS | SOIL_FLAG_TEXTURE_REPEATS | SOIL_FLAG_MULTIPLY_ALPHA | SOIL_FLAG_INVERT_Y | SOIL_FLAG_COMPRESS_TO_DXT