diff options
author | cflip <cflip@cflip.net> | 2022-03-24 09:16:57 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-03-24 09:16:57 -0600 |
commit | 09cc67351ec68ed37b2e664c9654f9aabd8fa33b (patch) | |
tree | b55de41df42050729e6c5d0db93a29c1b31933ce /src/train.cpp | |
parent | 0d99c20d0fafcf2b86d9d33430659de76b030395 (diff) |
Don't create a copy of the train graphics per vehicle
Diffstat (limited to 'src/train.cpp')
-rw-r--r-- | src/train.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/train.cpp b/src/train.cpp index d3ea7fb..cfbae97 100644 --- a/src/train.cpp +++ b/src/train.cpp @@ -3,6 +3,8 @@ #include "bitmap.h" #include "level.h" +static const Bitmap SPRITES("res/car.png"); + void Train::update() { if (m_next) { @@ -42,7 +44,7 @@ void Train::draw(Bitmap& bitmap, int xo, int yo) int tx = 0; if (m_dir == East || m_dir == West) tx = 24; - bitmap.blit(m_sprite, xx, yy, tx, 0, TileSize, TileSize); + bitmap.blit(SPRITES, xx, yy, tx, 0, TileSize, TileSize); } void Train::setPosition(int tx, int ty) |