mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-09 04:16:34 +00:00
IMMORTAL: addSprite() moved out of utilities
This commit is contained in:
parent
0467dbdb78
commit
a2bd437c5e
@ -23,6 +23,14 @@
|
|||||||
|
|
||||||
namespace Immortal {
|
namespace Immortal {
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* ----- -----
|
||||||
|
* ----- General Use -----
|
||||||
|
* ----- -----
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
void Utilities::delay(int j) { // Delay is measured in jiffies, which are 56.17ms
|
void Utilities::delay(int j) { // Delay is measured in jiffies, which are 56.17ms
|
||||||
g_system->delayMillis(j * 56);
|
g_system->delayMillis(j * 56);
|
||||||
}
|
}
|
||||||
@ -98,35 +106,4 @@ bool Utilities::insideRect(uint8 rectX, uint8 rectY, uint8 w, uint8 h, uint8 poi
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Utilities::addSprite(Sprite *sprites, uint16 vpX, uint16 vpY, int *num, DataSprite *d, int img, uint16 x, uint16 y, uint16 p) {
|
|
||||||
debug("adding sprite...");
|
|
||||||
if (*num != kMaxSprites) {
|
|
||||||
if (x >= (kResH + kMaxSpriteLeft)) {
|
|
||||||
x |= kMaskHigh; // Make it negative
|
|
||||||
}
|
|
||||||
|
|
||||||
sprites[*num]._X = (x << 1) + vpX;
|
|
||||||
|
|
||||||
if (y >= (kMaxSpriteAbove + kResV)) {
|
|
||||||
y |= kMaskHigh;
|
|
||||||
}
|
|
||||||
|
|
||||||
sprites[*num]._Y = (y << 1) + vpY;
|
|
||||||
|
|
||||||
if (p >= 0x80) {
|
|
||||||
p |= kMaskHigh;
|
|
||||||
}
|
|
||||||
|
|
||||||
sprites[*num]._priority = ((p + y) ^ 0xFFFF) + 1;
|
|
||||||
|
|
||||||
sprites[*num]._image = img;
|
|
||||||
sprites[*num]._dSprite = d;
|
|
||||||
sprites[*num]._on = 1;
|
|
||||||
*num += 1;
|
|
||||||
debug("sprite added");
|
|
||||||
} else {
|
|
||||||
debug("Max sprites reached beeeeeep!!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}; // namespace Immortal
|
}; // namespace Immortal
|
@ -25,7 +25,9 @@
|
|||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
#include "common/debug-channels.h"
|
#include "common/debug-channels.h"
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
|
|
||||||
#include "immortal/sprite_list.h"
|
#include "immortal/sprite_list.h"
|
||||||
|
#include "immortal/definitions.h"
|
||||||
|
|
||||||
namespace Immortal {
|
namespace Immortal {
|
||||||
|
|
||||||
@ -75,12 +77,12 @@ enum Screen { // These are constants t
|
|||||||
|
|
||||||
namespace Utilities {
|
namespace Utilities {
|
||||||
|
|
||||||
|
// Other
|
||||||
void delay(int j); // Delay engine by j jiffies (from driver originally, but makes more sense grouped with misc)
|
void delay(int j); // Delay engine by j jiffies (from driver originally, but makes more sense grouped with misc)
|
||||||
void delay4(int j); // || /4
|
void delay4(int j); // || /4
|
||||||
void delay8(int j); // || /8
|
void delay8(int j); // || /8
|
||||||
bool inside(uint8 dist, uint8 centX, uint8 centY, uint8 pointX, uint8 pointY);
|
bool inside(uint8 dist, uint8 centX, uint8 centY, uint8 pointX, uint8 pointY);
|
||||||
bool insideRect(uint8 rectX, uint8 rectY, uint8 w, uint8 h, uint8 pointX, uint8 pointY);
|
bool insideRect(uint8 rectX, uint8 rectY, uint8 w, uint8 h, uint8 pointX, uint8 pointY);
|
||||||
void addSprite(Sprite *sprites, uint16 vpX, uint16 vpY, int *num, DataSprite *d, int img, uint16 x, uint16 y, uint16 p);
|
|
||||||
|
|
||||||
}; // namespace Util
|
}; // namespace Util
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user