summaryrefslogtreecommitdiff
path: root/src/SFML/Graphics/SOIL/.svn/text-base/SOIL.c.svn-base
diff options
context:
space:
mode:
Diffstat (limited to 'src/SFML/Graphics/SOIL/.svn/text-base/SOIL.c.svn-base')
-rw-r--r--src/SFML/Graphics/SOIL/.svn/text-base/SOIL.c.svn-base145
1 files changed, 0 insertions, 145 deletions
diff --git a/src/SFML/Graphics/SOIL/.svn/text-base/SOIL.c.svn-base b/src/SFML/Graphics/SOIL/.svn/text-base/SOIL.c.svn-base
deleted file mode 100644
index b46eccc..0000000
--- a/src/SFML/Graphics/SOIL/.svn/text-base/SOIL.c.svn-base
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- Jonathan Dummer
- 2007-07-26-10.36
-
- Simple OpenGL Image Library
-
- Public Domain
- using Sean Barret's stb_image as a base
-
- Thanks to:
- * Sean Barret - for the awesome stb_image
- * Dan Venkitachalam - for finding some non-compliant DDS files, and patching some explicit casts
- * everybody at gamedev.net
-*/
-
-#define SOIL_CHECK_FOR_GL_ERRORS 0
-
-#ifdef WIN32
- #define WIN32_LEAN_AND_MEAN
- #include <windows.h>
- #include <wingdi.h>
-#elif defined(__APPLE__) || defined(__APPLE_CC__)
- /* I can't test this Apple stuff! */
- #define APIENTRY
-#else
-#endif
-
-#include "SOIL.h"
-#include "stb_image_aug.h"
-#include "image_DXT.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-/* error reporting */
-char *result_string_pointer = "SOIL initialized";
-
-
-unsigned char*
- SOIL_load_image
- (
- const char *filename,
- int *width, int *height, int *channels,
- int force_channels
- )
-{
- unsigned char *result = stbi_load( (char*)filename,
- width, height, channels, force_channels );
- if( result == NULL )
- {
- result_string_pointer = stbi_failure_reason();
- } else
- {
- result_string_pointer = "Image loaded";
- }
- return result;
-}
-
-unsigned char*
- SOIL_load_image_from_memory
- (
- const unsigned char *const buffer,
- int buffer_length,
- int *width, int *height, int *channels,
- int force_channels
- )
-{
- unsigned char *result = stbi_load_from_memory(
- (stbi_uc *)buffer, buffer_length,
- width, height, channels,
- force_channels );
- if( result == NULL )
- {
- result_string_pointer = stbi_failure_reason();
- } else
- {
- result_string_pointer = "Image loaded from memory";
- }
- return result;
-}
-
-int
- SOIL_save_image
- (
- const char *filename,
- int image_type,
- int width, int height, int channels,
- const unsigned char *const data
- )
-{
- int save_result;
-
- /* error check */
- if( (width < 1) || (height < 1) ||
- (channels < 1) || (channels > 4) ||
- (data == NULL) ||
- (filename == NULL) )
- {
- return 0;
- }
- if( image_type == SOIL_SAVE_TYPE_BMP )
- {
- save_result = stbi_write_bmp( (char*)filename,
- width, height, channels, (void*)data );
- } else
- if( image_type == SOIL_SAVE_TYPE_TGA )
- {
- save_result = stbi_write_tga( (char*)filename,
- width, height, channels, (void*)data );
- } else
- if( image_type == SOIL_SAVE_TYPE_DDS )
- {
- save_result = save_image_as_DDS( (const char*)filename,
- width, height, channels, (const unsigned char *const)data );
- } else
- {
- save_result = 0;
- }
- if( save_result == 0 )
- {
- result_string_pointer = "Saving the image failed";
- } else
- {
- result_string_pointer = "Image saved";
- }
- return save_result;
-}
-
-void
- SOIL_free_image_data
- (
- unsigned char *img_data
- )
-{
- free( (void*)img_data );
-}
-
-const char*
- SOIL_last_result
- (
- void
- )
-{
- return result_string_pointer;
-}