| 50 | } |
| 51 | |
| 52 | Result SetConstantValues(HConstant constant, dmVMath::Vector4* values, uint32_t num_values) |
| 53 | { |
| 54 | if (num_values > constant->m_NumValues) |
| 55 | { |
| 56 | dmVMath::Vector4* newmem = 0; |
| 57 | if (dmMemory::RESULT_OK != dmMemory::AlignedMalloc((void**)&newmem, 16, num_values * sizeof(dmVMath::Vector4))) |
| 58 | { |
| 59 | return RESULT_OUT_OF_RESOURCES; |
| 60 | } |
| 61 | if (constant->m_AllocatedValues) |
| 62 | dmMemory::AlignedFree(constant->m_Values); |
| 63 | constant->m_Values = newmem; |
| 64 | } |
| 65 | |
| 66 | memcpy(constant->m_Values, values, num_values * sizeof(dmVMath::Vector4)); |
| 67 | constant->m_NumValues = num_values; |
| 68 | constant->m_AllocatedValues = 1; |
| 69 | |
| 70 | return dmRender::RESULT_OK; |
| 71 | } |
| 72 | |
| 73 | Result SetConstantValuesRef(HConstant constant, dmVMath::Vector4* values, uint32_t num_values) |
| 74 | { |