mirror of
https://github.com/panda3d/panda3d.git
synced 2025-12-21 06:29:52 -06:00
Merge branch 'release/1.10.x' into incoming
This commit is contained in:
@@ -81,6 +81,7 @@ __all__ = ['DirectGuiBase', 'DirectGuiWidget']
|
||||
|
||||
from panda3d.core import *
|
||||
from direct.showbase import ShowBaseGlobal
|
||||
from direct.showbase.ShowBase import ShowBase
|
||||
from . import DirectGuiGlobals as DGG
|
||||
from .OnscreenText import *
|
||||
from .OnscreenGeom import *
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
------------------------ RELEASE 1.10.4.1 ---------------------
|
||||
|
||||
This release fixes only one critical regression: calling destroy()
|
||||
on a DirectGUI item would cause an exception.
|
||||
|
||||
------------------------ RELEASE 1.10.4 -----------------------
|
||||
|
||||
This release fixes a regression with DirectScrolledList in 1.10.3,
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
# and returns it on the command-line. This is useful for the
|
||||
# automated scripts that build the Panda3D releases.
|
||||
|
||||
from makepandacore import ParsePandaVersion, ParsePluginVersion
|
||||
from makepandacore import ParsePandaVersion, ParsePluginVersion, GetMetadataValue
|
||||
import sys
|
||||
|
||||
if '--runtime' in sys.argv:
|
||||
version = ParsePluginVersion("dtool/PandaVersion.pp")
|
||||
else:
|
||||
version = ParsePandaVersion("dtool/PandaVersion.pp")
|
||||
version = GetMetadataValue('version')
|
||||
|
||||
version = version.strip()
|
||||
sys.stdout.write(version)
|
||||
|
||||
@@ -1071,7 +1071,7 @@ if __name__ == "__main__":
|
||||
PkgDisable(pkg)
|
||||
|
||||
# Parse the version.
|
||||
match = re.match(r'^\d+\.\d+\.\d+', options.version)
|
||||
match = re.match(r'^\d+\.\d+(\.\d+)+', options.version)
|
||||
if not match:
|
||||
exit("version requires three digits")
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ def parseopts(args):
|
||||
elif (option=="--arch"): target_arch = value.strip()
|
||||
elif (option=="--nocolor"): DisableColors()
|
||||
elif (option=="--version"):
|
||||
match = re.match(r'^\d+\.\d+\.\d+', value)
|
||||
match = re.match(r'^\d+\.\d+(\.\d+)+', value)
|
||||
if not match:
|
||||
usage("version requires three digits")
|
||||
WHLVERSION = value
|
||||
@@ -2684,7 +2684,7 @@ PANDAVERSION_H="""
|
||||
#define PANDA_SEQUENCE_VERSION $VERSION3
|
||||
#define PANDA_VERSION $NVERSION
|
||||
#define PANDA_NUMERIC_VERSION $NVERSION
|
||||
#define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
|
||||
#define PANDA_VERSION_STR "$VERSION"
|
||||
#define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
|
||||
#define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
|
||||
#define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
|
||||
@@ -2803,6 +2803,7 @@ def CreatePandaVersionFiles():
|
||||
pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
|
||||
pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
|
||||
pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
|
||||
pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
|
||||
pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
|
||||
pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
|
||||
pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
|
||||
|
||||
@@ -132,8 +132,10 @@ FfmpegAudioCursor(FfmpegAudio *src) :
|
||||
// Set up the resample context if necessary.
|
||||
if (_audio_ctx->sample_fmt != AV_SAMPLE_FMT_S16) {
|
||||
#ifdef HAVE_SWRESAMPLE
|
||||
ffmpeg_cat.debug()
|
||||
<< "Codec does not use signed 16-bit sample format. Setting up swresample context.\n";
|
||||
if (ffmpeg_cat.is_debug()) {
|
||||
ffmpeg_cat.debug()
|
||||
<< "Codec does not use signed 16-bit sample format. Setting up swresample context.\n";
|
||||
}
|
||||
|
||||
_resample_ctx = swr_alloc();
|
||||
av_opt_set_int(_resample_ctx, "in_channel_count", _audio_channels, 0);
|
||||
|
||||
6
tests/gui/test_DirectButton.py
Normal file
6
tests/gui/test_DirectButton.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from direct.gui.DirectButton import DirectButton
|
||||
|
||||
|
||||
def test_button_destroy():
|
||||
btn = DirectButton(text="Test")
|
||||
btn.destroy()
|
||||
@@ -3,6 +3,11 @@ from direct.gui.DirectEntry import DirectEntry
|
||||
import sys
|
||||
|
||||
|
||||
def test_entry_destroy():
|
||||
entry = DirectEntry()
|
||||
entry.destroy()
|
||||
|
||||
|
||||
def test_entry_get():
|
||||
entry = DirectEntry()
|
||||
assert isinstance(entry.get(), str)
|
||||
|
||||
22
tests/gui/test_DirectGuiBase.py
Normal file
22
tests/gui/test_DirectGuiBase.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from direct.gui.DirectGuiBase import DirectGuiWidget
|
||||
from direct.showbase.ShowBase import ShowBase
|
||||
from direct.showbase import ShowBaseGlobal
|
||||
from panda3d import core
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.skipif(not ShowBaseGlobal.__dev__, reason="requires want-dev")
|
||||
def test_track_gui_items():
|
||||
page = core.load_prc_file_data("", "track-gui-items true")
|
||||
try:
|
||||
item = DirectGuiWidget()
|
||||
id = item.guiId
|
||||
|
||||
assert id in ShowBase.guiItems
|
||||
assert ShowBase.guiItems[id] == item
|
||||
|
||||
item.destroy()
|
||||
|
||||
assert id not in ShowBase.guiItems
|
||||
finally:
|
||||
core.unload_prc_file(page)
|
||||
Reference in New Issue
Block a user