summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenton Woods <denton.woods@gmail.com>2016-12-31 11:19:10 -0600
committerDenton Woods <denton.woods@gmail.com>2016-12-31 11:19:10 -0600
commit712e2681961ca78b4c499b3a439e753c3ad48f49 (patch)
treed719ab04972fd6088ec2aad4e0dc8583bb3e094b
parent8523d349ccbfcfdcbc7b4c23c6474eb316d563b4 (diff)
parente00833acfc991e7b32e3aff53a26470963d8d3ea (diff)
downloaddevil-712e2681961ca78b4c499b3a439e753c3ad48f49.tar.gz
Merge branch 'bcampbell-master'
-rw-r--r--DevIL/src-IL/include/il_stack.h24
-rw-r--r--DevIL/src-IL/src/il_stack.cpp27
-rw-r--r--DevIL/src-IL/src/il_xpm.cpp4
3 files changed, 31 insertions, 24 deletions
diff --git a/DevIL/src-IL/include/il_stack.h b/DevIL/src-IL/include/il_stack.h
index 5e4a214f..784fff31 100644
--- a/DevIL/src-IL/include/il_stack.h
+++ b/DevIL/src-IL/include/il_stack.h
@@ -16,28 +16,8 @@
#include "il_internal.h"
-// Just a guess...seems large enough
-#define I_STACK_INCREMENT 1024
-
-typedef struct iFree
-{
- ILuint Name;
- void *Next;
-} iFree;
-
-
-// Internal functions
-ILboolean iEnlargeStack(void);
-void iFreeMem(void);
-
-// Globals for il_stack.c
-ILuint StackSize = 0;
-ILuint LastUsed = 0;
-ILuint CurName = 0;
-ILimage **ImageStack = NULL;
-iFree *FreeNames = NULL;
-ILboolean OnExit = IL_FALSE;
-ILboolean ParentImage = IL_TRUE;
+// the currently-bound image
+extern ILuint CurName;
#endif//IMAGESTACK_H
diff --git a/DevIL/src-IL/src/il_stack.cpp b/DevIL/src-IL/src/il_stack.cpp
index 4bfca68d..cc955327 100644
--- a/DevIL/src-IL/src/il_stack.cpp
+++ b/DevIL/src-IL/src/il_stack.cpp
@@ -17,6 +17,33 @@
#include "il_internal.h"
#include "il_stack.h"
+ILuint CurName = 0;
+
+// Internal stuff
+
+// Just a guess...seems large enough
+#define I_STACK_INCREMENT 1024
+
+typedef struct iFree
+{
+ ILuint Name;
+ void *Next;
+} iFree;
+
+
+static ILboolean iEnlargeStack();
+
+static ILuint StackSize = 0;
+static ILuint LastUsed = 0;
+
+// two fixed slots - slot 0 is default (fallback) image, slot 1 is temp image
+static ILimage **ImageStack = NULL;
+
+static iFree *FreeNames = NULL;
+static ILboolean OnExit = IL_FALSE;
+static ILboolean ParentImage = IL_TRUE;
+
+
//! Creates Num images and puts their index in Images - similar to glGenTextures().
void ILAPIENTRY ilGenImages(ILsizei Num, ILuint *Images)
{
diff --git a/DevIL/src-IL/src/il_xpm.cpp b/DevIL/src-IL/src/il_xpm.cpp
index 9ca847a4..8dd44b4f 100644
--- a/DevIL/src-IL/src/il_xpm.cpp
+++ b/DevIL/src-IL/src/il_xpm.cpp
@@ -205,7 +205,7 @@ void XpmInsertEntry(XPMHASHENTRY **Table, const ILubyte* Name, int Len, XpmPixel
if (NewEntry != NULL) {
NewEntry->Next = Table[Index];
memcpy(NewEntry->ColourName, Name, Len);
- memcpy(NewEntry->ColourValue, Colour, sizeof(Colour));
+ memcpy(NewEntry->ColourValue, Colour, sizeof(XpmPixel));
Table[Index] = NewEntry;
}
}
@@ -222,7 +222,7 @@ void XpmGetEntry(XPMHASHENTRY **Table, const ILubyte* Name, int Len, XpmPixel Co
Entry = Entry->Next;
if (Entry != NULL)
- memcpy(Colour, Entry->ColourValue, sizeof(Colour));
+ memcpy(Colour, Entry->ColourValue, sizeof(XpmPixel));
}
#endif //XPM_DONT_USE_HASHTABLE