94
|
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
|
99
|
8 //#define IMG_MAX_X 1080
|
|
9 #define IMG_MAX_X 512
|
94
|
10
|
|
11 #ifndef NULL
|
99
|
12 # define NULL (0)
|
94
|
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;
|
99
|
21 typedef unsigned short GLushort;
|
94
|
22
|
|
23 typedef struct{
|
|
24 Uint8 r;
|
|
25 Uint8 g;
|
|
26 Uint8 b;
|
|
27 Uint8 unused;
|
|
28 } SDL_Color;
|
|
29
|
|
30 typedef struct{
|
|
31 int ncolors;
|
|
32 SDL_Color *colors;
|
|
33 } SDL_Palette;
|
|
34
|
|
35 typedef struct{
|
|
36 SDL_Palette *palette;
|
|
37 Uint8 BitsPerPixel;
|
|
38 Uint8 BytesPerPixel;
|
|
39 Uint32 Rmask, Gmask, Bmask, Amask;
|
|
40 Uint8 Rshift, Gshift, Bshift, Ashift;
|
|
41 Uint8 Rloss, Gloss, Bloss, Aloss;
|
|
42 Uint32 colorkey;
|
|
43 Uint8 alpha;
|
|
44 } SDL_PixelFormat;
|
|
45
|
|
46
|
|
47 class SpuDraw : public SchedTask {
|
|
48 public:
|
|
49 SpuDraw(TaskListPtr _tlist, TaskPtr _task,
|
|
50 void* _rbuf, void* _wbuf, DmaManager* _con)
|
|
51 :SchedTask(_tlist, _task, _rbuf, _wbuf, _con) {}
|
|
52
|
|
53 ~SpuDraw(void);
|
|
54
|
99
|
55 //int linebuf[8][IMG_MAX_X];
|
|
56 //float zRow[8][IMG_MAX_X];
|
|
57 int *linebuf;
|
|
58 //int *linebuf;
|
|
59 float *zRow;
|
94
|
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
|