5 #pragma RcB2 LINK "-lSDL"
6 #include "../sdl_rgb.h"
15 #include "../sprites/map_urban.c"
16 const struct palpic
*sprite
= &map_urban
.header
;
18 static void init_video() {
19 SDL_Init(SDL_INIT_VIDEO
);
20 surface
= SDL_SetVideoMode(VMODE_W
, VMODE_H
, 32, SDL_RESIZABLE
| SDL_HWPALETTE
);
21 video
.mem
= surface
->pixels
;
22 video
.pitch
= surface
->pitch
;
23 video
.width
= VMODE_W
;
24 video
.height
= VMODE_H
;
27 static void update_screen() {
28 SDL_UpdateRect(surface
, 0, 0, VMODE_W
, VMODE_H
);
32 uint_fast16_t x
, w
= VMODE_W
;
33 uint_fast16_t y
, h
= VMODE_H
;
34 sdl_rgb_t
*pix
, *ptr
= pix
= (sdl_rgb_t
*) surface
->pixels
;
35 uint_fast32_t pitch
= surface
->pitch
/ 4, inc
= pitch
- VMODE_W
;
37 for(x
=0;x
<w
;x
++) *ptr
++ = SRGB(0,0,0);
44 blit_sprite(315,240-16, &video
, SCALE
, sprite
, 35*5, 0);