comparison engine/core/gui/base/gui_image.cpp @ 146:54b3984e1afc

The getIndex function was a hack that shadowed another bug that caused the pools to misbehave. AddResourceFromFile works now exactly as getIndex, it's just faster. Fixed GUIImage to not hold a reference, it uses the index directly anyway. Plus heaps of minor adjustments for more informative debug output and statistics.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 09 Oct 2008 12:36:21 +0000
parents 90005975cdbb
children fee958103d58
comparison
equal deleted inserted replaced
145:e7a431577c95 146:54b3984e1afc
37 37
38 GuiImage::GuiImage(): gcn::Image(), m_poolid(Pool::INVALID_ID), m_pool(NULL) { 38 GuiImage::GuiImage(): gcn::Image(), m_poolid(Pool::INVALID_ID), m_pool(NULL) {
39 } 39 }
40 40
41 GuiImage::GuiImage(int id, ImagePool& pool): gcn::Image(), m_poolid(id), m_pool(&pool) { 41 GuiImage::GuiImage(int id, ImagePool& pool): gcn::Image(), m_poolid(id), m_pool(&pool) {
42 m_pool->getImage(m_poolid).addRef(); 42 m_pool->getImage(m_poolid);
43 } 43 }
44 44
45 GuiImage::~GuiImage() { 45 GuiImage::~GuiImage() {
46 m_pool->getImage(m_poolid).decRef(); 46 // m_pool->release(m_poolid,true);
47 } 47 }
48 48
49 void GuiImage::free() { 49 void GuiImage::free() {
50 // the imagepool should do this; should we tell it? 50 // the imagepool should do this; should we tell it?
51 } 51 }