client/anim/Animation.cpp
// unique frame animation
// used for characters
unique frame animation
used for characters
unique frame animation used for characters
std::tuple<float, float, int16_t> Animation::renderOne(Camera &camera,
                                                       float posX,
                                                       float posY,
                                                       int16_t angle) {
    float newPosX = posX;
    float newPosY = posY;
    int16_t newAngle = angle;
    auto frame = frames.at(currentFrame);
    if (!modifiedState.empty()) {
        auto state = modifiedState.front();
        newPosX += std::get<0>(state);
        newPosY += std::get<1>(state);
        newAngle += std::get<2>(state);
        if (newAngle >= 360) {
            newAngle -= 360;
        }
        modifiedState.pop();
    }
    Area src(frame.x, frame.y, frame.w, frame.h);
    camera.renderInSight(texture, src, newPosX, newPosY, newAngle);
    return std::make_tuple(newPosX - posX, newPosY - posY, newAngle - angle);
}
std :: tuple < float , float , int16_t > Animation :: renderOne ( Camera & camera , float posX , float posY , int16_t angle ) { float newPosX = posX ; float newPosY = posY ; int16_t newAngle = angle ; auto frame = frames . at ( currentFrame ) ; if ( ! modifiedState . empty ( ) ) { auto state = modifiedState . front ( ) ; newPosX += std :: get < 0 > ( state ) ; newPosY += std :: get < 1 > ( state ) ; newAngle += std :: get < 2 > ( state ) ; if ( newAngle >= 360 ) { newAngle -= 360 ; } modifiedState . pop ( ) ; } Area src ( frame . x , frame . y , frame . w , frame . h ) ; camera . renderInSight ( texture , src , newPosX , newPosY , newAngle ) ; return std :: make_tuple ( newPosX - posX , newPosY - posY , newAngle - angle ) ; }
unique frame animation
used for characters
unique frame animation used for characters