Mercurial > sdl-ios-xcode
comparison src/video/photon/SDL_ph_video.c @ 380:bce7171e7a85
Date: Wed, 22 May 2002 22:30:58 +0300
From: "Mike Gorchak" <mike@malva.com.ua>
Subject: One more QNX patch
Hi !
- Fixed graywin test application. Added properly support for
window size not equal to 640x480.
- Added support for not aligned pitch of image in SDL_SWSURFACE
and SDL_HWSURFACE. Using Photon builtin alignes.
- Added memory clear after each malloc to avoid problems in the
future :)
- Removed unused variables and static variables, fixed some warnings.
- Updated readme.QNX file.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 28 May 2002 19:31:32 +0000 |
parents | ba72f259bc88 |
children | 8e3ce997621c |
comparison
equal
deleted
inserted
replaced
379:11c8a7684f74 | 380:bce7171e7a85 |
---|---|
190 | 190 |
191 if (NULL == (event = malloc(EVENT_SIZE))) | 191 if (NULL == (event = malloc(EVENT_SIZE))) |
192 { | 192 { |
193 exit(EXIT_FAILURE); | 193 exit(EXIT_FAILURE); |
194 } | 194 } |
195 memset(event, 0x00, EVENT_SIZE); | |
195 | 196 |
196 /* Create the blank cursor */ | 197 /* Create the blank cursor */ |
197 SDL_BlankCursor = this->CreateWMCursor(this, blank_cdata, blank_cmask, | 198 SDL_BlankCursor = this->CreateWMCursor(this, blank_cdata, blank_cmask, |
198 (int)BLANK_CWIDTH, (int)BLANK_CHEIGHT, | 199 (int)BLANK_CWIDTH, (int)BLANK_CHEIGHT, |
199 (int)BLANK_CHOTX, (int)BLANK_CHOTY); | 200 (int)BLANK_CHOTX, (int)BLANK_CHOTY); |
200 | 201 |
201 if (SDL_BlankCursor == NULL) | 202 if (SDL_BlankCursor == NULL) |
202 { | 203 { |
203 printf("ph_VideoInit: could not create blank cursor\n"); | 204 printf("ph_VideoInit(): could not create blank cursor !\n"); |
204 } | 205 } |
205 | 206 |
206 if (PgGetGraphicsHWCaps(&my_hwcaps) < 0) | 207 if (PgGetGraphicsHWCaps(&my_hwcaps) < 0) |
207 { | 208 { |
208 fprintf(stderr,"ph_VideoInit: GetGraphicsHWCaps failed!! \n"); | 209 fprintf(stderr,"ph_VideoInit(): GetGraphicsHWCaps failed !\n"); |
209 } | 210 } |
210 | 211 |
211 if (PgGetVideoModeInfo(my_hwcaps.current_video_mode, &my_mode_info) < 0) | 212 if (PgGetVideoModeInfo(my_hwcaps.current_video_mode, &my_mode_info) < 0) |
212 { | 213 { |
213 fprintf(stderr,"ph_VideoInit: PgGetVideoModeInfo failed\n"); | 214 fprintf(stderr,"ph_VideoInit(): PgGetVideoModeInfo failed !\n"); |
214 } | 215 } |
215 | 216 |
216 /* We need to return BytesPerPixel as it in used by CreateRGBsurface */ | 217 /* We need to return BytesPerPixel as it in used by CreateRGBsurface */ |
217 vformat->BitsPerPixel = my_mode_info.bits_per_pixel; | 218 vformat->BitsPerPixel = my_mode_info.bits_per_pixel; |
218 vformat->BytesPerPixel = my_mode_info.bytes_per_scanline/my_mode_info.width; | 219 vformat->BytesPerPixel = my_mode_info.bytes_per_scanline/my_mode_info.width; |