Build tools/arttool: long --> int

git-svn-id: https://svn.eduke32.com/eduke32@5415 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-11-01 19:56:27 +00:00
parent 13c7b771a3
commit b98953cc7c

View file

@ -161,11 +161,11 @@ void usage()
class ARTFile { class ARTFile {
private: private:
Bstring filename_; Bstring filename_;
long localtilestart_; int localtilestart_;
long localtileend_; int localtileend_;
short * tilesizx_; short * tilesizx_;
short * tilesizy_; short * tilesizy_;
long * picanm_; int * picanm_;
// for removing or replacing tile data // for removing or replacing tile data
int markprelength_, markskiplength_, markpostlength_; int markprelength_, markskiplength_, markpostlength_;
@ -179,7 +179,7 @@ private:
Bfwrite(d,1,2,ofs); // 2 == sizeof(d) Bfwrite(d,1,2,ofs); // 2 == sizeof(d)
} }
void writeLong(BFILE *ofs, long l) void writeLong(BFILE *ofs, int l)
{ {
Bassert(ofs); Bassert(ofs);
char d[4] = { static_cast<char>(l&255), static_cast<char>((l>>8)&255), static_cast<char>((l>>16)&255), static_cast<char>((l>>24)&255) }; char d[4] = { static_cast<char>(l&255), static_cast<char>((l>>8)&255), static_cast<char>((l>>16)&255), static_cast<char>((l>>24)&255) };
@ -197,17 +197,17 @@ private:
return (short)s; return (short)s;
} }
long readLong(BFILE *ifs) int readLong(BFILE *ifs)
{ {
Bassert(ifs); Bassert(ifs);
unsigned char d[4]; unsigned char d[4];
unsigned long l; unsigned int l;
Bfread(d,1,4,ifs); // 4 == sizeof(d) Bfread(d,1,4,ifs); // 4 == sizeof(d)
l = (unsigned long)d[0]; l = (unsigned int)d[0];
l |= (unsigned long)d[1] << 8; l |= (unsigned int)d[1] << 8;
l |= (unsigned long)d[2] << 16; l |= (unsigned int)d[2] << 16;
l |= (unsigned long)d[3] << 24; l |= (unsigned int)d[3] << 24;
return (long)l; return (int)l;
} }
void dispose() void dispose()
@ -237,7 +237,7 @@ private:
tilesizx_ = new short[ntiles]; tilesizx_ = new short[ntiles];
tilesizy_ = new short[ntiles]; tilesizy_ = new short[ntiles];
picanm_ = new long[ntiles]; picanm_ = new int[ntiles];
for (i = 0; i < ntiles; ++i) { for (i = 0; i < ntiles; ++i) {
tilesizx_[i] = readShort(infile); tilesizx_[i] = readShort(infile);
@ -279,11 +279,11 @@ public:
localtileend_ = start + ntiles - 1; localtileend_ = start + ntiles - 1;
tilesizx_ = new short[ntiles]; tilesizx_ = new short[ntiles];
tilesizy_ = new short[ntiles]; tilesizy_ = new short[ntiles];
picanm_ = new long[ntiles]; picanm_ = new int[ntiles];
memset(tilesizx_, 0, sizeof(short)*ntiles); memset(tilesizx_, 0, sizeof(short)*ntiles);
memset(tilesizy_, 0, sizeof(short)*ntiles); memset(tilesizy_, 0, sizeof(short)*ntiles);
memset(picanm_, 0, sizeof(long)*ntiles); memset(picanm_, 0, sizeof(int)*ntiles);
markprelength_ = 0; markprelength_ = 0;
markskiplength_ = 0; markskiplength_ = 0;
@ -366,7 +366,7 @@ public:
tile -= localtilestart_; tile -= localtilestart_;
picanm_[tile] &= ~(255<<8); picanm_[tile] &= ~(255<<8);
picanm_[tile] |= ((long)((unsigned char)x) << 8); picanm_[tile] |= ((int)((unsigned char)x) << 8);
} }
void setYOfs(int tile, int y) void setYOfs(int tile, int y)
@ -377,7 +377,7 @@ public:
tile -= localtilestart_; tile -= localtilestart_;
picanm_[tile] &= ~(255<<16); picanm_[tile] &= ~(255<<16);
picanm_[tile] |= ((long)((unsigned char)y) << 16); picanm_[tile] |= ((int)((unsigned char)y) << 16);
} }
void setAnimType(int tile, int type) void setAnimType(int tile, int type)
@ -388,7 +388,7 @@ public:
tile -= localtilestart_; tile -= localtilestart_;
picanm_[tile] &= ~(3<<6); picanm_[tile] &= ~(3<<6);
picanm_[tile] |= ((long)(type&3) << 6); picanm_[tile] |= ((int)(type&3) << 6);
} }
void setAnimFrames(int tile, int frames) void setAnimFrames(int tile, int frames)
@ -399,7 +399,7 @@ public:
tile -= localtilestart_; tile -= localtilestart_;
picanm_[tile] &= ~(63); picanm_[tile] &= ~(63);
picanm_[tile] |= ((long)(frames&63)); picanm_[tile] |= ((int)(frames&63));
} }
void setAnimSpeed(int tile, int speed) void setAnimSpeed(int tile, int speed)
@ -410,7 +410,7 @@ public:
tile -= localtilestart_; tile -= localtilestart_;
picanm_[tile] &= ~(15<<24); picanm_[tile] &= ~(15<<24);
picanm_[tile] |= ((long)(speed&15) << 24); picanm_[tile] |= ((int)(speed&15) << 24);
} }
int write() int write()