store more texture data in rawdata mode

This commit is contained in:
David Rose 2004-03-04 02:23:36 +00:00
parent 6bc826c5a5
commit 703a038d59
6 changed files with 6887 additions and 6833 deletions

View File

@ -141,6 +141,19 @@ set_size(int x_org, int y_org, int x_size, int y_size) {
_yorg = y_org;
}
////////////////////////////////////////////////////////////////////
// Function: PixelBuffer::set_border
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE void PixelBuffer::
set_border(int border) {
if (_border != border) {
_border = border;
make_dirty();
}
}
////////////////////////////////////////////////////////////////////
// Function: PixelBuffer::set_num_components
// Access: Public
@ -181,12 +194,25 @@ set_format(PixelBuffer::Format format) {
}
////////////////////////////////////////////////////////////////////
// Function: PixelBuffer::set_loaded
// Access:
// Function: PixelBuffer::set_image_type
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE void PixelBuffer::set_loaded()
{
INLINE void PixelBuffer::
set_image_type(PixelBuffer::Type type) {
if (_type != type) {
_type = type;
make_dirty();
}
}
////////////////////////////////////////////////////////////////////
// Function: PixelBuffer::set_loaded
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE void PixelBuffer::
set_loaded() {
_loaded = true;
}

View File

@ -111,9 +111,11 @@ public:
INLINE void set_xorg(int org);
INLINE void set_yorg(int org);
INLINE void set_size(int x_org, int y_org, int x_size, int y_size);
INLINE void set_border(int border);
INLINE void set_num_components(int num_components);
INLINE void set_component_width(int component_width);
INLINE void set_format(Format format);
INLINE void set_image_type(Type type);
INLINE void set_loaded();
INLINE int get_xsize() const;

View File

@ -871,6 +871,11 @@ fillin(DatagramIterator &scan, BamReader *manager, bool has_rawdata) {
_pbuffer->set_ysize(scan.get_int32());
_pbuffer->set_xorg(scan.get_int32());
_pbuffer->set_yorg(scan.get_int32());
_pbuffer->set_border(scan.get_uint8());
_pbuffer->set_image_type((PixelBuffer::Type)scan.get_uint8());
_pbuffer->set_num_components(scan.get_uint8());
_pbuffer->set_component_width(scan.get_uint8());
_pbuffer->set_loaded();
PN_uint32 u_size = scan.get_uint32();
@ -923,6 +928,11 @@ write_datagram(BamWriter *manager, Datagram &me) {
me.add_int32(_pbuffer->get_ysize());
me.add_int32(_pbuffer->get_xorg());
me.add_int32(_pbuffer->get_yorg());
me.add_uint8(_pbuffer->get_border());
me.add_uint8(_pbuffer->get_image_type());
me.add_uint8(_pbuffer->get_num_components());
me.add_uint8(_pbuffer->get_component_width());
me.add_uint32(_pbuffer->_image.size());
me.append_data(_pbuffer->_image, _pbuffer->_image.size());
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -49,12 +49,25 @@
// If we don't have FreeType, we have to include the bam font, which
// is kind of bulky but at least we can compress it if we have zlib.
// Regenerate this file with (cmss12.egg can be loaded from the models tree):
// egg2bam -rawtex -o cmss12.bam cmss12.egg
// pcompress cmss12.bam
// bin2c -n default_font_data -o cmss12.bam.pz.c cmss12.bam.pz
#include "cmss12.bam.pz.c"
#else
// If we don't even have zlib, just include the whole uncompressed bam
// file.
// Regenerate this file with (cmss12.egg can be loaded from the models tree):
// egg2bam -rawtex -o cmss12.bam cmss12.egg
// bin2c -n default_font_data -o cmss12.bam.c cmss12.bam
#include "cmss12.bam.c"
#endif