mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-23 02:49:46 +00:00
fix MSVC build
This commit is contained in:
parent
05f9782786
commit
bab63edcb2
1 changed files with 5 additions and 4 deletions
|
|
@ -218,6 +218,8 @@ namespace {
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<NativeTrack> native_tracks;
|
std::vector<NativeTrack> native_tracks;
|
||||||
|
|
||||||
|
constexpr int MAX_TRACK_VALUES = 256;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read_indices(lua::State* L, int idx, const char* field, int* dst) {
|
static void read_indices(lua::State* L, int idx, const char* field, int* dst) {
|
||||||
|
|
@ -311,16 +313,15 @@ static int l_apply_track(lua::State* L) {
|
||||||
track.indices.push_back(found ? static_cast<int>(found->getIndex()) : -1);
|
track.indices.push_back(found ? static_cast<int>(found->getIndex()) : -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
constexpr int MAX_VALUES = 256;
|
float values[MAX_TRACK_VALUES + 1] {};
|
||||||
float values[MAX_VALUES + 1] {};
|
|
||||||
int top = lua_gettop(L);
|
int top = lua_gettop(L);
|
||||||
int count = std::min({track.valuesCount, top - 2, MAX_VALUES});
|
int count = std::min({track.valuesCount, top - 2, MAX_TRACK_VALUES});
|
||||||
for (int i = 1; i <= count; i++) {
|
for (int i = 1; i <= count; i++) {
|
||||||
values[i] = static_cast<float>(lua_tonumber(L, i + 2));
|
values[i] = static_cast<float>(lua_tonumber(L, i + 2));
|
||||||
}
|
}
|
||||||
static const glm::vec3 AXES[] {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
|
static const glm::vec3 AXES[] {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
|
||||||
auto value = [&values](int index, float fallback) {
|
auto value = [&values](int index, float fallback) {
|
||||||
return index > 0 && index <= MAX_VALUES ? values[index] : fallback;
|
return index > 0 && index <= MAX_TRACK_VALUES ? values[index] : fallback;
|
||||||
};
|
};
|
||||||
auto& matrices = skeleton->pose.matrices;
|
auto& matrices = skeleton->pose.matrices;
|
||||||
for (size_t i = 0; i < track.bones.size(); i++) {
|
for (size_t i = 0; i < track.bones.size(); i++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue