view TaskManager/Test/test_render/spe/DrawSpan.h @ 203:1eba8570808c draft

fix CreateSpan::run
author gongo@localhost.localdomain
date Mon, 26 Jan 2009 18:30:35 +0900
parents 1ff24ca2f016
children de235e3ef9d3
line wrap: on
line source

#ifndef INCLUDED_TASK_DRAW_SPAN
#define INCLUDED_TASK_DRAW_SPAN

#ifndef INCLUDED_SCHED_TASK
#  include "SchedTask.h"
#endif

#ifndef INCLUDED_TAPESTRY
#  include "Tapestry.h"
#endif

#ifndef INCLUDED_SPAN_PACK
#  include "SpanPack.h"
#endif

#ifndef INCLUDED_TEXTURE_HASH
#  include "TileHash.h"
#endif

class DrawSpan : public SchedTask {
public:
    SchedConstructor(DrawSpan);

    int *linebuf;
    float *zRow;
    TileHashPtr hash;
    TileListPtr tileList;
    int doneWrite;

    ~DrawSpan(void);

    int run(void *rbuf, void *wbuf);

    int* linebuf_init(int width, int height, int rgb);
    float* zRow_init(int width, int height);
    void set_rgb(uint32 *addr);
    void set_rgbs(uint32 *addr, uint32 *max_addr);
    uint32 get_rgb(int tx, int ty, uint32 *addr);
    TilePtr isAvailableTile(uint32 *addr);
    uint32* getTile(int tx, int ty, int tw, uint32 *tex_addr_top);
    int getTexBlock(int tx, int ty, int twidth);
    void writebuffer(unsigned int display, int width, int height, int screen_width);

    void reboot(SpanPackPtr spack, int cur_span_x);
};

typedef struct {
    uint32 display;
    int screen_width;
    int rangex_start;
    int rangex_end;
    int rangey;
} DrawSpanArg, *DrawSpanArgPtr;

#endif