zturtleman / mm3d

Maverick Model 3D is a 3D model editor and animator for games.
https://clover.moe/mm3d
GNU General Public License v2.0
116 stars 24 forks source link

md3filter.cc code broken, weirdly #74

Closed m-7761 closed 5 years ago

m-7761 commented 5 years ago

https://github.com/zturtleman/mm3d/blob/1282798bbef7a72896cf0d1beff82c8f0b7eff8f/src/libmm3d/md3filter.cc#L1023

Any idea what's up here? meshTriangleCount is not a compile-time constant value.

zturtleman commented 5 years ago

It's a variable-length array. It can be changed to a std::vector or whatever. Looks like it's not part of the C++ standard.

m-7761 commented 5 years ago

Thanks, never seen this before. I guess it's new to C99. I think there are parts of C99 that aren't parts of C++.

https://stackoverflow.com/questions/1887097/why-arent-variable-length-arrays-part-of-the-c-standard

zturtleman commented 5 years ago

Fixed in 167792432eca5bcc52987f08132e88a0d1ef11d7.

m-7761 commented 5 years ago

Off-topic: I didn't realize C++11 enables a vector of C-array type. It seems like it can't do a lot... not even resize. Always cool to learn something new that isn't an outlandish feature.