assimp: Drop support for older versions of Assimp

We now require at least Assimp 4, I believe.
This commit is contained in:
rdb 2022-11-03 10:13:55 +01:00
parent dba65d8bd4
commit 2a9a32fea9

View File

@ -1151,7 +1151,7 @@ load_node(const aiNode &node, PandaNode *parent, bool under_joint) {
//case AI_BOOL: //case AI_BOOL:
// value = (*static_cast<bool *>(entry.mData)) ? "1" : ""; // value = (*static_cast<bool *>(entry.mData)) ? "1" : "";
// break; // break;
case (aiMetadataType)1: // AI_INT32 case AI_INT32:
value = format_string(*static_cast<int32_t *>(entry.mData)); value = format_string(*static_cast<int32_t *>(entry.mData));
break; break;
case AI_UINT64: case AI_UINT64:
@ -1160,6 +1160,9 @@ load_node(const aiNode &node, PandaNode *parent, bool under_joint) {
case AI_FLOAT: case AI_FLOAT:
value = format_string(*static_cast<float *>(entry.mData)); value = format_string(*static_cast<float *>(entry.mData));
break; break;
case AI_DOUBLE:
value = format_string(*static_cast<double *>(entry.mData));
break;
case AI_AISTRING: case AI_AISTRING:
{ {
const aiString *str = static_cast<const aiString *>(entry.mData); const aiString *str = static_cast<const aiString *>(entry.mData);
@ -1167,13 +1170,6 @@ load_node(const aiNode &node, PandaNode *parent, bool under_joint) {
} }
break; break;
default: default:
// Special case because AI_DOUBLE was added in Assimp 4.0 with the same
// value as AI_AISTRING. Defined as if so that we don't get a duplicate
// case error with moder ncompilers.
if (entry.mType == (aiMetadataType)4) {
value = format_string(*static_cast<double *>(entry.mData));
break;
}
continue; continue;
} }
const aiString &key = node.mMetaData->mKeys[i]; const aiString &key = node.mMetaData->mKeys[i];
@ -1284,9 +1280,7 @@ load_light(const aiLight &light) {
plight->set_transform(TransformState::make_pos_quat(pos, quat)); plight->set_transform(TransformState::make_pos_quat(pos, quat));
break; } break; }
// This is a somewhat recent addition to Assimp, so let's be kind to those case aiLightSource_AMBIENT:
// that don't have an up-to-date version of Assimp.
case 0x4: //aiLightSource_AMBIENT:
// This is handled below. // This is handled below.
break; break;