mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Merge branch 'release/1.10.x'
This commit is contained in:
commit
1213d95560
16
direct/src/dist/_dist_hooks.py
vendored
Normal file
16
direct/src/dist/_dist_hooks.py
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# This module should not import Panda3D modules globally as it contains hooks
|
||||||
|
# that may be invoked by setuptools even when Panda3D is not used. If the
|
||||||
|
# Panda3D installation is broken, it should not affect other applications.
|
||||||
|
|
||||||
|
__all__ = ('finalize_distribution_options', )
|
||||||
|
|
||||||
|
|
||||||
|
def finalize_distribution_options(dist):
|
||||||
|
"""Entry point for compatibility with setuptools>=61, see #1394."""
|
||||||
|
|
||||||
|
options = dist.get_option_dict('build_apps')
|
||||||
|
if options.get('gui_apps') or options.get('console_apps'):
|
||||||
|
# Make sure this is set to avoid auto-discovery taking place.
|
||||||
|
if getattr(dist.metadata, 'py_modules', None) is None and \
|
||||||
|
getattr(dist.metadata, 'packages', None) is None:
|
||||||
|
dist.py_modules = []
|
12
direct/src/dist/commands.py
vendored
12
direct/src/dist/commands.py
vendored
@ -23,6 +23,7 @@ from . import FreezeTool
|
|||||||
from . import pefile
|
from . import pefile
|
||||||
from . import installers
|
from . import installers
|
||||||
from .icon import Icon
|
from .icon import Icon
|
||||||
|
from ._dist_hooks import finalize_distribution_options
|
||||||
import panda3d.core as p3d
|
import panda3d.core as p3d
|
||||||
|
|
||||||
|
|
||||||
@ -1773,14 +1774,3 @@ class bdist_apps(setuptools.Command):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
self.installer_functions[installer](self, basename, build_dir)
|
self.installer_functions[installer](self, basename, build_dir)
|
||||||
|
|
||||||
|
|
||||||
def finalize_distribution_options(dist):
|
|
||||||
"""Entry point for compatibility with setuptools>=61, see #1394."""
|
|
||||||
|
|
||||||
options = dist.get_option_dict('build_apps')
|
|
||||||
if options.get('gui_apps') or options.get('console_apps'):
|
|
||||||
# Make sure this is set to avoid auto-discovery taking place.
|
|
||||||
if getattr(dist.metadata, 'py_modules', None) is None and \
|
|
||||||
getattr(dist.metadata, 'packages', None) is None:
|
|
||||||
dist.py_modules = []
|
|
||||||
|
@ -841,8 +841,12 @@ class LerpFunctionInterval(Interval.Interval):
|
|||||||
self.extraArgs = extraArgs
|
self.extraArgs = extraArgs
|
||||||
# Generate unique name if necessary
|
# Generate unique name if necessary
|
||||||
if name is None:
|
if name is None:
|
||||||
|
if hasattr(function, '__name__'):
|
||||||
|
name = function.__name__
|
||||||
|
else:
|
||||||
|
name = '<' + function.__class__.__name__ + '>'
|
||||||
name = ('LerpFunctionInterval-%s-%d' %
|
name = ('LerpFunctionInterval-%s-%d' %
|
||||||
(function.__name__,
|
(name,
|
||||||
LerpFunctionInterval.lerpFunctionIntervalNum))
|
LerpFunctionInterval.lerpFunctionIntervalNum))
|
||||||
LerpFunctionInterval.lerpFunctionIntervalNum += 1
|
LerpFunctionInterval.lerpFunctionIntervalNum += 1
|
||||||
else:
|
else:
|
||||||
|
@ -3016,7 +3016,7 @@ build_apps = direct.dist.commands:build_apps
|
|||||||
bdist_apps = direct.dist.commands:bdist_apps
|
bdist_apps = direct.dist.commands:bdist_apps
|
||||||
|
|
||||||
[setuptools.finalize_distribution_options]
|
[setuptools.finalize_distribution_options]
|
||||||
build_apps = direct.dist.commands:finalize_distribution_options
|
build_apps = direct.dist._dist_hooks:finalize_distribution_options
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not PkgSkip("DIRECT"):
|
if not PkgSkip("DIRECT"):
|
||||||
|
@ -878,7 +878,7 @@ if __debug__:
|
|||||||
entry_points += 'build_apps = direct.dist.commands:build_apps\n'
|
entry_points += 'build_apps = direct.dist.commands:build_apps\n'
|
||||||
entry_points += 'bdist_apps = direct.dist.commands:bdist_apps\n'
|
entry_points += 'bdist_apps = direct.dist.commands:bdist_apps\n'
|
||||||
entry_points += '[setuptools.finalize_distribution_options]\n'
|
entry_points += '[setuptools.finalize_distribution_options]\n'
|
||||||
entry_points += 'build_apps = direct.dist.commands:finalize_distribution_options\n'
|
entry_points += 'build_apps = direct.dist._dist_hooks:finalize_distribution_options\n'
|
||||||
|
|
||||||
whl.write_file_data('panda3d_tools/__init__.py', PANDA3D_TOOLS_INIT.format(tools_init))
|
whl.write_file_data('panda3d_tools/__init__.py', PANDA3D_TOOLS_INIT.format(tools_init))
|
||||||
|
|
||||||
|
@ -180,9 +180,20 @@ play() {
|
|||||||
|
|
||||||
if (_sd->_sample) {
|
if (_sd->_sample) {
|
||||||
push_fresh_buffers();
|
push_fresh_buffers();
|
||||||
|
// The macOS implementation of alSourcePlay resets the offset, so we call
|
||||||
|
// it before and avoid calling restart_stalled_audio() afterwards (#1607)
|
||||||
|
#ifdef HAVE_OPENAL_FRAMEWORK
|
||||||
|
ALenum status;
|
||||||
|
alGetSourcei(_source, AL_SOURCE_STATE, &status);
|
||||||
|
if (status != AL_PLAYING) {
|
||||||
|
alSourcePlay(_source);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
alSourcef(_source, AL_SEC_OFFSET, _start_time);
|
alSourcef(_source, AL_SEC_OFFSET, _start_time);
|
||||||
_stream_queued[0]._time_offset = _start_time;
|
_stream_queued[0]._time_offset = _start_time;
|
||||||
|
#ifndef HAVE_OPENAL_FRAMEWORK
|
||||||
restart_stalled_audio();
|
restart_stalled_audio();
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
audio_debug("Play: stream tell = " << _sd->_stream->tell() << " seeking " << _start_time);
|
audio_debug("Play: stream tell = " << _sd->_stream->tell() << " seeking " << _start_time);
|
||||||
if (_sd->_stream->tell() != _start_time) {
|
if (_sd->_stream->tell() != _start_time) {
|
||||||
|
@ -134,7 +134,6 @@ get_cursor_position() const {
|
|||||||
/**
|
/**
|
||||||
* Returns the node position x of the cursor
|
* Returns the node position x of the cursor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
INLINE PN_stdfloat PGEntry::
|
INLINE PN_stdfloat PGEntry::
|
||||||
get_cursor_X() const {
|
get_cursor_X() const {
|
||||||
LightReMutexHolder holder(_lock);
|
LightReMutexHolder holder(_lock);
|
||||||
@ -144,14 +143,12 @@ get_cursor_X() const {
|
|||||||
/**
|
/**
|
||||||
* Returns the node position y of the cursor
|
* Returns the node position y of the cursor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
INLINE PN_stdfloat PGEntry::
|
INLINE PN_stdfloat PGEntry::
|
||||||
get_cursor_Y() const {
|
get_cursor_Y() const {
|
||||||
LightReMutexHolder holder(_lock);
|
LightReMutexHolder holder(_lock);
|
||||||
return _cursor_def.get_y();
|
return _cursor_def.get_z();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the maximum number of characters that may be typed into the entry.
|
* Sets the maximum number of characters that may be typed into the entry.
|
||||||
* This is a limit on the number of characters, as opposed to the width of the
|
* This is a limit on the number of characters, as opposed to the width of the
|
||||||
|
@ -621,6 +621,9 @@ make_glyph(int character, FT_Face face, int glyph_index) {
|
|||||||
render_distance_field(image, outline, bounds.xMin, bounds.yMin);
|
render_distance_field(image, outline, bounds.xMin, bounds.yMin);
|
||||||
|
|
||||||
glyph = slot_glyph(character, int_x_size, int_y_size, advance);
|
glyph = slot_glyph(character, int_x_size, int_y_size, advance);
|
||||||
|
if (glyph == nullptr) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
if (!_needs_image_processing) {
|
if (!_needs_image_processing) {
|
||||||
copy_pnmimage_to_texture(image, glyph);
|
copy_pnmimage_to_texture(image, glyph);
|
||||||
} else {
|
} else {
|
||||||
@ -633,6 +636,9 @@ make_glyph(int character, FT_Face face, int glyph_index) {
|
|||||||
// other processing before it goes to the texture, we can just copy it
|
// other processing before it goes to the texture, we can just copy it
|
||||||
// directly into the texture.
|
// directly into the texture.
|
||||||
glyph = slot_glyph(character, bitmap.width, bitmap.rows, advance);
|
glyph = slot_glyph(character, bitmap.width, bitmap.rows, advance);
|
||||||
|
if (glyph == nullptr) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
copy_bitmap_to_texture(bitmap, glyph);
|
copy_bitmap_to_texture(bitmap, glyph);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -660,6 +666,9 @@ make_glyph(int character, FT_Face face, int glyph_index) {
|
|||||||
tex_x_size += outline * 2;
|
tex_x_size += outline * 2;
|
||||||
tex_y_size += outline * 2;
|
tex_y_size += outline * 2;
|
||||||
glyph = slot_glyph(character, int_x_size, int_y_size, advance);
|
glyph = slot_glyph(character, int_x_size, int_y_size, advance);
|
||||||
|
if (glyph == nullptr) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (outline != 0) {
|
if (outline != 0) {
|
||||||
// Pad the glyph image to make room for the outline.
|
// Pad the glyph image to make room for the outline.
|
||||||
@ -940,10 +949,7 @@ slot_glyph(int character, int x_size, int y_size, PN_stdfloat advance) {
|
|||||||
|
|
||||||
if (page->is_empty()) {
|
if (page->is_empty()) {
|
||||||
// If we couldn't even put it on an empty page, we're screwed.
|
// If we couldn't even put it on an empty page, we're screwed.
|
||||||
text_cat.error()
|
goto does_not_fit;
|
||||||
<< "Glyph of size " << x_size << " by " << y_size
|
|
||||||
<< " pixels won't fit on an empty page.\n";
|
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pi = (pi + 1) % _pages.size();
|
pi = (pi + 1) % _pages.size();
|
||||||
@ -954,15 +960,27 @@ slot_glyph(int character, int x_size, int y_size, PN_stdfloat advance) {
|
|||||||
if (garbage_collect() != 0) {
|
if (garbage_collect() != 0) {
|
||||||
// Yes, we just freed up some space. Try once more, recursively.
|
// Yes, we just freed up some space. Try once more, recursively.
|
||||||
return slot_glyph(character, x_size, y_size, advance);
|
return slot_glyph(character, x_size, y_size, advance);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
// No good; all recorded glyphs are actually in use. We need to make a new
|
||||||
// No good; all recorded glyphs are actually in use. We need to make a
|
// page.
|
||||||
// new page.
|
{
|
||||||
_preferred_page = _pages.size();
|
_preferred_page = _pages.size();
|
||||||
PT(DynamicTextPage) page = new DynamicTextPage(this, _preferred_page);
|
PT(DynamicTextPage) page = new DynamicTextPage(this, _preferred_page);
|
||||||
_pages.push_back(page);
|
_pages.push_back(page);
|
||||||
return page->slot_glyph(character, x_size, y_size, _texture_margin, advance);
|
|
||||||
|
DynamicTextGlyph *glyph = page->slot_glyph(character, x_size, y_size, _texture_margin, advance);
|
||||||
|
if (glyph != nullptr) {
|
||||||
|
return glyph;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
does_not_fit:
|
||||||
|
// If you get this error, increase text-page-size in Config.prc.
|
||||||
|
text_cat.error()
|
||||||
|
<< "Glyph of size " << x_size << " by " << y_size
|
||||||
|
<< " pixels won't fit on an empty page.\n";
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -756,7 +756,9 @@ clear_wordwrap() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Sets the color of the text. Note that this will modulate the color of all
|
||||||
|
* components of the text, including the shadow and outline. If you wish to
|
||||||
|
* only set the foreground color, see DynamicTextFont::set_fg().
|
||||||
*/
|
*/
|
||||||
INLINE void TextNode::
|
INLINE void TextNode::
|
||||||
set_text_color(const LColor &text_color) {
|
set_text_color(const LColor &text_color) {
|
||||||
@ -766,7 +768,9 @@ set_text_color(const LColor &text_color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Sets the color of the text. Note that this will modulate the color of all
|
||||||
|
* components of the text, including the shadow and outline. If you wish to
|
||||||
|
* only set the foreground color, see DynamicTextFont::set_fg().
|
||||||
*/
|
*/
|
||||||
INLINE void TextNode::
|
INLINE void TextNode::
|
||||||
set_text_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a) {
|
set_text_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a) {
|
||||||
|
@ -419,7 +419,9 @@ get_preserve_trailing_whitespace() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Sets the color of the text. Note that this will modulate the color of all
|
||||||
|
* components of the text, including the shadow and outline. If you wish to
|
||||||
|
* only set the foreground color, see DynamicTextFont::set_fg().
|
||||||
*/
|
*/
|
||||||
INLINE void TextProperties::
|
INLINE void TextProperties::
|
||||||
set_text_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a) {
|
set_text_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a) {
|
||||||
@ -427,7 +429,9 @@ set_text_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Sets the color of the text. Note that this will modulate the color of all
|
||||||
|
* components of the text, including the shadow and outline. If you wish to
|
||||||
|
* only set the foreground color, see DynamicTextFont::set_fg().
|
||||||
*/
|
*/
|
||||||
INLINE void TextProperties::
|
INLINE void TextProperties::
|
||||||
set_text_color(const LColor &text_color) {
|
set_text_color(const LColor &text_color) {
|
||||||
@ -448,7 +452,7 @@ clear_text_color() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Returns true if a text color was specified with set_text_color().
|
||||||
*/
|
*/
|
||||||
INLINE bool TextProperties::
|
INLINE bool TextProperties::
|
||||||
has_text_color() const {
|
has_text_color() const {
|
||||||
|
@ -495,7 +495,7 @@ match_texture(TextureImage *texture) const {
|
|||||||
|
|
||||||
case KW_mipmap:
|
case KW_mipmap:
|
||||||
request._minfilter = EggTexture::FT_linear_mipmap_linear;
|
request._minfilter = EggTexture::FT_linear_mipmap_linear;
|
||||||
request._magfilter = EggTexture::FT_linear_mipmap_linear;
|
request._magfilter = EggTexture::FT_linear;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KW_anisotropic:
|
case KW_anisotropic:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user