annotate TaskManager/Test/simple_render/spe/SpuDraw.h @ 99:57bac9e07662

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