- tutorial2.zip
- bin
- DevIL.dll
- GrassIso.bmp
- KnightPause.bmp
- KnightWalk.bmp
- Trees.bmp
- dependencies
- DevIL
- include
- IL
- lib
- DevIL.dll
- DevIL.exp
- DevIL.lib
- ILU.dll
- ILU.exp
- ILU.lib
- ILUT.dll
- ILUT.exp
- ILUT.lib
- src
- Tutorial2.sln
- Tutorial2.vcproj
|
#include "AnimFileLoader.h"
#include <string>
using namespace std;
CAnimFileLoader::CAnimFileLoader(const string& strFile,
unsigned imgsPerRow,
unsigned imgWidth,
unsigned imgHeight)
: m_strFileName(strFile), m_uImgsPerRow(imgsPerRow),
m_uImgWidth(imgWidth), m_uImgHeight(imgHeight)
{
}
CAnimFileLoader::~CAnimFileLoader()
{
}
CImageList CAnimFileLoader::GetAnimation(unsigned startIndex,
unsigned stopIndex)
{
CImageList newImgList;
for (unsigned i=startIndex; i<=stopIndex; i++)
{
unsigned row = i/m_uImgsPerRow;
unsigned col = i%m_uImgsPerRow;
TRectanglei imgRect(row*m_uImgHeight,(row+1)*m_uImgHeight,
col*m_uImgWidth, (col+1)*m_uImgWidth);
newImgList.AppendImage(
CImage::CreateImage(m_strFileName,imgRect));
}
return newImgList;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am a 29 years old guy and I live with my girlfriend in Hoegaarden, little city from Belgium well known for its white beer
.
I studied as an industrial engineer in electronics but I oriented myself more towards software development when I started to work.
Currently I am working in a research centre in mechatronica. I mainly develop in C++ but I also do a bit of Java.
When I have so spare time, I like to read (mainly fantasy) and play electric guitar.