annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
94
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
1 #ifndef INCLUDED_TASK_SPU_DRAW
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
2 #define INCLUDED_TASK_SPU_DRAW
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
3
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
4 #ifndef INCLUDED_SCHED_TASK
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
5 # include "SchedTask.h"
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
6 #endif
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
7
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
8 //#define IMG_MAX_Y 1080
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
9 #define IMG_MAX_Y 480
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
10
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
11 #ifndef NULL
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
12 # define NULL ((void*)0)
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
13 #endif
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
14
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
15 typedef int8_t Sint8;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
16 typedef uint8_t Uint8;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
17 typedef int16_t Sint16;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
18 typedef uint16_t Uint16;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
19 typedef int32_t Sint32;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
20 typedef uint32_t Uint32;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
21
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
22 typedef unsigned short GLushort;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
23
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
24 typedef struct{
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
25 Uint8 r;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
26 Uint8 g;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
27 Uint8 b;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
28 Uint8 unused;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
29 } SDL_Color;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
30
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
31 typedef struct{
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
32 int ncolors;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
33 SDL_Color *colors;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
34 } SDL_Palette;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
35
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
36 typedef struct{
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
37 SDL_Palette *palette;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
38 Uint8 BitsPerPixel;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
39 Uint8 BytesPerPixel;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
40 Uint32 Rmask, Gmask, Bmask, Amask;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
41 Uint8 Rshift, Gshift, Bshift, Ashift;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
42 Uint8 Rloss, Gloss, Bloss, Aloss;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
43 Uint32 colorkey;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
44 Uint8 alpha;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
45 } SDL_PixelFormat;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
46
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
47
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
48 class SpuDraw : public SchedTask {
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
49 public:
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
50 SpuDraw(TaskListPtr _tlist, TaskPtr _task,
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
51 void* _rbuf, void* _wbuf, DmaManager* _con)
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
52 :SchedTask(_tlist, _task, _rbuf, _wbuf, _con) {}
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
53
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
54 ~SpuDraw(void);
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
55
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
56 //int linebuf[8][IMG_MAX_Y];
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
57 //float zRow[8][IMG_MAX_Y];
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
58 int **linebuf;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
59 float **zRow;
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
60 int run(void *readbuf, void *writebuf);
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
61
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
62 private:
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
63 void zRow_init(void);
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
64 void linebuf_init(void);
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
65 void writebuffer(int i, unsigned int fbdev_addr, int y);
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
66
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
67 char* get_pixel(int tx, int ty, void *texture_image);
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
68 Uint32 get_rgb(int tx, int ty, void *texture);
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
69 Uint32 SDL_MapRGB(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b);
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
70 Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b);
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
71 };
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
72
588ab5f0e659 *** empty log message ***
gongo
parents:
diff changeset
73 #endif