Merge branch 'master' into input-overhaul

This commit is contained in:
rdb 2018-01-07 12:08:59 +01:00
commit 27bd7ae4ac
7 changed files with 33 additions and 9 deletions

View File

@ -1103,8 +1103,8 @@ class Actor(DirectObject, NodePath):
# Get a handle to the joint. # Get a handle to the joint.
joint = bundle.findChild(jointName) joint = bundle.findChild(jointName)
if node == None: if node is None:
node = self.attachNewNode(jointName) node = partDef.partBundleNP.attachNewNode(jointName)
if (joint): if (joint):
if localTransform: if localTransform:

View File

@ -131,6 +131,9 @@ class CommonFilters:
if (len(configuration) == 0): if (len(configuration) == 0):
return return
if not self.manager.win.gsg.getSupportsBasicShaders():
return False
auxbits = 0 auxbits = 0
needtex = set(["color"]) needtex = set(["color"])
needtexcoord = set(["color"]) needtexcoord = set(["color"])
@ -338,7 +341,10 @@ class CommonFilters:
text += " o_color = float4(1, 1, 1, 1) - o_color;\n" text += " o_color = float4(1, 1, 1, 1) - o_color;\n"
text += "}\n" text += "}\n"
self.finalQuad.setShader(Shader.make(text, Shader.SL_Cg)) shader = Shader.make(text, Shader.SL_Cg)
if not shader:
return False
self.finalQuad.setShader(shader)
for tex in self.textures: for tex in self.textures:
self.finalQuad.setShaderInput("tx"+tex, self.textures[tex]) self.finalQuad.setShaderInput("tx"+tex, self.textures[tex])

View File

@ -1279,8 +1279,7 @@ class ShowBase(DirectObject.DirectObject):
if win == None: if win == None:
win = self.win win = self.win
if win != None and win.getSideBySideStereo() and \ if win != None and win.hasSize() and win.getSbsLeftYSize() != 0:
win.hasSize() and win.getSbsLeftYSize() != 0:
aspectRatio = float(win.getSbsLeftXSize()) / float(win.getSbsLeftYSize()) aspectRatio = float(win.getSbsLeftXSize()) / float(win.getSbsLeftYSize())
else: else:
if win == None or not hasattr(win, "getRequestedProperties"): if win == None or not hasattr(win, "getRequestedProperties"):
@ -2823,9 +2822,10 @@ class ShowBase(DirectObject.DirectObject):
# changed and update the camera lenses and aspect2d parameters # changed and update the camera lenses and aspect2d parameters
self.adjustWindowAspectRatio(self.getAspectRatio()) self.adjustWindowAspectRatio(self.getAspectRatio())
if win.getSideBySideStereo() and win.hasSize() and win.getSbsLeftYSize() != 0: if win.hasSize() and win.getSbsLeftYSize() != 0:
self.pixel2d.setScale(2.0 / win.getSbsLeftXSize(), 1.0, 2.0 / win.getSbsLeftYSize()) self.pixel2d.setScale(2.0 / win.getSbsLeftXSize(), 1.0, 2.0 / win.getSbsLeftYSize())
self.pixel2dp.setScale(2.0 / win.getSbsLeftXSize(), 1.0, 2.0 / win.getSbsLeftYSize()) if self.wantRender2dp:
self.pixel2dp.setScale(2.0 / win.getSbsLeftXSize(), 1.0, 2.0 / win.getSbsLeftYSize())
else: else:
xsize, ysize = self.getSize() xsize, ysize = self.getSize()
if xsize > 0 and ysize > 0: if xsize > 0 and ysize > 0:

View File

@ -435,7 +435,11 @@ pull_used_buffers() {
ReMutexHolder holder(OpenALAudioManager::_lock); ReMutexHolder holder(OpenALAudioManager::_lock);
while (_stream_queued.size()) { while (_stream_queued.size()) {
ALuint buffer = 0; ALuint buffer = 0;
alGetError(); ALint num_buffers = 0;
alGetSourcei(_source, AL_BUFFERS_PROCESSED, &num_buffers);
if (num_buffers <= 0) {
break;
}
alSourceUnqueueBuffers(_source, 1, &buffer); alSourceUnqueueBuffers(_source, 1, &buffer);
int err = alGetError(); int err = alGetError();
if (err == AL_NO_ERROR) { if (err == AL_NO_ERROR) {

View File

@ -62,6 +62,9 @@
// #include <GLESglext.h> // #include <GLESglext.h>
#endif #endif
// Some implementations (Arch Linux) set this in glext.h
typedef char GLchar;
#include "panda_esglext.h" #include "panda_esglext.h"
// This helps to keep the source clean of hundreds of ifdefs. // This helps to keep the source clean of hundreds of ifdefs.

View File

@ -7585,7 +7585,7 @@ make_shadow_buffer(LightLensNode *light, Texture *tex, GraphicsOutput *host) {
flags |= GraphicsPipe::BF_size_square; flags |= GraphicsPipe::BF_size_square;
} }
CLP(GraphicsBuffer) *sbuffer = new GLGraphicsBuffer(get_engine(), get_pipe(), light->get_name(), fbp, props, flags, this, host); CLP(GraphicsBuffer) *sbuffer = new CLP(GraphicsBuffer)(get_engine(), get_pipe(), light->get_name(), fbp, props, flags, this, host);
sbuffer->add_render_texture(tex, GraphicsOutput::RTM_bind_or_copy, GraphicsOutput::RTP_depth); sbuffer->add_render_texture(tex, GraphicsOutput::RTM_bind_or_copy, GraphicsOutput::RTP_depth);
get_engine()->add_window(sbuffer, light->get_shadow_buffer_sort()); get_engine()->add_window(sbuffer, light->get_shadow_buffer_sort());
return sbuffer; return sbuffer;

View File

@ -99,6 +99,7 @@ OdeTriMeshData(const NodePath& model, bool use_normals) :
write_faces(odetrimeshdata_cat.debug()); write_faces(odetrimeshdata_cat.debug());
#ifdef dSINGLE
if (!use_normals) { if (!use_normals) {
build_single(_vertices, sizeof(StridedVertex), _num_vertices, build_single(_vertices, sizeof(StridedVertex), _num_vertices,
_faces, _num_faces * 3, sizeof(StridedTri)); _faces, _num_faces * 3, sizeof(StridedTri));
@ -107,6 +108,16 @@ OdeTriMeshData(const NodePath& model, bool use_normals) :
_faces, _num_faces * 3, sizeof(StridedTri), _faces, _num_faces * 3, sizeof(StridedTri),
_normals); _normals);
} }
#else
if (!use_normals) {
build_double(_vertices, sizeof(StridedVertex), _num_vertices,
_faces, _num_faces * 3, sizeof(StridedTri));
} else {
build_double1(_vertices, sizeof(StridedVertex), _num_vertices,
_faces, _num_faces * 3, sizeof(StridedTri),
_normals);
}
#endif
preprocess(); preprocess();
} }