| 89 | } |
| 90 | |
| 91 | bool LightProbeObject::SetFromDesc(const EntityDescription& desc) { |
| 92 | LOG_ASSERT(probe_id_ == -1); |
| 93 | LOG_ASSERT(!stored_coefficients); |
| 94 | bool ret = Object::SetFromDesc(desc); |
| 95 | if (ret) { |
| 96 | for (const auto& field : desc.fields) { |
| 97 | switch (field.type) { |
| 98 | case EDF_NEGATIVE_LIGHT_PROBE: { |
| 99 | int negative_int; |
| 100 | field.ReadInt(&negative_int); |
| 101 | sp.ASAddIntCheckbox("Negative", false); |
| 102 | sp.ASSetInt("Negative", negative_int); |
| 103 | break; |
| 104 | } |
| 105 | |
| 106 | case EDF_GI_COEFFICIENTS: { |
| 107 | LOG_ASSERT(!stored_coefficients); |
| 108 | stored_coefficients = new float[kLightProbeNumCoeffs]; |
| 109 | memcpy(stored_coefficients, &field.data[0], kLightProbeNumCoeffs * sizeof(float)); |
| 110 | break; |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | return ret; |
| 117 | } |
nothing calls this directly
no test coverage detected