Skip to content

Commit

Permalink
Added Linux Makefile for AnimView tool (from / fixes issue CorsixTH#8).
Browse files Browse the repository at this point in the history
Fixed usage of MSVC-specific integer types in AnimView's th.h
  • Loading branch information
Peter Cawley committed Sep 12, 2009
1 parent af1412e commit 398431c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 9 deletions.
38 changes: 38 additions & 0 deletions AnimView/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Makefile for building AnimViewer
# This is quite a simple makefile and could probably do with some love from
# someone who understands the *nix buildchain better than I do.

CC= gcc
CPP= g++
RM= rm -f
CFLAGS= `wx-config --cflags`
LIBS= `wx-config --libs`

ALL_T= AnimViewer
ALL_O= app.o frmMain.o frmSprites.o rnc.o th.o

default: all

all: $(ALL_T)

clean:
$(RM) $(ALL_O) $(ALL_T)

AnimViewer: $(ALL_O)
$(CPP) -o $@ $(ALL_O) $(LIBS)

app.o:
$(CPP) -c app.cpp $(CFLAGS)

frmMain.o:
$(CPP) -c frmMain.cpp $(CFLAGS)

frmSprites.o:
$(CPP) -c frmSprites.cpp $(CFLAGS)

rnc.o:
$(CPP) -c rnc.cpp $(CFLAGS)

th.o:
$(CPP) -c th.cpp $(CFLAGS)

6 changes: 3 additions & 3 deletions AnimView/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ IMPLEMENT_APP(ThemeHospitalAnimViewApp)
bool ThemeHospitalAnimViewApp::OnInit()
{
wxTopLevelWindow *pForm;
//if(::wxMessageBox(L"Launch animation viewer? (No -> sprite viewer)", L"AnimView", wxYES_NO) == wxYES)
if(::wxMessageBox(L"Launch animation viewer? (No -> sprite viewer)", L"AnimView", wxYES_NO) == wxYES)
pForm = new frmMain;
//else
//pForm = new frmSprites;
else
pForm = new frmSprites;

pForm->Show(true);
SetTopWindow(pForm);
Expand Down
12 changes: 6 additions & 6 deletions AnimView/th.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class THLayerMask
}

protected:
unsigned __int32 m_iMask[13];
uint32_t m_iMask[13];
};

class Bitmap
Expand All @@ -130,10 +130,10 @@ class Bitmap
~Bitmap();

void create(int iWidth, int iHeight);
void create(int iWidth, int iHeight, const unsigned __int8* pData);
void create(int iWidth, int iHeight, const uint8_t* pData);

inline unsigned __int8 pixel(int iX, int iY) const {return m_pData[iY * m_iWidth + iX];}
inline unsigned __int8& pixel(int iX, int iY) {return m_pData[iY * m_iWidth + iX];}
inline uint8_t pixel(int iX, int iY) const {return m_pData[iY * m_iWidth + iX];}
inline uint8_t& pixel(int iX, int iY) {return m_pData[iY * m_iWidth + iX];}

int getWidth() const {return m_iWidth;}
int getHeight() const {return m_iHeight;}
Expand All @@ -146,7 +146,7 @@ class Bitmap
protected:
int m_iWidth;
int m_iHeight;
unsigned __int8* m_pData;
uint8_t* m_pData;
};

class THAnimations
Expand Down Expand Up @@ -209,7 +209,7 @@ class THAnimations
iCount = iLen / sizeof(T);
return true;
}
th_element_t* _getElement(unsigned __int32 iListIndex);
th_element_t* _getElement(uint32_t iListIndex);

th_anim_t* m_pAnims;
th_frame_t* m_pFrames;
Expand Down

0 comments on commit 398431c

Please sign in to comment.