TODO: it would probably cleaner to have a struct per data type, so you could lookup byte sizes, conversion functions, etc.
| 111 | // TODO: it would probably cleaner to have a struct per data type, so |
| 112 | // you could lookup byte sizes, conversion functions, etc. |
| 113 | static int getByteSize |
| 114 | ( |
| 115 | PHY_ScalarType type |
| 116 | ) |
| 117 | { |
| 118 | int size = 0; |
| 119 | |
| 120 | switch (type) { |
| 121 | case PHY_FLOAT: |
| 122 | size = sizeof(btScalar); |
| 123 | break; |
| 124 | |
| 125 | case PHY_UCHAR: |
| 126 | size = sizeof(unsigned char); |
| 127 | break; |
| 128 | |
| 129 | case PHY_SHORT: |
| 130 | size = sizeof(short); |
| 131 | break; |
| 132 | |
| 133 | default: |
| 134 | btAssert(!"Bad heightfield data type"); |
| 135 | } |
| 136 | |
| 137 | return size; |
| 138 | } |
| 139 | |
| 140 | |
| 141 |
no outgoing calls
no test coverage detected