mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Use IntsToStr function from gamecore.h
This commit is contained in:
parent
090b0942fb
commit
cce91746da
|
@ -7,6 +7,7 @@
|
||||||
#include <engine/shared/datafile.h>
|
#include <engine/shared/datafile.h>
|
||||||
#include <engine/storage.h>
|
#include <engine/storage.h>
|
||||||
#include <game/mapitems.h>
|
#include <game/mapitems.h>
|
||||||
|
#include <game/gamecore.h>
|
||||||
|
|
||||||
#include <pnglite.h>
|
#include <pnglite.h>
|
||||||
/*
|
/*
|
||||||
|
@ -64,23 +65,6 @@ int LoadPNG(CImageInfo *pImg, const char *pFilename)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void IntsToStr(const int *pInts, int Num, char *pStr)
|
|
||||||
{
|
|
||||||
while(Num)
|
|
||||||
{
|
|
||||||
pStr[0] = (((*pInts) >> 24) & 0xff) - 128;
|
|
||||||
pStr[1] = (((*pInts) >> 16) & 0xff) - 128;
|
|
||||||
pStr[2] = (((*pInts) >> 8) & 0xff) - 128;
|
|
||||||
pStr[3] = ((*pInts) & 0xff) - 128;
|
|
||||||
pStr += 4;
|
|
||||||
pInts++;
|
|
||||||
Num--;
|
|
||||||
}
|
|
||||||
|
|
||||||
// null terminate
|
|
||||||
pStr[-1] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CheckImageDimensions(void *pItem, int Type, const char *pFilename)
|
bool CheckImageDimensions(void *pItem, int Type, const char *pFilename)
|
||||||
{
|
{
|
||||||
if(Type != MAPITEMTYPE_LAYER)
|
if(Type != MAPITEMTYPE_LAYER)
|
||||||
|
|
Loading…
Reference in a new issue