texture animation

This commit is contained in:
devZoGok
2021-10-19 19:06:41 +03:00
parent e64eb4c58a
commit 5b67ea1f64
3 changed files with 11 additions and 17 deletions
+8 -12
View File
@@ -153,23 +153,19 @@ namespace vb01{
case KeyframeChannel::TEXTURE_MIX_RATIO:
mixRatio = value;
break;
case KeyframeChannel::TEXTURE_FRAME_A:
frameA = (int)value;
break;
case KeyframeChannel::TEXTURE_FRAME_B:
frameB = (int)value;
break;
}
}
void Texture::update(int id){
//updateFrame();
select(id);
select(id, frameA);
if(numFrames > 0)
select(id + 1, 1);
}
void Texture::updateFrame(){
if(numFrames > 0){
if(getTime() - lastUpdateTime > updateRate){
frame = getNextFrame(frame);
lastUpdateTime = getTime();
}
}
select(id + 1, frameB);
}
void Texture::select(int id, int fr){