HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. HEMEN TIKLA!
Oyun içerisinde ImageBox kullanan UI eklentileriniz varsa oyun penceresi açık olduğu sürece(relog atmadığınız sürece vs) pencereyi kapatsanız bile içerisindeki resimler hafızadan silinmiyor ve her açılışta yeniden yükledikçe hafıza artışına sebep oluyor, bunun çözümünü paylaşıcam.
Öncesi:
Sonrası:
Öncesi:
Sonrası:
* EterPythonLib\PythonWindowManagerModule.cpp
Arat:
Altına ekle:
Arat:
Altına ekle:
---
* EterPythonLib\PythonWindow.cpp
Arat:
Altına ekle:
---
* EterPythonLib\PythonWindow.h
Arat:
Altına ekle:
---
* root/ui.py
Arat:
Bul:
Altına ekle:
---
Arat:
Altına ekle:
---
Arat:
Altına ekle:
---
Dosyada "UnloadImage" fonksiyonu yoksa;
Arat:
def SetAlpha(self, alpha):
Üstüne ekle:
Arat:
Kod:
PyObject* wndImageLoadImage(PyObject* poSelf, PyObject* poArgs)
{
...
}
Altına ekle:
Kod:
PyObject* wndImageUnloadImage(PyObject* poSelf, PyObject* poArgs)
{
UI::CWindow* pWindow;
if (!PyTuple_GetWindow(poArgs, 0, &pWindow)) {
return Py_BuildException();
}
if (!((UI::CImageBox*)pWindow)->UnloadImage()) {
return Py_BuildException("Failed to unload image");
}
return Py_BuildNone();
}
Arat:
Kod:
{ "LoadImage", wndImageLoadImage, METH_VARARGS },
Altına ekle:
Kod:
{ "UnloadImage", wndImageUnloadImage, METH_VARARGS },
---
* EterPythonLib\PythonWindow.cpp
Arat:
Kod:
BOOL CImageBox::LoadImage(const char* c_szFileName)
{
...
}
Altına ekle:
Kod:
BOOL CImageBox::UnloadImage()
{
if (!m_pImageInstance)
return FALSE;
OnDestroyInstance();
return TRUE;
}
---
* EterPythonLib\PythonWindow.h
Arat:
Kod:
BOOL LoadImage(const char* c_szFileName);
Altına ekle:
Kod:
BOOL UnloadImage();
---
* root/ui.py
Arat:
Kod:
class ImageBox(Window):
Bul:
Kod:
self.eventFunc = {}
self.eventArgs = {}
Altına ekle:
Kod:
self.imageLoaded = False
---
Arat:
Kod:
wndMgr.LoadImage(self.hWnd, imageName)
Altına ekle:
Kod:
self.imageLoaded = True
---
Arat:
Kod:
def __del__(self):
Altına ekle:
Kod:
if self.imageLoaded:
self.UnloadImage()
---
Dosyada "UnloadImage" fonksiyonu yoksa;
Arat:
def SetAlpha(self, alpha):
Üstüne ekle:
Python:def UnloadImage(self): wndMgr.UnloadImage() self.imageLoaded = False if len(self.eventDict) != 0: print "UNLOAD IMAGE", self, self.eventDict
Son düzenleme:
En Çok Reaksiyon Alan Mesajlar
wndMgr.UnloadImage(self.hWnd)Öğeyi görmek için üye olmalısınız.Python:def UnloadImage(self): wndMgr.UnloadImage() self.imageLoaded = False if len(self.eventDict) != 0: print "UNLOAD IMAGE", self, self.eventDict
Öğeyi görmek için üye olmalısınız.Python:def UnloadImage(self): wndMgr.UnloadImage(self.hWnd) self.imageLoaded = False if len(self.eventDict) != 0: print "UNLOAD IMAGE", self, self.eventDict
çok mantıklı ve yararlı bir konu teşekkür ederim
Python:
def UnloadImage(self):
wndMgr.UnloadImage(self.hWnd)
self.imageLoaded = False
if len(self.eventDict) != 0:
print "UNLOAD IMAGE", self, self.eventDict
Son düzenleme:
wndMgr.UnloadImage(self.hWnd)Ekli dosyayı görüntüle 106959Python:def UnloadImage(self): wndMgr.UnloadImage() self.imageLoaded = False if len(self.eventDict) != 0: print "UNLOAD IMAGE", self, self.eventDict
Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)
Benzer konular
- Cevaplar
- 13
- Görüntüleme
- 3K
- Cevaplar
- 28
- Görüntüleme
- 6K
- Cevaplar
- 69
- Görüntüleme
- 3K
- Cevaplar
- 34
- Görüntüleme
- 4K
