compile in the rock-floor.rgb texture as part of the code, so it doesn't need to be found externally

This commit is contained in:
David Rose 2004-11-26 19:37:36 +00:00
parent 51cba437b9
commit 7c5e24c2ad
3 changed files with 9304 additions and 4 deletions

View File

@ -11,10 +11,11 @@
#define SOURCES \
config_framework.cxx config_framework.h \
pandaFramework.cxx pandaFramework.I pandaFramework.h \
windowFramework.cxx windowFramework.I windowFramework.h
windowFramework.cxx windowFramework.I windowFramework.h \
rock_floor_src.cxx
#define INSTALL_HEADERS \
pandaFramework.I pandaFramework.h \
windowFramework.I windowFramework.h
windowFramework.I windowFramework.h
#end lib_target

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,11 @@
#include "pnmImage.h"
#include "loaderFileTypeRegistry.h"
#include "pnmFileTypeRegistry.h"
#include "pnmImage.h"
// This is generated data for the standard texture we apply to the
// blue triangle.
#include "rock_floor_src.cxx"
// This number is chosen arbitrarily to override any settings in model
// files.
@ -634,8 +639,16 @@ load_default_model(const NodePath &parent) {
geom->set_colors(colors, G_PER_VERTEX, cindex);
CPT(RenderState) state = RenderState::make_empty();
Texture *tex = TexturePool::load_texture("rock-floor.rgb");
if (tex != (Texture *)NULL) {
// Get the default texture to apply to the triangle; it's compiled
// into the code these days.
string rock_floor_string(rock_floor, rock_floor_len);
istringstream rock_floor_strm(rock_floor_string);
PNMImage rock_floor_pnm;
if (rock_floor_pnm.read(rock_floor_strm, "rock-floor.rgb")) {
PT(Texture) tex = new Texture;
tex->set_name("rock-floor.rgb");
tex->load(rock_floor_pnm);
tex->set_minfilter(Texture::FT_linear);
tex->set_magfilter(Texture::FT_linear);
state = state->add_attrib(TextureAttrib::make(tex));