MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / ResAnimation

Method ResAnimation

LuaSTGPlus/ResourceMgr.cpp:34–57  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// ResAnimation ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

32/// ResAnimation
33////////////////////////////////////////////////////////////////////////////////
34ResAnimation::ResAnimation(const char* name, fcyRefPointer<ResTexture> tex, float x, float y, float w, float h,
35 int n, int m, int intv, double a, double b, bool rect)
36 : Resource(ResourceType::Animation, name), m_Interval(intv), m_HalfSizeX(a), m_HalfSizeY(b), m_bRectangle(rect)
37{
38 LASSERT(LAPP.GetRenderer());
39
40 // �ָ�����
41 for (int j = 0; j < m; ++j) // ��
42 {
43 for (int i = 0; i < n; ++i) // ��
44 {
45 fcyRefPointer<f2dSprite> t;
46 if (FCYFAILED(LAPP.GetRenderer()->CreateSprite2D(tex->GetTexture(), fcyRect(
47 x + w * i, y + h * j, x + w * (i + 1), y + h * (j + 1)
48 ), &t)))
49 {
50 throw fcyException("ResAnimation::ResAnimation", "CreateSprite2D failed.");
51 }
52 t->SetZ(0.5f);
53 t->SetColor(0xFFFFFFFF);
54 m_ImageSequences.push_back(t);
55 }
56 }
57}
58
59////////////////////////////////////////////////////////////////////////////////
60/// ResParticle

Callers

nothing calls this directly

Calls 2

GetRendererMethod · 0.80
GetTextureMethod · 0.45

Tested by

no test coverage detected