2016-09-29 03:21:43 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "drawercodegen.h"
|
|
|
|
|
|
|
|
enum class DrawColumnVariant
|
|
|
|
{
|
2016-10-07 01:38:43 +00:00
|
|
|
Fill,
|
|
|
|
FillAdd,
|
|
|
|
FillAddClamp,
|
|
|
|
FillSubClamp,
|
|
|
|
FillRevSubClamp,
|
2016-10-07 04:40:29 +00:00
|
|
|
DrawCopy,
|
2016-10-07 01:38:43 +00:00
|
|
|
Draw,
|
|
|
|
DrawAdd,
|
|
|
|
DrawTranslated,
|
|
|
|
DrawTlatedAdd,
|
|
|
|
DrawShaded,
|
|
|
|
DrawAddClamp,
|
|
|
|
DrawAddClampTranslated,
|
|
|
|
DrawSubClamp,
|
|
|
|
DrawSubClampTranslated,
|
|
|
|
DrawRevSubClamp,
|
|
|
|
DrawRevSubClampTranslated
|
2016-09-29 03:21:43 +00:00
|
|
|
};
|
|
|
|
|
2016-10-07 04:40:29 +00:00
|
|
|
enum class DrawColumnMethod
|
|
|
|
{
|
|
|
|
Normal,
|
|
|
|
Rt1,
|
|
|
|
Rt4
|
|
|
|
};
|
|
|
|
|
2016-09-29 03:21:43 +00:00
|
|
|
class DrawColumnCodegen : public DrawerCodegen
|
|
|
|
{
|
|
|
|
public:
|
2016-10-07 04:40:29 +00:00
|
|
|
void Generate(DrawColumnVariant variant, DrawColumnMethod method, SSAValue args, SSAValue thread_data);
|
2016-10-07 01:38:43 +00:00
|
|
|
|
|
|
|
private:
|
2016-10-07 04:40:29 +00:00
|
|
|
void Loop(DrawColumnVariant variant, DrawColumnMethod method, bool isSimpleShade);
|
|
|
|
SSAVec4i ProcessPixel(SSAInt sample_index, SSAVec4i bgcolor, DrawColumnVariant variant, bool isSimpleShade);
|
2016-10-07 10:45:21 +00:00
|
|
|
SSAVec4i ProcessPixelPal(SSAInt sample_index, SSAVec4i bgcolor, DrawColumnVariant variant, bool isSimpleShade);
|
|
|
|
SSAVec4i Sample(SSAInt frac);
|
2016-10-07 01:38:43 +00:00
|
|
|
SSAInt ColormapSample(SSAInt frac);
|
2016-10-14 10:10:11 +00:00
|
|
|
SSAVec4i TranslateSample(SSAInt frac);
|
|
|
|
SSAInt TranslateSamplePal(SSAInt frac);
|
2016-10-07 10:45:21 +00:00
|
|
|
SSAVec4i Shade(SSAVec4i fgcolor, bool isSimpleShade);
|
|
|
|
SSAVec4i ShadePal(SSAInt palIndex, bool isSimpleShade);
|
|
|
|
bool IsPaletteInput(DrawColumnVariant variant);
|
2016-10-07 01:38:43 +00:00
|
|
|
|
|
|
|
SSAStack<SSAInt> stack_index, stack_frac;
|
|
|
|
|
|
|
|
SSAUBytePtr dest;
|
|
|
|
SSAUBytePtr source;
|
|
|
|
SSAUBytePtr colormap;
|
|
|
|
SSAUBytePtr translation;
|
|
|
|
SSAUBytePtr basecolors;
|
|
|
|
SSAInt pitch;
|
|
|
|
SSAInt count;
|
|
|
|
SSAInt dest_y;
|
|
|
|
SSAInt iscale;
|
|
|
|
SSAInt texturefrac;
|
|
|
|
SSAInt light;
|
|
|
|
SSAVec4i color;
|
|
|
|
SSAVec4i srccolor;
|
|
|
|
SSAInt srcalpha;
|
|
|
|
SSAInt destalpha;
|
|
|
|
SSABool is_simple_shade;
|
|
|
|
SSAShadeConstants shade_constants;
|
|
|
|
SSAWorkerThread thread;
|
2016-09-29 03:21:43 +00:00
|
|
|
};
|