-
Notifications
You must be signed in to change notification settings - Fork 5
/
TweenPool.cpp
39 lines (30 loc) · 884 Bytes
/
TweenPool.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// TweenPool.cpp
//
// This code is derived from Universal Tween Engine
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
//
#include "TweenPool.h"
#include "Tween.h"
namespace TweenEngine
{
void TweenPoolCallback::onPool(Tween *obj)
{
obj->reset();
}
void TweenPoolCallback::onUnPool(Tween *obj)
{
obj->reset();
}
TweenPool::TweenPool() : Pool<TweenEngine::Tween>(20, new TweenPoolCallback())
{
}
Tween *TweenPool::create() { return new Tween(); }
//TweenPoolCallback *Tween::poolCallback = new TweenPoolCallback();
//TweenPool *Tween::pool = new TweenPool(20, Tween::poolCallback);
/*
private static final Pool<Tween> pool = new Pool<Tween>(20, poolCallback) {
@Override protected Tween create() {return new Tween();}
};
*/
}