- Katılım
- 21 Haz 2013
- Konular
- 198
- Mesajlar
- 1,742
- Çözüm
- 8
- Online süresi
- 17d 3h
- Reaksiyon Skoru
- 2,660
- Altın Konu
- 3
- Başarım Puanı
- 278
- MmoLira
- 714
- DevLira
- 103
ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ 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
- Katılım
- 15 May 2018
- Konular
- 96
- Mesajlar
- 948
- Çözüm
- 18
- Online süresi
- 3mo 25d
- Reaksiyon Skoru
- 284
- Altın Konu
- 0
- TM Yaşı
- 8 Yıl 22 Gün
- Başarım Puanı
- 166
- Yaş
- 28
- MmoLira
- 11,580
- DevLira
- 30
Paylaşımınız İçin Teşekkürler.
- Katılım
- 2 Şub 2015
- Konular
- 230
- Mesajlar
- 2,001
- Çözüm
- 2
- Online süresi
- 3mo 24d
- Reaksiyon Skoru
- 1,027
- Altın Konu
- 0
- Başarım Puanı
- 276
- MmoLira
- 5,706
- DevLira
- 31
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:
- Katılım
- 19 Şub 2019
- Konular
- 173
- Mesajlar
- 2,134
- Çözüm
- 26
- Online süresi
- 10mo 21d
- Reaksiyon Skoru
- 1,932
- Altın Konu
- 4
- Başarım Puanı
- 273
- MmoLira
- 4,234
- DevLira
- 97
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
- 10
- Görüntüleme
- 2K
- Cevaplar
- 28
- Görüntüleme
- 6K
- Cevaplar
- 69
- Görüntüleme
- 3K
- Cevaplar
- 34
- Görüntüleme
- 4K