Skip to content

Commit 921cbc6

Browse files
committed
Merge commit 'e0d34131822a8852ff72dc9c5597f4dc6900719a'
2 parents 66ac3be + e0d3413 commit 921cbc6

File tree

8 files changed

+225
-32
lines changed

8 files changed

+225
-32
lines changed

direct/src/dist/commands.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def initialize_options(self):
213213
'dciman32.dll', 'comdlg32.dll', 'comctl32.dll', 'ole32.dll',
214214
'oleaut32.dll', 'gdiplus.dll', 'winmm.dll', 'iphlpapi.dll',
215215
'msvcrt.dll', 'kernelbase.dll', 'msimg32.dll', 'msacm32.dll',
216+
'setupapi.dll', 'version.dll',
216217

217218
# manylinux1/linux
218219
'libdl.so.*', 'libstdc++.so.*', 'libm.so.*', 'libgcc_s.so.*',
@@ -230,6 +231,12 @@ def initialize_options(self):
230231
'/usr/lib/libedit.*.dylib',
231232
'/System/Library/**',
232233
]
234+
235+
if sys.version_info >= (3, 5):
236+
# Python 3.5+ requires at least Windows Vista to run anyway, so we
237+
# shouldn't warn about DLLs that are shipped with Vista.
238+
self.exclude_dependencies += ['bcrypt.dll']
239+
233240
self.package_data_dirs = {}
234241

235242
# We keep track of the zip files we've opened.
@@ -1350,17 +1357,22 @@ def create_nsis(self, basename, build_dir, is_64bit):
13501357
nsi.write('Section "" SecCore\n')
13511358
nsi.write(' SetOutPath "$INSTDIR"\n')
13521359
curdir = ""
1360+
nsi_dir = p3d.Filename.fromOsSpecific(build_cmd.build_base)
1361+
build_root_dir = p3d.Filename.fromOsSpecific(build_dir)
13531362
for root, dirs, files in os.walk(build_dir):
13541363
for name in files:
13551364
basefile = p3d.Filename.fromOsSpecific(os.path.join(root, name))
13561365
file = p3d.Filename(basefile)
13571366
file.makeAbsolute()
1358-
file.makeRelativeTo(build_dir)
1359-
outdir = file.getDirname().replace('/', '\\')
1367+
file.makeRelativeTo(nsi_dir)
1368+
outdir = p3d.Filename(basefile)
1369+
outdir.makeAbsolute()
1370+
outdir.makeRelativeTo(build_root_dir)
1371+
outdir = outdir.getDirname().replace('/', '\\')
13601372
if curdir != outdir:
13611373
nsi.write(' SetOutPath "$INSTDIR\\%s"\n' % outdir)
13621374
curdir = outdir
1363-
nsi.write(' File "%s"\n' % (basefile.toOsSpecific()))
1375+
nsi.write(' File "%s"\n' % (file.toOsSpecific()))
13641376
nsi.write(' SetOutPath "$INSTDIR"\n')
13651377
nsi.write(' WriteUninstaller "$INSTDIR\\Uninstall.exe"\n')
13661378
nsi.write(' ; Start menu items\n')

direct/src/gui/DirectGuiGlobals.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ def getDefaultFont():
128128
return defaultFont
129129

130130
def setDefaultFont(newFont):
131+
"""Changes the default font for DirectGUI items. To change the default
132+
font across the board, see :meth:`.TextNode.setDefaultFont`. """
131133
global defaultFont
132134
defaultFont = newFont
133135

@@ -161,3 +163,17 @@ def getDefaultPanel():
161163
def setDefaultPanel(newPanel):
162164
global panel
163165
panel = newPanel
166+
167+
get_default_rollover_sound = getDefaultRolloverSound
168+
set_default_rollover_sound = setDefaultRolloverSound
169+
get_default_click_sound = getDefaultClickSound
170+
set_default_click_sound = setDefaultClickSound
171+
get_default_font = getDefaultFont
172+
set_default_font = setDefaultFont
173+
get_default_dialog_geom = getDefaultDialogGeom
174+
get_default_dialog_relief = getDefaultDialogRelief
175+
set_default_dialog_geom = setDefaultDialogGeom
176+
get_default_draw_order = getDefaultDrawOrder
177+
set_default_draw_order = setDefaultDrawOrder
178+
get_default_panel = getDefaultPanel
179+
set_default_panel = setDefaultPanel

doc/ReleaseNotes

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,73 @@
1+
------------------------ RELEASE 1.10.7 -----------------------
2+
3+
This is primarily a bugfix release, but includes a few new features as well.
4+
5+
Rendering
6+
* Add High Dynamic Range filter with ACES tone mapping to CommonFilters
7+
* Add sRGB filter to CommonFilters (to be used as fallback to framebuffer-srgb)
8+
* Fix (shadow) buffer no longer working after host buffer is destroyed (#890)
9+
* Fix rare bug with shader parameters not being set right across render passes
10+
* Fog density passed to shader now defaults to 0 when no fog is applied
11+
* Don't check sampler/light type mismatch for non-shadow-casting lights (#942)
12+
* Shader generator now makes use of Material alpha values if present (#912)
13+
* Support sRGB textures and framebuffers in OpenGL ES 2 renderer
14+
15+
Asset Loading
16+
* Egg files can now be loaded with sRGB texture formats automatically
17+
* Fix maya2egg regression not creating animations properly (#1004)
18+
* Fix FMOD issue reading sounds from read-write-opened multifiles (#1002)
19+
20+
Stability
21+
* Fix faulty collision detection when sphere is under polygon (#907)
22+
* Fix PStats misreporting an exploding number of RenderState/TransformState
23+
* Fix memory leak when removing a task that is awaiting a non-Panda future
24+
* Optimize RenderState cache for case where texture is replaced repeatedly
25+
* PNMImage add_sub_image() / mult_sub_image() now properly adds offset (#903)
26+
* Fix some ServerRepository issues in Python 3
27+
* Fix has_tags() still returning true after clearing all Python tags (#936)
28+
* Fix crash in BitArray.has_any_of()
29+
* Fix errors in PythonUtil.detectLeaks() and PythonUtil.report()
30+
* Fix runtime error during ControlManager deletion (#884)
31+
* Some error messages in nativenet are changed to debug messages
32+
* Fix TexMemWatcher crash when graphics memory reaches 1 GB (#975)
33+
* Fix a Triangulator crash dealing with certain invalid polygons (#985)
34+
* Fix in MultiplexStreamBuf::Output::write_string() (#902)
35+
* Fix a buffer overrun on FreeBSD when extracting very long command-line args
36+
37+
Input and Windowing
38+
* M_confined mouse mode on Windows now confines mouse to client rectangle
39+
* Fix incorrect handling of shift modifier on macOS (#959)
40+
* Fix erroneous dpad_*-up events when emulating a dpad on Linux (#973)
41+
* Fix tab handling in DirectEntry with certain versions of Windows CRT (#994)
42+
* Fix parented window receiving WS_POPUP style on Windows (#915)
43+
44+
Deployment
45+
* macOS app bundle now performs chdir into Resources folder upon launch
46+
* No longer defaults to FMOD audio on macOS unless FMOD is explicitly bundled
47+
* Improvements to Config.prc handling (strip comments, sort files, etc.)
48+
* Line buffering is now used on Windows when writing to log files (#947)
49+
* stdout/stderr output streams are now flushed on exit (#946)
50+
* Build paths are now properly stripped from compiled Python code (#991)
51+
* Update to support a change in location of numpy/Pillow libraries (#914)
52+
* Fix libffi-7.dll not being included in official wheels
53+
* PYTHONINSPECT mechanism is no longer enabled when building with optimizations
54+
* A few unnecessary warning messages are squelched
55+
56+
API
57+
* Add pickle support to Datagram class
58+
* Unexpose a crashing CollisionPolygon constructor and method (#908)
59+
* FilterManager has new parameter to control framebuffer clamping
60+
* Add snake_case aliases for functions in DirectGuiGlobals
61+
* Global delete operator is now safe to call with a null pointer
62+
* Improvements to API reference documentation
63+
64+
Build
65+
* Fix issues building with development versions Python 3.9 and 3.10
66+
* Fix an ABI incompatibility issue with MouseWatcher in NDEBUG builds
67+
* Fix incorrect NaN/inf detection in double-precision release builds (#987)
68+
* interrogate C++ parser supports arbitrary constant expressions in bitfields
69+
* interrogate C++ parser supports sizeof with constant expression
70+
171
------------------------ RELEASE 1.10.6 -----------------------
272

373
This is a recommended bugfix release that adds additional stability fixes.

makepanda/makepanda.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,12 @@ def CompileCxx(obj,src,opts):
11111111
cmd += "/DWINVER=0x600 "
11121112

11131113
cmd += "/Fo" + obj + " /nologo /c"
1114-
if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts):
1115-
cmd += " /arch:SSE2"
1114+
if GetTargetArch() == 'x86':
1115+
# x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
1116+
if not PkgSkip("SSE2") or 'SSE2' in opts: # x86 with SSE2
1117+
cmd += " /arch:SSE2" # let's still be explicit and pass in /arch:SSE2
1118+
else: # x86 without SSE2
1119+
cmd += " /arch:IA32"
11161120
for x in ipath: cmd += " /I" + x
11171121
for (opt,dir) in INCDIRECTORIES:
11181122
if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)

panda/src/egg2pg/config_egg2pg.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,13 @@ ConfigVariableBool egg_implicit_alpha_binary
194194
"will automatically be downgraded to alpha type \"binary\" instead of "
195195
"whatever appears in the egg file."));
196196

197+
ConfigVariableBool egg_force_srgb_textures
198+
("egg-force-srgb-textures", false,
199+
PRC_DESC("If this is true, Panda3D will automatically assign the F_srgb or "
200+
"F_srgb_alpha format to all textures loaded from egg files, unless "
201+
"their envtype is set to a non-color map. Keep in mind that the "
202+
"model-cache must be cleared after changing this setting."));
203+
197204
ConfigureFn(config_egg2pg) {
198205
init_libegg2pg();
199206
}

panda/src/egg2pg/config_egg2pg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ extern EXPCL_PANDA_EGG2PG ConfigVariableBool egg_preload_simple_textures;
5454
extern EXPCL_PANDA_EGG2PG ConfigVariableDouble egg_vertex_membership_quantize;
5555
extern EXPCL_PANDA_EGG2PG ConfigVariableInt egg_vertex_max_num_joints;
5656
extern EXPCL_PANDA_EGG2PG ConfigVariableBool egg_implicit_alpha_binary;
57+
extern EXPCL_PANDA_EGG2PG ConfigVariableBool egg_force_srgb_textures;
5758

5859
extern EXPCL_PANDA_EGG2PG void init_libegg2pg();
5960

panda/src/egg2pg/eggLoader.cxx

Lines changed: 74 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,30 @@ apply_texture_attributes(Texture *tex, const EggTexture *egg_tex) {
11881188

11891189
tex->set_default_sampler(sampler);
11901190

1191+
bool force_srgb = false;
1192+
if (egg_force_srgb_textures) {
1193+
switch (egg_tex->get_env_type()) {
1194+
case EggTexture::ET_unspecified:
1195+
case EggTexture::ET_modulate:
1196+
case EggTexture::ET_decal:
1197+
case EggTexture::ET_blend:
1198+
case EggTexture::ET_replace:
1199+
case EggTexture::ET_add:
1200+
case EggTexture::ET_blend_color_scale:
1201+
case EggTexture::ET_modulate_glow:
1202+
case EggTexture::ET_modulate_gloss:
1203+
force_srgb = true;
1204+
if (egg2pg_cat.is_debug()) {
1205+
egg2pg_cat.debug()
1206+
<< "Enabling sRGB format on texture " << egg_tex->get_name() << "\n";
1207+
}
1208+
break;
1209+
1210+
default:
1211+
break;
1212+
}
1213+
}
1214+
11911215
if (tex->get_num_components() == 1) {
11921216
switch (egg_tex->get_format()) {
11931217
case EggTexture::F_red:
@@ -1203,44 +1227,52 @@ apply_texture_attributes(Texture *tex, const EggTexture *egg_tex) {
12031227
tex->set_format(Texture::F_alpha);
12041228
break;
12051229
case EggTexture::F_luminance:
1206-
tex->set_format(Texture::F_luminance);
1207-
break;
1208-
1209-
case EggTexture::F_unspecified:
1230+
tex->set_format(force_srgb ? Texture::F_sluminance : Texture::F_luminance);
12101231
break;
12111232

12121233
default:
12131234
egg2pg_cat.warning()
12141235
<< "Ignoring inappropriate format " << egg_tex->get_format()
12151236
<< " for 1-component texture " << egg_tex->get_name() << "\n";
1237+
1238+
case EggTexture::F_unspecified:
1239+
if (force_srgb) {
1240+
tex->set_format(Texture::F_sluminance);
1241+
}
1242+
break;
12161243
}
12171244

12181245
} else if (tex->get_num_components() == 2) {
12191246
switch (egg_tex->get_format()) {
12201247
case EggTexture::F_luminance_alpha:
1221-
tex->set_format(Texture::F_luminance_alpha);
1248+
tex->set_format(force_srgb ? Texture::F_sluminance_alpha : Texture::F_luminance_alpha);
12221249
break;
12231250

12241251
case EggTexture::F_luminance_alphamask:
1225-
tex->set_format(Texture::F_luminance_alphamask);
1226-
break;
1227-
1228-
case EggTexture::F_unspecified:
1252+
tex->set_format(force_srgb ? Texture::F_sluminance_alpha : Texture::F_luminance_alphamask);
12291253
break;
12301254

12311255
default:
12321256
egg2pg_cat.warning()
12331257
<< "Ignoring inappropriate format " << egg_tex->get_format()
12341258
<< " for 2-component texture " << egg_tex->get_name() << "\n";
1259+
1260+
case EggTexture::F_unspecified:
1261+
if (force_srgb) {
1262+
tex->set_format(Texture::F_sluminance_alpha);
1263+
}
1264+
break;
12351265
}
12361266

12371267
} else if (tex->get_num_components() == 3) {
12381268
switch (egg_tex->get_format()) {
12391269
case EggTexture::F_rgb:
1240-
tex->set_format(Texture::F_rgb);
1270+
tex->set_format(force_srgb ? Texture::F_srgb : Texture::F_rgb);
12411271
break;
12421272
case EggTexture::F_rgb12:
1243-
if (tex->get_component_width() >= 2) {
1273+
if (force_srgb) {
1274+
tex->set_format(Texture::F_srgb);
1275+
} else if (tex->get_component_width() >= 2) {
12441276
// Only do this if the component width supports it.
12451277
tex->set_format(Texture::F_rgb12);
12461278
} else {
@@ -1253,69 +1285,84 @@ apply_texture_attributes(Texture *tex, const EggTexture *egg_tex) {
12531285
case EggTexture::F_rgba8:
12541286
// We'll quietly accept RGBA8 for a 3-component texture, since flt2egg
12551287
// generates these for 3-component as well as for 4-component textures.
1256-
tex->set_format(Texture::F_rgb8);
1288+
tex->set_format(force_srgb ? Texture::F_srgb : Texture::F_rgb8);
12571289
break;
12581290
case EggTexture::F_rgb5:
1259-
tex->set_format(Texture::F_rgb5);
1291+
tex->set_format(force_srgb ? Texture::F_srgb : Texture::F_rgb5);
12601292
break;
12611293
case EggTexture::F_rgb332:
1262-
tex->set_format(Texture::F_rgb332);
1294+
tex->set_format(force_srgb ? Texture::F_srgb : Texture::F_rgb332);
12631295
break;
12641296
case EggTexture::F_srgb:
12651297
case EggTexture::F_srgb_alpha:
12661298
tex->set_format(Texture::F_srgb);
12671299
break;
12681300

1269-
case EggTexture::F_unspecified:
1270-
break;
1271-
12721301
default:
12731302
egg2pg_cat.warning()
12741303
<< "Ignoring inappropriate format " << egg_tex->get_format()
12751304
<< " for 3-component texture " << egg_tex->get_name() << "\n";
1305+
1306+
case EggTexture::F_unspecified:
1307+
if (force_srgb) {
1308+
tex->set_format(Texture::F_srgb);
1309+
}
1310+
break;
12761311
}
12771312

12781313
} else if (tex->get_num_components() == 4) {
12791314
switch (egg_tex->get_format()) {
12801315
case EggTexture::F_rgba:
1281-
tex->set_format(Texture::F_rgba);
1316+
tex->set_format(force_srgb ? Texture::F_srgb_alpha : Texture::F_rgba);
12821317
break;
12831318
case EggTexture::F_rgbm:
1284-
tex->set_format(Texture::F_rgbm);
1319+
tex->set_format(force_srgb ? Texture::F_srgb_alpha : Texture::F_rgbm);
12851320
break;
12861321
case EggTexture::F_rgba12:
1287-
if (tex->get_component_width() >= 2) {
1322+
if (force_srgb) {
1323+
tex->set_format(Texture::F_srgb_alpha);
1324+
} else if (tex->get_component_width() >= 2) {
12881325
// Only do this if the component width supports it.
1289-
tex->set_format(Texture::F_rgba12);
1326+
tex->set_format(force_srgb ? Texture::F_srgb_alpha : Texture::F_rgba12);
12901327
} else {
12911328
egg2pg_cat.warning()
12921329
<< "Ignoring inappropriate format " << egg_tex->get_format()
12931330
<< " for 8-bit texture " << egg_tex->get_name() << "\n";
12941331
}
12951332
break;
12961333
case EggTexture::F_rgba8:
1297-
tex->set_format(Texture::F_rgba8);
1334+
tex->set_format(force_srgb ? Texture::F_srgb_alpha : Texture::F_rgba8);
12981335
break;
12991336
case EggTexture::F_rgba4:
1300-
tex->set_format(Texture::F_rgba4);
1337+
tex->set_format(force_srgb ? Texture::F_srgb_alpha : Texture::F_rgba4);
13011338
break;
13021339
case EggTexture::F_rgba5:
1303-
tex->set_format(Texture::F_rgba5);
1340+
tex->set_format(force_srgb ? Texture::F_srgb_alpha : Texture::F_rgba5);
13041341
break;
13051342
case EggTexture::F_srgb_alpha:
13061343
tex->set_format(Texture::F_srgb_alpha);
13071344
break;
13081345

1309-
case EggTexture::F_unspecified:
1310-
break;
1311-
13121346
default:
13131347
egg2pg_cat.warning()
13141348
<< "Ignoring inappropriate format " << egg_tex->get_format()
13151349
<< " for 4-component texture " << egg_tex->get_name() << "\n";
1350+
1351+
case EggTexture::F_unspecified:
1352+
if (force_srgb) {
1353+
tex->set_format(Texture::F_srgb_alpha);
1354+
}
1355+
break;
13161356
}
13171357
}
13181358

1359+
if (force_srgb && tex->get_format() != Texture::F_alpha &&
1360+
!Texture::is_srgb(tex->get_format())) {
1361+
egg2pg_cat.warning()
1362+
<< "Unable to enable sRGB format on texture " << egg_tex->get_name()
1363+
<< " with specified format " << egg_tex->get_format() << "\n";
1364+
}
1365+
13191366
switch (egg_tex->get_quality_level()) {
13201367
case EggTexture::QL_unspecified:
13211368
case EggTexture::QL_default:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy