comparison src/video/wincommon/SDL_syswm.c @ 1336:3692456e7b0f

Use SDL_ prefixed versions of C library functions. FIXME: Change #include <stdlib.h> to #include "SDL_stdlib.h" Change #include <string.h> to #include "SDL_string.h" Make sure nothing else broke because of this...
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 06:59:48 +0000
parents 450721ad5436
children 604d73db6802
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
121 icon_len = sizeof(*icon_win32)+icon_plen+icon_mlen; 121 icon_len = sizeof(*icon_win32)+icon_plen+icon_mlen;
122 icon_win32 = (struct Win32Icon *)SDL_stack_alloc(Uint8, icon_len); 122 icon_win32 = (struct Win32Icon *)SDL_stack_alloc(Uint8, icon_len);
123 if ( icon_win32 == NULL ) { 123 if ( icon_win32 == NULL ) {
124 return; 124 return;
125 } 125 }
126 memset(icon_win32, 0, icon_len); 126 SDL_memset(icon_win32, 0, icon_len);
127 127
128 /* Set the basic BMP parameters */ 128 /* Set the basic BMP parameters */
129 icon_win32->biSize = sizeof(*icon_win32)-sizeof(icon_win32->biColors); 129 icon_win32->biSize = sizeof(*icon_win32)-sizeof(icon_win32->biColors);
130 icon_win32->biWidth = icon->w; 130 icon_win32->biWidth = icon->w;
131 icon_win32->biHeight = icon->h*2; 131 icon_win32->biHeight = icon->h*2;
142 } 142 }
143 pal_256 = icon_256->format->palette; 143 pal_256 = icon_256->format->palette;
144 if (icon->format->palette && 144 if (icon->format->palette &&
145 (icon->format->BitsPerPixel == icon_256->format->BitsPerPixel)){ 145 (icon->format->BitsPerPixel == icon_256->format->BitsPerPixel)){
146 Uint8 black; 146 Uint8 black;
147 memcpy(pal_256->colors, icon->format->palette->colors, 147 SDL_memcpy(pal_256->colors, icon->format->palette->colors,
148 pal_256->ncolors*sizeof(SDL_Color)); 148 pal_256->ncolors*sizeof(SDL_Color));
149 /* Make sure that 0 is black! */ 149 /* Make sure that 0 is black! */
150 black = SDL_FindColor(pal_256, 0x00, 0x00, 0x00); 150 black = SDL_FindColor(pal_256, 0x00, 0x00, 0x00);
151 pal_256->colors[black] = pal_256->colors[0]; 151 pal_256->colors[black] = pal_256->colors[0];
152 pal_256->colors[0].r = 0x00; 152 pal_256->colors[0].r = 0x00;
232 232
233 void WIN_SetWMCaption(_THIS, const char *title, const char *icon) 233 void WIN_SetWMCaption(_THIS, const char *title, const char *icon)
234 { 234 {
235 #ifdef _WIN32_WCE 235 #ifdef _WIN32_WCE
236 /* WinCE uses the UNICODE version */ 236 /* WinCE uses the UNICODE version */
237 int nLen = strlen(title)+1; 237 int nLen = SDL_strlen(title)+1;
238 LPWSTR lpszW = alloca(nLen*2); 238 LPWSTR lpszW = alloca(nLen*2);
239 MultiByteToWideChar(CP_ACP, 0, title, -1, lpszW, nLen); 239 MultiByteToWideChar(CP_ACP, 0, title, -1, lpszW, nLen);
240 SetWindowText(SDL_Window, lpszW); 240 SetWindowText(SDL_Window, lpszW);
241 #else 241 #else
242 SetWindowText(SDL_Window, title); 242 SetWindowText(SDL_Window, title);