Fixing image::locator not building on MSVC6

This commit is contained in:
Philippe Plantier 2004-08-03 20:36:20 +00:00
parent 9705576d5d
commit 03a15a1ae7
2 changed files with 54 additions and 1 deletions

View file

@ -239,6 +239,7 @@ surface locator::load_from_disk() const
assert(false);
}
#if 0
template<typename T>
bool locator::in_cache(const std::vector<cache_item<T> >& cache) const
{
@ -265,6 +266,50 @@ void locator::add_to_cache(std::vector<cache_item<T> >& cache, const T& item) co
cache[index_] = cache_item<T>(item);
}
#endif
bool locator::in_cache(const std::vector<cache_item<surface> >& cache) const
{
if(index_ == -1)
return false;
return cache[index_].loaded;
}
surface locator::locate_in_cache(const std::vector<cache_item<surface> >& cache) const
{
if(index_ == -1)
return surface();
return cache[index_].item;
}
void locator::add_to_cache(std::vector<cache_item<surface> >& cache, const surface& item) const
{
if(index_ == -1)
return;
cache[index_] = cache_item<surface>(item);
}
bool locator::in_cache(const std::vector<cache_item<locator> >& cache) const
{
if(index_ == -1)
return false;
return cache[index_].loaded;
}
locator locator::locate_in_cache(const std::vector<cache_item<locator> >& cache) const
{
if(index_ == -1)
return locator();
return cache[index_].item;
}
void locator::add_to_cache(std::vector<cache_item<locator> >& cache, const locator& item) const
{
if(index_ == -1)
return;
cache[index_] = cache_item<locator>(item);
}
manager::manager() {}

View file

@ -79,10 +79,11 @@ namespace image {
// loads the image it is pointing to from the disk
surface load_from_disk() const;
#if 0
// returns true if the locator already was stored in the given
// cache
template<typename T>
bool locator::in_cache(const std::vector<cache_item<T> >& cache) const;
bool in_cache(const std::vector<cache_item<T> >& cache) const;
// returns the image it is corresponding to in the given cache
template<typename T>
T locate_in_cache(const std::vector<cache_item<T> >& cache) const;
@ -90,6 +91,13 @@ namespace image {
// current locator
template<typename T>
void add_to_cache(std::vector<cache_item<T> >& cache, const T &image) const;
#endif
bool in_cache(const std::vector<cache_item<surface> >& cache) const;
surface locate_in_cache(const std::vector<cache_item<surface> >& cache) const;
void add_to_cache(std::vector<cache_item<surface> >& cache, const surface &image) const;
bool in_cache(const std::vector<cache_item<locator> >& cache) const;
locator locate_in_cache(const std::vector<cache_item<locator> >& cache) const;
void add_to_cache(std::vector<cache_item<locator> >& cache, const locator &image) const;
protected:
static int last_index_;
private: