comparison src/video/riscos/SDL_wimpvideo.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 c9b51268668f
children 604d73db6802
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
149 if (bpp == 8) this->hidden->bank[0] += 2048; /* 8bpp sprite have palette first */ 149 if (bpp == 8) this->hidden->bank[0] += 2048; /* 8bpp sprite have palette first */
150 150
151 this->hidden->bank[1] = buffer; /* Start of buffer */ 151 this->hidden->bank[1] = buffer; /* Start of buffer */
152 152
153 /* Remember sprite buffer so it can be freed later */ 153 /* Remember sprite buffer so it can be freed later */
154 if (this->hidden->alloc_bank) free(this->hidden->alloc_bank); 154 if (this->hidden->alloc_bank) SDL_free(this->hidden->alloc_bank);
155 this->hidden->alloc_bank = buffer; 155 this->hidden->alloc_bank = buffer;
156 156
157 current->pitch = width * bytesPerPixel; 157 current->pitch = width * bytesPerPixel;
158 if ((current->pitch & 3)) 158 if ((current->pitch & 3))
159 { 159 {
163 163
164 current->flags = flags | SDL_PREALLOC; 164 current->flags = flags | SDL_PREALLOC;
165 165
166 WIMP_ReadModeInfo(this); 166 WIMP_ReadModeInfo(this);
167 167
168 memset(this->hidden->bank[0], 0, height * current->pitch); 168 SDL_memset(this->hidden->bank[0], 0, height * current->pitch);
169 169
170 this->hidden->current_bank = 0; 170 this->hidden->current_bank = 0;
171 current->pixels = this->hidden->bank[0]; 171 current->pixels = this->hidden->bank[0];
172 172
173 173
388 388
389 void WIMP_SetWMCaption(_THIS, const char *title, const char *icon) 389 void WIMP_SetWMCaption(_THIS, const char *title, const char *icon)
390 { 390 {
391 _kernel_swi_regs regs; 391 _kernel_swi_regs regs;
392 392
393 strncpy(this->hidden->title, title, 255); 393 SDL_strncpy(this->hidden->title, title, 255);
394 this->hidden->title[255] = 0; 394 this->hidden->title[255] = 0;
395 395
396 if (RISCOS_GetWimpVersion() < 380) 396 if (RISCOS_GetWimpVersion() < 380)
397 { 397 {
398 int block[6]; 398 int block[6];
460 buffer = WIMP_CreateBuffer(width, height, bpp); 460 buffer = WIMP_CreateBuffer(width, height, bpp);
461 data = buffer + 60; /* Start of sprite data */ 461 data = buffer + 60; /* Start of sprite data */
462 if (bpp == 8) data += 2048; /* 8bpp sprite have palette first */ 462 if (bpp == 8) data += 2048; /* 8bpp sprite have palette first */
463 463
464 if (buffer == NULL) return 0; 464 if (buffer == NULL) return 0;
465 memcpy(data, this->hidden->bank[0], width * height * this->screen->format->BytesPerPixel); 465 SDL_memcpy(data, this->hidden->bank[0], width * height * this->screen->format->BytesPerPixel);
466 } 466 }
467 /* else We've switch to full screen before so we already have a sprite */ 467 /* else We've switch to full screen before so we already have a sprite */
468 468
469 old_bank[0] = this->hidden->bank[0]; 469 old_bank[0] = this->hidden->bank[0];
470 old_bank[1] = this->hidden->bank[1]; 470 old_bank[1] = this->hidden->bank[1];
486 WIMP_SetDeviceMode(this); 486 WIMP_SetDeviceMode(this);
487 WIMP_SetupPlotInfo(this); 487 WIMP_SetupPlotInfo(this);
488 488
489 if (riscos_backbuffer == 0) riscos_backbuffer = 1; 489 if (riscos_backbuffer == 0) riscos_backbuffer = 1;
490 490
491 if (buffer && old_alloc_bank) free(old_alloc_bank); 491 if (buffer && old_alloc_bank) SDL_free(old_alloc_bank);
492 492
493 return 1; 493 return 1;
494 } else 494 } else
495 { 495 {
496 /* Drop back to full screen mode on failure */ 496 /* Drop back to full screen mode on failure */
497 this->hidden->bank[0] = old_bank[0]; 497 this->hidden->bank[0] = old_bank[0];
498 this->hidden->bank[1] = old_bank[1]; 498 this->hidden->bank[1] = old_bank[1];
499 this->hidden->alloc_bank = old_alloc_bank; 499 this->hidden->alloc_bank = old_alloc_bank;
500 if (buffer) free(buffer); 500 if (buffer) SDL_free(buffer);
501 501
502 RISCOS_StoreWimpMode(); 502 RISCOS_StoreWimpMode();
503 FULLSCREEN_SetMode(width, height, bpp); 503 FULLSCREEN_SetMode(width, height, bpp);
504 } 504 }
505 505