File tree 1 file changed +8
-9
lines changed
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,14 @@ SDL_Surface *IMG_LoadSTB_RW(SDL_RWops *src)
157
157
int colorkey_index = -1 ;
158
158
SDL_bool has_alpha = SDL_FALSE ;
159
159
SDL_Palette * palette = surface -> format -> palette ;
160
+
161
+ /* FIXME: This sucks. It'd be better to allocate the surface first, then
162
+ * write directly to the pixel buffer:
163
+ * https://github.com/nothings/stb/issues/58
164
+ * -flibit
165
+ */
166
+ surface -> flags &= ~SDL_PREALLOC ;
167
+
160
168
if (palette ) {
161
169
int i ;
162
170
Uint8 * palette_bytes = (Uint8 * )palette_colors ;
@@ -185,15 +193,6 @@ SDL_Surface *IMG_LoadSTB_RW(SDL_RWops *src)
185
193
} else if (has_colorkey ) {
186
194
SDL_SetColorKey (surface , SDL_TRUE , colorkey_index );
187
195
}
188
-
189
- /* FIXME: This sucks. It'd be better to allocate the surface first, then
190
- * write directly to the pixel buffer:
191
- * https://github.com/nothings/stb/issues/58
192
- * -flibit
193
- */
194
- if (surface ) {
195
- surface -> flags &= ~SDL_PREALLOC ;
196
- }
197
196
}
198
197
199
198
} else if (format == STBI_grey || format == STBI_rgb || format == STBI_rgb_alpha ) {
You can’t perform that action at this time.
0 commit comments