// fprintf(stderr, "brushside with %s: %d matches (%f area)\n", buildSide->shaderInfo->shader, matches, best);
}
+#define FRAC(x) ((x) - floor(x))
static void ConvertOriginBrush( FILE *f, int num, vec3_t origin, qboolean brushPrimitives )
{
char pattern[6][5][3] = {
};
int i;
#define S(a,b,c) (pattern[a][b][c] == '+' ? +1 : pattern[a][b][c] == '-' ? -1 : 0)
-#define FRAC(x) ((x) - floor(x))
/* start brush */
fprintf( f, "\t// brush %d\n", num );
);
}
}
-#undef FRAC
#undef S
/* end brush */
pts[ 0 ][ 0 ], pts[ 0 ][ 1 ], pts[ 0 ][ 2 ],
pts[ 1 ][ 0 ], pts[ 1 ][ 1 ], pts[ 1 ][ 2 ],
pts[ 2 ][ 0 ], pts[ 2 ][ 1 ], pts[ 2 ][ 2 ],
- buildSide->texMat[0][0], buildSide->texMat[0][1], buildSide->texMat[0][2],
- buildSide->texMat[1][0], buildSide->texMat[1][1], buildSide->texMat[1][2],
+ buildSide->texMat[0][0], buildSide->texMat[0][1], FRAC(buildSide->texMat[0][2]),
+ buildSide->texMat[1][0], buildSide->texMat[1][1], FRAC(buildSide->texMat[1][2]),
texture,
// DEBUG: valid ? 0 : C_DETAIL
0
scale[0] = 1.0/sqrt(sts[0][0] * sts[0][0] + sts[0][1] * sts[0][1]);
scale[1] = 1.0/sqrt(sts[1][0] * sts[1][0] + sts[1][1] * sts[1][1]);
rotate = atan2(sts[0][1] * vecs[0][sv] - sts[1][0] * vecs[1][tv], sts[0][0] * vecs[0][sv] + sts[1][1] * vecs[1][tv]) * (180.0f / Q_PI);
- shift[0] = sts[0][2];
- shift[1] = sts[1][2];
+ shift[0] = buildSide->shaderInfo->shaderWidth * FRAC(sts[0][2] / buildSide->shaderInfo->shaderWidth);
+ shift[1] = buildSide->shaderInfo->shaderHeight * FRAC(sts[1][2] / buildSide->shaderInfo->shaderHeight);
/* print brush side */
/* ( 640 24 -224 ) ( 448 24 -224 ) ( 448 -232 -224 ) common/caulk 0 48 0 0.500000 0.500000 0 0 0 */
}
fprintf( f, "\t}\n\n" );
}
+#undef FRAC
#if 0
/* iterate through the brush sides (ignore the first 6 bevel planes) */