Browse Source
Untangles dependencies by splitting up `engine.{h,cpp}` into 3 files:
1. `primitive_render`
2. `ticks` -- only contains `GetAnimationFrame` for now.
3. `GetWidth2` renamed to `CalculateSpriteTileCenterX` and moved to `levels/dun_tile.hpp`.
pull/7628/head
71 changed files with 172 additions and 179 deletions
@ -0,0 +1,14 @@
|
||||
#include "engine/ticks.hpp" |
||||
|
||||
#include <cstdint> |
||||
|
||||
#include <SDL.h> |
||||
|
||||
namespace devilution { |
||||
|
||||
uint32_t GetAnimationFrame(uint32_t frames, uint32_t fps) |
||||
{ |
||||
return (SDL_GetTicks() / fps) % frames; |
||||
} |
||||
|
||||
} // namespace devilution
|
||||
@ -0,0 +1,9 @@
|
||||
#pragma once |
||||
|
||||
#include <cstdint> |
||||
|
||||
namespace devilution { |
||||
|
||||
uint32_t GetAnimationFrame(uint32_t frames, uint32_t fps = 60); |
||||
|
||||
} // namespace devilution
|
||||
Loading…
Reference in new issue