mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
texture animation
This commit is contained in:
+8
-12
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user