1019 unsigned char *point_orientation,
1020 unsigned char *point_frame,
1033 int total_vnum = verts_per_point * total_points;
1034 vnum = verts_per_point * active_points;
1035 pnum = polys_per_point * active_points;
1044 VertexLoc.Resize(total_vnum * 2,
false);
1045 VertexUV.Resize(total_vnum * 2,
false);
1059 enum LoopSelectionEnum {
1060 TRIS_NOSIZE_NOORIENT = ((int)
TRIS << 2) + 0,
1061 TRIS_SIZE_NOORIENT = ((
int)
TRIS << 2) + 1,
1062 TRIS_NOSIZE_ORIENT = ((int)
TRIS << 2) + 2,
1063 TRIS_SIZE_ORIENT = ((
int)
TRIS << 2) + 3,
1064 QUADS_NOSIZE_NOORIENT = ((int)
QUADS << 2) + 0,
1065 QUADS_SIZE_NOORIENT = ((
int)
QUADS << 2) + 1,
1066 QUADS_NOSIZE_ORIENT = ((int)
QUADS << 2) + 2,
1067 QUADS_SIZE_ORIENT = ((
int)
QUADS << 2) + 3,
1068 SCREEN_NOSIZE_NOORIENT = ((int)
SCREENSPACE << 2) + 0,
1069 SCREEN_SIZE_NOORIENT = ((
int)
SCREENSPACE << 2) + 1,
1070 SCREEN_NOSIZE_ORIENT = ((int)
SCREENSPACE << 2) + 2,
1073 LoopSelectionEnum loop_sel = (LoopSelectionEnum)(((
int)
PointMode << 2) +
1074 (point_orientation ? 2 : 0) + (point_size ? 1 : 0));
1084 case TRIS_NOSIZE_NOORIENT:
1093 for (i = 0; i < active_points; i++) {
1094 vertex_loc[vert + 0] = point_loc[i] + scaled_offset[0];
1095 vertex_loc[vert + 1] = point_loc[i] + scaled_offset[1];
1096 vertex_loc[vert + 2] = point_loc[i] + scaled_offset[2];
1102 case TRIS_SIZE_NOORIENT:
1105 for (i = 0; i < active_points; i++) {
1106 vertex_loc[vert + 0] = point_loc[i] +
1108 vertex_loc[vert + 1] = point_loc[i] +
1110 vertex_loc[vert + 2] = point_loc[i] +
1117 case TRIS_NOSIZE_ORIENT:
1120 for (i = 0; i < active_points; i++) {
1121 vertex_loc[vert + 0] = point_loc[i] +
1122 _TriVertexLocationOrientationTable[point_orientation[i]][0] *
DefaultPointSize;
1123 vertex_loc[vert + 1] = point_loc[i] +
1124 _TriVertexLocationOrientationTable[point_orientation[i]][1] *
DefaultPointSize;
1125 vertex_loc[vert + 2] = point_loc[i] +
1126 _TriVertexLocationOrientationTable[point_orientation[i]][2] *
DefaultPointSize;
1132 case TRIS_SIZE_ORIENT:
1135 for (i = 0; i < active_points; i++) {
1136 vertex_loc[vert + 0] = point_loc[i] +
1137 _TriVertexLocationOrientationTable[point_orientation[i]][0] * point_size[i];
1138 vertex_loc[vert + 1] = point_loc[i] +
1139 _TriVertexLocationOrientationTable[point_orientation[i]][1] * point_size[i];
1140 vertex_loc[vert + 2] = point_loc[i] +
1141 _TriVertexLocationOrientationTable[point_orientation[i]][2] * point_size[i];
1147 case QUADS_NOSIZE_NOORIENT:
1157 for (i = 0; i < active_points; i++) {
1158 vertex_loc[vert + 0] = point_loc[i] + scaled_offset[0];
1159 vertex_loc[vert + 1] = point_loc[i] + scaled_offset[1];
1160 vertex_loc[vert + 2] = point_loc[i] + scaled_offset[2];
1161 vertex_loc[vert + 3] = point_loc[i] + scaled_offset[3];
1167 case QUADS_SIZE_NOORIENT:
1170 for (i = 0; i < active_points; i++) {
1171 vertex_loc[vert + 0] = point_loc[i] +
1173 vertex_loc[vert + 1] = point_loc[i] +
1175 vertex_loc[vert + 2] = point_loc[i] +
1177 vertex_loc[vert + 3] = point_loc[i] +
1184 case QUADS_NOSIZE_ORIENT:
1187 for (i = 0; i < active_points; i++) {
1188 vertex_loc[vert + 0] = point_loc[i] +
1189 _QuadVertexLocationOrientationTable[point_orientation[i]][0] *
DefaultPointSize;
1190 vertex_loc[vert + 1] = point_loc[i] +
1191 _QuadVertexLocationOrientationTable[point_orientation[i]][1] *
DefaultPointSize;
1192 vertex_loc[vert + 2] = point_loc[i] +
1193 _QuadVertexLocationOrientationTable[point_orientation[i]][2] *
DefaultPointSize;
1194 vertex_loc[vert + 3] = point_loc[i] +
1195 _QuadVertexLocationOrientationTable[point_orientation[i]][3] *
DefaultPointSize;
1201 case QUADS_SIZE_ORIENT:
1210 for (i = 0; i < active_points; i++) {
1214 D3DXMatrixRotationZ(&(D3DXMATRIX&) rotMat, ((
float)point_orientation[i] / 255.0f * 2 * D3DX_PI));
1216 Vector4 orientedVecX = rotMat * GroundMultiplierX;
1217 Vector4 orientedVecY = rotMat * GroundMultiplierY;
1219 vertex_loc[vert + 0].
X = point_loc[i].
X + (orientedVecX.
X + orientedVecY.
X) * point_size[i];
1220 vertex_loc[vert + 0].
Y = point_loc[i].
Y + (orientedVecX.
Y + orientedVecY.
Y) * point_size[i];
1221 vertex_loc[vert + 0].
Z = point_loc[i].
Z;
1223 vertex_loc[vert + 1].
X = point_loc[i].
X + (orientedVecX.
X - orientedVecY.
X) * point_size[i];
1224 vertex_loc[vert + 1].
Y = point_loc[i].
Y + (orientedVecX.
Y - orientedVecY.
Y) * point_size[i];
1225 vertex_loc[vert + 1].
Z = point_loc[i].
Z;
1227 vertex_loc[vert + 2].
X = point_loc[i].
X + -(orientedVecX.
X + orientedVecY.
X) * point_size[i];
1228 vertex_loc[vert + 2].
Y = point_loc[i].
Y + -(orientedVecX.
Y + orientedVecY.
Y) * point_size[i];
1229 vertex_loc[vert + 2].
Z = point_loc[i].
Z;
1231 vertex_loc[vert + 3].
X = point_loc[i].
X + (-orientedVecX.
X + orientedVecY.
X) * point_size[i];
1232 vertex_loc[vert + 3].
Y = point_loc[i].
Y + (-orientedVecX.
Y + orientedVecY.
Y) * point_size[i];
1233 vertex_loc[vert + 3].
Z = point_loc[i].
Z;
1237 result = view*vertex_loc[vert + 0];
1238 vertex_loc[vert + 0].
X = result.
X;
1239 vertex_loc[vert + 0].Y = result.
Y;
1240 vertex_loc[vert + 0].Z = result.
Z;
1242 result = view*vertex_loc[vert + 1];
1243 vertex_loc[vert + 1].X = result.
X;
1244 vertex_loc[vert + 1].Y = result.
Y;
1245 vertex_loc[vert + 1].Z = result.
Z;
1247 result = view*vertex_loc[vert + 2];
1248 vertex_loc[vert + 2].X = result.
X;
1249 vertex_loc[vert + 2].Y = result.
Y;
1250 vertex_loc[vert + 2].Z = result.
Z;
1252 result = view*vertex_loc[vert + 3];
1253 vertex_loc[vert + 3].X = result.
X;
1254 vertex_loc[vert + 3].Y = result.
Y;
1255 vertex_loc[vert + 3].Z = result.
Z;
1258 vertex_loc[vert + 0] = point_loc[i] +
1259 _QuadVertexLocationOrientationTable[point_orientation[i]][0] * point_size[i];
1260 vertex_loc[vert + 1] = point_loc[i] +
1261 _QuadVertexLocationOrientationTable[point_orientation[i]][1] * point_size[i];
1262 vertex_loc[vert + 2] = point_loc[i] +
1263 _QuadVertexLocationOrientationTable[point_orientation[i]][2] * point_size[i];
1264 vertex_loc[vert + 3] = point_loc[i] +
1265 _QuadVertexLocationOrientationTable[point_orientation[i]][3] * point_size[i];
1273 case SCREEN_NOSIZE_NOORIENT:
1274 case SCREEN_NOSIZE_ORIENT:
1280 int xres, yres, bitdepth;
1288 for (
int i = 0; i < 2; i++) {
1289 for (
int j = 0; j < 3; j++) {
1290 scaled_locs[i][j].
X = _ScreenspaceVertexLocationSizeTable[i][j].X * x_scale;
1291 scaled_locs[i][j].
Y = _ScreenspaceVertexLocationSizeTable[i][j].Y * y_scale;
1292 scaled_locs[i][j].
Z = _ScreenspaceVertexLocationSizeTable[i][j].Z;
1298 for (i = 0; i < active_points; i++) {
1299 vertex_loc[vert + 0] = point_loc[i] + scaled_locs[size_idx][0];
1300 vertex_loc[vert + 1] = point_loc[i] + scaled_locs[size_idx][1];
1301 vertex_loc[vert + 2] = point_loc[i] + scaled_locs[size_idx][2];
1307 case SCREEN_SIZE_NOORIENT:
1308 case SCREEN_SIZE_ORIENT:
1314 int xres, yres, bitdepth;
1322 for (
int i = 0; i < 2; i++) {
1323 for (
int j = 0; j < 3; j++) {
1324 scaled_locs[i][j].
X = _ScreenspaceVertexLocationSizeTable[i][j].X * x_scale;
1325 scaled_locs[i][j].
Y = _ScreenspaceVertexLocationSizeTable[i][j].Y * y_scale;
1326 scaled_locs[i][j].
Z = _ScreenspaceVertexLocationSizeTable[i][j].Z;
1331 for (i = 0; i < active_points; i++) {
1332 int size_idx = (point_size[i] <= 1.0f) ? 0 : 1;
1333 vertex_loc[vert + 0] = point_loc[i] + scaled_locs[size_idx][0];
1334 vertex_loc[vert + 1] = point_loc[i] + scaled_locs[size_idx][1];
1335 vertex_loc[vert + 2] = point_loc[i] + scaled_locs[size_idx][2];
1362 for (
int i = 0; i < active_points; i++) {
1363 int uv_idx = (point_frame[i] & frame_mask) * 3;
1364 vertex_uv[vert++] = uv_ptr[uv_idx + 0];
1365 vertex_uv[vert++] = uv_ptr[uv_idx + 1];
1366 vertex_uv[vert++] = uv_ptr[uv_idx + 2];
1372 for (
int i = 0; i < active_points; i++) {
1373 int uv_idx = (point_frame[i] & frame_mask) * 4;
1374 vertex_uv[vert++] = uv_ptr[uv_idx + 0];
1375 vertex_uv[vert++] = uv_ptr[uv_idx + 1];
1376 vertex_uv[vert++] = uv_ptr[uv_idx + 2];
1377 vertex_uv[vert++] = uv_ptr[uv_idx + 3];
1389 for (
int i = 0; i < active_points; i++) {
1390 vertex_uv[vert++] = uv_ptr[0];
1391 vertex_uv[vert++] = uv_ptr[1];
1392 vertex_uv[vert++] = uv_ptr[2];
1398 for (
int i = 0; i < active_points; i++) {
1399 vertex_uv[vert++] = uv_ptr[0];
1400 vertex_uv[vert++] = uv_ptr[1];
1401 vertex_uv[vert++] = uv_ptr[2];
1402 vertex_uv[vert++] = uv_ptr[3];
1414 if (point_diffuse) {
1416 for (i = 0; i < active_points; i++) {
1417 for (j = 0; j < verts_per_point; j++) {
1418 vertex_color[vert + j] = point_diffuse[i];
1420 vert += verts_per_point;