| 1439 | } |
| 1440 | |
| 1441 | void matcen::DoRenderFrame() { |
| 1442 | // MATCEN NOTE: The objref of the created object is valid from the creation time to the |
| 1443 | // creation of the next object |
| 1444 | |
| 1445 | // Useful member variables: |
| 1446 | // m_prod_mode -- See below |
| 1447 | // m_last_prod_objref |
| 1448 | // m_prod_mode_time -- Zero the first frame of the current production mode |
| 1449 | // m_preprod_time |
| 1450 | // m_postprod_time |
| 1451 | |
| 1452 | // Useful status members: |
| 1453 | // MSTAT_CREATE_OBJ_FRAME |
| 1454 | |
| 1455 | // DAJ FIXES YET ANOTHER BUG WHERE THE ARRAY INDEX IS NOT CHECKED BEFORE USE (m_prod_type[m_cached_prod_index] |
| 1456 | // == -1) |
| 1457 | if (!(m_cached_prod_index >= 0 && m_cached_prod_index < m_num_prod_types && m_prod_type[m_cached_prod_index] >= 0 && |
| 1458 | m_prod_type[m_cached_prod_index] <= MAX_OBJECT_TYPES && |
| 1459 | Object_info[m_prod_type[m_cached_prod_index]].type != OBJ_NONE)) |
| 1460 | return; |
| 1461 | |
| 1462 | // MATCEN NOTE: If an effect does something graphical, add it here |
| 1463 | switch (m_prod_mode) { |
| 1464 | case MMODE_NOTPROD: { |
| 1465 | switch (m_creation_effect) { |
| 1466 | case MEFFECT_LINE_LIGHTNING: |
| 1467 | default: |
| 1468 | return; |
| 1469 | } |
| 1470 | } break; |
| 1471 | |
| 1472 | case MMODE_PREPROD: { |
| 1473 | switch (m_creation_effect) { |
| 1474 | case MEFFECT_LINE_LIGHTNING: { |
| 1475 | int i; |
| 1476 | |
| 1477 | int oi_index = m_prod_type[m_cached_prod_index]; |
| 1478 | |
| 1479 | if (oi_index < 0 || oi_index >= MAX_POLY_MODELS) |
| 1480 | break; |
| 1481 | |
| 1482 | PageInPolymodel(Object_info[oi_index].render_handle, Object_info[oi_index].type, &Object_info[oi_index].size); |
| 1483 | float size; |
| 1484 | |
| 1485 | if (oi_index >= 0) |
| 1486 | size = Object_info[oi_index].size * 1.5; |
| 1487 | else |
| 1488 | size = 0.0f; |
| 1489 | |
| 1490 | if (m_cur_saturation_count < 1) { |
| 1491 | for (i = 0; i < m_num_spawn_pnts; i++) { |
| 1492 | int croom = m_create_room; |
| 1493 | if (!ROOMNUM_OUTSIDE(m_create_room) && (Rooms[m_create_room].flags & RF_EXTERNAL)) { |
| 1494 | croom = GetTerrainRoomFromPos(&m_create_pnt); |
| 1495 | } |
| 1496 | |
| 1497 | m_spawn_vis_effects[m_cur_saturation_count][i] = -1; |
| 1498 |
no test coverage detected