Enable some hacky non-portable text drawing until I get my LAF font code working. X11-only at the moment (although a Windows equiv should be easy). Note that this breaks Copal's computer again, for some LUA'ish reason involving the parameter table sent to ChangeTextObject. Cleaned up a bit of code and renamed ColorMap class to CMap to prevent conflict against X headers.

This commit is contained in:
James Brown 2003-10-05 17:45:46 +00:00
parent 5a2430fd04
commit be37f31100
16 changed files with 132 additions and 74 deletions

View file

@ -149,18 +149,18 @@ Bitmap *ResourceLoader::loadBitmap(const char *filename) {
return result;
}
Colormap *ResourceLoader::loadColormap(const char *filename) {
CMap *ResourceLoader::loadColormap(const char *filename) {
std::string fname = filename;
makeLower(fname);
cache_type::iterator i = cache_.find(fname);
if (i != cache_.end()) {
return dynamic_cast<Colormap *>(i->second);
return dynamic_cast<CMap *>(i->second);
}
Block *b = getFileBlock(filename);
if (b == NULL)
error("Could not find colormap %s\n", filename);
Colormap *result = new Colormap(filename, b->data(), b->len());
CMap *result = new CMap(filename, b->data(), b->len());
delete b;
cache_[fname] = result;
return result;
@ -195,7 +195,7 @@ KeyframeAnim *ResourceLoader::loadKeyframe(const char *filename) {
}
Material *ResourceLoader::loadMaterial(const char *filename,
const Colormap &c) {
const CMap &c) {
std::string fname = filename;
makeLower(fname);
cache_type::iterator i = cache_.find(fname);
@ -212,7 +212,7 @@ Material *ResourceLoader::loadMaterial(const char *filename,
return result;
}
Model *ResourceLoader::loadModel(const char *filename, const Colormap &c) {
Model *ResourceLoader::loadModel(const char *filename, const CMap &c) {
std::string fname = filename;
makeLower(fname);
cache_type::iterator i = cache_.find(fname);