-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
83 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,8 +45,10 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#include "hsResMgr.h" | ||
|
||
#include "pnKeyedObject/plUoid.h" | ||
#include "pyImage.h" | ||
#include "pyImageLibMod.h" | ||
|
||
|
||
void pyImageLibMod::setKey(pyKey& ilmKey) // only for python glue, do NOT call | ||
{ | ||
if (fModifier && fModifierKey) | ||
|
@@ -56,17 +58,34 @@ void pyImageLibMod::setKey(pyKey& ilmKey) // only for python glue, do NOT call | |
fModifierKey = ilmKey.getKey(); | ||
} | ||
|
||
plBitmap* pyImageLibMod::GetImage(const ST::string& name) const | ||
pyImage* pyImageLibMod::GetImage(const ST::string& name) const | ||
{ | ||
plBitmap* image; | ||
|
||
if (fModifier) | ||
image = fModifier->GetImage(name); | ||
else | ||
image = plImageLibMod::ConvertNoRef(fModifierKey->ObjectIsLoaded())->GetImage(name); | ||
return image; | ||
|
||
return pyImage::ConvertFrom(pyImage::New(dynamic_cast<plMipmap*>(image))); | ||
} | ||
|
||
const std::vector<pyImage*> pyImageLibMod::GetImages() const | ||
{ | ||
std::vector<pyImage*> imageList; | ||
plImageLibMod* mod; | ||
|
||
if (fModifier) | ||
mod = fModifier; | ||
else | ||
mod = plImageLibMod::ConvertNoRef(fModifierKey->ObjectIsLoaded()); | ||
|
||
for (const auto& image : mod->GetImages()) | ||
imageList.push_back(pyImage::ConvertFrom(pyImage::New(dynamic_cast<plMipmap*>(image)))); | ||
return imageList; | ||
} | ||
|
||
std::vector<ST::string> pyImageLibMod::GetImageNames() const | ||
const std::vector<ST::string> pyImageLibMod::GetImageNames() const | ||
{ | ||
std::vector<ST::string> nameList; | ||
plImageLibMod* mod; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,8 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#include "pnKeyedObject/plKey.h" | ||
#include "plModifier/plImageLibMod.h" | ||
|
||
class pyImage; | ||
|
||
class pyImageLibMod | ||
{ | ||
protected: | ||
|
@@ -114,8 +116,9 @@ class pyImageLibMod | |
plKey GetKey() const { return fModifier ? fModifier->GetKey() : fModifierKey; } | ||
|
||
// for python access | ||
plBitmap* GetImage (const ST::string& name) const; | ||
std::vector<ST::string> GetImageNames() const; | ||
pyImage* GetImage (const ST::string& name) const; | ||
const std::vector<ST::string> GetImageNames() const; | ||
const std::vector<pyImage*> GetImages() const; | ||
}; | ||
|
||
#endif // pyImageLibMod_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#include "pyKey.h" | ||
#include "pyMatrix44.h" | ||
|
||
#include "pyImageLibMod.h" | ||
#include "pySceneObject.h" | ||
|
||
#include "cyAvatar.h" | ||
|
@@ -838,7 +839,7 @@ std::vector<PyObject*> pySceneObject::GetImageLibMods() | |
{ | ||
const plImageLibMod* ilm = plImageLibMod::ConvertNoRef(obj->GetModifierByType(plImageLibMod::Index())); | ||
if (ilm) | ||
pyPL.push_back(pyKey::New(ilm->GetKey())); | ||
pyPL.push_back(pyImageLibMod::New(ilm->GetKey())); | ||
} | ||
} | ||
return pyPL; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,13 +49,6 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
#include "hsStream.h" | ||
#include "hsResMgr.h" | ||
|
||
plImageLibMod::plImageLibMod() | ||
{ | ||
} | ||
|
||
plImageLibMod::~plImageLibMod() | ||
{ | ||
} | ||
|
||
bool plImageLibMod::MsgReceive(plMessage* msg) | ||
{ | ||
|
@@ -106,6 +99,14 @@ plBitmap* plImageLibMod::GetImage(const ST::string& imageName) const | |
return nullptr; | ||
} | ||
|
||
const std::vector<plBitmap*> plImageLibMod::GetImages() const | ||
{ | ||
std::vector<plBitmap*> images; | ||
for (auto image : fImages) | ||
images.emplace_back(image); | ||
return images; | ||
} | ||
|
||
const std::vector<ST::string> plImageLibMod::GetImageNames() const | ||
{ | ||
std::vector<ST::string> names; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters