diff --git a/README.md b/README.md index 36300f0a87..d373f3f3b1 100644 --- a/README.md +++ b/README.md @@ -52,11 +52,11 @@ Building Panda3D Windows ------- -You can build Panda3D with the Microsoft Visual C++ 2015 or 2017 compiler, +You can build Panda3D with the Microsoft Visual C++ 2015, 2017 or 2019 compiler, which can be downloaded for free from the [Visual Studio site](https://visualstudio.microsoft.com/downloads/). You will also need to install the [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk), -and if you intend to target Windows XP, you will also need the -[Windows 7.1 SDK](https://www.microsoft.com/en-us/download/details.aspx?id=8279). +and if you intend to target Windows XP, you will also need the Windows 7.1A +SDK (which can be installed from the Visual Studio Installer). You will also need to have the third-party dependency libraries available for the build scripts to use. These are available from one of these two URLs, @@ -64,16 +64,17 @@ depending on whether you are on a 32-bit or 64-bit system, or you can [click here](https://github.com/rdb/panda3d-thirdparty) for instructions on building them from source. -https://www.panda3d.org/download/panda3d-1.10.4.1/panda3d-1.10.4.1-tools-win64.zip -https://www.panda3d.org/download/panda3d-1.10.4.1/panda3d-1.10.4.1-tools-win32.zip +- https://www.panda3d.org/download/panda3d-1.10.5/panda3d-1.10.5-tools-win64.zip +- https://www.panda3d.org/download/panda3d-1.10.5/panda3d-1.10.5-tools-win32.zip -After acquiring these dependencies, you may simply build Panda3D from the -command prompt using the following command. (Change `14.1` to `14` if you are -using Visual C++ 2015 instead of 2017. Add the `--windows-sdk=10` option if -you don't need to support Windows XP and did not install the Windows 7.1 SDK.) +After acquiring these dependencies, you can build Panda3D from the command +prompt using the following command. Change the `--msvc-version` option based +on your version of Visual C++; 2019 is 14.2, 2017 is 14.1, and 2015 is 14. +Remove the `--windows-sdk=10` option if you need to support Windows XP, which +requires the Windows 7.1A SDK. ```bash -makepanda\makepanda.bat --everything --installer --msvc-version=14.1 --no-eigen --threads=2 +makepanda\makepanda.bat --everything --installer --msvc-version=14.2 --windows-sdk=10 --no-eigen --threads=2 ``` When the build succeeds, it will produce an .exe file that you can use to diff --git a/direct/src/tkpanels/AnimPanel.py b/direct/src/tkpanels/AnimPanel.py index a8348c299d..12bc1feefd 100644 --- a/direct/src/tkpanels/AnimPanel.py +++ b/direct/src/tkpanels/AnimPanel.py @@ -276,7 +276,7 @@ class AnimPanel(AppShell): title = 'Load Animation', parent = self.component('hull') ) - if not animFilename: + if not animFilename or animFilename == 'None': # no file selected, canceled return diff --git a/direct/src/tkpanels/MopathRecorder.py b/direct/src/tkpanels/MopathRecorder.py index 8ff2341865..1cf65cd0aa 100644 --- a/direct/src/tkpanels/MopathRecorder.py +++ b/direct/src/tkpanels/MopathRecorder.py @@ -1638,7 +1638,7 @@ class MopathRecorder(AppShell, DirectObject): initialdir = path, title = 'Load Nurbs Curve', parent = self.parent) - if mopathFilename: + if mopathFilename and mopathFilename != 'None': self.reset() nodePath = loader.loadModel( Filename.fromOsSpecific(mopathFilename)) diff --git a/direct/src/tkpanels/ParticlePanel.py b/direct/src/tkpanels/ParticlePanel.py index b7a632f61a..d82677b5e5 100644 --- a/direct/src/tkpanels/ParticlePanel.py +++ b/direct/src/tkpanels/ParticlePanel.py @@ -1272,7 +1272,7 @@ class ParticlePanel(AppShell): initialdir = path, title = 'Load Particle Effect', parent = self.parent) - if particleFilename: + if particleFilename and particleFilename != 'None': # Delete existing particles and forces self.particleEffect.loadConfig( Filename.fromOsSpecific(particleFilename)) diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index ca3fb07d79..bd36f99da3 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -615,8 +615,10 @@ release_vertex_buffer(VertexBufferContext *vbc) { } #endif - dvbc->_vbuffer->Release(); - dvbc->_vbuffer = nullptr; + if (dvbc->_vbuffer != nullptr) { + dvbc->_vbuffer->Release(); + dvbc->_vbuffer = nullptr; + } delete dvbc; } diff --git a/panda/src/gobj/material.cxx b/panda/src/gobj/material.cxx index 091c7eff2f..a87c978c1c 100644 --- a/panda/src/gobj/material.cxx +++ b/panda/src/gobj/material.cxx @@ -544,6 +544,11 @@ fillin(DatagramIterator &scan, BamReader *manager) { } _refractive_index = scan.get_stdfloat(); + if ((_flags & (F_base_color | F_metallic)) == (F_base_color | F_metallic)) { + // Compute the ambient, diffuse and specular settings. + set_base_color(_base_color); + } + } else { _ambient.read_datagram(scan); _diffuse.read_datagram(scan); diff --git a/panda/src/grutil/lineSegs.I b/panda/src/grutil/lineSegs.I index 5236f13b74..5a7b533e1d 100644 --- a/panda/src/grutil/lineSegs.I +++ b/panda/src/grutil/lineSegs.I @@ -99,7 +99,7 @@ draw_to(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z) { * Creates a new GeomNode that will render the series of line segments and * points described via calls to move_to() and draw_to(). The lines and * points are created with the color and thickness established by calls to - * set_color() and set_thick(). + * set_color() and set_thickness(). * * If dynamic is true, the line segments will be created with the dynamic Geom * setting, optimizing them for runtime vertex animation. diff --git a/panda/src/grutil/lineSegs.cxx b/panda/src/grutil/lineSegs.cxx index 534c1f5700..bdf7912d7e 100644 --- a/panda/src/grutil/lineSegs.cxx +++ b/panda/src/grutil/lineSegs.cxx @@ -164,7 +164,7 @@ get_current_position() { * Appends to an existing GeomNode a new Geom that will render the series of * line segments and points described via calls to move_to() and draw_to(). * The lines and points are created with the color and thickness established - * by calls to set_color() and set_thick(). + * by calls to set_color() and set_thickness(). * * If dynamic is true, the line segments will be created with the dynamic Geom * setting, optimizing them for runtime vertex animation. diff --git a/panda/src/pgraph/shaderInput.I b/panda/src/pgraph/shaderInput.I index b8e182421f..2ace5d614b 100644 --- a/panda/src/pgraph/shaderInput.I +++ b/panda/src/pgraph/shaderInput.I @@ -490,7 +490,19 @@ operator < (const ShaderInput &other) const { return false; case M_vector: - return _stored_vector < other._stored_vector; + if (_stored_vector[0] != other._stored_vector[0]) { + return _stored_vector[0] < other._stored_vector[0]; + } + if (_stored_vector[1] != other._stored_vector[1]) { + return _stored_vector[1] < other._stored_vector[1]; + } + if (_stored_vector[2] != other._stored_vector[2]) { + return _stored_vector[2] < other._stored_vector[2]; + } + if (_stored_vector[3] != other._stored_vector[3]) { + return _stored_vector[3] < other._stored_vector[3]; + } + return false; case M_numeric: return _stored_ptr._ptr < other._stored_ptr._ptr; diff --git a/tests/pgraph/test_shaderinput.py b/tests/pgraph/test_shaderinput.py new file mode 100644 index 0000000000..68bb6b2e24 --- /dev/null +++ b/tests/pgraph/test_shaderinput.py @@ -0,0 +1,32 @@ +from panda3d.core import ShaderInput, Vec4 + + +def test_shaderinput_vector_compare(): + i0 = ShaderInput('a', Vec4(0, 0, 0, 0)) + i1 = ShaderInput('a', Vec4(1e-9, 0, 0, 0)) + i2 = ShaderInput('a', Vec4(1e-8, 0, 0, 0)) + i3 = ShaderInput('a', Vec4(2, 0, 0, 0)) + + assert i0 == i0 + assert i1 == i1 + assert i2 == i2 + assert i3 == i3 + + assert i0 != i1 + assert i0 != i2 + assert i0 != i3 + assert i1 != i2 + assert i2 != i3 + assert i1 != i3 + + assert not i0 < i0 + assert not i1 < i1 + assert not i2 < i2 + assert not i3 < i3 + + assert i0 < i1 + assert i0 < i2 + assert i0 < i3 + assert i1 < i2 + assert i2 < i3 + assert i1 < i3