introduce model-cache-dir

This commit is contained in:
David Rose 2006-06-15 00:23:08 +00:00
parent 7719dd539e
commit 86837677b6
2 changed files with 27 additions and 2 deletions

View File

@ -27,6 +27,7 @@
#include "recorderTable.h" #include "recorderTable.h"
#include "dcast.h" #include "dcast.h"
#include "pvector.h" #include "pvector.h"
#include "bamCacheRecord.h"
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: BamInfo::Constructor // Function: BamInfo::Constructor
@ -131,6 +132,17 @@ get_info(const Filename &filename) {
Objects objects; Objects objects;
TypedWritable *object = bam_file.read_object(); TypedWritable *object = bam_file.read_object();
if (object != (TypedWritable *)NULL &&
object->is_exact_type(BamCacheRecord::get_class_type())) {
// Here's a special case: if the first object in the file is a
// BamCacheRecord, it's a cache data file; in this case, we output
// the cache record, and then pretend it doesn't exist.
DCAST(BamCacheRecord, object)->write(nout, 2);
nout << "\n";
object = bam_file.read_object();
}
while (object != (TypedWritable *)NULL || !bam_file.is_eof()) { while (object != (TypedWritable *)NULL || !bam_file.is_eof()) {
if (object != (TypedWritable *)NULL) { if (object != (TypedWritable *)NULL) {
objects.push_back(object); objects.push_back(object);

View File

@ -35,6 +35,7 @@
#include "geomVertexReader.h" #include "geomVertexReader.h"
#include "string_utils.h" #include "string_utils.h"
#include "bamFile.h" #include "bamFile.h"
#include "bamCacheRecord.h"
#include "eggGroup.h" #include "eggGroup.h"
#include "eggVertexPool.h" #include "eggVertexPool.h"
#include "eggVertex.h" #include "eggVertex.h"
@ -93,6 +94,16 @@ run() {
typedef pvector<TypedWritable *> Objects; typedef pvector<TypedWritable *> Objects;
Objects objects; Objects objects;
TypedWritable *object = bam_file.read_object(); TypedWritable *object = bam_file.read_object();
if (object != (TypedWritable *)NULL &&
object->is_exact_type(BamCacheRecord::get_class_type())) {
// Here's a special case: if the first object in the file is a
// BamCacheRecord, it's really a cache data file and not a true
// bam file; but skip over the cache data record and let the user
// treat it like an ordinary bam file.
object = bam_file.read_object();
}
while (object != (TypedWritable *)NULL || !bam_file.is_eof()) { while (object != (TypedWritable *)NULL || !bam_file.is_eof()) {
if (object != (TypedWritable *)NULL) { if (object != (TypedWritable *)NULL) {
objects.push_back(object); objects.push_back(object);
@ -467,8 +478,6 @@ get_egg_texture(Texture *tex) {
} }
switch (tex->get_minfilter()) { switch (tex->get_minfilter()) {
case Texture::FT_invalid:
break;
case Texture::FT_nearest: case Texture::FT_nearest:
temp.set_minfilter(EggTexture::FT_nearest); temp.set_minfilter(EggTexture::FT_nearest);
break; break;
@ -487,6 +496,9 @@ get_egg_texture(Texture *tex) {
case Texture::FT_linear_mipmap_linear: case Texture::FT_linear_mipmap_linear:
temp.set_minfilter(EggTexture::FT_linear_mipmap_linear); temp.set_minfilter(EggTexture::FT_linear_mipmap_linear);
break; break;
default:
break;
} }
switch (tex->get_magfilter()) { switch (tex->get_magfilter()) {
@ -496,6 +508,7 @@ get_egg_texture(Texture *tex) {
case Texture::FT_linear: case Texture::FT_linear:
temp.set_magfilter(EggTexture::FT_linear); temp.set_magfilter(EggTexture::FT_linear);
break; break;
default: default:
break; break;
} }