mirror of
https://github.com/zeldaret/tp
synced 2026-07-10 23:22:01 -04:00
Some Z2WolfHowlMgr progress
This commit is contained in:
@@ -10,7 +10,7 @@ class JAISoundID;
|
||||
|
||||
class JAISoundHandle {
|
||||
public:
|
||||
JAISoundHandle();
|
||||
JAISoundHandle() {sound_ = NULL;};
|
||||
~JAISoundHandle() {}
|
||||
|
||||
bool isSoundAttached() const { return sound_ != NULL; }
|
||||
|
||||
@@ -6,18 +6,35 @@
|
||||
template <class T>
|
||||
class JASGlobalInstance {
|
||||
public:
|
||||
T* getInstance() { return sInstance; }
|
||||
inline T* getInstance() { return sInstance; }
|
||||
|
||||
JASGlobalInstance(bool param) {
|
||||
inline JASGlobalInstance(bool param) {
|
||||
if (param) {
|
||||
ASSERT(sInstance == 0);
|
||||
if (this!=NULL) {
|
||||
sInstance = this - sizeof(T);
|
||||
}
|
||||
//if (this!=NULL) {
|
||||
sInstance = (T*)this;
|
||||
//We need a better way to compute the location of sInstance
|
||||
//sInstance = (T*)((char*)this-(char*)&(((T*)NULL)->JASGlobalInstance<T>));
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
static T* sInstance;
|
||||
};
|
||||
|
||||
class Parent {
|
||||
public:
|
||||
int x;
|
||||
};
|
||||
|
||||
class Parent2 {
|
||||
public:
|
||||
int y;
|
||||
};
|
||||
|
||||
class Child : public Parent, public Parent2 {
|
||||
public:
|
||||
void func() {
|
||||
Parent2::y = 5; // Access the member x of the Parent class
|
||||
}
|
||||
};
|
||||
#endif /* JASGADGET_H */
|
||||
|
||||
Reference in New Issue
Block a user