Changeset 442 for pwntcha/trunk
- Timestamp:
- Jan 10, 2005, 1:33:40 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pwntcha/trunk/src/image.c
r439 r442 16 16 #include "common.h" 17 17 18 #if defined(WIN32) 18 #if defined(HAVE_IL_H) 19 # error "DevIL routines not implemented yet" 20 #elif defined(HAVE_OLECTL_H) 19 21 # include <windows.h> 20 22 # include <ocidl.h> 21 23 # include <olectl.h> 22 BOOL oleload(LPCTSTR name, LPPICTURE* pic);24 static BOOL oleload(LPCTSTR name, LPPICTURE* pic); 23 25 struct priv 24 26 { … … 40 42 { 41 43 struct image *img; 42 #if defined(WIN32) 44 #if defined(HAVE_IL_H) 45 #elif defined(HAVE_OLECTL_H) 43 46 struct priv *priv = malloc(sizeof(struct priv)); 44 47 LPPICTURE pic = NULL; … … 58 61 return NULL; 59 62 60 #if defined( WIN32)63 #if defined(HAVE_OLECTL_H) 61 64 if(!oleload((LPCTSTR)name, &pic)) 62 65 { … … 119 122 120 123 img = (struct image *)malloc(sizeof(struct image)); 121 #if defined(WIN32) 124 #if defined(HAVE_IL_H) 125 #elif defined(HAVE_OLECTL_H) 122 126 img->width = width; 123 127 img->height = height; … … 153 157 { 154 158 struct image *img; 155 #if defined(WIN32) 159 #if defined(HAVE_IL_H) 160 #elif defined(HAVE_OLECTL_H) 156 161 struct priv *priv = malloc(sizeof(struct priv)); 157 162 HDC dc; … … 183 188 184 189 img = (struct image *)malloc(sizeof(struct image)); 185 #if defined(WIN32) 190 #if defined(HAVE_IL_H) 191 #elif defined(HAVE_OLECTL_H) 186 192 dc = CreateCompatibleDC(NULL); 187 193 if(GetDeviceCaps(dc, BITSPIXEL) < 24) … … 233 239 void image_free(struct image *img) 234 240 { 235 #if defined(WIN32) 241 #if defined(HAVE_IL_H) 242 #elif defined(HAVE_OLECTL_H) 236 243 struct priv *priv = img->priv; 237 244 DeleteObject(priv->bitmap); … … 253 260 void image_save(struct image *img, const char *name) 254 261 { 255 #if defined(WIN32) 262 #if defined(HAVE_IL_H) 263 #elif defined(HAVE_OLECTL_H) 256 264 257 265 #elif defined(HAVE_SDL_IMAGE_H) … … 307 315 } 308 316 309 #if defined( WIN32)310 BOOL oleload(LPCTSTR name, LPPICTURE* pic)317 #if defined(HAVE_OLECTL_H) 318 static BOOL oleload(LPCTSTR name, LPPICTURE* pic) 311 319 { 312 320 HRESULT ret;
Note: See TracChangeset
for help on using the changeset viewer.