Mercurial > hg > Game > Cerium
comparison TaskManager/Test/simple_render/spe/SpuDraw.h @ 109:028ffc9c0375 draft
Cerium cvs version
author | gongo@gendarme.local |
---|---|
date | Wed, 12 Nov 2008 17:39:33 +0900 |
parents | 3e331f7576a1 |
children |
comparison
equal
deleted
inserted
replaced
108:6f3b3dd3c095 | 109:028ffc9c0375 |
---|---|
4 #ifndef INCLUDED_SCHED_TASK | 4 #ifndef INCLUDED_SCHED_TASK |
5 # include "SchedTask.h" | 5 # include "SchedTask.h" |
6 #endif | 6 #endif |
7 | 7 |
8 //#define IMG_MAX_X 1920 | 8 //#define IMG_MAX_X 1920 |
9 #define IMG_MAX_X 640 | 9 //#define IMG_MAX_X 640 |
10 | |
11 #ifndef NULL | |
12 # define NULL (0) | |
13 #endif | |
14 | 10 |
15 typedef int8_t Sint8; | 11 typedef int8_t Sint8; |
16 typedef uint8_t Uint8; | 12 typedef uint8_t Uint8; |
17 typedef int16_t Sint16; | 13 typedef int16_t Sint16; |
18 typedef uint16_t Uint16; | 14 typedef uint16_t Uint16; |
19 typedef int32_t Sint32; | 15 typedef int32_t Sint32; |
20 typedef uint32_t Uint32; | 16 typedef uint32_t Uint32; |
21 typedef unsigned short GLushort; | 17 typedef unsigned short GLushort; |
22 | |
23 #if 0 | |
24 typedef struct{ | |
25 Uint8 r; | |
26 Uint8 g; | |
27 Uint8 b; | |
28 Uint8 unused; | |
29 } SDL_Color; | |
30 | |
31 typedef struct{ | |
32 int ncolors; | |
33 SDL_Color *colors; | |
34 } SDL_Palette; | |
35 | |
36 typedef struct{ | |
37 SDL_Palette *palette; | |
38 Uint8 BitsPerPixel; | |
39 Uint8 BytesPerPixel; | |
40 Uint32 Rmask, Gmask, Bmask, Amask; | |
41 Uint8 Rshift, Gshift, Bshift, Ashift; | |
42 Uint8 Rloss, Gloss, Bloss, Aloss; | |
43 Uint32 colorkey; | |
44 Uint8 alpha; | |
45 } SDL_PixelFormat; | |
46 #endif | |
47 | 18 |
48 class SpuDraw : public SchedTask { | 19 class SpuDraw : public SchedTask { |
49 public: | 20 public: |
50 SpuDraw(TaskListPtr _tlist, TaskPtr _task, | 21 SpuDraw(TaskListPtr _tlist, TaskPtr _task, |
51 void* _rbuf, void* _wbuf, DmaManager* _con) | 22 void* _rbuf, void* _wbuf, DmaManager* _con) |
60 int run(void *readbuf, void *writebuf); | 31 int run(void *readbuf, void *writebuf); |
61 void write(void); | 32 void write(void); |
62 | 33 |
63 private: | 34 private: |
64 void zRow_init(void); | 35 void zRow_init(void); |
65 void linebuf_init(void); | 36 void linebuf_init(int rgb = 0xffffff); |
66 void writebuffer(unsigned int fbdev_addr, int y); | 37 void writebuffer(unsigned int fbdev_addr, int y); |
67 | 38 |
68 char* get_pixel(int tx, int ty, void *texture_image); | 39 char* get_pixel(int tx, int ty, void *texture_image); |
69 Uint32 get_rgb(int tx, int ty, void *texture); | 40 Uint32 get_rgb(int tx, int ty, void *texture); |
70 //Uint32 SDL_MapRGB(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b); | |
71 //Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b); | |
72 }; | 41 }; |
73 | 42 |
74 #endif | 43 #endif |