[Bf-blender-cvs] [3353221166b] soc-2018-npr: Fix code for strict compile.
Nick Wu
noreply at git.blender.org
Wed Jul 25 16:16:03 CEST 2018
Commit: 3353221166b09083e875b9d3d4b95a523b115e08
Author: Nick Wu
Date: Wed Jul 25 22:15:18 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rB3353221166b09083e875b9d3d4b95a523b115e08
Fix code for strict compile.
===================================================================
M source/blender/draw/engines/lanpr/lanpr_all.h
M source/blender/draw/engines/lanpr/lanpr_chain.c
M source/blender/draw/engines/lanpr/lanpr_dpix.c
M source/blender/draw/engines/lanpr/lanpr_ops.c
M source/blender/draw/engines/lanpr/lanpr_util.c
M source/blender/draw/engines/lanpr/lanpr_util.h
M source/blender/draw/engines/lanpr/shaders/lanpr_snake_line_connection_geom.glsl
M source/blender/draw/engines/lanpr/shaders/lanpr_snake_multichannel_frag.glsl
===================================================================
diff --git a/source/blender/draw/engines/lanpr/lanpr_all.h b/source/blender/draw/engines/lanpr/lanpr_all.h
index 0ab2c80eccb..330df6aa6de 100644
--- a/source/blender/draw/engines/lanpr/lanpr_all.h
+++ b/source/blender/draw/engines/lanpr/lanpr_all.h
@@ -573,7 +573,7 @@ extern RenderEngineType DRW_engine_viewport_lanpr_type;
#define TNS_IN_TILE(RenderTile, Fx, Fy) \
(TNS_IN_TILE_X(RenderTile, Fx) && TNS_IN_TILE_Y(RenderTile, Fy))
-__inline void tMatConvert44df(tnsMatrix44d from, tnsMatrix44f to) {
+BLI_INLINE void tMatConvert44df(tnsMatrix44d from, tnsMatrix44f to) {
to[0] = from[0];
to[1] = from[1];
to[2] = from[2];
@@ -592,7 +592,7 @@ __inline void tMatConvert44df(tnsMatrix44d from, tnsMatrix44f to) {
to[15] = from[15];
}
-__inline int lanpr_TrangleLineBoundBoxTest(LANPR_RenderTriangle *rt, LANPR_RenderLine *rl) {
+BLI_INLINE int lanpr_TrangleLineBoundBoxTest(LANPR_RenderTriangle *rt, LANPR_RenderLine *rl) {
if (MAX3(rt->V[0]->FrameBufferCoord[2], rt->V[1]->FrameBufferCoord[2], rt->V[2]->FrameBufferCoord[2]) > MIN2(rl->L->FrameBufferCoord[2], rl->R->FrameBufferCoord[2])) return 0;
if (MAX3(rt->V[0]->FrameBufferCoord[0], rt->V[1]->FrameBufferCoord[0], rt->V[2]->FrameBufferCoord[0]) < MIN2(rl->L->FrameBufferCoord[0], rl->R->FrameBufferCoord[0])) return 0;
if (MIN3(rt->V[0]->FrameBufferCoord[0], rt->V[1]->FrameBufferCoord[0], rt->V[2]->FrameBufferCoord[0]) > MAX2(rl->L->FrameBufferCoord[0], rl->R->FrameBufferCoord[0])) return 0;
@@ -601,8 +601,8 @@ __inline int lanpr_TrangleLineBoundBoxTest(LANPR_RenderTriangle *rt, LANPR_Rende
return 1;
}
-__inline double tMatGetLinearRatio(real L, real R, real FromL);
-__inline int lanpr_LineIntersectTest2d(tnsVector2d a1, tnsVector2d a2, tnsVector2d b1, tnsVector2d b2, double *aRatio) {
+BLI_INLINE double tMatGetLinearRatio(real L, real R, real FromL);
+BLI_INLINE int lanpr_LineIntersectTest2d(tnsVector2d a1, tnsVector2d a2, tnsVector2d b1, tnsVector2d b2, double *aRatio) {
double k1, k2;
double x;
double y;
@@ -656,96 +656,96 @@ __inline int lanpr_LineIntersectTest2d(tnsVector2d a1, tnsVector2d a2, tnsVector
return 1;
}
-__inline double lanpr_GetLineZ(tnsVector3d L, tnsVector3d R, real Ratio) {
+BLI_INLINE double lanpr_GetLineZ(tnsVector3d L, tnsVector3d R, real Ratio) {
//double z = 1 / tnsLinearItp(1 / L[2], 1 / R[2], Ratio);
double z = tnsLinearItp(L[2], R[2], Ratio);
return z;
}
-__inline double lanpr_GetLineZPoint(tnsVector3d L, tnsVector3d R, tnsVector3d FromL) {
+BLI_INLINE double lanpr_GetLineZPoint(tnsVector3d L, tnsVector3d R, tnsVector3d FromL) {
double r = (FromL[0] - L[0]) / (R[0] - L[0]);
return tnsLinearItp(L[2], R[2], r);
//return 1 / tnsLinearItp(1 / L[2], 1 / R[2], r);
}
-__inline double lanpr_GetLinearRatio(tnsVector3d L, tnsVector3d R, tnsVector3d FromL) {
+BLI_INLINE double lanpr_GetLinearRatio(tnsVector3d L, tnsVector3d R, tnsVector3d FromL) {
double r = (FromL[0] - L[0]) / (R[0] - L[0]);
return r;
}
-__inline double tMatGetLinearRatio(real L, real R, real FromL) {
+BLI_INLINE double tMatGetLinearRatio(real L, real R, real FromL) {
double r = (FromL - L) / (R - L);
return r;
}
-__inline void tMatVectorMinus2d(tnsVector2d result, tnsVector2d l, tnsVector2d r) {
+BLI_INLINE void tMatVectorMinus2d(tnsVector2d result, tnsVector2d l, tnsVector2d r) {
result[0] = l[0] - r[0];
result[1] = l[1] - r[1];
}
-__inline void tMatVectorMinus3d(tnsVector3d result, tnsVector3d l, tnsVector3d r) {
+BLI_INLINE void tMatVectorMinus3d(tnsVector3d result, tnsVector3d l, tnsVector3d r) {
result[0] = l[0] - r[0];
result[1] = l[1] - r[1];
result[2] = l[2] - r[2];
}
-__inline void tMatVectorSubtract3d(tnsVector3d l, tnsVector3d r) {
+BLI_INLINE void tMatVectorSubtract3d(tnsVector3d l, tnsVector3d r) {
l[0] = l[0] - r[0];
l[1] = l[1] - r[1];
l[2] = l[2] - r[2];
}
-__inline void tMatVectorPlus3d(tnsVector3d result, tnsVector3d l, tnsVector3d r) {
+BLI_INLINE void tMatVectorPlus3d(tnsVector3d result, tnsVector3d l, tnsVector3d r) {
result[0] = l[0] + r[0];
result[1] = l[1] + r[1];
result[2] = l[2] + r[2];
}
-__inline void tMatVectorAccum3d(tnsVector3d l, tnsVector3d r) {
+BLI_INLINE void tMatVectorAccum3d(tnsVector3d l, tnsVector3d r) {
l[0] = l[0] + r[0];
l[1] = l[1] + r[1];
l[2] = l[2] + r[2];
}
-__inline void tMatVectorAccum2d(tnsVector2d l, tnsVector2d r) {
+BLI_INLINE void tMatVectorAccum2d(tnsVector2d l, tnsVector2d r) {
l[0] = l[0] + r[0];
l[1] = l[1] + r[1];
}
-__inline void tMatVectorNegate3d(tnsVector3d result, tnsVector3d l) {
+BLI_INLINE void tMatVectorNegate3d(tnsVector3d result, tnsVector3d l) {
result[0] = -l[0];
result[1] = -l[1];
result[2] = -l[2];
}
-__inline void tMatVectorNegateSelf3d(tnsVector3d l) {
+BLI_INLINE void tMatVectorNegateSelf3d(tnsVector3d l) {
l[0] = -l[0];
l[1] = -l[1];
l[2] = -l[2];
}
-__inline void tMatVectorCopy2d(tnsVector2d from, tnsVector2d to) {
+BLI_INLINE void tMatVectorCopy2d(tnsVector2d from, tnsVector2d to) {
to[0] = from[0];
to[1] = from[1];
}
-__inline void tMatVectorCopy3d(tnsVector3d from, tnsVector3d to) {
+BLI_INLINE void tMatVectorCopy3d(tnsVector3d from, tnsVector3d to) {
to[0] = from[0];
to[1] = from[1];
to[2] = from[2];
}
-__inline void tMatVectorCopy4d(tnsVector4d from, tnsVector4d to) {
+BLI_INLINE void tMatVectorCopy4d(tnsVector4d from, tnsVector4d to) {
to[0] = from[0];
to[1] = from[1];
to[2] = from[2];
to[3] = from[3];
}
-__inline void tMatVectorMultiSelf4d(tnsVector3d from, real num) {
+BLI_INLINE void tMatVectorMultiSelf4d(tnsVector3d from, real num) {
from[0] *= num;
from[1] *= num;
from[2] *= num;
from[3] *= num;
}
-__inline void tMatVectorMultiSelf3d(tnsVector3d from, real num) {
+BLI_INLINE void tMatVectorMultiSelf3d(tnsVector3d from, real num) {
from[0] *= num;
from[1] *= num;
from[2] *= num;
}
-__inline void tMatVectorMultiSelf2d(tnsVector3d from, real num) {
+BLI_INLINE void tMatVectorMultiSelf2d(tnsVector3d from, real num) {
from[0] *= num;
from[1] *= num;
}
-__inline real tMatDirectionToRad(tnsVector2d Dir) {
+BLI_INLINE real tMatDirectionToRad(tnsVector2d Dir) {
real arcc = acos(Dir[0]);
real arcs = asin(Dir[1]);
@@ -760,14 +760,14 @@ __inline real tMatDirectionToRad(tnsVector2d Dir) {
}
-__inline void tMatVectorConvert4fd(tnsVector4f from, tnsVector4d to) {
+BLI_INLINE void tMatVectorConvert4fd(tnsVector4f from, tnsVector4d to) {
to[0] = from[0];
to[1] = from[1];
to[2] = from[2];
to[3] = from[3];
}
-__inline void tMatVectorConvert3fd(tnsVector3f from, tnsVector3d to) {
+BLI_INLINE void tMatVectorConvert3fd(tnsVector3f from, tnsVector3d to) {
to[0] = from[0];
to[1] = from[1];
to[2] = from[2];
diff --git a/source/blender/draw/engines/lanpr/lanpr_chain.c b/source/blender/draw/engines/lanpr/lanpr_chain.c
index b23d297f492..46bdd76cd21 100644
--- a/source/blender/draw/engines/lanpr/lanpr_chain.c
+++ b/source/blender/draw/engines/lanpr/lanpr_chain.c
@@ -67,6 +67,7 @@ LANPR_RenderLine* lanpr_get_connected_render_line(LANPR_BoundingArea* ba, LANPR_
int lanpr_get_nearby_render_line(LANPR_BoundingArea* ba, LANPR_RenderLine* rl){
// hold on
+ return 1;
}
LANPR_RenderLineChain* lanpr_create_render_line_chain(LANPR_RenderBuffer *rb){
diff --git a/source/blender/draw/engines/lanpr/lanpr_dpix.c b/source/blender/draw/engines/lanpr/lanpr_dpix.c
index 7f86f9daaaa..d717b7799fc 100644
--- a/source/blender/draw/engines/lanpr/lanpr_dpix.c
+++ b/source/blender/draw/engines/lanpr/lanpr_dpix.c
@@ -228,7 +228,7 @@ int lanpr_feed_atlas_data_intersection_cache(void *vedata,
i = 0;
- if (!rb) return;
+ if (!rb) return 0;
for (lip = rb->IntersectionLines.pFirst; lip; lip = lip->pNext) {
rl = lip->p;
diff --git a/source/blender/draw/engines/lanpr/lanpr_ops.c b/source/blender/draw/engines/lanpr/lanpr_ops.c
index 988027ed131..ee594033d95 100644
--- a/source/blender/draw/engines/lanpr/lanpr_ops.c
+++ b/source/blender/draw/engines/lanpr/lanpr_ops.c
@@ -187,7 +187,7 @@ void lanpr_connect_new_bounding_areas(LANPR_RenderBuffer *rb, LANPR_BoundingArea
while (lstPopPointerNoFree(&Root->BP));
}
void lanpr_link_triangle_with_bounding_area(LANPR_RenderBuffer *rb, LANPR_BoundingArea *RootBoundingArea, LANPR_RenderTriangle *rt, real *LRUB, int Recursive);
-int lanpr_triangle_calculate_intersections_in_bounding_area(LANPR_RenderBuffer *rb, LANPR_RenderTriangle *rt, LANPR_BoundingArea *ba);
+void lanpr_triangle_calculate_intersections_in_bounding_area(LANPR_RenderBuffer *rb, LANPR_RenderTriangle *rt, LANPR_BoundingArea *ba);
void lanpr_split_bounding_area(LANPR_RenderBuffer *rb, LANPR_BoundingArea *Root) {
LANPR_BoundingArea *ba = memStaticAquire(&rb->RenderDataPool, sizeof(LANPR_BoundingArea) * 4);
@@ -1823,6 +1823,7 @@ LANPR_RenderLine *lanpr_another_edge(LANPR_RenderTriangle *rt, LANPR_RenderVert
{
return rt->RL[0];
}
+ return 0;
}
int lanpr_share_edge(LANPR_RenderTriangle *rt, LANPR_RenderVert *rv, LANPR_RenderLine *rl) {
@@ -1840,6 +1841,7 @@ int lanpr_share_edge(LANPR_RenderTriangle *rt, LANPR_RenderVert *rv, LANPR_Rende
if (another == rt->V[0] || another == rt->V[1]) return 1;
return 0;
}
+ return 0;
}
int lanpr_share_edge_direct(LANPR_RenderTriangle *rt, LANPR_RenderLine *rl) {
if (rt->RL[0] == rl || rt->RL[1] == rl || rt->RL[2] == rl)
@@ -2419,7 +2421,7 @@ LANPR_RenderLine *lanpr_triangle_generate_intersection_line_only(LANPR_RenderBuf
return Result;
}
-int lanpr_triangle_calculate_intersections_in_bounding_area(LANPR_RenderBuffer *rb, LANPR_RenderTriangle *rt, LANPR_BoundingArea *ba) {
+void lanpr_triangle_calculate_intersections_in_bounding_area(LANPR_RenderBuffer *rb, LANPR_RenderTriangle *rt, LANPR_BoundingArea *ba) {
tnsVector3d n, c = { 0 };
tnsVector3d TL, TR;
LANPR_RenderTriangle *TestingTriangle;
@@ -2660,11 +2662,6 @@ LANPR_RenderBuffer *lanpr_create_render_buffer(SceneLANPR *lanpr) {
void lanpr_rebuild_render_draw_command(LANPR_RenderBuffer *rb, LANPR_LineLayer *ll);
-int lanpr_draw_edge_preview(LANPR_RenderBuffer *rb, LANPR_LineLayer *OverrideLayer, Collection *OverrideGroup,
- real ThicknessScale, RenderEngine *e, GPUFrameBuffer *Off) {
- //too many errors. later....
-}
-
int lanpr_ge
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list