Mercurial > hg > Game > Cerium
comparison TaskManager/Test/simple_render/spe/SpuDraw.h @ 94:588ab5f0e659
*** empty log message ***
author | gongo |
---|---|
date | Thu, 28 Feb 2008 17:41:08 +0900 |
parents | |
children | 57bac9e07662 |
comparison
equal
deleted
inserted
replaced
93:dd33ec2e51b9 | 94:588ab5f0e659 |
---|---|
1 #ifndef INCLUDED_TASK_SPU_DRAW | |
2 #define INCLUDED_TASK_SPU_DRAW | |
3 | |
4 #ifndef INCLUDED_SCHED_TASK | |
5 # include "SchedTask.h" | |
6 #endif | |
7 | |
8 //#define IMG_MAX_Y 1080 | |
9 #define IMG_MAX_Y 480 | |
10 | |
11 #ifndef NULL | |
12 # define NULL ((void*)0) | |
13 #endif | |
14 | |
15 typedef int8_t Sint8; | |
16 typedef uint8_t Uint8; | |
17 typedef int16_t Sint16; | |
18 typedef uint16_t Uint16; | |
19 typedef int32_t Sint32; | |
20 typedef uint32_t Uint32; | |
21 | |
22 typedef unsigned short GLushort; | |
23 | |
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 | |
47 | |
48 class SpuDraw : public SchedTask { | |
49 public: | |
50 SpuDraw(TaskListPtr _tlist, TaskPtr _task, | |
51 void* _rbuf, void* _wbuf, DmaManager* _con) | |
52 :SchedTask(_tlist, _task, _rbuf, _wbuf, _con) {} | |
53 | |
54 ~SpuDraw(void); | |
55 | |
56 //int linebuf[8][IMG_MAX_Y]; | |
57 //float zRow[8][IMG_MAX_Y]; | |
58 int **linebuf; | |
59 float **zRow; | |
60 int run(void *readbuf, void *writebuf); | |
61 | |
62 private: | |
63 void zRow_init(void); | |
64 void linebuf_init(void); | |
65 void writebuffer(int i, unsigned int fbdev_addr, int y); | |
66 | |
67 char* get_pixel(int tx, int ty, void *texture_image); | |
68 Uint32 get_rgb(int tx, int ty, void *texture); | |
69 Uint32 SDL_MapRGB(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b); | |
70 Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b); | |
71 }; | |
72 | |
73 #endif |