mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
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:
parent
51cba437b9
commit
7c5e24c2ad
@ -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
|
||||
|
9286
panda/src/framework/rock_floor_src.cxx
Normal file
9286
panda/src/framework/rock_floor_src.cxx
Normal file
File diff suppressed because it is too large
Load Diff
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user