| 217 | return found_count; |
| 218 | } |
| 219 | int seqSetStaticLight(SeqInstance *arg0, DefTracker *light_trkr) |
| 220 | { |
| 221 | char buf[100000]; |
| 222 | GfxTree_Node *bones[70]; |
| 223 | Matrix4x3 operator_mat; |
| 224 | |
| 225 | if (!arg0 || !arg0->gfx_root || !arg0->gfx_root->children_list) |
| 226 | return 1; |
| 227 | memset(bones, 0, sizeof(GfxTree_Node *)*70); |
| 228 | if (0==segs_seqgraphics_getBoneNodes(arg0->gfx_root->children_list, bones, arg0->seq_instance_handle)) |
| 229 | return 1; |
| 230 | if (!light_trkr) |
| 231 | light_trkr = groupFindInside(&arg0->gfx_root->mat.TranslationPart, 2); |
| 232 | if (!light_trkr || !light_trkr->light_grid) |
| 233 | return 0; |
| 234 | for (int i = 0; i < 70; ++i) |
| 235 | { |
| 236 | if (!bones[i]) |
| 237 | continue; |
| 238 | assert(bones[i]->anim_id() == i && !bones[i]->rgb_entries && legitBone(i) && bones[i]->model && bones[i]->model->Model_flg1 & 0x8000); //OBJ_STATICFX |
| 239 | gfxTreeFindWorldSpaceMat(&operator_mat, bones[i]); |
| 240 | size_t size = 4 * bones[i]->model->vertex_count; |
| 241 | char *vertices_memory = buf; |
| 242 | if (size > 100000) |
| 243 | { |
| 244 | vertices_memory = (char *)COH_MALLOC(size); |
| 245 | } |
| 246 | lightModel(bones[i]->model, &operator_mat, (unsigned __int8 *)vertices_memory, light_trkr); |
| 247 | arg0->bone_rgb_buffers[i] = segs_modelConvertRgbBuffer(vertices_memory, bones[i]->model->vertex_count, vertices_memory != buf); |
| 248 | bones[i]->rgb_entries = arg0->bone_rgb_buffers[i]; |
| 249 | } |
| 250 | return 1; |
| 251 | } |
| 252 | static void lightGiveLightTrackerToMyDoor(DefTracker *tracker, DefTracker *light_trkr) |
| 253 | { |
| 254 | assert(tracker && light_trkr); |
no test coverage detected