|
@@ -167,22 +167,6 @@ NEED_STRUCTURE(tnsLoopItem);
|
|
|
NEED_STRUCTURE(tnsRenderLine);
|
|
|
NEED_STRUCTURE(tnsRenderBuffer);
|
|
|
|
|
|
-STRUCTURE(tnsFilterKernel){
|
|
|
- int Size;
|
|
|
- real *Kernel;
|
|
|
-};
|
|
|
-
|
|
|
-STRUCTURE(tnsTriangulateNode){
|
|
|
- char Picked;
|
|
|
- real Angle; //rad
|
|
|
- tnsLoopItem *LoopItem;
|
|
|
- tnsRenderLine *FowardRL;
|
|
|
- tnsRenderLine *BackwardRL;
|
|
|
-};
|
|
|
-STRUCTURE(tnsTriangulateEdgeNode){
|
|
|
- tnsRenderLine *RL;
|
|
|
-};
|
|
|
-
|
|
|
STRUCTURE(tnsImage){
|
|
|
laListItem Item;
|
|
|
void* MemPNG;
|
|
@@ -237,8 +221,6 @@ struct _tnsMain {
|
|
|
laListHandle Textures;
|
|
|
tnsTexture *PreviewTexture;
|
|
|
|
|
|
- tnsFilterKernel EdgeGaussFilter;
|
|
|
-
|
|
|
GLenum GlTextureSets;
|
|
|
|
|
|
// Corresponds to current GL_TEXTURE0/1...
|
|
@@ -289,41 +271,6 @@ struct _tnsMain {
|
|
|
laListHandle Images;
|
|
|
};
|
|
|
|
|
|
-typedef struct _tnsLineStripPoint tnsLineStripPoint;
|
|
|
-struct _tnsLineStripPoint
|
|
|
-{
|
|
|
- laListItem Item;
|
|
|
- tnsVector3d P;
|
|
|
-};
|
|
|
-
|
|
|
-typedef struct _tnsLineStrip tnsLineStrip;
|
|
|
-struct _tnsLineStrip
|
|
|
-{
|
|
|
- laListItem Item;
|
|
|
- laListHandle Points;
|
|
|
- int PointCount;
|
|
|
-};
|
|
|
-
|
|
|
-#define TNS_SNAKE_STRENGTH_LIMIT 30
|
|
|
-#define TNS_SNAKE_STEP_LENGTH 5
|
|
|
-#define TNS_SNAKE_STRENGTH_MARCHING_LIMIT 30
|
|
|
-
|
|
|
-#define TNS_SNAKE_EDGE_WIDTH 2
|
|
|
-#define TNS_SNAKE_FILTER_SIZE 6
|
|
|
-#define TNS_SNAKE_ANGLE_DEVIATE 0.5
|
|
|
-#define TNS_SNAKE_ANGLE_PRICISION 1
|
|
|
-#define TNS_SNAKE_STEP1 3
|
|
|
-#define TNS_SNAKE_STEP2 5
|
|
|
-
|
|
|
-typedef struct _tnsTextureSample tnsTextureSample;
|
|
|
-struct _tnsTextureSample
|
|
|
-{
|
|
|
- laListItem Item;
|
|
|
- u8bit Sample;
|
|
|
- int X, Y;
|
|
|
- real Z;
|
|
|
-};
|
|
|
-
|
|
|
typedef struct _tnsTexture tnsTexture;
|
|
|
struct _tnsTexture
|
|
|
{
|
|
@@ -451,88 +398,8 @@ struct _tnsFontBoundBox
|
|
|
int x, y, w, h; /* Upper Left and width,height */
|
|
|
};
|
|
|
|
|
|
-#define TNS_FONT_BUFFER_W 2048
|
|
|
-#define TNS_FONT_BUFFER_H 2048
|
|
|
-
|
|
|
-#define TNS_FONT_ALIGN_LEFT 1
|
|
|
-#define TNS_FONT_ALIGN_CENTER 2
|
|
|
-#define TNS_FONT_ALIGN_RIGHT 4
|
|
|
-#define TNS_FONT_ALIGN_LEFT_PROTECT 8
|
|
|
-#define TNS_FONT_ALIGN_CENTER_FIRST (2 | 8)
|
|
|
-
|
|
|
-#define CSS_FLOW_DIRECTION_LR 1
|
|
|
-#define CSS_FLOW_DIRECTION_TD 0
|
|
|
-
|
|
|
-//typedef struct _tnsCssBorder tnsCssBorder;
|
|
|
-//struct _tnsCssBorder{
|
|
|
-// real Px;//thickness
|
|
|
-// real Color[4];//rgba
|
|
|
-// int Style;//Like________ or ....... or __.__.__. or ======== or ~~~~~~~
|
|
|
-// int Padding;
|
|
|
-// int Margin;
|
|
|
-//};
|
|
|
-//
|
|
|
-//typedef struct _tnsCssBackground tnsCssBackground;
|
|
|
-//struct _tnsCssBackground{
|
|
|
-// real Color[4];
|
|
|
-// int ImageID;//LA SPECIFIC
|
|
|
-// int Repeat;
|
|
|
-// int PositionFixed;
|
|
|
-// real PositionRatio;
|
|
|
-//};
|
|
|
-//
|
|
|
-//typedef struct _tnsCssText tnsCssText;
|
|
|
-//struct _tnsCssText{
|
|
|
-// real Color[4];
|
|
|
-// int LineSpacing;
|
|
|
-// int LetterSpacing;
|
|
|
-// int Align;//0-LR 1-C 2-L 3-R all support number-ready display
|
|
|
-// int Decoration;
|
|
|
-// int Underline;
|
|
|
-// int Shadow;
|
|
|
-//};
|
|
|
-//
|
|
|
-//typedef struct _tnsCssMisc tnsCssMisc;
|
|
|
-//struct _tnsCssMisc{
|
|
|
-// real Color[4];
|
|
|
-// int Size;
|
|
|
-// const char * Name;
|
|
|
-// const char * Description;
|
|
|
-//};
|
|
|
-//
|
|
|
-//typedef struct _tnsCssState tnsCssState;
|
|
|
-//struct _tnsCssState{
|
|
|
-// char NameReplace[36];
|
|
|
-// tnsCssBackground Bkg;
|
|
|
-// tnsCssBorder BorderLeft;
|
|
|
-// tnsCssBorder BorderRight;
|
|
|
-// tnsCssBorder BorderTop;
|
|
|
-// tnsCssBorder BorderBottom;
|
|
|
-// tnsCssText Text;
|
|
|
-// tnsCssMisc Misc1;
|
|
|
-// tnsCssMisc Misc2;
|
|
|
-// tnsCssMisc Misc3;
|
|
|
-// tnsCssMisc Misc4;
|
|
|
-//};
|
|
|
-
|
|
|
-#define TNS_STATE_NORMAL 0
|
|
|
-#define TNS_STATE_PUSHED 1
|
|
|
-#define TNS_STATE_HIGHLIGHT 2
|
|
|
-#define TNS_STATE_HIGHLIGHT_SELECT 3
|
|
|
-#define TNS_STATE_KEYING 4
|
|
|
-#define TNS_STATE_INTERPOLATING 5
|
|
|
-#define TNS_STATE_LIMITED 6
|
|
|
-//
|
|
|
-//typedef struct _tnsCssStyle tnsCssStyle;
|
|
|
-//struct _tnsCssStyle{
|
|
|
-// tnsCssState Normal;
|
|
|
-// tnsCssState Pushed;
|
|
|
-// tnsCssState Highlight;
|
|
|
-// tnsCssState HighlightSelect;
|
|
|
-// tnsCssState Keying;
|
|
|
-// tnsCssState Interpolating;
|
|
|
-// tnsCssState Limited;
|
|
|
-//};
|
|
|
+#define TNS_FONT_BUFFER_W 512
|
|
|
+#define TNS_FONT_BUFFER_H 512
|
|
|
|
|
|
//=====================================================[3d comp]
|
|
|
|
|
@@ -553,15 +420,6 @@ typedef struct _tnsObject tnsObject;
|
|
|
#define TNS_OBJECT_LIGHT (1<<2)
|
|
|
#define TNS_OBJECT_MESH (1<<3)
|
|
|
|
|
|
-//typedef struct _tnsObjectLinker tnsObjectLinker;
|
|
|
-//struct _tnsObjectLinker {
|
|
|
-// laListItem Item;
|
|
|
-// tnsObject* o;
|
|
|
-//};
|
|
|
-
|
|
|
-NEED_STRUCTURE(tnsRenderTriangle);
|
|
|
-NEED_STRUCTURE(tnsRenderVert);
|
|
|
-
|
|
|
#define TNS_OBJECT_FLAGS_SELECTED 1
|
|
|
|
|
|
NEED_STRUCTURE(tnsBatch)
|
|
@@ -911,51 +769,6 @@ STRUCTURE(tnsEdgeHash){
|
|
|
#define TNS_IN_TILE(RenderTile, Fx, Fy) \
|
|
|
(TNS_IN_TILE_X(RenderTile, Fx) && TNS_IN_TILE_Y(RenderTile, Fy))
|
|
|
|
|
|
-#define TNS_RENDERBUFFER_INCOMPLETE 0
|
|
|
-#define TNS_RENDERBUFFER_GEOMETRY_COMPLETE 1
|
|
|
-#define TNS_RENDERBUFFER_RASTERIZER_COMPLETE 2
|
|
|
-#define TNS_RENDERBUFFER_COMPLETE (TNS_RENDERBUFFER_GEOMETRY_COMPLETE | TNS_RENDERBUFFER_RASTERIZER_COMPLETE)
|
|
|
-
|
|
|
-#define TNS_DISPLAY_MODE_WIRE GL_LINE_LOOP
|
|
|
-#define TNS_DISPLAY_MODE_SOLID GL_TRIANGLES
|
|
|
-#define TNS_INTERNAL_MODE_WIRE 1
|
|
|
-#define TNS_INTERNAL_MODE_SOLID 2
|
|
|
-
|
|
|
-#define TNS_ARROW_L 1
|
|
|
-#define TNS_ARROW_R 2
|
|
|
-#define TNS_ARROW_U 3
|
|
|
-#define TNS_ARROW_D 4
|
|
|
-
|
|
|
-#define TNS_KEYWORD_OBJECT_COUNT 1
|
|
|
-#define TNS_KEYWORD_OBJECT_NAME 2
|
|
|
-#define TNS_KEYWORD_OBJECT_TYPE 3
|
|
|
-#define TNS_KEYWORD_OBJECT_LOCATION 4
|
|
|
-#define TNS_KEYWORD_OBJECT_ROTATION 5
|
|
|
-#define TNS_KEYWORD_OBJECT_SCALE 6
|
|
|
-#define TNS_KEYWORD_OBJECT_CHILDREN_COUNT 7
|
|
|
-#define TNS_KEYWORD_OBJECT_CHILDREN_NAMES 8
|
|
|
-//#define TNS_KEYWORD_MESH_COUNT 9
|
|
|
-//#define TNS_KEYWORD_MESH_NAME 10
|
|
|
-#define TNS_KEYWORD_MESH_VERTEX_COUNT 11
|
|
|
-#define TNS_KEYWORD_MESH_VERTICES 12
|
|
|
-#define TNS_KEYWORD_MESH_LOOP_COUNT 13
|
|
|
-#define TNS_KEYWORD_MESH_TOPOLOGY 14
|
|
|
-#define TNS_KEYWORD_MESH_UV_COUNT 15
|
|
|
-#define TNS_KEYWORD_MESH_UV_NAME 16
|
|
|
-#define TNS_KEYWORD_MATERIAL_COUNT 17
|
|
|
-#define TNS_KEYWORD_MATERIAL_NAME 18
|
|
|
-#define TNS_KEYWORD_MATERIAL_COLOR 19
|
|
|
-#define TNS_KEYWORD_MATERIAL_END 20
|
|
|
-
|
|
|
-#define TNS_KEYWORD_CAMERA_FOV 20
|
|
|
-#define TNS_KEYWORD_CAMERA_IS_ACTIVE 21
|
|
|
-#define TNS_KEYWORD_CAMERA_NEAR 22
|
|
|
-#define TNS_KEYWORD_CAMERA_FAR 23
|
|
|
-
|
|
|
-#define TNS_KEYWORD_GROUP_COUNT 24
|
|
|
-#define TNS_KEYWORD_GROUP_NAME 25
|
|
|
-#define TNS_KEYWORD_OBJECT_GROUP_COUNT 26
|
|
|
-
|
|
|
void tnsSetuptnsFontManager();
|
|
|
|
|
|
tnsShader *tnsNewShaderProgram(int VertexShaderID, int FragmentShaderID, int GeometryShaderID);
|
|
@@ -1072,7 +885,6 @@ void tnsVectorMulti3d(tnsVector3d to, tnsVector3d from, real num);
|
|
|
void tnsVectorMulti2d(tnsVector2d to, tnsVector2d from, real num);
|
|
|
real tnsDirectionToRad(tnsVector2d Dir);
|
|
|
void tnsConvert44df(tnsMatrix44d from, tnsMatrix44f to);
|
|
|
-int tnsTrangleLineBoundBoxTest(tnsRenderTriangle *rt, tnsRenderLine *rl);
|
|
|
|
|
|
#define tnsVectorSet2(to, x,y) \
|
|
|
{(to)[0]=x;(to)[1]=y;}
|
|
@@ -1355,37 +1167,6 @@ void tnsDraw2DTextureArg(tnsTexture *t,
|
|
|
real LPadding, real RPadding, real TPadding, real BPadding);
|
|
|
|
|
|
int tnsTextureMemorySize(tnsTexture *t, int mem);
|
|
|
-void tnsCreateTextureReadbackBuffer(tnsTexture *t);
|
|
|
-void tnsDeleteTextureReadbackBuffer(tnsTexture *t);
|
|
|
-void tnsReadbackTexture(tnsTexture *t);
|
|
|
-
|
|
|
-#define TNS_CLAMP_TEXTURE_W(t, Col) \
|
|
|
- { \
|
|
|
- if (Col >= t->Width) \
|
|
|
- Col = t->Width - 1; \
|
|
|
- if (Col < 0) \
|
|
|
- Col = 0; \
|
|
|
- }
|
|
|
-
|
|
|
-#define TNS_CLAMP_TEXTURE_H(t, Row) \
|
|
|
- { \
|
|
|
- if (Row >= t->Height) \
|
|
|
- Row = t->Height - 1; \
|
|
|
- if (Row < 0) \
|
|
|
- Row = 0; \
|
|
|
- }
|
|
|
-
|
|
|
-#define TNS_CLAMP_TEXTURE_CONTINUE(t, Col, Row) \
|
|
|
- { \
|
|
|
- if (Col >= t->Width) \
|
|
|
- continue; \
|
|
|
- if (Col < 0) \
|
|
|
- continue; \
|
|
|
- if (Row >= t->Height) \
|
|
|
- continue; \
|
|
|
- if (Row < 0) \
|
|
|
- continue; \
|
|
|
- }
|
|
|
|
|
|
void tnsDelete2DOffscreen(tnsOffscreen *o);
|
|
|
tnsOffscreen *tnsCreateOffscreenHandle();
|
|
@@ -1454,7 +1235,6 @@ void tnsMakeBridgedIndex(unsigned int *result, int num, int revert, int begin);
|
|
|
void DrawWireRect2dp(real x, real y, real x2, real y2);
|
|
|
void tnsViewportWithScissor(int x, int y, int w, int h);
|
|
|
|
|
|
-
|
|
|
void tnssRGB2XYZ(tnsVector3d rgb,tnsVector3d xyz);
|
|
|
void tnsClay2XYZ(tnsVector3d rgb,tnsVector3d xyz);
|
|
|
void tnsXYZ2sRGB(tnsVector3d xyz,tnsVector3d rgb);
|
|
@@ -1473,18 +1253,3 @@ void tnsHCY2RGBLinear(real *hcy, real *rgb);
|
|
|
void tnsRGB2HCYLinear(real *rgb, real *hcy);
|
|
|
void tnsHCY2RGB(real *hcy, real *rgb);
|
|
|
void tnsRGB2HCY(real *rgb, real *hcy);
|
|
|
-
|
|
|
-tnsLineStrip *tnsCreateLineStrip();
|
|
|
-tnsLineStripPoint *tnsAppendPoint(tnsLineStrip *ls, real X, real Y, real Z);
|
|
|
-tnsLineStripPoint *tnsPushPoint(tnsLineStrip *ls, real X, real Y, real Z);
|
|
|
-void tnsRemovePoint(tnsLineStrip *ls, tnsLineStripPoint *lsp);
|
|
|
-void tnsDestroyLineStrip(tnsLineStrip *ls);
|
|
|
-
|
|
|
-void tnsGetGaussianKernel(tnsFilterKernel *fk, int size, real sigma);
|
|
|
-
|
|
|
-void *tnsTextureSampleSafe(tnsTexture *t, int Col, int Row);
|
|
|
-int tnsTextureSampleWeightSafe(tnsTexture *t, int Col, int Row, real Size, tnsVector2d Direction);
|
|
|
-real tnsTextureSampleSafeGaussU8R(tnsTexture *t, tnsFilterKernel *fk, int Col, int Row);
|
|
|
-void tnsTextureSetBitSafeU8R(tnsTexture *t, int Col, int Row, int Bit);
|
|
|
-void tnsTextureSetRGBSafeU8R(tnsTexture *t, int Col, int Row, u8bit r, u8bit g, u8bit b);
|
|
|
-u8bit *tnsTextureSampleU8(tnsTexture *t, int Col, int Row);
|