Skip to content

Commit d53b2ca

Browse files
committed
Backport various bugfixes from master, among which:
- Fix Windows pbuffer crash on Intel cards - Fix crash when using pnmimage.write with unsupported format - Fix GLSL diagnostics on Mesa GLES2 compiler - Reduce warning severity when resizing immutable storage texture - Print more debug info when FrameBufferProperties are insufficient - Fix "Bam file contains objects of unknown type: MovingPart<LMatrix4f>" - Fix memory leak in BulletTriangleMesh - Fix pmerge in Python 3
1 parent 3951a19 commit d53b2ca

File tree

11 files changed

+49
-16
lines changed

11 files changed

+49
-16
lines changed

direct/src/p3d/SeqValue.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def setFromString(self, value):
3535
""" Sets the seq from the indicated string of dot-separated
3636
integers. Raises ValueError on error. """
3737
assert isinstance(value, types.StringTypes)
38-
38+
3939
self.value = ()
4040
if value:
4141
value = value.split('.')
@@ -77,9 +77,14 @@ def __cmp__(self, other):
7777
""" Compares to another seq value. """
7878
return cmp(self.value, other.value)
7979

80+
def __lt__(self, other):
81+
return self.value < other.value
82+
83+
def __gt__(self, other):
84+
return self.value > other.value
85+
8086
def __bool__(self):
8187
return bool(self.value)
8288

8389
def __str__(self):
8490
return 'SeqValue%s' % (repr(self.value))
85-

dtool/src/dtoolbase/pdtoa.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ inline static unsigned CountDecimalDigit32(uint32_t n) {
250250
}
251251

252252
inline static void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) {
253-
static const uint32_t kPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 };
253+
static const uint32_t kPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 0, 0, 0, 0, 0 };
254254
const DiyFp one(uint64_t(1) << -Mp.e, Mp.e);
255255
const DiyFp wp_w = Mp - W;
256256
uint32_t p1 = static_cast<uint32_t>(Mp.f >> -one.e);

makepanda/makepandacore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
import cPickle as pickle
2121
import thread
2222

23-
SUFFIX_INC = [".cxx",".c",".h",".I",".yxx",".lxx",".mm",".rc",".r"]
23+
SUFFIX_INC = [".cxx",".cpp",".c",".h",".I",".yxx",".lxx",".mm",".rc",".r"]
2424
SUFFIX_DLL = [".dll",".dlo",".dle",".dli",".dlm",".mll",".exe",".pyd",".ocx"]
2525
SUFFIX_LIB = [".lib",".ilb"]
26-
VCS_DIRS = set(["CVS", "CVSROOT", ".git", ".hg"])
26+
VCS_DIRS = set(["CVS", "CVSROOT", ".git", ".hg", "__pycache__"])
2727
VCS_FILES = set([".cvsignore", ".gitignore", ".gitmodules", ".hgignore"])
2828
STARTTIME = time.time()
2929
MAINTHREAD = threading.currentThread()

panda/src/bullet/bulletHeightfieldShape.I

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ INLINE BulletHeightfieldShape::
2121
~BulletHeightfieldShape() {
2222

2323
delete _shape;
24-
delete _data;
24+
delete [] _data;
2525
}
2626

2727
////////////////////////////////////////////////////////////////////

panda/src/bullet/bulletTriangleMesh.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ add_geom(const Geom *geom, bool remove_duplicate_vertices, const TransformState
149149
_mesh->addTriangle(v0, v1, v2, remove_duplicate_vertices);
150150
}
151151
}
152+
153+
delete [] vertices;
152154
}
153155

154156
////////////////////////////////////////////////////////////////////
@@ -180,6 +182,8 @@ add_array(const PTA_LVecBase3 &points, const PTA_int &indices, bool remove_dupli
180182

181183
_mesh->addTriangle(v0, v1, v2, remove_duplicate_vertices);
182184
}
185+
186+
delete [] vertices;
183187
}
184188

185189
////////////////////////////////////////////////////////////////////

panda/src/chan/config_chan.cxx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,17 @@ ConfigureFn(config_chan) {
146146
AnimChannelScalarTable::register_with_read_factory();
147147
AnimChannelScalarDynamic::register_with_read_factory();
148148
AnimPreloadTable::register_with_read_factory();
149+
150+
// For compatibility with old .bam files.
151+
#ifndef STDFLOAT_DOUBLE
152+
TypeRegistry *reg = TypeRegistry::ptr();
153+
reg->record_alternate_name(AnimChannelFixed<ACMatrixSwitchType>::get_class_type(),
154+
"AnimChannelFixed<LMatrix4f>");
155+
reg->record_alternate_name(MovingPart<ACMatrixSwitchType>::get_class_type(),
156+
"MovingPart<LMatrix4f>");
157+
reg->record_alternate_name(MovingPart<ACScalarSwitchType>::get_class_type(),
158+
"MovingPart<float>");
159+
#endif
149160
}
150161

151162

panda/src/display/graphicsEngine.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ make_output(GraphicsPipe *pipe,
437437
if (flags & GraphicsPipe::BF_fb_props_optional) {
438438
display_cat.warning()
439439
<< "FrameBufferProperties available less than requested.\n";
440+
display_cat.warning(false)
441+
<< " requested: " << fb_prop << "\n"
442+
<< " got: " << window->get_fb_properties() << "\n";
440443
return window;
441444
}
442445
display_cat.error()

panda/src/glstuff/glGraphicsStateGuardian_src.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10745,7 +10745,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) {
1074510745
}
1074610746

1074710747
if (needs_reload && gtc->_immutable) {
10748-
GLCAT.warning() << "Attempt to modify texture with immutable storage, recreating texture.\n";
10748+
GLCAT.info() << "Attempt to modify texture with immutable storage, recreating texture.\n";
1074910749
gtc->reset_data();
1075010750
glBindTexture(target, gtc->_index);
1075110751
}

panda/src/glstuff/glShaderContext_src.cxx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,10 +1861,10 @@ glsl_report_shader_errors(GLuint shader, Shader::ShaderType type, bool fatal) {
18611861
istringstream log(info_log);
18621862
string line;
18631863
while (getline(log, line)) {
1864-
int fileno, lineno;
1864+
int fileno, lineno, colno;
18651865
int prefixlen = 0;
18661866

1867-
// First is AMD/Intel driver syntax, second is NVIDIA syntax.
1867+
// This first format is used by the majority of compilers.
18681868
if (sscanf(line.c_str(), "ERROR: %d:%d: %n", &fileno, &lineno, &prefixlen) == 2
18691869
&& prefixlen > 0) {
18701870

@@ -1879,14 +1879,22 @@ glsl_report_shader_errors(GLuint shader, Shader::ShaderType type, bool fatal) {
18791879
GLCAT.warning(false)
18801880
<< "WARNING: " << fn << ":" << lineno << ": " << (line.c_str() + prefixlen) << "\n";
18811881

1882-
18831882
} else if (sscanf(line.c_str(), "%d(%d) : %n", &fileno, &lineno, &prefixlen) == 2
18841883
&& prefixlen > 0) {
18851884

1885+
// This is the format NVIDIA uses.
18861886
Filename fn = _shader->get_filename_from_index(fileno, type);
18871887
GLCAT.error(false)
18881888
<< fn << "(" << lineno << ") : " << (line.c_str() + prefixlen) << "\n";
18891889

1890+
} else if (sscanf(line.c_str(), "%d:%d(%d): %n", &fileno, &lineno, &colno, &prefixlen) == 3
1891+
&& prefixlen > 0) {
1892+
1893+
// This is the format for Mesa's OpenGL ES 2 implementation.
1894+
Filename fn = _shader->get_filename_from_index(fileno, type);
1895+
GLCAT.error(false)
1896+
<< fn << ":" << lineno << "(" << colno << "): " << (line.c_str() + prefixlen) << "\n";
1897+
18901898
} else if (!fatal) {
18911899
GLCAT.warning(false) << line << "\n";
18921900

panda/src/pnmimage/pnmImageHeader.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ make_writer(ostream *file, bool owns_file, const Filename &filename,
375375
delete file;
376376
}
377377

378-
if (!writer->is_valid()) {
378+
if (writer != NULL && !writer->is_valid()) {
379379
delete writer;
380380
writer = NULL;
381381
}

0 commit comments

Comments
 (0)