Mercurial > sdl-ios-xcode
comparison src/video/dummy/SDL_nullvideo.c @ 1720:a1ebb17f9c52 SDL-1.3
Cleaned up a bunch of warnings, started adding Win32 event support
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 30 Jun 2006 05:42:49 +0000 |
parents | 80a5e6a4e1e2 |
children | 98a3207ddde8 |
comparison
equal
deleted
inserted
replaced
1719:5b9f50c957ed | 1720:a1ebb17f9c52 |
---|---|
67 } | 67 } |
68 | 68 |
69 static void | 69 static void |
70 DUMMY_DeleteDevice(SDL_VideoDevice * device) | 70 DUMMY_DeleteDevice(SDL_VideoDevice * device) |
71 { | 71 { |
72 SDL_free(device->hidden); | |
73 SDL_free(device); | 72 SDL_free(device); |
74 } | 73 } |
75 | 74 |
76 static SDL_VideoDevice * | 75 static SDL_VideoDevice * |
77 DUMMY_CreateDevice(int devindex) | 76 DUMMY_CreateDevice(int devindex) |
78 { | 77 { |
79 SDL_VideoDevice *device; | 78 SDL_VideoDevice *device; |
80 | 79 |
81 /* Initialize all variables that we clean on shutdown */ | 80 /* Initialize all variables that we clean on shutdown */ |
82 device = (SDL_VideoDevice *) SDL_malloc(sizeof(SDL_VideoDevice)); | 81 device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); |
83 if (device) { | 82 if (!device) { |
84 SDL_memset(device, 0, (sizeof *device)); | |
85 device->hidden = (struct SDL_PrivateVideoData *) | |
86 SDL_malloc((sizeof *device->hidden)); | |
87 } | |
88 if ((device == NULL) || (device->hidden == NULL)) { | |
89 SDL_OutOfMemory(); | 83 SDL_OutOfMemory(); |
90 if (device) { | 84 if (device) { |
91 SDL_free(device); | 85 SDL_free(device); |
92 } | 86 } |
93 return (0); | 87 return (0); |
94 } | 88 } |
95 SDL_memset(device->hidden, 0, (sizeof *device->hidden)); | |
96 | 89 |
97 /* Set the function pointers */ | 90 /* Set the function pointers */ |
98 device->VideoInit = DUMMY_VideoInit; | 91 device->VideoInit = DUMMY_VideoInit; |
99 device->SetDisplayMode = DUMMY_SetDisplayMode; | 92 device->SetDisplayMode = DUMMY_SetDisplayMode; |
100 device->VideoQuit = DUMMY_VideoQuit; | 93 device->VideoQuit = DUMMY_VideoQuit; |