Compare commits

...

390 Commits

Author SHA1 Message Date
Tom Rothamel f49a04468b Merge pull request #2017 from wchill/py3_ints
[Py3] Make Python 3 integer related changes
2019-10-09 19:30:49 -04:00
Tom Rothamel d337e47e1f Fix changelog. 2019-10-07 21:05:29 -04:00
Tom Rothamel d10d81647b Fix changelog typo. 2019-10-07 20:52:27 -04:00
Tom Rothamel e7708c23fb Merge pull request #2030 from Andykl/fix-dynamic-image
Fix dynamic image
2019-10-07 20:13:05 -04:00
Andy_kl cc45453f4a More correct clear target on prefix change 2019-10-08 03:11:48 +03:00
Andy_kl 4dba39c57a More correct comment 2019-10-08 00:16:09 +03:00
Andy_kl c570d96458 Remove debug print 2019-10-08 00:07:04 +03:00
Andy_kl 0888c1ae1c Set target back if changing the prefix refers to the same image. 2019-10-08 00:04:27 +03:00
Andy_kl 9222ca20c6 Do not lose target after lock 2019-10-07 23:34:11 +03:00
Andy_kl 4ad03d0f98 Set _duplicatable flag before first targeting 2019-10-07 23:31:40 +03:00
Tom Rothamel de33e805d4 Revert glGet of FBO.
This prevents having to query the GPU, which would force a thread
synchronization in a multithreaded GPU driver.
2019-10-06 13:35:04 -04:00
Tom Rothamel dab57aeec3 Update changelog ad documentation. 2019-10-05 21:45:16 -04:00
Tom Rothamel 82caa0a66a Allow "[prefix_]" to be used in non-style DynamicImages..
Fixes #2016.
2019-10-05 21:26:14 -04:00
Tom Rothamel fe3c6908ea Merge pull request #1932 from Andykl/sl2-fixes
CDSL displayables should allow 'if' statements inside self.
2019-10-04 23:26:10 -04:00
Tom Rothamel 0c39b34c79 Merge pull request #2021 from Andykl/fix-translate
Fix line in Russian translate
2019-10-04 23:24:42 -04:00
Tom Rothamel 05b35745a1 lint: Do not pass formatted text into report.
Fixes #2027.
2019-10-04 22:48:31 -04:00
Tom Rothamel 77c04ac67d Fix docstrings for DragGroup. 2019-10-04 21:47:12 -04:00
Tom Rothamel bb4154c25f Perform FLATTEN during the render-to-texture pass.
This prevents it from leaving single-frame artifacts.
2019-10-03 21:59:38 -04:00
Andy_kl d8ad65e912 Fix line 2019-10-03 13:35:00 +03:00
Tom Rothamel be678bd4ba Update changelog. 2019-10-03 01:42:01 -04:00
Tom Rothamel e12c00ee6d Merge pull request #2015 from Andykl/fix-drag-issues
Set the style prefix for dragged set even after update screen
2019-10-03 01:32:25 -04:00
Tom Rothamel b22c4c1379 Drop textures when changing fullscreen mode on windows.
Fixes a bug where obsolete textures are used, causing the wrong
texture to be displayed.
2019-10-03 00:57:39 -04:00
Tom Rothamel 3a58834de0 Fix issues caused by a double-RTT with shared resources. 2019-10-02 23:44:46 -04:00
Tom Rothamel d2b96c0eab Bump version. 2019-10-02 20:26:12 -04:00
Eric Ahn f452540ad0 Add version check and define the long type if needed 2019-10-02 16:15:02 -07:00
Eric Ahn 2b65a69611 Import the int builtin as long 2019-10-02 15:48:04 -07:00
Eric Ahn 8c37264d84 Remove long constants and use new octal syntax 2019-10-02 15:40:53 -07:00
Eric Ahn 8ab711722c Fix integer division and remove long type 2019-10-02 15:24:42 -07:00
Andy_kl b3b4036955 Update Drag's prefix of the current dragging even after restart_interaction
Per #2014
2019-10-02 23:18:49 +03:00
Andy_kl 544dde6d5c Set the style prefix for dragged set even after update screen
Per #2014
2019-10-02 16:16:00 +03:00
Tom Rothamel 3002a1b019 Merge pull request #2011 from lunalucid/typo-fixes
Some typo fixes on config.rst and displayables.rst
2019-10-01 01:00:02 -04:00
lunalucid 08a621fdcf Some typo fixes on config.rst and displayables.rst 2019-09-30 22:53:06 -06:00
Tom Rothamel 3ba9569ace Allow character to call a function to supply its name.
Fixes #2007.
2019-09-30 22:46:25 -04:00
Tom Rothamel 166807fc76 Update credits. 2019-09-30 19:56:55 -04:00
Tom Rothamel 628a09d187 Merge pull request #2010 from lunalucid/correct-linespacing
Correct preference 'font vertical spacing' to 'font line spacing'
2019-09-30 01:58:16 -04:00
lunalucid e4348c52d6 correct preference 'font vertical spacing' to 'font line spacing' 2019-09-29 22:38:41 -06:00
Tom Rothamel 8f62aac732 Update credits. 2019-09-29 19:39:55 -04:00
Tom Rothamel 9f0a05fc6b Remove manual notarization.
It's now integrated into the app/dmg signing scripts, making it
a walk-away process.
2019-09-29 10:36:38 -04:00
Tom Rothamel d492249835 Merge pull request #2005 from Herpior/viewport-edgescroll-fix
Clear edgescroll timer when mouse moved out of bounds
2019-09-28 21:40:05 -04:00
Tom Rothamel dcfc23d2f3 Fix matrix.is_unit_aligned.
The implementation was wrong, and so it would never return true.
2019-09-28 18:43:37 -04:00
Beuc ad5e11c710 Typos 2019-09-28 10:06:54 +02:00
Tom Rothamel 5354bb0762 Fix a problem that prevents installing the android sdk. 2019-09-28 00:45:36 -04:00
Tom Rothamel f721662ef9 Merge pull request #2006 from renpy/Beuc-patch-1
config.cache_surfaces is False by default
2019-09-27 16:23:24 -04:00
Beuc c6641e53fe config.cache_surfaces is False by default 2019-09-27 22:20:04 +02:00
Roope Herpiö b97b29d894 Clear edgescroll timer when mouse moved out of bounds 2019-09-27 15:08:02 +03:00
Tom Rothamel 32eb7be5a1 Fix name. 2019-09-27 01:24:50 -04:00
Tom Rothamel 0b8bf87eaf doc: Fix changelog and update credits. 2019-09-26 20:12:56 -04:00
Tom Rothamel 857d776538 Remove information about mac signing.
It's best done with renpy/mac-notarization, rather than the
current system.
2019-09-26 18:33:29 -04:00
Tom Rothamel df51f5233f Finish notarization of Ren'Py.
This includes the notarization of the DMG that Ren'Py is
distributed with.
2019-09-24 20:50:50 -04:00
Tom Rothamel aed2625486 Merge pull request #2004 from uyjulian/avoid_spam_threading
Join previous autosave thread before spawning a new one
2019-09-24 01:58:56 -04:00
uyjulian 47271b7af9 Join previous autosave thread before spawning a new one 2019-09-24 00:53:54 -05:00
Tom Rothamel d8050e9f5d Use a tarball for notarization.
Turns out that a .zip can't really represent the extended
attributes used for signing some files properly, but the
tar format can. So we use that to ship things over, and
get a working .dmg.
2019-09-24 01:17:34 -04:00
Tom Rothamel b639171118 Scripts for notarizing Ren'Py. 2019-09-23 22:14:46 -04:00
Tom Rothamel 25e66d3150 More mac codesigning improvements.
* Do not sign the dmg.
* Fix giving the path to the entitlements.
2019-09-21 15:34:41 -04:00
Tom Rothamel dcaa97a70e Improve support for codesigning with entitlements. 2019-09-21 01:08:46 -04:00
Tom Rothamel e0fd8dc4d5 Update changelog and credits. 2019-09-20 00:08:04 -04:00
Tom Rothamel 2cc4bdd407 doc: Mention the Android version change in the changelog. 2019-09-19 23:41:09 -04:00
Tom Rothamel 8ccfb9abc7 Check in updated keywords. 2019-09-19 23:21:41 -04:00
Tom Rothamel 4734fb62f4 Merge pull request #2002 from Herpior/viewport-edgescroll-fix
Fixed bug with edgescroll in viewport
2019-09-19 22:08:25 -04:00
Tom Rothamel 8353120f55 doc: Changelog and sponsors. 2019-09-19 21:17:23 -04:00
Tom Rothamel 5a081b6dc7 doc: Web changelog, from Beuc. 2019-09-19 19:57:16 -04:00
Tom Rothamel 52cdcb699a doc: Changelog. 2019-09-19 02:25:05 -04:00
Tom Rothamel e190596f3d Add backwards compatibility for force_step. 2019-09-19 02:18:14 -04:00
Tom Rothamel 9352339f5b doc: Audio directory. 2019-09-18 01:41:58 -04:00
Tom Rothamel 5c315d02d1 doc: Fix. 2019-09-17 19:43:49 -04:00
Tom Rothamel 86a95abb60 Document AudioData. 2019-09-17 19:42:13 -04:00
Tom Rothamel cc03f54738 Allow audio data to be encapsulated in AudioData. 2019-09-16 23:56:26 -04:00
Tom Rothamel f40ff85436 Include the wave and sunau files with Ren'Py. 2019-09-16 22:25:53 -04:00
Tom Rothamel 3c6918c36f Fix crash caused by non-existent screen in save. 2019-09-15 10:40:35 -04:00
Tom Rothamel 754aec0507 Ensure that InputValue is called when an Input is shown for the first time. 2019-09-14 21:02:31 -04:00
Tom Rothamel 9f800275ad Remove spurious return. 2019-09-14 19:00:28 -04:00
Tom Rothamel cf05311158 Make the name of the screen used by renpy.input configurable. 2019-09-14 18:59:59 -04:00
Tom Rothamel 644d24dcc4 Avoid error if a a substitution doesn't exist during screen prep.
I believe that improvements to screen analysis make text more
predictable, which caused this problem.
2019-09-14 18:59:59 -04:00
Roope Herpiö 87f076e78c Mouse motion events on viewport no longer reset self.edge_last_st unless necessary 2019-09-13 21:11:35 +03:00
Tom Rothamel b0cc98cea2 Merge pull request #1998 from Andykl/missed-ignore
Minor fixes
2019-09-13 14:00:56 -04:00
Tom Rothamel 498ea82ec9 Document how arguments are passed to screens in modern Ren'Py. 2019-09-12 21:41:58 -04:00
Tom Rothamel e587790021 Move the start callbacks after the defaults.
Per #2001.
2019-09-12 01:05:57 -04:00
Tom Rothamel bbaf654ef9 Mark Ren'Py collection types as pure.
More specifically, __renpy__list__, __renpy__set__, and
__renpy__dict__.

Per #1935.
2019-09-11 22:57:29 -04:00
Tom Rothamel 44b5af95ff Merge pull request #2000 from Andykl/fix-drag-issue
Set correct style_prefix for drop object after restart interaction.
2019-09-10 19:44:40 -04:00
Andy_kl 5470f86c39 Set correct style prefix for drop object after restart interaction. 2019-09-11 02:38:44 +03:00
Tom Rothamel 8e04c766de Hide the notify screen on rollback.
Fixes #1951.
2019-09-10 01:17:32 -04:00
Tom Rothamel 82b396d424 The non-screens menu indicates that it shows the window.
Fixes #1981.
2019-09-09 23:27:27 -04:00
Tom Rothamel a0dad58dbf Ignore printable keycodes without unicode.
This should fix a race condition where that could cause unprefixed
key commands (like 'v' or 'a') to trigger if KEYDOWN is present
but the TEXTINPUT hasn't been delivered yet.
2019-09-09 22:57:33 -04:00
Tom Rothamel d28ecb39ff In a multipart statment like menu, call from should use the first part.
Fixes #1996.
2019-09-08 20:28:56 -04:00
Andy_kl 6597edcada Add vibrate to drag alternate 2019-09-09 02:03:19 +03:00
Andy_kl 5c44e738e6 Fix wrong event ignore 2019-09-09 01:49:44 +03:00
Tom Rothamel 7e295d67b5 Call renpy.shown_window from nvl_menu.
Fixes #1934.
2019-09-08 01:26:49 -04:00
Tom Rothamel 61eb81c79d Lock a button's style after _in_current_store.
Fixes #1973.
2019-09-08 01:15:05 -04:00
Tom Rothamel df32d31113 Throw a hard exception when gui.init is called outside of the init phase. 2019-09-08 00:59:07 -04:00
Tom Rothamel 59587015ba doc: Fix incomplete sentence.
Fixes #1962.
2019-09-08 00:55:27 -04:00
Tom Rothamel 312c49f194 Fix #1982. 2019-09-08 00:20:49 -04:00
Tom Rothamel 7c75a79c13 Deal with a problem when a FontGroup is replaced.
Fixes #1994.
2019-09-07 23:56:17 -04:00
Tom Rothamel e6546189eb ffmedia: Fix the mixing of mono files into stereo.
Fixes #1943.
2019-09-07 23:28:11 -04:00
Tom Rothamel 9500f658a3 Merge pull request #1889 from Andykl/change-get-layer
Receive a layer from default_layer in all exports funcs
2019-09-07 11:06:40 -04:00
Tom Rothamel 6d9bcff1f6 Merge pull request #1937 from Moshibit/master
patch - minor fixes
2019-09-07 11:05:57 -04:00
Tom Rothamel 3a352af1e5 Merge pull request #1965 from Beuc/gleshighp
gles: handle GPUs that do not support highp
2019-09-07 11:04:34 -04:00
Tom Rothamel 87b323a3d4 Tweak documentation. 2019-09-07 10:56:37 -04:00
Tom Rothamel 1bf97965b8 Merge pull request #1967 from Andykl/is_init_phase
Added is_init_phase in exports.
2019-09-07 10:55:29 -04:00
Tom Rothamel eafcbf572f Merge pull request #1997 from pionere/sound-fix
fixed sound-queue call_back
2019-09-07 10:54:45 -04:00
pionere 427a1542d8 fixed sound-queue call_back
call queue_empty_callback only if the queue is really empty
2019-09-07 16:37:50 +02:00
pionere ee53f232aa Revert: prevent crash when get_selected is called on a non-existent field 2019-09-07 16:32:17 +02:00
Tom Rothamel 7c03642cb5 Fix tyop that broke itch on mac. 2019-09-06 20:11:40 -04:00
Tom Rothamel 4347c89c15 gl2: Implement is_pixel_opaque. 2019-09-06 01:50:55 -04:00
Tom Rothamel 9783a0a733 gl2: Move the fbo into GLDraw.
This lets the same fbo be shared between the texture system and
things like screenshots and is_pixel_opaque.
2019-09-05 02:29:25 -04:00
Tom Rothamel e5252af42b Automatically voice character menu captions.
Fixes #1991.
2019-09-04 03:37:55 -04:00
Tom Rothamel 094009fa3a gl2: Replace the renderbuffer with a texture.
RGBA renderbuffers don't seem to be supported well on WebGL or
OpenGL ES, at least for the low-end platforms.
2019-09-03 00:17:10 -04:00
Tom Rothamel 6471986ea9 oldgl: Bind a texture to the framebuffer, not a renderbuffer.
Creating RGBA or RGBA8 renderbuffers doesn't seem to be supported
very well (at leeast in webgl), while texture attachments seem to work.
2019-09-02 22:28:29 -04:00
Tom Rothamel ab97732865 oldgl: Use renderbuffer copying to render textures.
This is a backport of a performance improvement from the gl2
branch, where profiling reported that rebinding the framebuffer
was very slow, and simply copying the pixels out is much
faster.
2019-09-01 22:04:49 -04:00
Tom Rothamel 4f90718eaa oldgl: Expose renderbuffer functions. 2019-09-01 22:00:57 -04:00
Tom Rothamel 2aa796d418 glold: Remove support for OpenGL ES 1
This wasn't used for anything, and it's obsolete, so out it goes.
2019-09-01 21:51:46 -04:00
Moshibit e62ee21922 translation correction 2019-08-31 22:47:17 -05:00
Moshibit 218cb677cd Delete indepth_minigame.rpyc 2019-08-31 22:46:44 -05:00
Moshibit fe0e129ad3 translation correction 2019-08-31 22:45:40 -05:00
Moshibit 630ed80eb5 translation correction 2019-08-31 22:33:55 -05:00
Moshibit 2b5d40053d translation correction 2019-08-31 21:48:12 -05:00
Moshibit 8728fd137a translation correction 2019-08-31 21:44:18 -05:00
Moshibit 7b34ec1ba3 translation correction 2019-08-31 21:04:06 -05:00
Moshibit 3f785ee366 Delete indepth_transitions.rpyc 2019-08-31 21:03:36 -05:00
Moshibit 1f9401a602 translation correction 2019-08-31 21:02:32 -05:00
Moshibit 91a0677f67 translation correction 2019-08-31 19:45:36 -05:00
Tom Rothamel 1392fb9239 gl2: Fix order of matrix operations. 2019-08-31 20:42:19 -04:00
Moshibit ac902ee733 translation correction 2019-08-31 19:06:40 -05:00
Tom Rothamel 6031917511 Fix matrix order. 2019-08-31 17:39:41 -04:00
Tom Rothamel 0e6ad371fe Merge pull request #1938 from Andykl/doc-afm_enabled
Doc afm enabled
2019-08-30 21:28:27 -04:00
Tom Rothamel ead5c63eac Merge pull request #1939 from psunbury/patch-1
Added that the default setting are in options.rpy
2019-08-30 21:27:55 -04:00
Tom Rothamel 18827a8ab3 Merge pull request #1952 from Andykl/atl-fix
Fix missed continue
2019-08-30 21:27:31 -04:00
Tom Rothamel 8c81811177 Merge pull request #1955 from jsfehler/pref_typo
Fix typo in common/00preferences.rpy
2019-08-30 21:27:16 -04:00
Tom Rothamel ce634662bd Merge pull request #1969 from renpy/Beuc-doc-python
doc: python: clarify other stores usage
2019-08-30 21:26:59 -04:00
Tom Rothamel 13c32894cf Document renpy.random.shuffle.
Per #1989.
2019-08-29 21:51:13 -04:00
Tom Rothamel 26e0f1617e gl2: Use the reverse matrix to multiple rendered textures. 2019-08-29 21:49:33 -04:00
Tom Rothamel 6754d50c12 Merge pull request #1984 from tdh8316/Korean-translation
Improve Korean translation
2019-08-26 21:39:46 -04:00
Donghyeok Tak ebe8264b1d Cleanup translations 2019-08-25 22:01:52 +09:00
Donghyeok Tak 5c9a1066e3 Improve Korean translation 2019-08-25 21:47:33 +09:00
Tom Rothamel 07a6f3dcbd Compate for audio directory stuff. 2019-08-25 08:27:18 -04:00
Tom Rothamel 3441e0e7f0 Remove pluralization.
Fixes #1983.
2019-08-25 08:14:34 -04:00
Moshibit 3bd9055c5f Add files via upload 2019-08-24 11:41:22 -05:00
Moshibit 2941031b2a Merge pull request #5 from renpy/master
update from renpy/master
2019-08-24 10:26:43 -05:00
Tom Rothamel 627b18a8e8 Merge pull request #1970 from renpy/Beuc-doc-emscripten
doc: reference renpy.emscripten + renpyweb enabling renpy.mobile
2019-08-23 06:45:10 -04:00
Tom Rothamel 681d3a5772 Merge pull request #1972 from Andykl/adjustment-force_step
Adjustment force_step
2019-08-22 05:18:13 -05:00
Tom Rothamel 39be517a0a gl2: Move shaders into the common section.
And introduce a function to register the shaders.
2019-08-20 23:16:28 -04:00
Tom Rothamel 8916575921 Automatically define audio files in the audio namespace. 2019-08-19 00:37:04 -05:00
Tom Rothamel 5288ff876d Use _audio_eval on voice filenames. 2019-08-18 18:36:50 -05:00
Tom Rothamel 067d98cdf0 Improve changes to SelectedIf and SensitiveIf.
This builds on the changes in #1977, so that all Action methods
can be proxied.
2019-08-17 08:58:17 -05:00
Tom Rothamel 65957b3236 Merge pull request #1977 from Andykl/improve-if-actions
Improve SelectedIf and SensitiveIf
2019-08-17 08:37:39 -05:00
Moshibit 726e535f1b corrections 2019-08-16 16:43:37 -05:00
Andy_kl 095a253bf8 Fix doc 2019-08-16 22:48:45 +03:00
Andy_kl d3c36b843e Improve SelectedIf and SensitiveIf 2019-08-16 22:42:17 +03:00
Tom Rothamel b5707d7091 Merge pull request #1953 from Beuc/variants-web
web: set variants according to what the browser runs on
2019-08-16 12:45:22 -05:00
Tom Rothamel 024b0aef81 Merge pull request #1961 from Beuc/fullscreen-web
web: detect when fullscreen status changed externally
2019-08-16 12:44:39 -05:00
Tom Rothamel 365913c267 gl2: Use a depth renderbuffer when rendering-to-texture with depth. 2019-08-15 08:10:13 -04:00
Tom Rothamel a2b8842206 gl2: Optimized path for triangle meshes. 2019-08-14 22:57:56 -04:00
Tom Rothamel dc51db06b1 gl2: If a mesh consists of only one kind of polygon, indicate that. 2019-08-14 22:56:38 -04:00
Tom Rothamel c590c4f956 gl2: Do not give OpenGL precision qualifiers. 2019-08-14 22:53:44 -04:00
Tom Rothamel 3871803088 gl2: Properly name config.depth_size. 2019-08-14 02:44:46 -04:00
Tom Rothamel 40ec6f87ef gl2: Depth buffer and depth testing. 2019-08-14 01:45:29 -04:00
Tom Rothamel 6339c0dfef gl2: Fix reload. 2019-08-10 16:38:24 -04:00
Tom Rothamel 510b7cb909 gl2: Support gles directly, rather than in the preprocessor. 2019-08-10 16:35:53 -04:00
Tom Rothamel 3a011ca2c6 gl2: Allow games to use config.gl2 to opt in. 2019-08-09 21:06:47 -04:00
Andy_kl d12fe12c2b Restore type after rounding 2019-08-09 22:04:23 +03:00
Tom Rothamel 37a128a470 gl2: Remove gl2ftl.pyx, now that a better version is in gl2texture. 2019-08-08 22:12:17 -04:00
Tom Rothamel 9e8b074a16 gl2: Disable gl2debug for now.
I haven't been using it, and it's causing build errors.
2019-08-07 18:31:55 -04:00
Tom Rothamel 3147e71c45 Fix windows build. 2019-08-07 11:22:24 -04:00
Tom Rothamel 60d413f96f gl2: Implement ImageDissolve. 2019-08-05 22:47:59 -04:00
Tom Rothamel 5029e6d078 gl2: Dissolve shader. 2019-08-05 21:59:14 -04:00
Tom Rothamel ef167433f4 gl2: Properly set up textures. 2019-08-05 21:54:00 -04:00
Andy_kl aac1f4c421 Compat this 2019-08-06 04:23:16 +03:00
Andy_kl 0ab0856e37 Doc for this 2019-08-06 04:17:31 +03:00
Andy_kl 760503b124 Added force_step keyword to all Action which uses step. 2019-08-06 04:08:26 +03:00
Andy_kl d16e3eea75 Added round_value process to Viewport 2019-08-06 03:48:44 +03:00
Andy_kl 09fda5505e Added round_value process to Bar 2019-08-06 03:47:03 +03:00
Andy_kl 5d4bb738ef Added force_step keyword and round value to Adjustment 2019-08-06 03:37:33 +03:00
Sylvain Beucler 204a48f577 web: more variants tuning 2019-08-05 14:03:51 +02:00
Beuc 8889ab487d doc: reference renpy.emscripten + renpyweb enabling renpy.mobile 2019-08-05 13:16:24 +02:00
Beuc 06684d692a doc: python: clarify other stores usage
Additional stores are available as local variables in the default 'store' under their name already, consequently 'import store.mystore as mystore' is a no-op
2019-08-05 13:08:57 +02:00
Sylvain Beucler 5f4e6d4ba1 web: set variants according to what the browser runs on 2019-08-05 12:51:52 +02:00
Tom Rothamel 200af0d584 gl2: Add rendering to a Texture. 2019-08-05 03:04:21 -04:00
Tom Rothamel e78828fa3b gl2: Add matrix function generation to Ren'Py. 2019-08-05 03:01:02 -04:00
Tom Rothamel 7e602c256e gl2: Add renpy.display.render.models.
A variable to determine if we are supporting a renderer that
support models (gl2) or quads (sw/gl).
2019-08-04 13:15:48 -04:00
Tom Rothamel 1a8154c78a gl2: Add fields for gl2 to renpy.render. 2019-08-04 12:32:11 -04:00
Tom Rothamel 2d7460bafd gl2: Fix a gc leak through Texture. 2019-08-04 12:21:40 -04:00
Tom Rothamel ae998912f5 gl2: Make renpy.geometry the 'default shader', so it doesn't have to be passed.
While we could have just added it to the tuple of shaders created in
GL2DrawingContext, that would lead to creating a tuple on every
render. So instead, it's added in the shader compiler.
2019-08-04 02:27:49 -04:00
Tom Rothamel e8cd034b7a gl2: Separate Texture and non-texture Models.
Which should make things simpler when determining if a RTT is
required, going forwards.
2019-08-03 16:46:21 -04:00
Andy_kl 900e291cdc Added is_init_phase in exports. 2019-08-03 15:19:18 +03:00
Tom Rothamel cb98d18aa9 gl2: Rename TexturedMesh -> Model. 2019-08-03 02:42:24 -04:00
Tom Rothamel ef4c5aff9e gl2: Do not copy a Polygon, Mesh, or TexturedMesh that didn't change. 2019-08-02 23:00:55 -04:00
Tom Rothamel 6cdcb5dfbc Create a flatten operation type.
This makes RTT entirely the renderer's concern.
2019-08-02 19:39:26 -04:00
Tom Rothamel 797ef0fc25 fix: Duplicate the children of DynamicDisplayable.
Fixes #1966, which causesd a Transform that was added to the
tree of surfaces twice, then rendered in a way that wasn't
cached, to cause a crash.
2019-08-01 22:01:35 -04:00
Tom Rothamel c132df21ca gl2: Dynamically select shader and implement alpha blending. 2019-08-01 02:16:07 -04:00
Tom Rothamel 6ab2df60f4 gl2: Implement texture preloading. 2019-07-31 22:47:05 -04:00
Tom Rothamel 101cb8c348 gl2: Support zero copy texture loading.
At least for the common cases, like loading text into the GPU.
2019-07-31 21:17:54 -04:00
Sylvain Beucler 2f53ddc03e gles: handle GPUs that do not support highp 2019-07-31 15:47:42 +02:00
Tom Rothamel 8a042fe187 gl2: Texture improvements.
* Ask GL for the maximum size.
* Remove the idea of generations - we swap out the loader when a
  generation is obsolete.
* Cache the fbo so changing it is needed less often.
2019-07-31 01:27:02 -04:00
Tom Rothamel f9a61f7567 gl2: Read the maximum texture size from the video card. 2019-07-30 01:11:14 -04:00
Tom Rothamel 79c965ba5d gl2: Deal with precision issues in the barycentric interpolator.
It's the same issue as before - arriving at the same point by
different paths might lead to being outside by a very small
amount, which we don't want.
2019-07-30 00:41:41 -04:00
Tom Rothamel 340db775c5 gl2: Fix method name typo. 2019-07-30 00:34:58 -04:00
Tom Rothamel d1224c0707 gl2: Load large surfaces as tiles. 2019-07-29 08:17:18 -04:00
Tom Rothamel afeb06c1d9 gl2: Change how rectangles work. 2019-07-28 23:32:44 -04:00
Tom Rothamel afad82b082 gl2: The Great Geometry Rewrite (tm)
This improves gl2 Polygons and Meshes by making it clear if a
new object is created or they're updated in place, by supporting
multiplication by matrices directly, and by including the repr
function everywhere.

Really, a quality of life improvement.
2019-07-28 18:33:27 -04:00
Tom Rothamel 2f683b2d69 gl2: Increase the numerical stability of gl2 by dealing with parallel lines. 2019-07-28 00:02:28 -04:00
Beuc d8ec4503a6 doc: fix formatting in sprites.html 2019-07-27 22:51:51 +02:00
Moshibit bb207a7fce Spanish translation correction
short and long must be in English
2019-07-27 11:44:52 -05:00
Sylvain Beucler 629ea6f13f web: detect when fullscreen status changed externally 2019-07-27 15:16:12 +02:00
Tom Rothamel 2a78e0141f gl2: Avoid leaking textures by changing generation too early. 2019-07-27 03:48:03 -04:00
Tom Rothamel 8da9eafd28 gl2: Remove debug print. 2019-07-27 03:28:50 -04:00
Tom Rothamel 1f8e1cacf6 gl2: Use a renderbuffer to load textures.
After extensive profiling my GTX 1060, it appears that using
glFrameBufferTexture2D is unacceptably slow. (300+us for just that
one call). glCopyTexImage seem to be much faster, with realistic
small texture loads (like button images) taking 60us or so.
2019-07-27 03:22:55 -04:00
Tom Rothamel 048f8fea8f gl2: Remove debugging from uguu.
Using KHR_debug gives us the same thing, faster.
2019-07-26 23:47:16 -04:00
Tom Rothamel 229bd5a82d gl2: Enable all debugging. 2019-07-26 23:23:19 -04:00
Tom Rothamel 12405a22d9 gl2: Support using KHR_debug to get error output. 2019-07-26 23:11:25 -04:00
Tom Rothamel 3529d40ba0 Add GetCharacterVolume. 2019-07-25 18:42:54 -04:00
Tom Rothamel 02be00bb78 Add compatibility for tile_ratio to Frame. 2019-07-25 12:36:57 -04:00
Tom Rothamel 189e7d8e4f Merge pull request #1956 from RenpyRemix/master
Add support for tile="integer" to frame. 

This is a version of tiling that always does an integer number of repeats, scaling as necessary to accomplish this.
2019-07-25 12:22:39 -04:00
Tom Rothamel 0956519365 gl2: Fix issues preventing a restart.
* Matrix can now be unpickled.
* deinit -> quit.
2019-07-24 01:32:07 -04:00
Tom Rothamel efbd897832 gl2: Avoid mipmapping, for now.
It changes the look of certainy parts of drawing, and so it needs
to be disabled for now.
2019-07-23 23:56:11 -04:00
Tom Rothamel c6d9b6e0c1 gl2: Fix uninitialized variable. 2019-07-23 23:42:42 -04:00
Tom Rothamel d0bbc81ebf gl2: Return the subsurface when taking a texture subsurface. 2019-07-23 22:52:24 -04:00
Tom Rothamel 662e8227ab gl2: The color used for solid textures should be alpha-premultiplied. 2019-07-23 22:39:47 -04:00
Tom Rothamel 33e3174692 Default to not code-signing for macOS.
Per #1958.
2019-07-23 18:05:40 -04:00
Moshibit dde68dd735 Merge pull request #4 from renpy/master
update from renpy/master
2019-07-23 15:34:15 -05:00
Tom Rothamel 5accb1c3e4 Add repr to texture. 2019-07-23 02:41:34 -04:00
Tom Rothamel 77d8b9b318 gl2: Properly reset the clipping rectangle. 2019-07-23 02:40:32 -04:00
Tom Rothamel 202fc47419 gl2: glEnableVertexAttribArray -> glDisableVertexAttribArray 2019-07-22 21:29:43 -04:00
RenpyRemix 49c0ec0504 Update imagelike.py
Support for tile="integer" in Frame
2019-07-22 23:51:26 +01:00
Tom Rothamel bc437b5e9b gl2: Implement clipping using polygons in the screen space. 2019-07-22 01:15:01 -04:00
Tom Rothamel b4dfcc44cf gl2: Determine if polygons are wound clockwise or counterclockwise.
This might actually change over the lifecycle of a polygon, as the
winding of the polygon changes when it goes from the pygame/Ren'Py
coordinate space to the OpenGL viewport space.

This change means it doesn't matter - polygon intersection can
always occur.
2019-07-22 01:00:00 -04:00
Tom Rothamel 1a98502bdc gl2: Set the number of actual points when restriding a polygon. 2019-07-22 00:52:54 -04:00
Joshua Fehler 977726c3ab Update 00preferences.rpy
Fix typo in common/00preferences.rpy
2019-07-21 23:48:51 -04:00
Tom Rothamel ed9cbfd21c gl2: Support cropping to a viewport-space polygon. 2019-07-21 15:07:46 -04:00
Tom Rothamel 261a0b807d gl2: Redo shaders to minimize allocation. 2019-07-21 01:14:09 -04:00
Tom Rothamel 261718967a gl2: Share the mesh used for ftl. 2019-07-20 23:13:49 -04:00
Moshibit 3e5e77b400 fix code
keyword "menu" cause an exception. Maybe you wanted to put "label" as it usually is after menu
2019-07-20 20:24:36 -05:00
Beuc 7fa4265f15 Remove mistaken file from Moshibit 2019-07-20 23:19:07 +02:00
Andy_kl 995823fbcf Fix missed continue 2019-07-20 23:00:47 +03:00
Tom Rothamel 663961581f Merge pull request #1949 from Andykl/nondevelop-dynamic
Do not raise error if dynamic variable already deleted in pop time.
2019-07-20 01:45:01 -04:00
Tom Rothamel d32946ce53 gl2: Texture loading (and eventually RTT) to its own pass. 2019-07-19 21:15:26 -04:00
Andy_kl 6bd9523780 Do not raise error if dynamic variable already deleted in pop time. 2019-07-20 02:36:48 +03:00
Tom Rothamel b0b49b353e gl2: Fix draw glitches.
These were caused by state that was left behind by the texture
loader.
2019-07-18 23:07:08 -04:00
Tom Rothamel b1b943b456 gl2: Render the Ren'Py surface tree.
This means that we're displaying a partially-correct screen,
rather than just test images.
2019-07-18 02:37:54 -04:00
Tom Rothamel dd5326c205 gl2: Load and display textures. 2019-07-17 22:40:21 -04:00
Tom Rothamel e62cc921c7 gl2: Able to load a surface as a TexturedMesh. 2019-07-16 23:14:41 -04:00
Tom Rothamel d343617616 gl2: Process texure loading through a TextureLoader object. 2019-07-16 02:11:15 -04:00
Tom Rothamel 0cf72637b2 Rename draw.free_memory to draw.kill_textures, unify with deinit.
The differentiation between .deinit() and .quit() was hard to understand.
This change makes it clear - .kill_textures frees all of the OpenGL textures,
while .quit() releases all GL resources.
2019-07-15 22:47:57 -04:00
Tom Rothamel e9312a3604 gl2: Display a solid. 2019-07-14 14:33:52 -04:00
psunbury 39420b940a Added that the default setting are in options.rpy
I spent a lot of time finding where this was set. It would be useful putting what file it is located.
2019-07-13 19:46:56 -07:00
Andy_kl d8655be2c5 Correct renpy.get_skipping returns 2019-07-14 05:18:09 +03:00
Andy_kl c276ac8ec8 Fix spurious skipping value 2019-07-14 05:16:17 +03:00
Andy_kl 37e7060baa Documented preferences.afm_enable 2019-07-14 05:15:44 +03:00
Tom Rothamel b155fa9411 gl2: Minor fixes, now can display a blank screen. 2019-07-13 12:02:58 -04:00
Tom Rothamel 4ef1e05dc8 gl2: Work on texture meshes. 2019-07-13 02:35:17 -04:00
Tom Rothamel da6e5e2c73 gl2: Add shader cache. 2019-07-12 23:29:48 -04:00
Moshibit 95c1cd5ad8 correct radio button 2019-07-12 21:50:40 -05:00
Moshibit f8747f6e38 Delete screens.rpy 2019-07-12 21:47:43 -05:00
Moshibit 450aeb55dc correct radio button 2019-07-12 21:41:14 -05:00
Moshibit 878e2284f8 fix typo 2019-07-12 21:35:09 -05:00
Moshibit a4291ccddb Merge pull request #3 from renpy/master
update from renpy/renpy master
2019-07-12 21:27:04 -05:00
Tom Rothamel 2091161241 Merge pull request #1933 from Queex/patch-1
Missing config prefix for gc_print_unreachable
2019-07-12 09:38:14 -04:00
Ben Wright c8ac8b511f Missing config prefix for gc_print_unreachable 2019-07-12 13:06:09 +01:00
Tom Rothamel ed3182c74c gl2: TexturedMesh fields. 2019-07-12 03:18:04 -04:00
Tom Rothamel 82b0d59f19 gl2: Cut out the old texture code. 2019-07-11 22:42:27 -04:00
Andy_kl 836238de5c CDSL displayables should allow 'if' statements inside self. 2019-07-12 00:06:40 +03:00
Tom Rothamel 60b42fd79b Merge pull request #1929 from Andykl/sl2-fixes
Sl2 fixes
2019-07-11 00:56:24 -04:00
Tom Rothamel ba2c72eaac Allow config.load_failed_label to take a function.
Fixes #1928.
2019-07-10 21:31:46 -04:00
Andy_kl 7751d5603e Fix indention in doc 2019-07-11 02:35:49 +03:00
Andy_kl 6e8d622282 Moved minimum property to position properties 2019-07-11 02:19:51 +03:00
Andy_kl 30b3366168 Documented default_properties 2019-07-11 02:18:37 +03:00
Tom Rothamel 736d9487c5 gl2: Combine the geometry stuff into one file. 2019-07-09 23:15:58 -04:00
Tom Rothamel 7bf7af52b1 gl2: float -> double, so it works with emscripten. 2019-07-08 22:33:46 -04:00
Tom Rothamel be7daf39d5 gl2: Clean as much of we can of gl1 out of gl2draw.pyx. 2019-07-08 02:28:27 -04:00
Tom Rothamel 0faf7810f6 Include gl2 and matrix in the built distributions. 2019-07-07 20:16:53 -04:00
Tom Rothamel bd333803b2 gl2: Log shader cache errors. 2019-07-06 15:04:25 -04:00
Tom Rothamel f24e3f199e gl2: Add modules from glexperiment into Ren'Py. 2019-07-06 03:07:38 -04:00
Tom Rothamel 13a755ae93 IF a pure-python module can't be parsed as utf-8, try it as latin-1. 2019-07-05 22:05:46 -04:00
Tom Rothamel a907cfaa2e Remove gl2 blacklist.
It was not used.
2019-07-05 20:33:34 -04:00
Tom Rothamel b236453972 Convert from using a 2x2 matrix to a 4x4 matrix.
This will eventually let us represent z-rotations
and translations using matrices.
2019-07-05 13:10:47 -04:00
Tom Rothamel 95fe225a8c Merge pull request #1921 from Beuc/sigttin
rapt: prevent gradle from stopping Ren'Py when run in the background
2019-07-04 10:19:39 -04:00
Sylvain Beucler 621fbe9449 rapt: prevent gradle from stopping Ren'Py when run in the background 2019-07-04 15:57:02 +02:00
Tom Rothamel f6029db185 Avoid a with None before a say attribute transition with a layer.
As this would make the transition moot.
2019-07-03 22:23:09 -04:00
Tom Rothamel 38f8e1f16f Document config.keyword_after_python as an incompatible change. 2019-07-02 23:06:01 -04:00
Tom Rothamel ca95350b70 Bump version. 2019-07-02 19:42:21 -04:00
Sylvain Beucler 985b54d284 web: avoid encoding issues in non-UTF-8 environments
e.g. windows korean, cf. renpyweb issue 1
2019-07-02 22:39:30 +02:00
Tom Rothamel 5664e29c7d Sponsor doc. 2019-07-01 22:17:03 -04:00
Tom Rothamel ae61f801f8 Update changelog. 2019-07-01 22:15:40 -04:00
Tom Rothamel cac70f9544 Merge pull request #1915 from Moshibit/master
correction in spanish translation
2019-07-01 22:00:53 -04:00
Tom Rothamel 45b792b4bd Only emulate the platform if asked.
Fixes #1917.
2019-07-01 21:58:33 -04:00
Tom Rothamel 97f578baac Bump version. 2019-07-01 21:14:02 -04:00
Tom Rothamel 2d9c8565be Automatically tag renpyweb. 2019-06-30 23:34:49 -04:00
Tom Rothamel a4596ecfbc Update changelog. 2019-06-30 23:21:09 -04:00
Tom Rothamel 740400db2c Make the preload thread actually do something.
Fixes #1890.
2019-06-30 23:09:05 -04:00
Tom Rothamel b1c6a3a16d Update keywords. 2019-06-30 22:45:44 -04:00
Moshibit 0f90a189f3 Merge pull request #2 from renpy/master
a
2019-06-30 17:49:04 -05:00
Tom Rothamel d427968170 Fix and update translations. 2019-06-30 01:50:00 -04:00
Tom Rothamel 673b1fcb4a Update changelog and sponsor docs. 2019-06-29 22:58:56 -04:00
Tom Rothamel 9a6f7f3975 sl2: Do not update scopes in used screens.
This is a much simpler fix for the problem in a1dd218560,
which is that the wrong scope will be given in a used screen that happens to be
constant.

The realization is that if a used screen is constant, it can't change - and hence
it doesn't need to be given a new scope at all.
2019-06-29 03:04:30 -04:00
Tom Rothamel af5e885e17 Revert "sl2: Store the scopes to provide them to _scope."
This reverts commit a1dd218560.
2019-06-29 02:46:54 -04:00
Tom Rothamel af0314885b Revert "Fix issues with screens and scopes."
This reverts commit df8f27f0d0.
2019-06-29 02:45:50 -04:00
Tom Rothamel e76411a6c9 Merge pull request #1900 from lee-yunseok/lee-yunseok
Update Korean strings.
2019-06-28 16:53:56 -04:00
Tom Rothamel bf9b60aa59 Merge pull request #1910 from Andykl/fixes
Update Russian
2019-06-28 16:53:38 -04:00
Moshibit d9aa172882 Merge pull request #1 from renpy/master
Fix issues with screens and scopes.
2019-06-27 22:08:14 -05:00
Moshibit 79a67705f1 correction 2019-06-27 22:04:06 -05:00
Tom Rothamel df8f27f0d0 Fix issues with screens and scopes.
Fixes #1905, where several bugs got collected into one place. The
main problem is that we need to store the actual values of
non-constant variables that, for example, change durting iteration,
while at the same time allowing things that use the scope to
update when the screen scope changes (from new parameters, or
something like SetScreenVairable).

This uses a method (scope_changed, similar to copy_on_change) to
take things that use the scope out of the cache when a scope change
happens.
2019-06-27 21:44:44 -04:00
Andy_kl d85241bfa7 Update Russian 2019-06-27 11:32:31 +03:00
Tom Rothamel c5cf467274 Fix spurious spaces in Spanish translation.
Fixes #1906.
2019-06-26 21:31:14 -04:00
Tom Rothamel 641a1b4f99 Fix None error in 8c36a9a4a5. 2019-06-25 22:29:14 -04:00
Tom Rothamel 01a0b6ed42 Always initialize the sound system.
To ensure silent movies can play, even if sounds aren't involved.

Fixes #1901.
2019-06-25 20:56:11 -04:00
Tom Rothamel 8c36a9a4a5 Fix double duplication in Transform.
Fixes #1903.
2019-06-25 20:49:22 -04:00
Tom Rothamel bfeb11a7be Merge pull request #1902 from Andykl/has-subblock
Added Lexer.has_subblock method.
2019-06-25 20:33:27 -04:00
Tom Rothamel f937f4bf42 Improve descriptive text.
- Move it to 00acessibility.rpy, where I can find it.
- sv -> alt (The old name still works.)
- Allow the creator to supply a character that's used to display
  descriptive text.
2019-06-25 01:52:14 -04:00
Tom Rothamel ba9accfd5e Process text tags when self_closing_custom_text_tags is set.
The check hadn't included that, which means that text tags would
not be processed when self_closing_custom_text_tags was set, and
custom_text_tags was not.
2019-06-24 19:28:53 -04:00
Andy_kl 0ca1f3ef66 Added Lexer.has_subblock method. 2019-06-24 23:31:40 +03:00
Lee Yunseok d19148f282 Fix typo. 2019-06-24 18:51:07 +09:00
Lee Yunseok 72d7b9ba59 Fix 2019-06-24 18:33:24 +09:00
Lee Yunseok 6231ffe2f3 Update Korean translation for renpyweb. 2019-06-24 18:09:41 +09:00
Lee Yunseok 097c24b140 Korean translation for accessibility in Tutorial, The Question. 2019-06-24 18:09:06 +09:00
Tom Rothamel c49f697b4d Avoid runing the gl test on a restart.
This prevents a with_none call that broke config.end_game_transition.
2019-06-23 10:42:16 -04:00
Tom Rothamel 8fc5225985 focus: Prioritize the highest default_focus value. 2019-06-22 14:59:49 -04:00
Tom Rothamel ac60c3ec9e To fix a conflict, replace default with default_focus. 2019-06-22 13:23:45 -04:00
pionere 7d655595e0 prevent crash when get_selected is called on a non-existent field
A field (especially a global Variable) might not exists at the beginning of the interaction. This causes the application to crash e.g. if the variable is set on the 'action' of a button.
The solution is that the get_selected returns False if the given field does not exists at the moment.
2019-06-22 14:35:41 +02:00
Tom Rothamel 6165d4aa11 Remove 'set' from the list of Ren'Py keywords.
It's used often in Python and expressions, and rarely in
Ren'Py.
2019-06-21 19:10:37 -04:00
Tom Rothamel 5e717b9bbe Improvements to rt run.
* The command is run with os.exec, so that ctrl-C can trigger
  a traceback.
* Command line arguments are passed to rt run in the right order.
2019-06-21 19:10:14 -04:00
Tom Rothamel 90b2f69876 Merge pull request #1897 from Andykl/fix-flatten
Flatten passing the position from child.
2019-06-20 17:18:40 -04:00
Andy_kl adbb05c99d Flatten passing the position from child. 2019-06-20 22:26:57 +03:00
Tom Rothamel ce2b11e7cf Add a random number generator that supports Rollback.
This is now returned by renpy.random.Random, and ensures the
numbers returned by it are deterministic.

Fixes #1893.
2019-06-20 09:58:06 -04:00
Tom Rothamel ae4369d223 Fix bad path to render_for_size. 2019-06-19 15:49:55 -04:00
Tom Rothamel 9a2cf214dc Properly generate the nvl clear UserStatement.
Fixes #1888.
2019-06-19 15:40:38 -04:00
Tom Rothamel 2ac606980a Add a function to render in sizing mode.
This doesn't catch the rendering that's done in sizing mode, but
reuses renders that are already cached at the same size.
2019-06-18 20:17:48 -04:00
Andy_kl 669a25d530 Receive a layer from default_layer in all exports funcs 2019-06-18 22:51:54 +03:00
Tom Rothamel f89de7e332 Set the platform as part of the emulator. 2019-06-17 19:32:21 -04:00
Tom Rothamel 2f12cdf843 Distinguish real and emulated platform.
This is to prep for a change where the emulator can set the platform,
so renpy.android is true under the android emulator.
2019-06-17 19:29:48 -04:00
Tom Rothamel c0ed44651c Pass the text input rectangle through subsurface. 2019-06-17 18:36:16 -04:00
Tom Rothamel ecbe0952c8 Fix the {clear} tag.
There was a regression caused by the UserStatement changes.
2019-06-17 00:03:01 -04:00
Tom Rothamel e48f24d8d1 Bump version. 2019-06-16 19:38:50 -04:00
Tom Rothamel e8b50d55f3 Add an example of a gallery button that's always unlocked.
Per discussion in 1887.
2019-06-16 16:06:52 -04:00
Tom Rothamel fbcdfe8561 Document that Showif creates a displayable.
Addresses #1886.
2019-06-16 13:38:46 -04:00
Tom Rothamel 99524a1033 sl2: Allow a has statement after an if statement with no children.
Addresses #1886.
2019-06-16 13:26:47 -04:00
Tom Rothamel 9781c0d07e Fix spurious spaces in the_question. 2019-06-16 11:58:58 -04:00
Tom Rothamel c09d0142df Package web-presplash.{jpg,png}, ignore oyua_icon.png. 2019-06-16 11:26:25 -04:00
Tom Rothamel 5bb8ae6772 Clean up translations. 2019-06-15 20:57:12 -04:00
Tom Rothamel 7c48ffc3f3 Updateyay igpay atinlay. 2019-06-15 20:56:13 -04:00
Tom Rothamel efec9192b7 Fix spacing. 2019-06-15 20:54:25 -04:00
Tom Rothamel 12b0decd15 Merge pull request #1885 from Moshibit/master
Update common.rpy
2019-06-15 19:54:37 -04:00
Moshibit c0185751d6 Update common.rpy 2019-06-15 18:47:30 -05:00
Moshibit fc06af1d93 Update common.rpy 2019-06-15 18:46:51 -05:00
Moshibit e44d6d14c3 Update common.rpy 2019-06-15 18:41:47 -05:00
Moshibit 7aae8c506f Update common.rpy 2019-06-15 18:31:47 -05:00
Tom Rothamel 2d47ae004e Merge pull request #1884 from Moshibit/master
accessibility message changed to translatable string
2019-06-15 19:11:13 -04:00
Moshibit 148c74a312 change to translatable string 2019-06-15 18:05:30 -05:00
Tom Rothamel 1c34d0643e Merge pull request #1883 from Moshibit/master
corrections in the Spanish translation
2019-06-15 18:53:27 -04:00
Moshibit 196517ac34 Update launcher.rpy 2019-06-15 17:49:24 -05:00
Moshibit 041832a573 Add files via upload 2019-06-15 17:34:28 -05:00
Moshibit 8533a6e089 Add files via upload 2019-06-15 17:32:36 -05:00
Moshibit 610a13bf20 Add files via upload 2019-06-15 17:31:22 -05:00
Tom Rothamel 3e2fbe4554 Screen sensitivity passes timer events.
Fixes #1882.
2019-06-15 11:58:21 -04:00
Tom Rothamel 038ea8fee2 Merge pull request #1880 from mal/screen-sensitivity-scope
Use scope when evalling screen sensitivity
2019-06-15 10:58:39 -04:00
Tom Rothamel f97dc0c0f0 Merge pull request #1881 from Andykl/fix-sluse-report
More sensitive report about inexistent screen in sl use expression
2019-06-15 10:58:11 -04:00
Andy_kl b064ea9a82 More sensitive report about inexistent screen in sl use expression 2019-06-15 17:56:55 +03:00
Mal Graty 3fc13fad93 Use scope when evalling screen sensitivity 2019-06-15 15:49:23 +01:00
Tom Rothamel d86d188dc8 Fix documentation and update sponsors doc. 2019-06-15 00:21:44 -04:00
Tom Rothamel 71beb64a4a Document that tooltip requires equality. 2019-06-14 17:12:53 -04:00
Tom Rothamel 6b27321496 Tweak the error message for a Side with the wrong number of children. 2019-06-13 23:26:06 -04:00
Tom Rothamel 1446c2b31d Merge pull request #1874 from Andykl/fix-side-mistake
Raise exception if Side not completely full at the render
2019-06-13 21:24:29 -04:00
Tom Rothamel 97b844cd9b Merge pull request #1876 from Andykl/fix-adjustment-bug
Fix adjustment bug
2019-06-13 21:23:36 -04:00
Andy_kl a17f63368b Do not redraw if we are sizing 2019-06-13 10:31:48 +03:00
Andy_kl 1bc3945f1d Kill the render is the right way. 2019-06-13 10:28:41 +03:00
Andy_kl 884b7901bf Raise exception if Side not completely full at the render 2019-06-12 08:49:30 +03:00
Tom Rothamel acc48b08ae Avoid redrawing when fixing a per-frame render.
Fixes #1869.
2019-06-11 02:47:34 -04:00
Tom Rothamel b24a2b06db Fix code-typo.
Fixes #1871.
2019-06-10 22:36:50 -04:00
Tom Rothamel ae402797cf Update changelog. 2019-06-09 22:41:45 -04:00
Tom Rothamel 51c726f736 Update changelog. 2019-06-09 22:40:38 -04:00
Tom Rothamel c8cc2b0353 Use a Window's minimums to determine the width and height of its children.
See https://lemmasoft.renai.us/forums/viewtopic.php?f=32&t=55574
2019-06-09 22:33:17 -04:00
Tom Rothamel dd7cdea0c2 Check in updated keywords. 2019-06-09 22:32:58 -04:00
Tom Rothamel ff59a3060d Apply AdjustTimes to images displayed in the gallery.
This makes sure that any ATL or other transforms start running from
the frame where the image is first shown.

Fixes #1867.
2019-06-09 21:39:51 -04:00
Tom Rothamel ae123b383a Fix local variable masking global variable. 2019-06-09 21:08:49 -04:00
Tom Rothamel 1175e65552 Proxy get_tooltip from Confirm to its yes action. 2019-06-09 20:50:10 -04:00
Tom Rothamel a1c1c15a3c Disallow style properties on tooltips. 2019-06-09 20:35:03 -04:00
Tom Rothamel 8d7236b32e cds: Pass the label of the next statement to predict_next.
This is necessary to properly emulate a conditional statement,
where we might go directly to the next statement.
2019-06-09 20:20:38 -04:00
Tom Rothamel 718628e48a Add a get_tooltip method to Action and BarValue.
This allows actions to supply tooltips to buttons and bars,
keeping that logic in one place. Per #1868.
2019-06-09 20:14:32 -04:00
Tom Rothamel 75f666479c Fix prediction problems in character.
Fixes #1853.
2019-06-09 00:00:09 -04:00
Tom Rothamel 63f2f9db47 Make sure we can't save between a menu and it's dialogue.
Fixes #1861.
2019-06-08 23:41:31 -04:00
Tom Rothamel 3c3c8963a3 Document narration and display_menu.
Fixes #1863.
2019-06-08 23:17:37 -04:00
Tom Rothamel 0399767528 cds: Fix prediction.
Fixes #1864.
2019-06-08 23:00:21 -04:00
Tom Rothamel c4ee0e8e5d cds: Allow lexer.renpy_block to deal with empty blocks.
Either by reporting the error, or by creating a block with a pass
statement.
2019-06-08 22:44:14 -04:00
Tom Rothamel 36ed61735d Merge pull request #1862 from Andykl/return-statement-argument
Added return value argument to renpy.return_statement
2019-06-08 19:13:33 -04:00
Tom Rothamel 4af01f3192 Avoid the repeated setting of adjustments when siding for a side.
Fixes #1858.
2019-06-08 01:42:44 -04:00
Tom Rothamel a72e17baea Document android input change. 2019-06-07 23:28:48 -04:00
Tom Rothamel 88728c932c Merge pull request #1855 from nyaatrap/master
Update Japanese
2019-06-06 22:50:46 -04:00
Andy_kl 298bf1d1c3 Added return value argument to renpy.return_statement 2019-06-06 22:01:37 +03:00
Beuc 59cc091828 Typo 2019-06-06 11:19:47 +02:00
Beuc 6aa9d6b920 Typo 2019-06-06 11:18:22 +02:00
Tom Rothamel 3241176e8f Ensure that the render_cache is updated after invalidation.
Before this change, if an invaidation was to occur mid-render,
it was possible the new render would not be added to the cache.

Fixes #1856.

This also defers invalidation when a redraw is going to happen.
2019-06-05 00:56:24 -04:00
Tom Rothamel 0d4d5f6621 accessibility: Cache the opendyslexic font group.
This makes displaying opendyslexic much faster.

Fixes #1857.
2019-06-04 19:16:04 -04:00
nyaatraps badb0e7803 Update Japanese 2019-06-04 17:34:52 +09:00
215 changed files with 16010 additions and 16025 deletions
+2
View File
@@ -82,3 +82,5 @@ sphinx/source/inc
sphinx/source/thequestion.rst
tutorial/game/tutorial_director.rpy
launcher/theme
module/emscripten-static/
web/
+1 -1
View File
@@ -124,7 +124,7 @@ not edit the files in sphinx/source/inc directly, as they will be overwritten.
Docstrings may include tags on the first few lines:
\:doc: `section` `kind`
Indicates that this functions should be documented. `section` gives
Indicates that this function should be documented. `section` gives
the name of the include file the function will be documented in, while
`kind` indicates the kind of object to be documented (one of ``function``,
``method`` or ``class``. If omitted, `kind` will be auto-detected.
+1
View File
@@ -14,6 +14,7 @@ SOURCE = [
"/home/tom/ab/ripe/renios",
"/home/tom/ab/renpy-deps",
"/home/tom/ab/pygame_sdl2",
"/home/tom/ab/renpyweb",
]
version = ".".join(str(i) for i in version_tuple)
+11 -2
View File
@@ -9,6 +9,7 @@ import compileall
import shutil
import subprocess
import argparse
import time
if not sys.flags.optimize:
raise Exception("Optimization disabled.")
@@ -43,6 +44,8 @@ def copy_tutorial_file(src, dest):
def main():
start = time.time()
if not sys.flags.optimize:
raise Exception("Not running with python optimization.")
@@ -54,6 +57,7 @@ def main():
ap.add_argument("--variant", action="store")
ap.add_argument("--sign", action="store_true", default=True)
ap.add_argument("--nosign", action="store_false", dest="sign")
ap.add_argument("--notarized", action="store_true", dest="notarized")
ap.add_argument("--vc-version-only", action="store_true")
args = ap.parse_args()
@@ -175,6 +179,12 @@ def main():
destination,
]
if args.notarized:
cmd.extend([
"--macapp",
"notarized/out",
])
print()
subprocess.check_call(cmd)
@@ -250,8 +260,7 @@ def main():
print()
if not (args.fast or args.sign):
print("For a final-ish release, remember to use --sign so we're signed on the mac.")
print("Distribute took {:.0f} seconds.".format(time.time() - start))
if __name__ == "__main__":
-6
View File
@@ -199,12 +199,6 @@ init python:
build.documentation('*.html')
build.documentation('*.txt')
## Set this to a string containing your Apple Developer ID Application
## to enable codesigning on the Mac. Be sure to change it to your own
## Apple-issued ID.
# define build.mac_identity = "Developer ID Application: Guy Shy (XHTE5H7Z42)"
## A Google Play license key is required to download expansion files and
## perform in-app purchases. It can be found on the "Services & APIs" page
+5 -3
View File
@@ -323,12 +323,14 @@ screen navigation():
textbutton _("About") action ShowMenu("about")
if renpy.variant("pc"):
if renpy.variant("pc") or (renpy.variant("web") and not renpy.variant("mobile")):
## Help isn't necessary or relevant to mobile devices.
textbutton _("Help") action ShowMenu("help")
## The quit button is banned on iOS and unnecessary on Android.
if renpy.variant("pc"):
## The quit button is banned on iOS and unnecessary on Android and Web.
textbutton _("Quit") action Quit(confirm=not main_menu)
@@ -725,7 +727,7 @@ screen preferences():
hbox:
box_wrap True
if renpy.variant("pc"):
if renpy.variant("pc") or renpy.variant("web"):
vbox:
style_prefix "radio"
+26 -12
View File
@@ -373,7 +373,7 @@ init python in distribute:
This manages the process of building distributions.
"""
def __init__(self, project, destination=None, reporter=None, packages=None, build_update=True, open_directory=False, noarchive=False, packagedest=None, report_success=True, scan=True):
def __init__(self, project, destination=None, reporter=None, packages=None, build_update=True, open_directory=False, noarchive=False, packagedest=None, report_success=True, scan=True, macapp=None):
"""
Distributes `project`.
@@ -404,6 +404,10 @@ init python in distribute:
`report_success`
If true, we report that the build succeeded.
`macapp`
If given, the path to a macapp that's used instead of
the macapp
"""
# A map from a package to a unique update version hash.
@@ -437,6 +441,9 @@ init python in distribute:
# Logfile.
self.log = open(self.temp_filename("distribute.txt"), "w")
# The path to the mac app.
self.macapp = macapp
# Start by scanning the project, to get the data and build
# dictionaries.
data = project.data
@@ -1059,6 +1066,9 @@ init python in distribute:
Signs the mac app contained in appzip.
"""
if self.macapp:
return self.rescan(fl, self.macapp)
identity = self.build.get('mac_identity', None)
if identity is None:
@@ -1094,6 +1104,7 @@ init python in distribute:
self.build["mac_codesign_command"],
identity=identity,
app=os.path.join(dn, self.app),
entitlements=os.path.join(config.gamedir, "entitlements.plist"),
)
# Rescan the signed app.
@@ -1109,7 +1120,7 @@ init python in distribute:
identity = self.build.get('mac_identity', None)
if identity is None:
raise Exception("Creating an unsigned DMG is not supported. Please set build.mac_identity.")
identity = ''
self.run(
_("Creating the Macintosh DMG..."),
@@ -1120,14 +1131,16 @@ init python in distribute:
dmg=dmg,
)
self.run(
_("Signing the Macintosh DMG..."),
self.build["mac_codesign_dmg_command"],
identity=identity,
volname=volname,
sourcedir=sourcedir,
dmg=dmg,
)
if self.build.get("mac_codesign_dmg_command", None):
self.run(
_("Signing the Macintosh DMG..."),
self.build["mac_codesign_dmg_command"],
identity=identity,
volname=volname,
sourcedir=sourcedir,
dmg=dmg,
)
def prepare_file_list(self, format, file_lists):
"""
@@ -1265,7 +1278,7 @@ init python in distribute:
file_hash, old_fl_hash = self.build_cache.get(full_filename, ("", ""))
if (not directory) and old_fl_hash == fl_hash:
if (not directory) and (old_fl_hash == fl_hash) and not(self.build['renpy'] and (variant == "sdk")):
if file_hash:
self.build_cache[full_filename] = (file_hash, fl_hash)
@@ -1476,6 +1489,7 @@ init python in distribute:
ap.add_argument("--no-update", default=True, action="store_false", dest="build_update", help="Prevents updates from being built.")
ap.add_argument("--package", action="append", help="If given, a package to build. Defaults to building all packages.")
ap.add_argument("--no-archive", action="store_true", help="If given, files will not be added to archives.")
ap.add_argument("--macapp", default=None, action="store", help="If given, the path to a signed and notarized mac app.")
ap.add_argument("project", help="The path to the project directory.")
args = ap.parse_args()
@@ -1487,7 +1501,7 @@ init python in distribute:
else:
packages = None
Distributor(p, destination=args.destination, reporter=TextReporter(), packages=packages, build_update=args.build_update, noarchive=args.no_archive, packagedest=args.packagedest)
Distributor(p, destination=args.destination, reporter=TextReporter(), packages=packages, build_update=args.build_update, noarchive=args.no_archive, packagedest=args.packagedest, macapp=args.macapp)
return False
+1 -1
View File
@@ -27,7 +27,7 @@ init python:
platform = "windows-amd64"
exe = "butler.exe"
elif renpy.macintosh:
plaform = "darwin-amd64"
platform = "darwin-amd64"
exe = "butler"
else:
platform = "linux-amd64"
+5 -3
View File
@@ -190,11 +190,12 @@ init -1 python:
interface.processing(self.info_msg, show_screen=True, cancel=cancel_action)
kwargs = { }
if yes:
kwargs["stdin"] = subprocess.PIPE
try:
self.process = subprocess.Popen(cmd, cwd=renpy.fsencode(RAPT_PATH), stdout=f, stderr=f, startupinfo=startupinfo, **kwargs)
self.process = subprocess.Popen(cmd, cwd=renpy.fsencode(RAPT_PATH), stdout=f, stderr=f, stdin=subprocess.PIPE, startupinfo=startupinfo, **kwargs)
# avoid SIGTTIN caused by e.g. gradle doing empty read on terminal stdin
if not yes:
self.process.stdin.close()
except:
import traceback
traceback.print_exc(file=f)
@@ -215,6 +216,7 @@ init -1 python:
if yes and self.yes_thread:
self.run_yes = False
self.yes_thread.join()
self.process.stdin.close()
self.process = None
self.yes_thread = None
+15 -12
View File
@@ -28,10 +28,17 @@ init python in distribute:
import struct
import stat
import shutil
import sys
import threading
from renpy import six
from zipfile import crc32
# Since the long type doesn't exist on py3, define it here
if six.PY3:
long = int
zlib.Z_DEFAULT_COMPRESSION = 5
class ZipFile(zipfile.ZipFile):
@@ -156,9 +163,9 @@ init python in distribute:
zi.create_system = 3
if xbit:
zi.external_attr = long(0100755) << 16
zi.external_attr = long(0o100755) << 16
else:
zi.external_attr = long(0100644) << 16
zi.external_attr = long(0o100644) << 16
self.zipfile.write_with_info(zi, path)
@@ -170,7 +177,7 @@ init python in distribute:
zi.date_time = self.get_date_time(path)
zi.compress_type = zipfile.ZIP_STORED
zi.create_system = 3
zi.external_attr = (long(0040755) << 16) | 0x10
zi.external_attr = (long(0o040755) << 16) | 0x10
self.zipfile.write_with_info(zi, path)
@@ -201,9 +208,9 @@ init python in distribute:
info.type = tarfile.DIRTYPE
if xbit:
info.mode = 0755
info.mode = 0o755
else:
info.mode = 0644
info.mode = 0o644
info.uid = 1000
info.gid = 1000
@@ -267,7 +274,7 @@ init python in distribute:
def mkdir(self, path):
if not os.path.isdir(path):
os.makedirs(path, 0755)
os.makedirs(path, 0o755)
def __init__(self, path):
self.path = path
@@ -282,9 +289,9 @@ init python in distribute:
shutil.copy2(path, fn)
if xbit:
os.chmod(fn, 0755)
os.chmod(fn, 0o755)
else:
os.chmod(fn, 0644)
os.chmod(fn, 0o644)
def add_directory(self, name, path):
fn = os.path.join(self.path, name)
@@ -396,7 +403,3 @@ init python in distribute:
for i in parallel_threads:
if i.done:
i.done()
+18 -11
View File
@@ -55,6 +55,13 @@ import math
import exceptions
import string
import array
from renpy import six
# Since the long type doesn't exist on py3, define it here
if six.PY3:
long = int
sha1, sha256, sha512, md5 = None, None, None, None
@@ -85,8 +92,8 @@ IMAGE_OS2_SIGNATURE_LE = 0x454C
IMAGE_VXD_SIGNATURE = 0x454C
IMAGE_NT_SIGNATURE = 0x00004550
IMAGE_NUMBEROF_DIRECTORY_ENTRIES= 16
IMAGE_ORDINAL_FLAG = 0x80000000L
IMAGE_ORDINAL_FLAG64 = 0x8000000000000000L
IMAGE_ORDINAL_FLAG = 0x80000000
IMAGE_ORDINAL_FLAG64 = long(0x8000000000000000)
OPTIONAL_HEADER_MAGIC_PE = 0x10b
OPTIONAL_HEADER_MAGIC_PE_PLUS = 0x20b
@@ -169,7 +176,7 @@ section_characteristics = [
('IMAGE_SCN_MEM_SHARED', 0x10000000),
('IMAGE_SCN_MEM_EXECUTE', 0x20000000),
('IMAGE_SCN_MEM_READ', 0x40000000),
('IMAGE_SCN_MEM_WRITE', 0x80000000L) ]
('IMAGE_SCN_MEM_WRITE', 0x80000000) ]
SECTION_CHARACTERISTICS = dict([(e[1], e[0]) for e in
section_characteristics]+section_characteristics)
@@ -816,7 +823,7 @@ class Structure:
for key in keys:
val = getattr(self, key)
if isinstance(val, int) or isinstance(val, long):
if isinstance(val, six.integer_types):
val_str = '0x%-8X' % (val)
if key == 'TimeDateStamp' or key == 'dwTimeStamp':
try:
@@ -1557,7 +1564,7 @@ class PE:
'Normal values are never larger than 0x10, the value is: 0x%x' %
self.OPTIONAL_HEADER.NumberOfRvaAndSizes )
for i in xrange(int(0x7fffffffL & self.OPTIONAL_HEADER.NumberOfRvaAndSizes)):
for i in xrange(int(0x7fffffff & self.OPTIONAL_HEADER.NumberOfRvaAndSizes)):
if len(self.__data__[offset:]) == 0:
break
@@ -2355,13 +2362,13 @@ class PE:
return None
#resource.NameIsString = (resource.Name & 0x80000000L) >> 31
resource.NameOffset = resource.Name & 0x7FFFFFFFL
resource.NameOffset = resource.Name & 0x7FFFFFFF
resource.__pad = resource.Name & 0xFFFF0000L
resource.Id = resource.Name & 0x0000FFFFL
resource.__pad = resource.Name & 0xFFFF0000
resource.Id = resource.Name & 0x0000FFFF
resource.DataIsDirectory = (resource.OffsetToData & 0x80000000L) >> 31
resource.OffsetToDirectory = resource.OffsetToData & 0x7FFFFFFFL
resource.DataIsDirectory = (resource.OffsetToData & 0x80000000) >> 31
resource.OffsetToDirectory = resource.OffsetToData & 0x7FFFFFFF
return resource
@@ -2683,7 +2690,7 @@ class PE:
raw_data[varword_offset+2:varword_offset+4], 0)
varword_offset += 4
if isinstance(word1, (int, long)) and isinstance(word1, (int, long)):
if isinstance(word1, six.integer_types):
var_struct.entry = {var_string: '0x%04x 0x%04x' % (word1, word2)}
var_offset = self.dword_align(
+80
View File
@@ -694,3 +694,83 @@ translate japanese strings:
old "Image cache: [cache_pct:.1f]% ([cache_size_mb:.1f] MB)"
new "イメージキャッシュ: [cache_pct:.1f]% ([cache_size_mb:.1f] MB)"
# renpy/common/00accessibility.rpy:76
old "Font Override"
new "フォントオーバーライド"
# renpy/common/00accessibility.rpy:80
old "Default"
new "デフォルト"
# renpy/common/00accessibility.rpy:84
old "DejaVu Sans"
new "DejaVu Sans"
# renpy/common/00accessibility.rpy:88
old "Opendyslexic"
new "Opendyslexic"
# renpy/common/00accessibility.rpy:94
old "Text Size Scaling"
new "テキストサイズのスケーリング"
# renpy/common/00accessibility.rpy:100
old "Reset"
new "リセット"
# renpy/common/00accessibility.rpy:105
old "Line Spacing Scaling"
new "行間のスケーリング"
# renpy/common/00accessibility.rpy:117
old "Self-Voicing"
new "セルフボイシング"
# renpy/common/00accessibility.rpy:121
old "Off"
new "オフ"
# renpy/common/00accessibility.rpy:125
old "Text-to-speech"
new "テキストを読む"
# renpy/common/00accessibility.rpy:129
old "Clipboard"
new "クリップボード"
# renpy/common/00accessibility.rpy:133
old "Debug"
new "デバッグ"
# renpy/common/00preferences.rpy:430
old "font transform"
new "フォント変換"
# renpy/common/00preferences.rpy:433
old "font size"
new "フォントサイズ"
# renpy/common/00preferences.rpy:441
old "font line spacing"
new "フォントの行間"
# renpy/common/_developer/developer.rpym:63
old "Image Attributes"
new "画像属性"
# renpy/common/_developer/developer.rpym:90
old "[name] [attributes] (hidden)"
new "[name] [attributes] (hidden)"
# renpy/common/_developer/developer.rpym:94
old "[name] [attributes]"
new "[name] [attributes]"
# renpy/common/_developer/developer.rpym:154
old "Hide deleted"
new "消去済みを隠す"
# renpy/common/_developer/developer.rpym:154
old "Show deleted"
new "消去済みを表示する"
+8
View File
@@ -177,3 +177,11 @@ translate japanese strings:
old "jump <label>: jumps to label"
new "jump <ラベル>: ラベルにジャンプ"
# renpy/common/00console.rpy:685
old "short: Shorten the representation of objects on the console (default)."
new "short: コンソール上のオブジェクトを短く表現する(デフォルト)"
# renpy/common/00console.rpy:690
old "long: Print the full representation of objects on the console."
new "long: コンソール上のオブジェクトを全て表現する"
+24
View File
@@ -235,3 +235,27 @@ translate japanese strings:
old "Tearing"
new "ティアリング"
# renpy/common/_errorhandling.rpym:542
old "Copy BBCode"
new "BBCode でコピー"
# renpy/common/_errorhandling.rpym:544
old "Copies the traceback.txt file to the clipboard as BBcode for forums like https://lemmasoft.renai.us/."
new "クリップボードに traceback.txt を https://lemmasoft.renai.us/ 等のフォーラムに適した BBcode 形式でコピーする。"
# renpy/common/_errorhandling.rpym:546
old "Copy Markdown"
new "Markdown でコピー"
# renpy/common/_errorhandling.rpym:548
old "Copies the traceback.txt file to the clipboard as Markdown for Discord."
new "クリップボードに traceback.txt を Discord に適した Markdown 形式でコピーする。"
# renpy/common/_errorhandling.rpym:683
old "Copies the errors.txt file to the clipboard as BBcode for forums like https://lemmasoft.renai.us/."
new "クリップボードに errors.txt を https://lemmasoft.renai.us/ 等のフォーラムに適した BBcode 形式でコピーする。"
# renpy/common/_errorhandling.rpym:687
old "Copies the errors.txt file to the clipboard as Markdown for Discord."
new "クリップボードに errors.txt を Discord に適した Markdown 形式でコピーする。"
+380 -4
View File
@@ -51,7 +51,7 @@ translate japanese strings:
# android.rpy:35
old "Choose \"Build\" to build the current project, or attach an Android device and choose \"Build & Install\" to build and install it on the device."
new "「ビルド」を選択して現在のプロジェクトをビルドするか、Android デバイスを接続して「ビルド & インストール」を選択し、ビルド後そのデバイスにインストールしてください。"
new "「ビルド」を選択して現在のプロジェクトをビルドするか、Android デバイスを接続して「ビルドインストール」を選択し、そのデバイスにインストールしてください。"
# android.rpy:37
old "Attempts to emulate an Android phone.\n\nTouch input is emulated through the mouse, but only when the button is held down. Escape is mapped to the menu button, and PageUp is mapped to the back button."
@@ -135,7 +135,7 @@ translate japanese strings:
# android.rpy:365
old "Configure"
new "設定"
new "構成の設定"
# android.rpy:369
old "Build Package"
@@ -143,7 +143,7 @@ translate japanese strings:
# android.rpy:373
old "Build & Install"
new "ビルド & インストール"
new "ビルドインストール"
# android.rpy:377
old "Build, Install & Launch"
@@ -623,7 +623,7 @@ translate japanese strings:
# interface.rpy:386
old "File and directory names must consist of ASCII characters."
new "ファイル、ディレクトリー名はアスキーコードの文字列で構成される必要があります。"
new "ファイル、ディレクトリー名はアスキーコードの文字列でなければなりません。"
# interface.rpy:454
old "PROCESSING"
@@ -1321,3 +1321,379 @@ translate japanese strings:
# front_page.rpy:221
old "Actions"
new "アクション"
translate japanese strings:
# game/add_file.rpy:37
old "The file name may not be empty."
new "ファイル名が与えられていません。"
# game/android.rpy:31
old "A 64-bit/x64 Java 8 Development Kit is required to build Android packages on Windows. The JDK is different from the JRE, so it's possible you have Java without having the JDK.\n\nPlease {a=http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html}download and install the JDK{/a}, then restart the Ren'Py launcher."
new "ウィンドウズでアンドロイドパッケージをビルドするには、 64-bit/x64 Java 8 Development Kit が必要になります。 JDK は JRE とは違うもので、Java には含まれていません。\n\n{a=http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html}から JDK をダンロードしてインストールし{/a}、それから Ren'Py ランチャーを再起動してください。"
# game/android.rpy:50
old "Selects the Debug build, which can be accessed through Android Studio. Changing between debug and release builds requires an uninstall from your device."
new "Android Studio からアクセスできるデバッグビルドを選択する。 デバッグビルドとリリースビルドを切り替えるには、デバイスからアンインストールする必要があります。"
# game/android.rpy:51
old "Selects the Release build, which can be uploaded to stores. Changing between debug and release builds requires an uninstall from your device."
new "ストアへアップロード可能なリリースビルドを選択する。 デバッグビルドとリリースビルドを切り替えるには、デバイスからアンインストールする必要があります。"
# game/androidstrings.rpy:7
old "{} is not a directory."
new "{} はディレクトリーではありません。"
# game/androidstrings.rpy:8
old "{} does not contain a Ren'Py game."
new "{} に Ren'Py のゲームは含まれていません。"
# game/androidstrings.rpy:9
old "Run configure before attempting to build the app."
new "アプリをビルドする前に構成を変更する。"
# game/androidstrings.rpy:10
old "Google Play support is enabled, but build.google_play_key is not defined."
new "Google Play サポートは有効になりましたが、 build.google_play_key が定義されていません。"
# game/androidstrings.rpy:11
old "Updating project."
new "プロジェクトを更新しています。"
# game/androidstrings.rpy:12
old "Creating assets directory."
new "アセットディレクトリーを作成しています"
# game/androidstrings.rpy:13
old "Creating expansion file."
new "拡張ファイルを作成しています。"
# game/androidstrings.rpy:14
old "Packaging internal data."
new "内部データをパッケージングしています。"
# game/androidstrings.rpy:15
old "I'm using Gradle to build the package."
new "パッケージのビルドに Gradle を使用しています。"
# game/androidstrings.rpy:16
old "Uploading expansion file."
new "拡張ファイルをアップロードしています。"
# game/androidstrings.rpy:17
old "The build seems to have failed."
new "ビルドに失敗したようです"
# game/androidstrings.rpy:18
old "Launching app."
new "アプリを起動しています。"
# game/androidstrings.rpy:19
old "The build seems to have succeeded."
new "ビルドに成功したようです。"
# game/androidstrings.rpy:20
old "The arm64-v8a version works on newer Android devices, the armeabi-v7a version works on older devices, and the x86_64 version works on the simulator and chromebooks."
new "arm64-v8a version は新しいアンドロイドデバイスで動きます。 armeabi-v7a version は古いデバイスで動きます。 the x86_64 version はシミュレーターやクロームブックで動きます。"
# game/androidstrings.rpy:21
old "What is the full name of your application? This name will appear in the list of installed applications."
new "アプリのフルネームはなんですか? フルネームはインストール済みアプリの一覧に表示されます。"
# game/androidstrings.rpy:22
old "What is the short name of your application? This name will be used in the launcher, and for application shortcuts."
new "アプリのショートネームは何ですか? ショートネームはランチャーやショートカットで使われます。"
# game/androidstrings.rpy:23
old "What is the name of the package?\n\nThis is usually of the form com.domain.program or com.domain.email.program. It may only contain ASCII letters and dots. It must contain at least one dot."
new "パッケージ名はなんですか?\n\nこれは通常 com.domain.program や com.domain.email.program の形を取ります。 ASCII 文字とドットのみで構成され、最低一つのドットを含まなければなりません。"
# game/androidstrings.rpy:24
old "The package name may not be empty."
new "パッケージ名が与えられていません。"
# game/androidstrings.rpy:25
old "The package name may not contain spaces."
new "パッケージ名はスペースを含んではいけません。"
# game/androidstrings.rpy:26
old "The package name must contain at least one dot."
new "パッケージ名は最低一つのドットを含まなければなりません。"
# game/androidstrings.rpy:27
old "The package name may not contain two dots in a row, or begin or end with a dot."
new "パッケージ名は2つのドットが連続したり、最初や最後がドットになってはいけません。"
# game/androidstrings.rpy:28
old "Each part of the package name must start with a letter, and contain only letters, numbers, and underscores."
new "パッケージ名の各部分は文字から始めまり、文字・数字・アンダースコアのみを使用しなければなりません"
# game/androidstrings.rpy:29
old "{} is a Java keyword, and can't be used as part of a package name."
new "{} は Java のキーワードのため、パッケージ名に使用することはできません。."
# game/androidstrings.rpy:30
old "What is the application's version?\n\nThis should be the human-readable version that you would present to a person. It must contain only numbers and dots."
new "アプリケーションのバージョンはなんですか?\n\nバージョンは他の人に分かりやすい名前にします。数字とドットのみが使用できます。"
# game/androidstrings.rpy:31
old "The version number must contain only numbers and dots."
new "バージョンナンバーは数字とドットのみが使用できます。"
# game/androidstrings.rpy:32
old "What is the version code?\n\nThis must be a positive integer number, and the value should increase between versions."
new "バージョンコードは何ですか?\n\nこれは正の整数で、バージョンが上がるごとに増えていきます。"
# game/androidstrings.rpy:33
old "The numeric version must contain only numbers."
new "バージョンコードは数字のみが使用できます。"
# game/androidstrings.rpy:34
old "How would you like your application to be displayed?"
new "どのようにアプリケーションを表示したいですか?"
# game/androidstrings.rpy:35
old "In landscape orientation."
new "ランドスケープ(横向き)"
# game/androidstrings.rpy:36
old "In portrait orientation."
new "ポートレイト(縦向き)"
# game/androidstrings.rpy:37
old "In the user's preferred orientation."
new "ユーザーが選択した向き"
# game/androidstrings.rpy:38
old "Which app store would you like to support in-app purchasing through?"
new "アプリ内課金をどのアプリストアに対応させますか?"
# game/androidstrings.rpy:39
old "Google Play."
new "Google Play"
# game/androidstrings.rpy:40
old "Amazon App Store."
new "Amazon App Store"
# game/androidstrings.rpy:41
old "Both, in one app."
new "一つのアプリで両方とも"
# game/androidstrings.rpy:42
old "Neither."
new "どちらも対応させない"
# game/androidstrings.rpy:43
old "Would you like to create an expansion APK?"
new "APK 拡張ファイルを作成しますか?"
# game/androidstrings.rpy:44
old "No. Size limit of 100 MB on Google Play, but can be distributed through other stores and sideloaded."
new "いいえ。Google Play では100MBのサイズ制限がありますが、他のストアを通したり、直接配布することが可能です。"
# game/androidstrings.rpy:45
old "Yes. 2 GB size limit, but won't work outside of Google Play. (Read the documentation to get this to work.)"
new "はい。2GBのサイズまで作成できますが、 Google Play 以外では動きません。(ドキュメンテーションを参照してください。)"
# game/androidstrings.rpy:46
old "Do you want to allow the app to access the Internet?"
new "アプリのインターネット接続を許可しますか?"
# game/androidstrings.rpy:47
old "Do you want to automatically update the generated project?"
new "作成したプロジェクトを自動的に更新させますか?"
# game/androidstrings.rpy:48
old "Yes. This is the best choice for most projects."
new "はい。多くのプロジェクトで最良の選択です。"
# game/androidstrings.rpy:49
old "No. This may require manual updates when Ren'Py or the project configuration changes."
new "いいえ。Ren'Py やプロジェクトの構成が変更されるごとに、手動でアップデートする必要があります。"
# game/androidstrings.rpy:50
old "Unknown configuration variable: {}"
new "未知の構成変数: {}"
# game/androidstrings.rpy:51
old "I'm compiling a short test program, to see if you have a working JDK on your system."
new "小さなテストプログラムをコンパイルして、あなたのシステムで JDK が動作するか確認しています。"
# game/androidstrings.rpy:52
old "I was unable to use javac to compile a test file. If you haven't installed the Java Development Kit yet, please download it from:\n\nhttp://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html\n\nThe JDK is different from the JRE, so it's possible you have Java without having the JDK. Without a working JDK, I can't continue."
new "テストファイルのコンパイルに javac が利用できません。Java Development Kit をダウンロードしていないなら、\n\nhttp://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html\n\nからダウンロードしてください。 JDK は JRE とは違うもので、Java には含まれていません。JDK がなければ継続できません。"
# game/androidstrings.rpy:53
old "The version of Java on your computer does not appear to be JDK 8, which is the only version supported by the Android SDK. If you need to install JDK 8, you can download it from:\n\nhttp://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html\n\nYou can also set the JAVA_HOME environment variable to use a different version of Java."
new "あなたのコンピューターにある Java のバージョンは JDK 8 ではないようです。JDK 8 は Android SDK がサポートする唯一のバージョンです。JDK 8 は:\n\nhttp://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html\n\nからダウンロードできます。 異なるバージョンの JAVA を使う場合は、JAVA_HOME の環境変数を設定します。"
# game/androidstrings.rpy:54
old "The JDK is present and working. Good!"
new "JDK が動作することを確認しました。"
# game/androidstrings.rpy:55
old "The Android SDK has already been unpacked."
new "Android SDK の解凍は完了しています。"
# game/androidstrings.rpy:56
old "Do you accept the Android SDK Terms and Conditions?"
new "Android SDK の契約内容・条件を承諾しますか?"
# game/androidstrings.rpy:57
old "I'm downloading the Android SDK. This might take a while."
new "Android SDK をダウンロードしています。この処理にはしばらくかかります。"
# game/androidstrings.rpy:58
old "I'm extracting the Android SDK."
new "Android SDK を解凍しています。"
# game/androidstrings.rpy:59
old "I've finished unpacking the Android SDK."
new "Android SDK の解凍を完了しました。"
# game/androidstrings.rpy:60
old "I'm about to download and install the required Android packages. This might take a while."
new "必要な Android パッケージをダウンロードしてインストールしようとしています。この処理にはしばらくかかります。"
# game/androidstrings.rpy:61
old "I was unable to accept the Android licenses."
new "Android ライセンスを承諾出来ませんでした。"
# game/androidstrings.rpy:62
old "I was unable to install the required Android packages."
new "必要な Android パッケージをインストールできませんでした。"
# game/androidstrings.rpy:63
old "I've finished installing the required Android packages."
new "必要な Android パッケージのインストールが終了しました。"
# game/androidstrings.rpy:64
old "You set the keystore yourself, so I'll assume it's how you want it."
new "keystore が設定されているため、あなた自身で設定したいのだと判断しました。"
# game/androidstrings.rpy:65
old "You've already created an Android keystore, so I won't create a new one for you."
new "Android keystore が既に作成済みのため、新しい keystore の作成は行いません。"
# game/androidstrings.rpy:66
old "I can create an application signing key for you. Signing an application with this key allows it to be placed in the Android Market and other app stores.\n\nDo you want to create a key?"
new "アプリケーションに署名するキーを発行できます。このキーでアプリケーションに署名すると、アンドロイドマーケットや他のストアで配布できるようになります。\n\nキーを作成しますか?"
# game/androidstrings.rpy:67
old "I will create the key in the android.keystore file.\n\nYou need to back this file up. If you lose it, you will not be able to upgrade your application.\n\n\\You also need to keep the key safe. If evil people get this file, they could make fake versions of your application, and potentially steal your users' data.\n\nWill you make a backup of android.keystore, and keep it in a safe place?"
new "android.keystore ファイルを作成します。\n\nこのファイルはバックアップしてください。もし失くした場合はアプリをアップグレードすることが出来なくなります。\n\nまた、このファイルは安全な場所に保管してください。このファイルが悪意のある人間の手に渡ると、アプリのフェイクバージョンを作られたり、ユーザーデータを盗まれる恐れがあります。\n\nandroid.keystore のバックアップを作成し、安全な場所に保存しますか?"
# game/androidstrings.rpy:68
old "Please enter your name or the name of your organization."
new "あなたの名前か組織名を入力してください。"
# game/androidstrings.rpy:69
old "Could not create android.keystore. Is keytool in your path?"
new "android.keystore を作成できませんでした。keytool があなたのパスに存在しますか?"
# game/androidstrings.rpy:70
old "I've finished creating android.keystore. Please back it up, and keep it in a safe place."
new "android.keystore の作成を終了しました。 このファイルをバックアップして、安全な場所に保管してください。"
# game/androidstrings.rpy:71
old "It looks like you're ready to start packaging games."
new "ゲームのパッケージングの準備が整ったようです。"
# game/choose_theme.rpy:507
old "changing the theme"
new "テーマを変更しています。"
# game/front_page.rpy:252
old "Web"
new "Web"
# game/front_page.rpy:252
old "(Beta)"
new "(Beta)"
# game/gui7.rpy:429
old "creating a new project"
new "新しいプロジェクトを作成しています。"
# game/gui7.rpy:433
old "activating the new project"
new "新しいプロジェクトを認証しています。"
# game/interface.rpy:372
old "opening the log file"
new "ログファイルを開いています。"
# game/itch.rpy:43
old "Downloading the itch.io butler."
new "itch.io butler をダウンロードしています。"
# game/updater.rpy:101
old "The update channel controls the version of Ren'Py the updater will download."
new "アップロードチャンネルはアップデーターのバージョンをコントロールします。"
# game/updater.rpy:110
old "• This version is installed and up-to-date."
new "• このバージョンは最新の状態でインストールされています。"
# game/updater.rpy:118
old "%B %d, %Y"
new "%B %d, %Y"
# game/updater.rpy:188
old "Fetching the list of update channels"
new "アップデートチャンネルのリストを取得しています。"
# game/updater.rpy:194
old "downloading the list of update channels"
new "アップデートチャンネルのリストをダウンロードしています。"
# game/updater.rpy:198
old "parsing the list of update channels"
new "アップデートチャンネルのリストを解析しています。"
# game/web.rpy:118
old "Web: [project.current.display_name!q]"
new "Web: [project.current.display_name!q]"
# game/web.rpy:148
old "Build Web Application"
new "ウェブアプリケーションをビルドする"
# game/web.rpy:149
old "Build and Open in Browser"
new "ビルドしてブラウザで開く"
# game/web.rpy:150
old "Open in Browser"
new "ブラウザで開く"
# game/web.rpy:151
old "Open build directory"
new "ビルドしたディレクトリーを開く"
# game/web.rpy:155
old "Support:"
new "サポート:"
# game/web.rpy:163
old "RenPyWeb Home"
new "RenPyWeb ホーム"
# game/web.rpy:164
old "Beuc's Patreon"
new "Beuc's Patreon"
# game/web.rpy:182
old "Ren'Py web applications require the entire game to be downloaded to the player's computer before it can start."
new "Ren'Py ウェブアプリケーションは、ゲームをスタートする前に、プレイヤーのコンピューターにデータを全てダウンロードする必要があります。"
# game/web.rpy:186
old "Current limitations in the web platform mean that loading large images, audio files, or movies may cause audio or framerate glitches, and lower performance in general."
new "現在のウェブプラットホームの限界により、一般的なパフォーマンスの低下や、大きな画像・音声・動画ファイルのロードによる音声やフレームレートの異常が発生します。"
# game/web.rpy:195
old "Before packaging web apps, you'll need to download RenPyWeb, Ren'Py's web support. Would you like to download RenPyWeb now?"
new "ウェブアプリをパッケージングするために、RenPyWeb (Ren'Py's web support) をダウンロードする必要があります。 RenPyWeb をダウンロードしますか?"
+1 -1
View File
@@ -166,7 +166,7 @@ translate japanese strings:
# screens.rpy:352
old "## Used to display the main menu when Ren'Py starts."
new "## Ren'py が起動した時に表示されるメインメニューを表示するスクリーンです。"
new "## Ren'Py が起動した時に表示されるメインメニューを表示するスクリーンです。"
# screens.rpy:354
old "## http://www.renpy.org/doc/html/screen_special.html#main-menu"
+4 -8
View File
@@ -20,7 +20,7 @@ label start:
# 背景を表示します。デフォルトではプレースホルダー(仮画像)を使用しますが、
# images ディレクトリーにファイル(ファイル名は "bg room.png" や "bg room.jpg"
# を追加することにより表示できます。
# を追加すること表示できます。
scene bg room
@@ -39,14 +39,10 @@ label start:
with dissolve
# 音楽を再生します。ここではタグを利用して無音を再生していますが、
# game ディレクトリーに "music.ogg" などと命名したファイルを追加すると
# play music "music.ogg" の形で再生することができます。
# 音楽を再生します。
# game ディレクトリーに "music.ogg" などファイルを追加すると再生できます。
# 効果音を再生する時は play audio "filename" を使用します。
# play music とは違って複数の効果音を同時に再生することができます。
play music "<silence .5>"
# play music "music.ogg"
# 以下は台詞を表示します。
+5 -1
View File
@@ -760,6 +760,10 @@
old "Clipboard"
new "클립보드"
# 00accessibility.rpy:146
old "The options on this menu are intended to improve accessibility. They may not work with all games, and some combinations of options may render the game unplayable. This is not an issue with the game or engine. For the best results when changing fonts, try to keep the text size the same as it originally was."
new "이 메뉴의 옵션은 접근성을 향상시키기 위한 것입니다. 모든 게임에서 작동하지 않을 수 있고 일부 옵션 조합은 게임을 플레이할 수 없게 만들 수 있으며 이러한 경우 게임이나 엔진의 문제가 아닙니다. 글꼴을 변경할 때 최상의 결과를 얻으려면 글자 크기를 원래대로 유지하십시오."
# 00preferences.rpy:430
old "font transform"
new "글꼴 변형"
@@ -770,4 +774,4 @@
# 00preferences.rpy:441
old "font line spacing"
new "글꼴 줄 간격"
new "글꼴 줄 간격"
+4 -4
View File
@@ -102,7 +102,7 @@
# _developer/inspector.rpym:145
old " (no properties affect the displayable)"
new "(디스플레이어블에 적용되는 속성이 없습니다)"
new " (디스플레이어블에 적용되는 속성이 없습니다)"
# _developer/inspector.rpym:147
old " (default properties omitted)"
@@ -134,11 +134,11 @@
# 00console.rpy:413
old " <renpy script statement>: run the statement\n"
new "<렌파이 스크립트 명령문>: 명령문을 실행한다\n"
new " <렌파이 스크립트 명령문>: 명령문을 실행한다\n"
# 00console.rpy:415
old " <python expression or statement>: run the expression or statement"
new "<파이썬 표현식 또는 명령문>: 표현식이나 명령문을 실행한다"
new " <파이썬 표현식 또는 명령문>: 표현식이나 명령문을 실행한다"
# 00console.rpy:423
old "clear: clear the console history"
@@ -175,7 +175,7 @@
# 00console.rpy:536
old "jump <label>: jumps to label"
new "jump <label>: label로 점프한다"
# 00console.rpy:685
old "short: Shorten the representation of objects on the console (default)."
new "short: 콘솔에서 오브젝트 표시를 줄인다 (기본값)."
+1 -1
View File
@@ -207,7 +207,7 @@
# _errorhandling.rpym:668
old "Copies the errors.txt file to the clipboard."
new "errors.txt 파일을 클립보드로 복사합니다."
# _errorhandling.rpym:542
old "Copy BBCode"
new "BB코드 복사"
+13 -9
View File
@@ -18,11 +18,11 @@
# add_file.rpy:31
old "The filename must have the .rpy extension."
new "파일 이름에는 반드시 .rpy 확장자가 적혀있어야 합니다."
new "파일의 확장자는 반드시 .rpy 어야 합니다."
# add_file.rpy:39
old "The file already exists."
new "파일 이름이 이미 존재합니다."
new "파일이 이미 존재합니다."
# add_file.rpy:42
old "# Ren'Py automatically loads all script files ending with .rpy. To use this\n# file, define a label and jump to it from another file.\n"
@@ -214,7 +214,7 @@
# androidstrings.rpy:17
old "The build seems to have failed."
new "빌드 실패했습니다."
new "빌드 실패했습니다."
# androidstrings.rpy:18
old "Launching app."
@@ -594,7 +594,7 @@
# dmgcheck.rpy:50
old "Ren'Py is running from a read only folder. Some functionality will not work."
new "렌파이가 읽기 전용 폴더로부터 실행되고 있습니다. 일부 기능이 작동하지 않을 수 있습니다."
new "렌파이가 읽기 전용 폴더에서 실행되고 있습니다. 일부 기능이 작동하지 않을 수 있습니다."
# dmgcheck.rpy:50
old "This is probably because Ren'Py is running directly from a Macintosh drive image. To fix this, quit this launcher, copy the entire %s folder somewhere else on your computer, and run Ren'Py again."
@@ -1525,8 +1525,12 @@
new "빌드 및 브라우저에서 열기"
# web.rpy:150
old "Open without Build"
new "빌드하지 않고 열기"
old "Open in Browser"
new "브라우저에서 열기"
# web.rpy:151
old "Open build directory"
new "빌드 디렉토리 열기"
# web.rpy:154
old "Support:"
@@ -1538,7 +1542,7 @@
# web.rpy:163
old "Beuc's Patreon"
new "Beuc의 페트론"
new "Beuc의 페이트리온"
# web.rpy:181
old "Ren'Py web applications require the entire game to be downloaded to the player's computer before it can start."
@@ -1550,12 +1554,12 @@
# web.rpy:194
old "Before packaging web apps, you'll need to download RenPyWeb, Ren'Py's web support. Would you like to download RenPyWeb now?"
new "웹 앱을 패키징하려면 렌파이 렌파이웹(RenpyWeb)이 필요니다. 지금 내려받으시겠습니까?"
new "웹 앱을 패키징하려면 렌파이의 웹 지원인 렌파이웹(RenpyWeb)이 필요니다. 지금 내려받으시겠습니까?"
# updater.rpy:188
old "Fetching the list of update channels"
new "업데이트 채널 목록 가져오기"
# choose_theme.rpy:507
old "changing the theme"
new "테마를 바꾸는 중"
+71 -67
View File
@@ -1,54 +1,106 @@
translate piglatin strings:
# renpy/common/00accessibility.rpy:76
# renpy/common/00accessibility.rpy:28
old "Self-voicing disabled."
new "Elfsay-oicingvay isabledday."
# renpy/common/00accessibility.rpy:29
old "Clipboard voicing enabled. "
new "Lipboardcay oicingvay enableday. "
# renpy/common/00accessibility.rpy:30
old "Self-voicing enabled. "
new "Elfsay-oicingvay enableday. "
# renpy/common/00accessibility.rpy:32
old "bar"
new "arbay"
# renpy/common/00accessibility.rpy:33
old "selected"
new "electedsay"
# renpy/common/00accessibility.rpy:34
old "viewport"
new "iewportvay"
# renpy/common/00accessibility.rpy:35
old "horizontal scroll"
new "orizontalhay crollsay"
# renpy/common/00accessibility.rpy:36
old "vertical scroll"
new "erticalvay crollsay"
# renpy/common/00accessibility.rpy:37
old "activate"
new "activateay"
# renpy/common/00accessibility.rpy:38
old "deactivate"
new "eactivateday"
# renpy/common/00accessibility.rpy:39
old "increase"
new "increaseay"
# renpy/common/00accessibility.rpy:40
old "decrease"
new "ecreaseday"
# renpy/common/00accessibility.rpy:128
old "Font Override"
new "Ontfay Verrideoay"
# renpy/common/00accessibility.rpy:80
# renpy/common/00accessibility.rpy:132
old "Default"
new "Efaultday"
# renpy/common/00accessibility.rpy:84
# renpy/common/00accessibility.rpy:136
old "DejaVu Sans"
new "Ejavuday Anssay"
# renpy/common/00accessibility.rpy:88
# renpy/common/00accessibility.rpy:140
old "Opendyslexic"
new "Pendyslexicoay"
# renpy/common/00accessibility.rpy:94
# renpy/common/00accessibility.rpy:146
old "Text Size Scaling"
new "Exttay Izesay Calingsay"
# renpy/common/00accessibility.rpy:100
# renpy/common/00accessibility.rpy:152
old "Reset"
new "Esetray"
# renpy/common/00accessibility.rpy:105
# renpy/common/00accessibility.rpy:157
old "Line Spacing Scaling"
new "Inelay Pacingsay Calingsay"
# renpy/common/00accessibility.rpy:117
# renpy/common/00accessibility.rpy:169
old "Self-Voicing"
new "Elfsay-Oicingvay"
# renpy/common/00accessibility.rpy:121
# renpy/common/00accessibility.rpy:173
old "Off"
new "Ffoay"
# renpy/common/00accessibility.rpy:125
# renpy/common/00accessibility.rpy:177
old "Text-to-speech"
new "Exttay-otay-peechsay"
# renpy/common/00accessibility.rpy:129
# renpy/common/00accessibility.rpy:181
old "Clipboard"
new "Lipboardcay"
# renpy/common/00accessibility.rpy:133
# renpy/common/00accessibility.rpy:185
old "Debug"
new "Ebugday"
# renpy/common/00accessibility.rpy:191
old "The options on this menu are intended to improve accessibility. They may not work with all games, and some combinations of options may render the game unplayable. This is not an issue with the game or engine. For the best results when changing fonts, try to keep the text size the same as it originally was."
new "Hetay optionsay onay histay enumay areay intendeday otay improveay accessibilityay. Heytay aymay otnay orkway ithway allay amesgay, anday omesay ombinationscay ofay optionsay aymay enderray hetay amegay unplayableay. Histay isay otnay anay issueay ithway hetay amegay oray engineay. Orfay hetay estbay esultsray henway angingchay ontsfay, ytray otay eepkay hetay exttay izesay hetay amesay asay itay originallyay asway."
# renpy/common/00action_file.rpy:26
old "{#weekday}Monday"
new "{#weekday}Ondaymay"
@@ -393,59 +445,11 @@ translate piglatin strings:
old "Saved screenshot as %s."
new "Avedsay creenshotsay asay %say."
# renpy/common/00library.rpy:175
old "Self-voicing disabled."
new "Elfsay-oicingvay isabledday."
# renpy/common/00library.rpy:176
old "Clipboard voicing enabled. "
new "Lipboardcay oicingvay enableday. "
# renpy/common/00library.rpy:177
old "Self-voicing enabled. "
new "Elfsay-oicingvay enableday. "
# renpy/common/00library.rpy:179
old "bar"
new "arbay"
# renpy/common/00library.rpy:180
old "selected"
new "electedsay"
# renpy/common/00library.rpy:181
old "viewport"
new "iewportvay"
# renpy/common/00library.rpy:182
old "horizontal scroll"
new "orizontalhay crollsay"
# renpy/common/00library.rpy:183
old "vertical scroll"
new "erticalvay crollsay"
# renpy/common/00library.rpy:184
old "activate"
new "activateay"
# renpy/common/00library.rpy:185
old "deactivate"
new "eactivateday"
# renpy/common/00library.rpy:186
old "increase"
new "increaseay"
# renpy/common/00library.rpy:187
old "decrease"
new "ecreaseday"
# renpy/common/00library.rpy:222
# renpy/common/00library.rpy:195
old "Skip Mode"
new "Kipsay Odemay"
# renpy/common/00library.rpy:308
# renpy/common/00library.rpy:281
old "This program contains free software under a number of licenses, including the MIT License and GNU Lesser General Public License. A complete list of software, including links to full source code, can be found {a=https://www.renpy.org/l/license}here{/a}."
new "Histay rogrampay ontainscay eefray oftwaresay underay aay umbernay ofay icenseslay, includingay hetay Itmay Icenselay anday Nugay Esserlay Eneralgay Ublicpay Icenselay. Aay ompletecay istlay ofay oftwaresay, includingay inkslay otay ullfay ourcesay odecay, ancay ebay oundfay {a=https://www.renpy.org/l/license}erehay{/a}."
@@ -693,23 +697,23 @@ translate piglatin strings:
old "The updates were cancelled."
new "Hetay updatesay ereway ancelledcay."
# renpy/common/00gallery.rpy:587
# renpy/common/00gallery.rpy:592
old "Image [index] of [count] locked."
new "Mageiay [index] ofay [count] ockedlay."
# renpy/common/00gallery.rpy:607
# renpy/common/00gallery.rpy:612
old "prev"
new "revpay"
# renpy/common/00gallery.rpy:608
# renpy/common/00gallery.rpy:613
old "next"
new "extnay"
# renpy/common/00gallery.rpy:609
# renpy/common/00gallery.rpy:614
old "slideshow"
new "ideshowslay"
# renpy/common/00gallery.rpy:610
# renpy/common/00gallery.rpy:615
old "return"
new "eturnray"
+12 -8
View File
@@ -1562,30 +1562,34 @@ translate piglatin strings:
new "Uildbay anday Penoay inay Rowserbay"
# game/web.rpy:150
old "Open without Build"
new "Penoay ithoutway Uildbay"
old "Open in Browser"
new "Penoay inay Rowserbay"
# game/web.rpy:154
# game/web.rpy:151
old "Open build directory"
new "Penoay uildbay irectoryday"
# game/web.rpy:155
old "Support:"
new "Upportsay:"
# game/web.rpy:162
# game/web.rpy:163
old "RenPyWeb Home"
new "Enpywebray Omehay"
# game/web.rpy:163
# game/web.rpy:164
old "Beuc's Patreon"
new "Eucbay'say Atreonpay"
# game/web.rpy:181
# game/web.rpy:182
old "Ren'Py web applications require the entire game to be downloaded to the player's computer before it can start."
new "Enray'Ypay ebway applicationsay equireray hetay entireay amegay otay ebay ownloadedday otay hetay ayerplay'say omputercay eforebay itay ancay artstay."
# game/web.rpy:185
# game/web.rpy:186
old "Current limitations in the web platform mean that loading large images, audio files, or movies may cause audio or framerate glitches, and lower performance in general."
new "Urrentcay imitationslay inay hetay ebway atformplay eanmay hattay oadinglay argelay imagesay, audioay ilesfay, oray oviesmay aymay ausecay audioay oray ameratefray itchesglay, anday owerlay erformancepay inay eneralgay."
# game/web.rpy:194
# game/web.rpy:195
old "Before packaging web apps, you'll need to download RenPyWeb, Ren'Py's web support. Would you like to download RenPyWeb now?"
new "Eforebay ackagingpay ebway appsay, ouyay'llay eednay otay ownloadday Enpywebray, Enray'Ypay'say ebway upportsay. Ouldway ouyay ikelay otay ownloadday Enpywebray ownay?"
+4
View File
@@ -876,3 +876,7 @@ translate russian strings:
# 00preferences.rpy:441
old "font line spacing"
new "межстрочный интервал"
# renpy/common/00accessibility.rpy:191
old "The options on this menu are intended to improve accessibility. They may not work with all games, and some combinations of options may render the game unplayable. This is not an issue with the game or engine. For the best results when changing fonts, try to keep the text size the same as it originally was."
new "Параметры этого меню предназначены для увеличения доступности. Они могут работать не со всеми играми, а некоторые комбинации опций могут сделать игру отображаемой некорректно. Это не проблема с игрой или движком. Для достижения наилучших результатов при изменении шрифтов старайтесь сохранять размер текста таким, каким он был изначально."
+11 -3
View File
@@ -1517,9 +1517,9 @@ translate russian strings:
old "Web"
new "Веб-инструменты"
# front_page.rpy:252
old "Web (Beta)"
new "Веб-инструменты (Бета)"
# game/front_page.rpy:252
old "(Beta)"
new "(Бета)"
# interface.rpy:394
old "While [what!qt], an error occured:"
@@ -1596,3 +1596,11 @@ translate russian strings:
# updater.rpy:198
old "parsing the list of update channels"
new "разбор списка каналов обновления"
# game/web.rpy:150
old "Open in Browser"
new "Открыть в браузере"
# game/web.rpy:151
old "Open build directory"
new "Открыть папку сборки"
+2 -3
View File
@@ -158,8 +158,8 @@ translate russian strings:
new "Помощь"
# screens.rpy:331
old "## The quit button is banned on iOS and unnecessary on Android."
new "## Кнопка выхода блокирована в iOS и не нужна на Android."
old "## The quit button is banned on iOS and unnecessary on Android and Web."
new "## Кнопка выхода блокирована в iOS и не нужна на Android и в веб-версии."
# screens.rpy:332
old "Quit"
@@ -672,4 +672,3 @@ translate russian strings:
# screens.rpy:1431
old "Menu"
new "Меню"
+8 -5
View File
@@ -1,5 +1,4 @@
translate spanish strings:
translate spanish strings:
# 00action_file.rpy:26
old "{#weekday}Monday"
@@ -653,7 +652,7 @@ translate spanish strings:
# 00accessibility.rpy:76
old "Font Override"
new "Invalidar Fuente"
new "Cambiar Fuente"
# 00accessibility.rpy:80
old "Default"
@@ -669,7 +668,7 @@ translate spanish strings:
# 00accessibility.rpy:94
old "Text Size Scaling"
new "Tamaño de la Escala del Texto"
new "Escala del tamaño del texto"
# 00accessibility.rpy:100
old "Reset"
@@ -677,7 +676,7 @@ translate spanish strings:
# 00accessibility.rpy:105
old "Line Spacing Scaling"
new "Escalado del espaciado de línea"
new "Escala del espacio de línea"
# 00accessibility.rpy:117
old "Self-Voicing"
@@ -735,3 +734,7 @@ translate spanish strings:
old "Show deleted"
new "Mostrar borrados"
# renpy/common/00accessibility.rpy:146
old "The options on this menu are intended to improve accessibility. They may not work with all games, and some combinations of options may render the game unplayable. This is not an issue with the game or engine. For the best results when changing fonts, try to keep the text size the same as it originally was."
new "Las opciones en este menú están destinadas a mejorar la accesibilidad. Es posible que no funcionen con todos los juegos, y algunas combinaciones de opciones pueden hacer que el juego no se pueda jugar. Esto no es un problema con el juego o el motor. Para obtener los mejores resultados al cambiar las fuentes, intente mantener el tamaño del texto igual al original."
+11 -14
View File
@@ -1,5 +1,4 @@
translate spanish strings:
translate spanish strings:
# _developer/developer.rpym:38
old "Developer Menu"
@@ -187,15 +186,13 @@ translate spanish strings:
# 00console.rpy:639
old "jump <label>: jumps to label"
new "jump <label>: salta a la etiqueta"
translate spanish strings:
# 00console.rpy:680
old "short: Shorten the representation of objects on the console (default)."
new "corto: Acorta la representación de los objetos en la consola (predeterminado)."
# 00console.rpy:685
old "long: Print the full representation of objects on the console."
new "largo: imprime la representación completa de los objetos en la consola."
new "jump <label>: salta a la etiqueta"
# 00console.rpy:680
old "short: Shorten the representation of objects on the console (default)."
new "short: Acorta la representación de los objetos en la consola (predeterminado)."
# 00console.rpy:685
old "long: Print the full representation of objects on the console."
new "long: imprime la representación completa de los objetos en la consola."
+27 -30
View File
@@ -1,5 +1,4 @@
translate spanish strings:
translate spanish strings:
# 00gltest.rpy:70
old "Renderer"
@@ -211,31 +210,29 @@ translate spanish strings:
# _errorhandling.rpym:667
old "Copies the errors.txt file to the clipboard."
new "Copia el archivo errors.txt al portapapeles."
translate spanish strings:
# _errorhandling.rpym:542
old "Copy BBCode"
new "Copiar BBCode"
# _errorhandling.rpym:544
old "Copies the traceback.txt file to the clipboard as BBcode for forums like https://lemmasoft.renai.us/."
new "Copia el archivo traceback.txt en el portapapeles como BBcode para foros como https://lemmasoft.renai.us/."
# _errorhandling.rpym:546
old "Copy Markdown"
new "Copiar Markdown"
# _errorhandling.rpym:548
old "Copies the traceback.txt file to the clipboard as Markdown for Discord."
new "Copia el archivo traceback.txt al portapapeles como Markdown paara Discord."
# _errorhandling.rpym:683
old "Copies the errors.txt file to the clipboard as BBcode for forums like https://lemmasoft.renai.us/."
new "Copia el archivo errors.txt en el portapapeles como BBcode para foros como https://lemmasoft.renai.us/."
# _errorhandling.rpym:687
old "Copies the errors.txt file to the clipboard as Markdown for Discord."
new "Copia el archivo errors.txt al portapapeles como Markdown para Discord."
new "Copia el archivo errors.txt al portapapeles."
# _errorhandling.rpym:542
old "Copy BBCode"
new "Copiar BBCode"
# _errorhandling.rpym:544
old "Copies the traceback.txt file to the clipboard as BBcode for forums like https://lemmasoft.renai.us/."
new "Copia el archivo traceback.txt en el portapapeles como BBcode para foros como https://lemmasoft.renai.us/."
# _errorhandling.rpym:546
old "Copy Markdown"
new "Copiar Markdown"
# _errorhandling.rpym:548
old "Copies the traceback.txt file to the clipboard as Markdown for Discord."
new "Copia el archivo traceback.txt al portapapeles como Markdown paara Discord."
# _errorhandling.rpym:683
old "Copies the errors.txt file to the clipboard as BBcode for forums like https://lemmasoft.renai.us/."
new "Copia el archivo errors.txt en el portapapeles como BBcode para foros como https://lemmasoft.renai.us/."
# _errorhandling.rpym:687
old "Copies the errors.txt file to the clipboard as Markdown for Discord."
new "Copia el archivo errors.txt al portapapeles como Markdown para Discord."
+1 -2
View File
@@ -1,5 +1,4 @@
translate spanish strings:
translate spanish strings:
# gui.rpy:2
old "## Initialization"
+10 -3
View File
@@ -1,5 +1,4 @@
translate spanish strings:
translate spanish strings:
# about.rpy:39
old "[version!q]"
@@ -1577,7 +1576,7 @@ translate spanish strings:
# game/itch.rpy:43
old "Downloading the itch.io butler."
new "DEscargando el butler de itch.io"
new "Descargando el butler de itch.io"
# game/updater.rpy:101
old "The update channel controls the version of Ren'Py the updater will download."
@@ -1643,3 +1642,11 @@ translate spanish strings:
old "Before packaging web apps, you'll need to download RenPyWeb, Ren'Py's web support. Would you like to download RenPyWeb now?"
new "Antes de empaquetar aplicaciones web, deberá descargar RenPyWeb, el soporte web de Ren'Py. ¿Te gustaría descargar RenPyWeb ahora?"
# game/web.rpy:150
old "Open in Browser"
new "Abrir en Navegador"
# game/web.rpy:151
old "Open build directory"
new "Abrir directorio de construcción"
+1 -2
View File
@@ -1,5 +1,4 @@
translate spanish strings:
translate spanish strings:
# _layout/classic_joystick_preferences.rpym:94
old "Joystick Mapping"
+3 -4
View File
@@ -1,5 +1,4 @@
translate spanish strings:
translate spanish strings:
# options.rpy:1
old "## This file contains options that can be changed to customize your game."
@@ -139,11 +138,11 @@ translate spanish strings:
# options.rpy:152
old "## Icon"
new "## Icono"
new "## Ícono"
# options.rpy:154
old "## The icon displayed on the taskbar or dock."
new "## El icono mostrado en la barra de tareas."
new "## El ícono mostrado en la barra de tareas."
# options.rpy:159
old "## Build configuration"
+1 -1
View File
@@ -279,7 +279,7 @@ translate spanish strings:
# screens.rpy:646
old "{#file_time}%A, %B %d %Y, %H:%M"
new "{#file_time}%A, %d %B %Y, %H:%M"
new "{#file_time}%A, %d de %B %Y, %H:%M"
# screens.rpy:646
old "empty slot"
+1 -2
View File
@@ -1,5 +1,4 @@
# TODO: Translation updated at 2019-05-11 23:37
translate turkish strings:
# 00console.rpy:271
+1 -2
View File
@@ -1,5 +1,4 @@
# TODO: Translation updated at 2019-05-11 23:37
translate turkish strings:
# 00gltest.rpy:70
+1 -2
View File
@@ -1,5 +1,4 @@
# TODO: Translation updated at 2019-05-11 23:37
translate turkish strings:
# gui.rpy:2
+1 -2
View File
@@ -1,5 +1,4 @@
# TODO: Translation updated at 2019-05-11 23:37
translate turkish strings:
# about.rpy:39
+1 -2
View File
@@ -1,5 +1,4 @@
# TODO: Translation updated at 2019-05-11 23:37
translate turkish strings:
# options.rpy:1
+1 -2
View File
@@ -1,5 +1,4 @@
# TODO: Translation updated at 2019-05-11 23:37
translate turkish strings:
# screens.rpy:9
+4 -3
View File
@@ -27,6 +27,7 @@ init python:
import shutil
import webserver
import io
WEB_PATH = None
@@ -91,12 +92,12 @@ init python:
shutil.copy(os.path.join(WEB_PATH, fn), os.path.join(destination, fn))
# Copy over index.html.
with open(os.path.join(WEB_PATH, "index.html")) as f:
with io.open(os.path.join(WEB_PATH, "index.html"), encoding='utf-8') as f:
html = f.read()
html = html.replace("%%TITLE%%", display_name.encode("utf-8"))
html = html.replace("%%TITLE%%", display_name)
with open(os.path.join(destination, "index.html"), "w") as f:
with io.open(os.path.join(destination, "index.html"), "w", encoding='utf-8') as f:
f.write(html)
webserver.start(destination)
+17 -6
View File
@@ -20,7 +20,7 @@
static int audio_equal_mono = 1;
/* The weight of stereo channels when audio_equal_mono is true. */
static float stereo_matrix[] = { 1.0, 1.0 };
static double stereo_matrix[] = { 1.0, 1.0 };
/* The output audio sample rate. */
static int audio_sample_rate = 44100;
@@ -571,19 +571,30 @@ static void decode_audio(MediaState *ms) {
break;
}
converted_frame = av_frame_alloc();
converted_frame->sample_rate = audio_sample_rate;
converted_frame->channel_layout = AV_CH_LAYOUT_STEREO;
converted_frame->format = AV_SAMPLE_FMT_S16;
if (!ms->audio_decode_frame->channel_layout) {
ms->audio_decode_frame->channel_layout = av_get_default_channel_layout(ms->audio_decode_frame->channels);
if (audio_equal_mono && (ms->audio_decode_frame->channels == 1)) {
swr_alloc_set_opts(
ms->swr,
converted_frame->channel_layout,
converted_frame->format,
converted_frame->sample_rate,
ms->audio_decode_frame->channel_layout,
ms->audio_decode_frame->format,
ms->audio_decode_frame->sample_rate,
0,
NULL);
swr_set_matrix(ms->swr, stereo_matrix, 1);
}
}
converted_frame = av_frame_alloc();
converted_frame->sample_rate = audio_sample_rate;
converted_frame->channel_layout = AV_CH_LAYOUT_STEREO;
converted_frame->format = AV_SAMPLE_FMT_S16;
if(swr_convert_frame(ms->swr, converted_frame, ms->audio_decode_frame)) {
av_frame_free(&converted_frame);
continue;
+45
View File
@@ -0,0 +1,45 @@
#include <SDL.h>
#include <SDL_opengl.h>
#include <SDL_opengl_glext.h>
#include <stdio.h>
#include "gl2debug.h"
static void APIENTRY gl2_debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam) {
printf("GL %s: 0x%x, 0x%x: %s\n", (type == GL_DEBUG_TYPE_ERROR ? "ERROR" : " "), type, severity, message);
}
void gl2_enable_debug(void) {
void APIENTRY (*debugMessageCallback)(GLDEBUGPROC callback, const void *userParam);
void APIENTRY (*debugMessageControl)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);
void APIENTRY (*glEnable)(GLenum);
debugMessageCallback = SDL_GL_GetProcAddress("glDebugMessageCallback");
if (!debugMessageCallback) {
debugMessageCallback = SDL_GL_GetProcAddress("glDebugMessageCallbackKHR");
}
if (debugMessageCallback == NULL) {
printf("GL: Could not get glDebugMessageCallback\n");
return;
}
debugMessageControl = SDL_GL_GetProcAddress("glDebugMessageControl");
if (!debugMessageControl) {
debugMessageControl = SDL_GL_GetProcAddress("glDebugMessageControlKHR");
}
if (debugMessageControl == NULL) {
printf("GL: Could not get glDebugMessageControl\n");
return;
}
glEnable = SDL_GL_GetProcAddress("glEnable");
glEnable(GL_DEBUG_OUTPUT);
debugMessageCallback(gl2_debug_callback, 0);
debugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, 1);
}
+
+6
View File
@@ -0,0 +1,6 @@
#ifndef GL2DEBUG_H
#define GL2DEBUG_H
void gl2_enable_debug(void);
#endif
+7 -27
View File
@@ -44,33 +44,6 @@
#endif
#if defined RENPY_GLES_1
#include <GLES/gl.h>
#include <GLES/glext.h>
#define glOrtho glOrthof
#define GL_SOURCE0_ALPHA GL_SRC0_ALPHA
#define GL_SOURCE1_ALPHA GL_SRC1_ALPHA
#define GL_SOURCE2_ALPHA GL_SRC2_ALPHA
#define GL_SOURCE0_RGB GL_SRC0_RGB
#define GL_SOURCE1_RGB GL_SRC1_RGB
#define GL_SOURCE2_RGB GL_SRC2_RGB
#define GL_FRAMEBUFFER_EXT GL_FRAMEBUFFER_OES
#define GL_COLOR_ATTACHMENT0_EXT GL_COLOR_ATTACHMENT0_OES
#define glBindFramebufferEXT glBindFramebufferOES
#define glFramebufferTexture2DEXT glFramebufferTexture2DOES
#define glGenFramebuffersEXT glGenFramebuffersOES
#define glDeleteFramebuffersEXT glDeleteFramebuffersOES
#define glCheckFramebufferStatusEXT glCheckFramebufferStatusOES
#define RENPY_THIRD_TEXTURE 0
#endif
#if defined RENPY_GLES_2
#ifdef ANGLE
@@ -88,6 +61,12 @@ typedef GLchar GLcharARB;
#define GL_MAX_TEXTURE_UNITS GL_MAX_TEXTURE_IMAGE_UNITS
#define GL_RENDERBUFFER_EXT GL_RENDERBUFFER
#define glGenRenderbuffersEXT glGenRenderbuffers
#define glBindRenderbufferEXT glBindRenderbuffer
#define glRenderbufferStorageEXT glRenderbufferStorage
#define glDeleteRenderbuffersEXT glDeleteRenderbuffers
#define GL_FRAMEBUFFER_EXT GL_FRAMEBUFFER
#define GL_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING
#define GL_COLOR_ATTACHMENT0_EXT GL_COLOR_ATTACHMENT0
@@ -96,6 +75,7 @@ typedef GLchar GLcharARB;
#define glGenFramebuffersEXT glGenFramebuffers
#define glDeleteFramebuffersEXT glDeleteFramebuffers
#define glCheckFramebufferStatusEXT glCheckFramebufferStatus
#define glFramebufferRenderbufferEXT glFramebufferRenderbuffer
#define GL_OBJECT_INFO_LOG_LENGTH_ARB GL_INFO_LOG_LENGTH
#define GL_OBJECT_COMPILE_STATUS_ARB GL_COMPILE_STATUS
+3
View File
@@ -2755,6 +2755,9 @@ def find_gl_names(dirname, gl1):
rv = list(names)
rv.sort()
for i in rv:
print(i)
return rv
+3 -3
View File
@@ -181,6 +181,7 @@ for p in generate_styles.prefixes:
cython("renpy.styledata.style_{}functions".format(p), pyx=setuplib.gen + "/style_{}functions.pyx".format(p))
# renpy.display
cython("renpy.display.matrix")
cython("renpy.display.render", libs=[ 'z', 'm' ])
cython("renpy.display.accelerator", libs=sdl + [ 'z', 'm' ])
@@ -218,11 +219,10 @@ cython("renpy.gl.glrtt_fbo", libs=glew_libs)
cython("renpy.gl2.uguugl", libs=sdl)
cython("renpy.gl2.uguu", libs=sdl)
cython("renpy.gl2.gl2geometry")
cython("renpy.gl2.gl2draw", libs=sdl)
cython("renpy.gl2.gl2texture", libs=sdl)
cython("renpy.gl2.gl2environ_shader", libs=sdl)
cython("renpy.gl2.gl2rtt_fbo", libs=sdl)
cython("renpy.gl2.gl2shader", libs=sdl)
if not (android or ios or emscripten):
# renpy.angle
+279
View File
@@ -0,0 +1,279 @@
from __future__ import print_function
from sympy import symbols, Matrix, pi, cos, sin, simplify
matrix_names = [
"xdx",
"xdy",
"xdz",
"xdw",
"ydx",
"ydy",
"ydz",
"ydw",
"zdx",
"zdy",
"zdz",
"zdw",
"wdx",
"wdy",
"wdz",
"wdw",
]
def prefixed_matrix(prefix):
"""
Returns a matrix where each entry is of the for prefix___name.
"""
return Matrix(4, 4, [ symbols(prefix + "___" + i) for i in matrix_names ])
###############################################################################
import cStringIO
generators = [ ]
class Generator(object):
def __init__(self, name, docs):
self.f = cStringIO.StringIO()
self.name = name
self.docs = docs
generators.append(self)
self.first_let = True
def parameters(self, params):
print(file=self.f)
print(file=self.f)
print("def {}({}):".format(
self.name,
", ".join("float " + i for i in params.split())), file=self.f)
if self.docs:
print(' """' + self.docs + '"""', file=self.f)
if params.split():
return symbols(params)
def let(self, name, value):
if self.first_let:
print(file=self.f)
self.first_let = False
value = simplify(value, rational=True)
print(" cdef float {} = {}".format(name, str(value)), file=self.f)
return symbols(name)
def matrix(self, m):
print(file=self.f)
print(" cdef Matrix rv = Matrix(None)", file=self.f)
print(file=self.f)
for name, value in zip(matrix_names, m):
if value == 0.0:
continue
print(" rv.{} =".format(name), simplify(value, rational=True), file=self.f)
print(file=self.f)
print(" return rv", file=self.f)
def generate(func):
g = Generator(func.__name__, func.__doc__)
func(g)
return func
def write(fn):
with open(fn, "w") as f:
for i in generators:
f.write(i.f.getvalue())
@generate
def identity(g):
"""
Returns an identity matrix.
"""
g.parameters("")
g.matrix(Matrix(4, 4, [
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0,
]))
@generate
def offset(g):
"""
Returns a matrix that offsets the vertex by a fixed amount.
"""
x, y, z = g.parameters("x y z")
g.matrix(Matrix(4, 4, [
1.0, 0.0, 0.0, x,
0.0, 1.0, 0.0, y,
0.0, 0.0, 1.0, z,
0.0, 0.0, 0.0, 1.0,
]))
@generate
def rotate(g):
"""
Returns a matrix that rotates the displayable around the
origin.
`x`, `y`, `x`
The amount to rotate around the origin, in degrees.
"""
x, y, z = g.parameters("x y z")
sinx = g.let("sinx", sin(x * pi / 180.0))
cosx = g.let("cosx", cos(x * pi / 180.0))
siny = g.let("siny", sin(y * pi / 180.0))
cosy = g.let("cosy", cos(y * pi / 180.0))
sinz = g.let("sinz", sin(z * pi / 180.0))
cosz = g.let("cosz", cos(z * pi / 180.0))
rx = Matrix(4, 4, [
1, 0, 0, 0,
0, cosx, -sinx, 0,
0, sinx, cosx, 0,
0, 0, 0, 1 ])
ry = Matrix(4, 4, [
cosy, 0, siny, 0,
0, 1, 0, 0,
-siny, 0, cosy, 0,
0, 0, 0, 1])
rz = Matrix(4, 4, [
cosz, -sinz, 0, 0,
sinz, cosz, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1, ])
g.matrix(rz * ry * rx)
@generate
def perspective(g):
"""
Returns the Ren'Py projection matrix. This is a view into a 3d space
where (0, 0) is the top left corner (`w`/2, `h`/2) is the center, and
(`w`,`h`) is the bottom right, when the z coordinate is 0.
`w`, `h`
The width and height of the input plane, in pixels.
`n`
The distance of the near plane from the camera.
`p`
The distance of the 1:1 plane from the camera. This is where 1 pixel
is one coordinate unit.
`f`
The distance of the far plane from the camera.
"""
w, h, n, p, f = g.parameters('w h n p f')
offset = Matrix(4, 4, [
1.0, 0.0, 0.0, -w / 2.0,
0.0, 1.0, 0.0, -h / 2.0,
0.0, 0.0, 1.0, -p,
0.0, 0.0, 0.0, 1.0,
])
projection = Matrix(4, 4, [
2.0 * p / w, 0.0, 0.0, 0.0,
0.0, 2.0 * p / h, 0.0, 0.0,
0.0, 0.0, -(f+n)/(f-n), -2 * f * n / (f - n),
0.0, 0.0, -1.0, 0.0,
])
reverse_offset = Matrix(4, 4, [
w / 2.0, 0.0, 0.0, w / 2.0,
0.0, h / 2.0, 0.0, h / 2.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0,
])
g.matrix(reverse_offset * projection * offset)
@generate
def screen_projection(g):
"""
This generates a matrix that projects the Ren'Py space, where (0, 0) is the
top left and (`w`, `h`) is the bottom right, into the OpenGL viewport, where
(-1.0, 1.0) is the top left and (1.0, -1.0) is the bottom.
Generates the matrix that projects the Ren'Py screen to the OpenGL screen.
"""
w, h = g.parameters("w h")
m = Matrix(4, 4, [
2.0 / w, 0.0, 0.0, -1.0,
0.0, -2.0 / h, 0.0, 1.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0
])
g.matrix(m)
@generate
def texture_projection(g):
"""
This generates a matrix that project the Ren'Py space, where (0, 0) is the
top left and (`w`, `h`) is the bottom right, into the OpenGL render-to-texture
space, where (-1.0, -1.0) is the top left and (1.0, 1.0) is the bottom.
Generates the matrix that projects the Ren'Py screen to the OpenGL screen.
"""
w, h = g.parameters("w h")
m = Matrix(4, 4, [
2.0 / w, 0.0, 0.0, -1.0,
0.0, 2.0 / h, 0.0, -1.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0
])
g.matrix(m)
if __name__ == "__main__":
import os
RENPY = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
write(os.path.join(RENPY, "renpy", "display", "matrix_functions.pxi"))
+1 -1
View File
@@ -6,7 +6,7 @@ from libc.stdlib cimport calloc, free
from cpython.buffer cimport PyObject_GetBuffer, PyBuffer_Release, PyBUF_CONTIG, PyBUF_CONTIG_RO
cimport uguugl
from uguugl import reset_error, get_error, enable_check_error, load
from uguugl import load
cdef object proxy_return_string(const GLubyte *s):
"""
-38
View File
@@ -12,41 +12,3 @@ cdef void *find_gl_command(names):
raise Exception("{} not found.".format(names[0]))
cdef const char *error_function
cdef GLenum error_code
def reset_error():
"""
Resets the
"""
global error_function
error_function = NULL
global error_code
error_code = GL_NO_ERROR
reset_error()
def get_error():
if error_function != NULL:
return error_function.decode("utf-8"), error_code
else:
return None, GL_NO_ERROR
cdef void check_error(const char *function) nogil:
global error_function
global error_code
cdef GLenum error
error = real_glGetError()
if (error_function == NULL) and (error != GL_NO_ERROR):
error_function = function
error_code = error
+1 -27
View File
@@ -304,28 +304,10 @@ class XMLToPYX:
c = self.commands[i]
w("")
w(f"cdef {i}_type real_{i}")
w(f"cdef {i}_type {i}")
w("")
param_list = c.format_param_list()
proxy_call = c.format_proxy_call()
if c.return_type != "void":
w(f'cdef {c.return_type} check_{i}{param_list} nogil:')
w(f' cdef {c.return_type} rv')
w(f' rv = real_{i}{proxy_call}')
w(f' check_error("{i}")')
w(f' return rv')
else:
w(f'cdef {c.return_type} check_{i}{param_list} nogil:')
w(f' real_{i}{proxy_call}')
w(f' check_error("{i}")')
w("")
w("def load():")
@@ -339,16 +321,8 @@ class XMLToPYX:
names = [ i.encode("utf-8") for i in names ]
w(f"")
w(f" global real_{i}, {i}")
w(f" real_{i} = <{i}_type> find_gl_command({names!r})")
w(f" {i} = real_{i}")
w("")
w("def enable_check_error():")
for i in sorted(self.features.commands):
w(f" global {i}")
w(f" {i} = check_{i}")
w(f" {i} = <{i}_type> find_gl_command({names!r})")
def generate_uguu_pyx(self, f):
+1
View File
@@ -48,3 +48,4 @@ BLIT = int
DISSOLVE = int
IMAGEDISSOLVE = int
PIXELLATE = int
FLATTEN = int
+13 -2
View File
@@ -40,7 +40,7 @@ except ImportError:
vc_version = 0
# The tuple giving the version number.
version_tuple = (7, 3, 0, vc_version)
version_tuple = (7, 3, 4, vc_version)
# The name of this version.
version_name = "The world (wide web) is not enough."
@@ -171,6 +171,7 @@ backup_blacklist = {
"renpy.test.testkey",
"renpy.test.testmouse",
"renpy.test.testparser",
"renpy.gl2",
"renpycoverage",
}
@@ -586,7 +587,7 @@ def reload_all():
renpy.display.render.mark_sweep()
# Get rid of the draw module and interface.
renpy.display.draw.deinit()
renpy.display.draw.quit()
renpy.display.draw = None
renpy.display.interface = None
@@ -654,6 +655,8 @@ def import_cython():
import renpy.arguments
import renpy.display.accelerator
import renpy.display.matrix
import renpy.display.render
import renpy.gl.gl
@@ -673,6 +676,14 @@ def import_cython():
import renpy.angle.glrtt_fbo
import renpy.angle.gltexture
import renpy.gl2.gl2draw
import renpy.gl2.gl2ftl
import renpy.gl2.gl2geometry
import renpy.gl2.gl2shader
import renpy.gl2.gl2texture
import renpy.gl2.uguu
import renpy.gl2.uguugl
if False:
import renpy.defaultstore as store
+6
View File
@@ -1526,16 +1526,19 @@ cdef extern from "glcompat.h" nogil:
cdef int glActiveTextureARB(GLenum) except? 0
cdef int glAttachObjectARB(GLhandleARB, GLhandleARB) except? 0
cdef int glBindFramebufferEXT(GLenum, GLuint) except? 0
cdef int glBindRenderbufferEXT(GLenum, GLuint) except? 0
cdef int glBindTexture(GLenum, GLuint) except? 0
cdef int glBlendFunc(GLenum, GLenum) except? 0
cdef int glClear(GLbitfield) except? 0
cdef int glClearColor(GLclampf, GLclampf, GLclampf, GLclampf) except? 0
cdef int glCompileShaderARB(GLhandleARB) except? 0
cdef int glCopyTexImage2D(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint) except? 0
cdef int glCopyTexSubImage2D(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei) except? 0
cdef GLhandleARB glCreateProgramObjectARB() except? 0
cdef GLhandleARB glCreateShaderObjectARB(GLenum) except? 0
cdef int glDeleteFramebuffersEXT(GLsizei, GLuint *) except? 0
cdef int glDeleteProgram(GLuint) except? 0
cdef int glDeleteRenderbuffersEXT(GLsizei, GLuint *) except? 0
cdef int glDeleteShader(GLuint) except? 0
cdef int glDeleteTextures(GLsizei, GLuint *) except? 0
cdef int glDisable(GLenum) except? 0
@@ -1544,8 +1547,10 @@ cdef int glDrawArrays(GLenum, GLint, GLsizei) except? 0
cdef int glEnable(GLenum) except? 0
cdef int glEnableVertexAttribArrayARB(GLuint) except? 0
cdef int glFinish() except? 0
cdef int glFramebufferRenderbufferEXT(GLenum, GLenum, GLenum, GLuint) except? 0
cdef int glFramebufferTexture2DEXT(GLenum, GLenum, GLenum, GLuint, GLint) except? 0
cdef int glGenFramebuffersEXT(GLsizei, GLuint *) except? 0
cdef int glGenRenderbuffersEXT(GLsizei, GLuint *) except? 0
cdef int glGenTextures(GLsizei, GLuint *) except? 0
cdef GLint glGetAttribLocationARB(GLhandleARB, GLchar *) except? 0
cdef int glGetIntegerv(GLenum, GLint *) except? 0
@@ -1557,6 +1562,7 @@ cdef GLchar * glGetString(GLenum) except? NULL
cdef GLint glGetUniformLocationARB(GLhandleARB, GLchar *) except? 0
cdef int glLinkProgramARB(GLhandleARB) except? 0
cdef int glReadPixels(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLubyte *) except? 0
cdef int glRenderbufferStorageEXT(GLenum, GLenum, GLsizei, GLsizei) except? 0
cdef int glScissor(GLint, GLint, GLsizei, GLsizei) except? 0
cdef int glShaderSourceARB(GLhandleARB, GLsizei, GLchar * *, GLint *) except? 0
cdef int glTexImage2D(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, GLubyte *) except? 0
+90 -2
View File
@@ -1,5 +1,3 @@
from __future__ import print_function
import os
import renpy
@@ -52,6 +50,21 @@ cdef int glBindFramebufferEXT(GLenum a0, GLuint a1) except? 0:
raise Exception(message)
return 1
cdef int glBindRenderbufferEXT(GLenum a0, GLuint a1) except? 0:
if check_errors & 4:
renpy.display.log.write('glBindRenderbufferEXT')
cdef GLenum error
realGlBindRenderbufferEXT(a0, a1)
if check_errors:
error = realGlGetError()
if error:
message = 'GL error %x in glBindRenderbufferEXT' % error
if check_errors & 1:
renpy.display.log.write('%s', message)
if check_errors & 2:
raise Exception(message)
return 1
cdef int glBindTexture(GLenum a0, GLuint a1) except? 0:
if check_errors & 4:
renpy.display.log.write('glBindTexture')
@@ -128,6 +141,21 @@ cdef int glCompileShaderARB(GLhandleARB a0) except? 0:
raise Exception(message)
return 1
cdef int glCopyTexImage2D(GLenum a0, GLint a1, GLenum a2, GLint a3, GLint a4, GLsizei a5, GLsizei a6, GLint a7) except? 0:
if check_errors & 4:
renpy.display.log.write('glCopyTexImage2D')
cdef GLenum error
realGlCopyTexImage2D(a0, a1, a2, a3, a4, a5, a6, a7)
if check_errors:
error = realGlGetError()
if error:
message = 'GL error %x in glCopyTexImage2D' % error
if check_errors & 1:
renpy.display.log.write('%s', message)
if check_errors & 2:
raise Exception(message)
return 1
cdef int glCopyTexSubImage2D(GLenum a0, GLint a1, GLint a2, GLint a3, GLint a4, GLint a5, GLsizei a6, GLsizei a7) except? 0:
if check_errors & 4:
renpy.display.log.write('glCopyTexSubImage2D')
@@ -203,6 +231,21 @@ cdef int glDeleteProgram(GLuint a0) except? 0:
raise Exception(message)
return 1
cdef int glDeleteRenderbuffersEXT(GLsizei a0, GLuint * a1) except? 0:
if check_errors & 4:
renpy.display.log.write('glDeleteRenderbuffersEXT')
cdef GLenum error
realGlDeleteRenderbuffersEXT(a0, a1)
if check_errors:
error = realGlGetError()
if error:
message = 'GL error %x in glDeleteRenderbuffersEXT' % error
if check_errors & 1:
renpy.display.log.write('%s', message)
if check_errors & 2:
raise Exception(message)
return 1
cdef int glDeleteShader(GLuint a0) except? 0:
if check_errors & 4:
renpy.display.log.write('glDeleteShader')
@@ -323,6 +366,21 @@ cdef int glFinish() except? 0:
raise Exception(message)
return 1
cdef int glFramebufferRenderbufferEXT(GLenum a0, GLenum a1, GLenum a2, GLuint a3) except? 0:
if check_errors & 4:
renpy.display.log.write('glFramebufferRenderbufferEXT')
cdef GLenum error
realGlFramebufferRenderbufferEXT(a0, a1, a2, a3)
if check_errors:
error = realGlGetError()
if error:
message = 'GL error %x in glFramebufferRenderbufferEXT' % error
if check_errors & 1:
renpy.display.log.write('%s', message)
if check_errors & 2:
raise Exception(message)
return 1
cdef int glFramebufferTexture2DEXT(GLenum a0, GLenum a1, GLenum a2, GLuint a3, GLint a4) except? 0:
if check_errors & 4:
renpy.display.log.write('glFramebufferTexture2DEXT')
@@ -353,6 +411,21 @@ cdef int glGenFramebuffersEXT(GLsizei a0, GLuint * a1) except? 0:
raise Exception(message)
return 1
cdef int glGenRenderbuffersEXT(GLsizei a0, GLuint * a1) except? 0:
if check_errors & 4:
renpy.display.log.write('glGenRenderbuffersEXT')
cdef GLenum error
realGlGenRenderbuffersEXT(a0, a1)
if check_errors:
error = realGlGetError()
if error:
message = 'GL error %x in glGenRenderbuffersEXT' % error
if check_errors & 1:
renpy.display.log.write('%s', message)
if check_errors & 2:
raise Exception(message)
return 1
cdef int glGenTextures(GLsizei a0, GLuint * a1) except? 0:
if check_errors & 4:
renpy.display.log.write('glGenTextures')
@@ -518,6 +591,21 @@ cdef int glReadPixels(GLint a0, GLint a1, GLsizei a2, GLsizei a3, GLenum a4, GLe
raise Exception(message)
return 1
cdef int glRenderbufferStorageEXT(GLenum a0, GLenum a1, GLsizei a2, GLsizei a3) except? 0:
if check_errors & 4:
renpy.display.log.write('glRenderbufferStorageEXT')
cdef GLenum error
realGlRenderbufferStorageEXT(a0, a1, a2, a3)
if check_errors:
error = realGlGetError()
if error:
message = 'GL error %x in glRenderbufferStorageEXT' % error
if check_errors & 1:
renpy.display.log.write('%s', message)
if check_errors & 2:
raise Exception(message)
return 1
cdef int glScissor(GLint a0, GLint a1, GLsizei a2, GLsizei a3) except? 0:
if check_errors & 4:
renpy.display.log.write('glScissor')
+16 -5
View File
@@ -356,9 +356,10 @@ class Node(object):
A node in the abstract syntax tree of the program.
@ivar name: The name of this node.
@ivar filename: The filename where this node comes from.
@ivar linenumber: The line number of the line on which this node is defined.
@ivar next: The statement that will execute after this one.
@ivar statement_start: If present, the first node that makes up the statement that includes this node.
"""
__slots__ = [
@@ -366,6 +367,7 @@ class Node(object):
'filename',
'linenumber',
'next',
'statement_start',
]
# True if this node is translatable, false otherwise. (This can be set on
@@ -589,6 +591,7 @@ class Say(Node):
'attributes',
'arguments',
'temporary_attributes',
'rollback',
]
def diff_info(self):
@@ -600,6 +603,7 @@ class Say(Node):
self.interact = True
self.arguments = None
self.temporary_attributes = None
self.rollback = "normal"
return self
def __init__(self, loc, who, what, with_, interact=True, attributes=None, arguments=None, temporary_attributes=None):
@@ -1516,7 +1520,6 @@ class Return(Node):
class Menu(Node):
translation_relevant = True
rollback = "force"
__slots__ = [
'items',
@@ -1525,6 +1528,7 @@ class Menu(Node):
'has_caption',
'arguments',
'item_arguments',
'rollback',
]
def __new__(cls, *args, **kwargs):
@@ -1532,6 +1536,7 @@ class Menu(Node):
self.has_caption = False
self.arguments = None
self.item_arguments = None
self.rollback = "force"
return self
def __init__(self, loc, items, set, with_, has_caption, arguments, item_arguments): # @ReservedAssignment
@@ -1951,12 +1956,18 @@ class UserStatement(Node):
renpy.easy.predict(i)
if self.parsed and renpy.statements.get("predict_all", self.parsed):
return [ i[0] for i in self.subparses ] + [ self.next ]
return [ i.block[0] for i in self.subparses ] + [ self.next ]
next_list = self.call("predict_next")
if self.next:
next_label = self.next.name
else:
next_label = None
next_list = self.call("predict_next", next_label)
if next_list is not None:
return [ renpy.game.script.lookup(i) for i in next_list if i is not None ]
nexts = [ renpy.game.script.lookup_or_none(i) for i in next_list if i is not None ]
return [ i for i in nexts if i is not None ]
return [ self.next ]
+7 -1
View File
@@ -388,7 +388,12 @@ class ATLTransformBase(renpy.object.Object):
self.atl_st_offset = t.atl_st_offset
if self.child is renpy.display.motion.null:
self.child = t.child
if t.child and t.child._duplicatable:
self.child = t.child._duplicate(None)
else:
self.child = t.child
self.raw_child = t.raw_child
def __call__(self, *args, **kwargs):
@@ -1823,6 +1828,7 @@ def parse_atl(l):
if l.keyword('circles'):
expr = l.require(l.simple_expression)
rm.add_circles(expr)
continue
# Try to parse a property.
cp = l.checkpoint()
+54 -17
View File
@@ -36,6 +36,7 @@ import os
import re
import threading
import sys
import io
# Import the appropriate modules, or set them to None if we cannot.
@@ -73,6 +74,42 @@ def load(fn):
return rv
class AudioData(unicode):
"""
:doc: audio
This class wraps a bytes object containing audio data, so it can be
passed to the audio playback system. The audio data should be contained
in some format Ren'Py supports. (For examples RIFF WAV format headers,
not unadorned samples.)
`data`
A bytes object containing the audio file data.
`filename`
A synthetic filename associated with this data. It can be used to
suggest the format `data` is in, and is reported as part of
error messages.
Once created, this can be used wherever an audio filename is allowed. For
example::
define audio.easteregg = AudioData(b'...', 'sample.wav')
play sound easteregg
"""
def __new__(cls, data, filename):
rv = unicode.__new__(cls, filename)
rv.data = data
return rv
def __init__(self, data, filename):
pass
def __reduce__(self):
return(AudioData, (self.data, unicode(self)))
class QueueEntry(object):
"""
A queue entry object.
@@ -359,9 +396,6 @@ class Channel(object):
self.queue = [ ]
return
# Should we do the callback?
do_callback = False
topq = None
# This has been modified so we only queue a single sound file
@@ -417,7 +451,10 @@ class Channel(object):
if (end >= 0) and ((end - start) <= 0) and self.queue:
continue
topf = load(self.file_prefix + filename + self.file_suffix)
if isinstance(topq.filename, AudioData):
topf = io.BytesIO(topq.filename.data)
else:
topf = load(self.file_prefix + filename + self.file_suffix)
renpysound.set_video(self.number, self.movie)
@@ -442,20 +479,20 @@ class Channel(object):
break
if self.loop and not self.queue:
for i in self.loop:
if topq is not None:
newq = QueueEntry(i, 0, topq.tight, True)
else:
newq = QueueEntry(i, 0, False, True)
# Empty queue?
if not self.queue:
# Re-loop:
if self.loop:
for i in self.loop:
if topq is not None:
newq = QueueEntry(i, 0, topq.tight, True)
else:
newq = QueueEntry(i, 0, False, True)
self.queue.append(newq)
else:
do_callback = True
# Queue empty callback.
if do_callback and self.callback:
self.callback() # E1102
self.queue.append(newq)
# Try callback:
elif self.callback:
self.callback() # E1102
want_pause = self.context.pause or global_pause
+2
View File
@@ -87,6 +87,8 @@ def extra_imports():
import pstats; pstats
import _ssl; _ssl
import SimpleHTTPServer; SimpleHTTPServer
import wave; wave
import sunau; sunau
# Used by requests.
import cgi; cgi
+15 -11
View File
@@ -893,7 +893,7 @@ class ADVCharacter(object):
show_image = (self.image_tag,) + attrs + tuple(wanted) + tuple( "-" + i for i in remove)
if predict:
images.predict_show(show_image)
images.predict_show(layer, show_image)
else:
renpy.exports.show(show_image)
return True
@@ -974,13 +974,11 @@ class ADVCharacter(object):
delta = ()
trans, layer = renpy.config.say_attribute_transition_callback(
self.image_tag, mode, *delta)
self.image_tag, mode, *delta)
if trans is not None:
if layer is None:
renpy.exports.with_statement(trans)
else:
renpy.exports.with_statement(None)
renpy.exports.transition(trans, layer=layer)
def restore_say_attributes(self, predicting, state, interact):
@@ -1094,6 +1092,8 @@ class ADVCharacter(object):
if interact:
mode = _mode or self.mode
renpy.exports.mode(mode)
else:
renpy.game.context().deferred_translate_identifier = renpy.game.context().translate_identifier
# Figure out the arguments to display.
display_args = self.display_args.copy()
@@ -1109,7 +1109,10 @@ class ADVCharacter(object):
# If dynamic is set, evaluate the name expression.
if self.dynamic:
who = renpy.python.py_eval(who)
if callable(who):
who = who()
else:
who = renpy.python.py_eval(who)
def sub(s, scope=None, force=False, translate=True):
return renpy.substitutions.substitute(s, scope=scope, force=force, translate=translate)[0]
@@ -1170,9 +1173,6 @@ class ADVCharacter(object):
old_attr_state = self.handle_say_attributes(True, True)
if renpy.config.speaking_attribute is not None:
self.resolve_say_attributes(True, wanted=[ renpy.config.speaking_attribute ])
old_side_image_attributes = renpy.store._side_image_attributes
if self.image_tag:
@@ -1332,9 +1332,13 @@ def Character(name=NotSet, kind=None, **properties):
These options help to control the display of the name.
`dynamic`
If true, then `name` should be a string containing a Python
expression. That string will be evaluated before each line
of dialogue, and the result used as the name of the character.
If true, then `name` should either be a string containing a Python
expression, a function, or a callable object. If it's a string,
That string will be evaluated before each line of dialogue, and
the result used as the name of the character. Otherwise, the
function or callable object will be called with no arguments
before each line of dialogue, and the return value of the call will
be used as the name of the character.
**Controlling Interactions.**
These options control if the dialogue is displayed, if an
+53 -1
View File
@@ -19,10 +19,61 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
init -1500 python:
##########################################################################
# Self-voicing
# Strings used internally in Ren'Py.
_("Self-voicing disabled.")
_("Clipboard voicing enabled. ")
_("Self-voicing enabled. ")
_("bar")
_("selected")
_("viewport")
_("horizontal scroll")
_("vertical scroll")
_("activate")
_("deactivate")
_("increase")
_("decrease")
# The character that's used for descriptive text.
config.descriptive_text_character = None
def alt(what, interact=True):
"""
Uses the narrator to speak `what` if self-voicing is enabled.
"""
if _preferences.self_voicing:
c = config.descriptive_text_character
if c is None:
c = narrator
return c(what, interact=interact)
# Old name for alt.
sv = alt
init -1500 python hide:
##########################################################################
# Font Transforms.
store.__opendyslexic = { }
def opendyslexic(f):
rv = store.__opendyslexic.get(f, None)
if rv is not None:
return rv
# Generated with fc-query --format=%{charset} OpenDyslexic3-Regular.ttf
charset = "20-7e a0-107 10a-113 116-11b 11e-123 126-12b 12e-133 136-137 139-148 14a-14d 150-15b 15e-16b 16e-17e 186 188-189 18e-192 194 197 19d 1a0-1a1 1a9 1ac 1af-1b4 1c0-1c3 1cd-1df 1e6-1e7 1fe-1ff 218-21b 228-22b 241-244 24b-24c 250-254 256-259 25b-25c 261-262 265 268 26a-26b 26f-270 272 274-276 279-27a 280-281 283 289-28a 28c-28f 294-295 298-299 29b-29c 29f 2a1-2a2 2c6-2c7 2d8-2dd 309 31b 323 326 32d 331 3b2 3b8 3c0 3c7 401 403 405-408 40c 40e 410 412 415 418 41c-41e 420-422 425 427 42f-430 432 435 437 439 43e 440-441 443 445 44f 451 453 455-458 45b-45c 45e 472 498-499 4ae 4b1 4c0 4d0 4d2-4df 4e2-4f5 4f8-4f9 1e04-1e05 1e0c-1e0f 1e12-1e13 1e24-1e25 1e2e-1e2f 1e36-1e37 1e3c-1e3f 1e44-1e47 1e4a-1e4d 1e50-1e53 1e62-1e63 1e6c-1e71 1e80-1e85 1e92-1e93 1ea0-1ef9 2013-2014 2018-201a 201c-201e 2020-2022 2026 2030 2039-203a 203d 2044 20ac 2122 2126 215b-215e 2202 2206 220f 2211-2212 2219-221a 221e 222b 2248 2260 2264-2265 25ca 2c64 2c6d 2c72-2c73 2e18 fb01-fb02"
@@ -37,6 +88,7 @@ init -1500 python hide:
rv.add(f, None, None)
store.__opendyslexic[f] = rv
return rv
config.font_transforms["opendyslexic"] = opendyslexic
@@ -136,7 +188,7 @@ screen _accessibility():
vbox:
text ("The options on this menu are intended to improve accessibility. They may not work with all games, and some combinations of options may render the game unplayable. This is not an issue with the game or engine. For the best results when changing fonts, try to keep the text size the same as it originally was.")
text _("The options on this menu are intended to improve accessibility. They may not work with all games, and some combinations of options may render the game unplayable. This is not an issue with the game or engine. For the best results when changing fonts, try to keep the text size the same as it originally was.")
hbox:
spacing gui._scale(25)
+33 -10
View File
@@ -74,19 +74,29 @@ init -1500 python:
"""
:doc: other_action
This allows an expression to control if a button should be marked
as selected. It should be used as part of a list with one or more
actions. For example::
This indicates that one action in a list of actions should be used
to determine if a button is selected. This only makes sense
when the button has a list of actions. For example::
# The button is selected if mars_flag is True
# The button is selected only if mars_flag is True
textbutton "Marsopolis":
action [ Jump("mars"), SelectedIf(mars_flag) ]
action [ SelectedIf(SetVariable("mars_flag", True)), SetVariable("on_mars", True) ]
The action inside SelectedIf is run normally when the button is clicked.
"""
# Note: This had been documented to take a boolean.
def __init__(self, expression):
self.expression = expression
if isinstance(expression, Action):
for i in [ "get_selected", "get_sensitive", "get_tooltip", "periodic", "unhovered", "unhovered" ]:
setattr(self, i, getattr(expression, i, None))
def __call__(self):
if isinstance(self.expression, Action):
return self.expression()
return None
def get_selected(self):
@@ -97,19 +107,29 @@ init -1500 python:
"""
:doc: other_action
This allows an expression to control if a button should be marked
as sensitive. It should be used as part of a list with one or more
actions. For example::
This indicates that one action in a list of actions should be used
to determine if a button is sensitive. This only makes sense
when the button has a list of actions. For example::
# The button is sensitive if mars_flag is True
# The button is sensitive only if mars_flag is True
textbutton "Marsopolis":
action [ Jump("mars"), SensitiveIf(mars_flag) ]
action [ SensitiveIf(SetVariable("mars_flag", True)), SetVariable("on_mars", True) ]
The action inside SensitiveIf is run normally when the button is clicked.
"""
# Note: This had been documented to take a boolean.
def __init__(self, expression):
self.expression = expression
if isinstance(expression, Action):
for i in [ "get_selected", "get_sensitive", "get_tooltip", "periodic", "unhovered", "unhovered" ]:
setattr(self, i, getattr(expression, i, None))
def __call__(self):
if isinstance(self.expression, Action):
return self.expression()
return None
def get_sensitive(self):
@@ -564,6 +584,9 @@ init -1500 python:
def get_selected(self):
return renpy.is_selected(self.yes)
def get_tooltip(self):
return renpy.display.behavior.get_tooltip(self.yes)
@renpy.pure
class Scroll(Action, DictEquality):
@@ -1,4 +1,4 @@
# Copyright 2004-2019 Tom Rothamel <pytom@bishoujo.us>
# Copyright 2004-2019 Tom Rothamel <pytom@bishoujo.us>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
@@ -19,30 +19,30 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
init -1900 python:
config.audio_directory = 'audio'
# The blacklist of OpenGL cards. Fields are:
# - A substring of the Renderer.
# - A substring of the Version.
# - True to allow shader rendering.
# - True to allow fixed-function rendering.
def _scan_audio_directory():
# If both of the last two entries are false, GL refuses to
# start.
import os
from __future__ import print_function
if not config.audio_directory:
return
BLACKLIST = [
prefix = config.audio_directory.rstrip('/') + '/'
# Crashes for Mugenjohncel.
("S3 Graphics DeltaChrome", "1.4 20.00", False, False),
for fn in renpy.list_files():
if not fn.startswith(prefix):
continue
# A bug in Mesa 7.9 and 7.10 (before 7.10.3) causes the system to
# fail to initialize the GLSL compiler.
# https://bugs.freedesktop.org/show_bug.cgi?id=35603
("Mesa", "Mesa 7.9", False, True),
("Mesa", "Mesa 7.10.3", True, True),
("Mesa", "Mesa 7.10", False, True),
basename = os.path.basename(fn)
base, ext = os.path.splitext(basename)
# Default to allowing everything.
("", "", True, True),
]
if not ext.lower() in [ ".wav", ".mp2", ".mp3", ".ogg", ".opus" ]:
continue
base = base.lower()
audio.__dict__.setdefault(base, fn)
init python:
_scan_audio_directory()
+23 -11
View File
@@ -145,17 +145,19 @@ init -1500 python:
offset = 0
action = None
force_step = False
identity_fields = [ 'dict' ]
equality_fields = [ 'key', 'range', 'max_is_zero', 'style', 'offset', 'step', 'action']
equality_fields = [ 'key', 'range', 'max_is_zero', 'style', 'offset', 'step', 'action', 'force_step' ]
def __init__(self, dict, key, range, max_is_zero=False, style="bar", offset=0, step=None, action=None):
def __init__(self, dict, key, range, max_is_zero=False, style="bar", offset=0, step=None, action=None, force_step=False):
self.dict = dict
self.key = key
self.range = range
self.max_is_zero = max_is_zero
self.style = style
self.offset = offset
self.force_step = force_step
if step is None:
if isinstance(range, float):
@@ -197,7 +199,9 @@ init -1500 python:
range=self.range,
value=value,
changed=self.changed,
step=self.step)
step=self.step,
force_step=self.force_step,
)
def get_style(self):
return self.style, "v" + self.style
@@ -236,17 +240,19 @@ init -1500 python:
offset = 0
action = None
force_step = False
identity_fields = [ 'object', ]
equality_fields = [ 'range', 'max_is_zero', 'style', 'offset', 'step', 'action']
equality_fields = [ 'range', 'max_is_zero', 'style', 'offset', 'step', 'action', 'force_step' ]
def __init__(self, object, field, range, max_is_zero=False, style="bar", offset=0, step=None, action=None):
def __init__(self, object, field, range, max_is_zero=False, style="bar", offset=0, step=None, action=None, force_step=False):
self.object = object
self.field = field
self.range = range
self.max_is_zero = max_is_zero
self.style = style
self.offset = offset
self.force_step = force_step
if step is None:
if isinstance(range, float):
@@ -288,13 +294,15 @@ init -1500 python:
range=self.range,
value=value,
changed=self.changed,
step=self.step)
step=self.step,
force_step=self.force_step,
)
def get_style(self):
return self.style, "v" + self.style
@renpy.pure
def VariableValue(variable, range, max_is_zero=False, style="bar", offset=0, step=None, action=None):
def VariableValue(variable, range, max_is_zero=False, style="bar", offset=0, step=None, action=None, force_step=False):
"""
:doc: value
@@ -323,7 +331,7 @@ init -1500 python:
If not None, an action to call when the field has changed.
"""
return FieldValue(store, variable, range, max_is_zero=max_is_zero, style=style, offset=offset, step=step, action=action)
return FieldValue(store, variable, range, max_is_zero=max_is_zero, style=style, offset=offset, step=step, action=action, force_step=force_step)
@renpy.pure
class ScreenVariableValue(BarValue, FieldEquality):
@@ -356,16 +364,18 @@ init -1500 python:
action = None
offset = 0
force_step = False
identity_fields = [ ]
equality_fields = [ 'variable', 'max_is_zero', 'style', 'offset', 'step', 'action']
equality_fields = [ 'variable', 'max_is_zero', 'style', 'offset', 'step', 'action', 'force_step' ]
def __init__(self, variable, range, max_is_zero=False, style="bar", offset=0, step=None, action=None):
def __init__(self, variable, range, max_is_zero=False, style="bar", offset=0, step=None, action=None, force_step=False):
self.variable = variable
self.range = range
self.max_is_zero = max_is_zero
self.style = style
self.offset = offset
self.force_step = force_step
if step is None:
if isinstance(range, float):
@@ -414,7 +424,9 @@ init -1500 python:
range=self.range,
value=value,
changed=self.changed,
step=self.step)
step=self.step,
force_step=self.force_step,
)
def get_style(self):
return self.style, "v" + self.style
+6 -3
View File
@@ -149,12 +149,15 @@ init -1500 python in build:
(".android.json", "android"),
("android-*.png", "android"),
("android-*.jpg", "android"),
("ouya_icon.png", "android"),
("ouya_icon.png", None),
("ios-presplash.*", "ios"),
("ios-launchimage.png", None),
("ios-icon.png", None),
("web-presplash.png", "web"),
("web-presplash.jpg", "web"),
])
base_patterns = [ ]
@@ -386,13 +389,13 @@ init -1500 python in build:
mac_identity = None
# The command used for mac codesigning.
mac_codesign_command = [ "/usr/bin/codesign", "-s", "{identity}", "-f", "--deep", "--no-strict", "{app}" ]
mac_codesign_command = [ "/usr/bin/codesign", "--entitlements={entitlements}", "--options=runtime", "--timestamp", "-s", "{identity}", "-f", "--deep", "--no-strict", "{app}" ]
# The command used to build a dmg.
mac_create_dmg_command = [ "/usr/bin/hdiutil", "create", "-format", "UDBZ", "-volname", "{volname}", "-srcfolder", "{sourcedir}", "-ov", "{dmg}" ]
# The command used to sign a dmg.
mac_codesign_dmg_command = [ "/usr/bin/codesign", "-s", "{identity}", "-f", "{dmg}" ]
mac_codesign_dmg_command = [ "/usr/bin/codesign", "--timestamp", "-s", "{identity}", "-f", "{dmg}" ]
# Do we want to add the script_version file?
script_version = True
+6 -1
View File
@@ -185,9 +185,14 @@ init -1900 python:
if version <= (7, 2, 2):
config.say_attribute_transition_callback_attrs = False
config.keep_side_render_order = False
if version <= (7, 3, 0):
config.keep_side_render_order = False
config.force_sound = False
if version <= (7, 3, 2):
config.audio_directory = None
config.early_start_store = True
# The version of Ren'Py this script is intended for, or
# None if it's intended for the current version.
+5
View File
@@ -41,6 +41,9 @@ init -1500 python:
def check(self, all_prior):
for i in self.images:
print(i, renpy.seen_image(i))
if not renpy.seen_image(i):
return False
@@ -92,6 +95,8 @@ init -1500 python:
else:
d = config.default_transform(d)
d = renpy.display.layout.AdjustTimes(d, None, None)
displayables.append(d)
renpy.show_screen("_gallery", locked=locked, index=index + 1, count=count, displayables=displayables, gallery=self.gallery)
+4 -1
View File
@@ -388,8 +388,11 @@ init -1500 python:
renderer_info = renpy.get_renderer_info()
if config.gl2 and not renderer_info.get("models", False):
problem = "fixed"
# Software renderer check.
if config.renderer != "sw" and renderer_info["renderer"] == "sw":
elif config.renderer != "sw" and renderer_info["renderer"] == "sw":
problem = "sw"
# Speed check.
+3
View File
@@ -39,6 +39,9 @@ init -1100 python in gui:
The height of the default window.
"""
if (not renpy.is_init_phase()) and config.developer:
raise Exception("gui.init may only be called during the init phase.")
config.screen_width = width
config.screen_height = height
+3 -3
View File
@@ -182,7 +182,7 @@ init -1500 python in iap:
def init(self):
restore(False)
if renpy.ios:
if renpy.renpy.ios:
import pyobjus
IAPHelper = pyobjus.autoclass(b"IAPHelper")
NSMutableArray = pyobjus.autoclass(b"NSMutableArray")
@@ -583,9 +583,9 @@ init -1500 python in iap:
persistent._iap_purchases[p.identifier] = False
# Set up the back end.
if renpy.android:
if renpy.renpy.android:
backend = init_android()
elif renpy.ios:
elif renpy.renpy.ios:
backend = IOSBackend()
else:
backend = NoneBackend()
+3 -29
View File
@@ -168,33 +168,6 @@ init -1700 python:
extend.record_say = False
##########################################################################
# Self-voicing
# Strings used internally in Ren'Py.
_("Self-voicing disabled.")
_("Clipboard voicing enabled. ")
_("Self-voicing enabled. ")
_("bar")
_("selected")
_("viewport")
_("horizontal scroll")
_("vertical scroll")
_("activate")
_("deactivate")
_("increase")
_("decrease")
def sv(what, interact=True):
"""
Uses the narrator to speak `what` iff self-voicing is enabled.
"""
if _preferences.self_voicing:
return narrator(what, interact=interact)
##########################################################################
# Skip indicator
@@ -326,6 +299,7 @@ init -1000 python:
for i in """
adv
alt
anim
blinds
center
@@ -419,9 +393,9 @@ init 1700 python hide:
# Used by renpy.return() to return.
# Used by renpy.return_statement() to return.
label _renpy_return:
return
return _return
# Entry point for the developer screen. The rest of it is loaded from
# _developer.rpym
+2 -3
View File
@@ -24,9 +24,8 @@
init -1600 python hide:
# Set to true in the very unlikely event you want to manually init
# the sound system.
config.force_sound = False
# Set to False if you don't want sound to initialize without any mixers.
config.force_sound = True
# basics: True if the game will have music.
config.has_music = True
+1
View File
@@ -456,6 +456,7 @@ init -1500 python:
renpy.mode('nvl_menu')
renpy.shown_window()
if nvl_list is None:
store.nvl_list = [ ]
+3 -3
View File
@@ -200,11 +200,11 @@ init -1500 python:
* Preference("gl tearing", False) - Skips frames rather than tearing.
* Preference("font transform", "opendyslexic") - Sets the accessibility font transform to opendyslexic.
* Preference("font transform", "dejavusans") - Sets the accessibility font trandform to deja vu sans.
* Preference("font transform", "dejavusans") - Sets the accessibility font transform to deja vu sans.
* Preference("font transform", None) - Disables the accessibility font transform.
* Preference("font size", 1.0) - Sets the accessibility font size scaling factor.
* Preference("font vertical spacing", 1.0) - Sets the accessibility font vertical spacing scaling factor.
* Preference("font line spacing", 1.0) - Sets the accessibility font vertical spacing scaling factor.
Values that can be used with bars are:
@@ -215,7 +215,7 @@ init -1500 python:
* Preference("voice volume")
* Preference("mixer <mixer> volume")
* Preference("font size")
* Preference("font vertical spacing")
* Preference("font line spacing")
The `range` parameter can be given to give the range of certain bars.
For "text speed", it defaults to 200 cps. For "auto-forward time", it
+84
View File
@@ -0,0 +1,84 @@
init python:
renpy.register_shader("renpy.geometry", variables="""
uniform mat4 uTransform;
attribute vec4 aPosition;
""", vertex_100="""
gl_Position = uTransform * aPosition;
""")
renpy.register_shader("renpy.texture", variables="""
uniform sampler2D uTex0;
attribute vec2 aTexCoord;
varying vec2 vTexCoord;
""", vertex_110="""
vTexCoord = aTexCoord;
""", fragment_110="""
gl_FragColor = texture2D(uTex0, vTexCoord.xy);
""")
renpy.register_shader("renpy.solid", variables="""
uniform vec4 uSolidColor;
""", fragment_110="""
gl_FragColor = uSolidColor;
""")
renpy.register_shader("renpy.dissolve", variables="""
uniform sampler2D uTex0;
uniform sampler2D uTex1;
uniform float uDissolve;
attribute vec2 aTexCoord;
varying vec2 vTexCoord;
""", vertex_110="""
vTexCoord = aTexCoord;
""", fragment_110="""
vec4 color0 = texture2D(uTex0, vTexCoord.st);
vec4 color1 = texture2D(uTex1, vTexCoord.st);
gl_FragColor = mix(color0, color1, uDissolve);
""")
renpy.register_shader("renpy.imagedissolve", variables="""
uniform sampler2D uTex0;
uniform sampler2D uTex1;
uniform sampler2D uTex2;
uniform float uDissolveOffset;
uniform float uDissolveMultiplier;
attribute vec2 aTexCoord;
varying vec2 vTexCoord;
""", vertex_110="""
vTexCoord = aTexCoord;
""", fragment_110="""
vec4 color0 = texture2D(uTex0, vTexCoord.st);
vec4 color1 = texture2D(uTex1, vTexCoord.st);
vec4 color2 = texture2D(uTex2, vTexCoord.st);
float a = clamp((color0.a + uDissolveOffset) * uDissolveMultiplier, 0.0, 1.0);
gl_FragColor = mix(color1, color2, a);
""")
renpy.register_shader("renpy.colormatrix", variables="""
uniform mat4 uColorMatrix;
""", fragment_120="""
gl_FragColor = gl_FragColor * uColorMatrix;
""")
renpy.register_shader("renpy.alpha", variables="""
uniform float uAlpha;
uniform float uOver;
""", fragment_130="""
gl_FragColor = gl_FragColor * vec4(uAlpha, uAlpha, uAlpha, uAlpha * uOver);
""")
renpy.register_shader("renpy.ftl", variables="""
attribute vec4 aPosition;
attribute vec2 aTexCoord;
varying vec2 vTexCoord;
uniform sampler2D uTex0;
""", vertex_100="""
vTexCoord = aTexCoord;
gl_Position = aPosition;
""", fragment_100="""
gl_FragColor = texture2D(uTex0, vTexCoord.xy);
""")
+12 -3
View File
@@ -59,6 +59,9 @@ init -1600 python hide:
# Should we profile reloading?
config.profile_reload = False
# When should start_store happen?
config.early_start_store = False
init -1600 python:
def _init_language():
@@ -180,11 +183,17 @@ label _splashscreen:
# tell anyone.
label _start:
call _start_store
if config.early_start_store:
call _start_store
python:
renpy.execute_default_statement(True)
if not config.early_start_store:
call _start_store
python:
# Predict the main menu. When a load occurs, the loaded data will
# overwrite the prediction requests.
if renpy.has_screen("main_menu"):
@@ -192,10 +201,10 @@ label _start:
renpy.block_rollback()
scene black
call _gl_test
if not _restart:
call _gl_test
python hide:
renpy.warp.warp()
+3 -3
View File
@@ -835,9 +835,9 @@ init -1500 python in updater:
info.gname = "renpy"
if xbit or directory:
info.mode = 0777
info.mode = 0o777
else:
info.mode = 0666
info.mode = 0o666
if info.isreg():
with open(path, "rb") as f:
@@ -1090,7 +1090,7 @@ init -1500 python in updater:
umask = os.umask(0)
os.umask(umask)
os.chmod(new_path, 0777 & (~umask))
os.chmod(new_path, 0o777 & (~umask))
except:
pass
+18 -4
View File
@@ -170,8 +170,8 @@ init -1500 python:
:doc: voice_action
This allows the volume of each characters to be adjusted.
If `volume` is None, this returns the value of volume of `voice_tag`.
Otherwise, this set it to `volume`.
If `volume` is None, this returns a BarValue that
controls the value of `voice_tag`. Otherwise, this set it to `volume`.
`volume` is a number between 0.0 and 1.0, and is interpreted as a
fraction of the mixer volume for `voice` channel.
@@ -185,6 +185,17 @@ init -1500 python:
else:
return SetDict(persistent._character_volume, voice_tag, volume)
def GetCharacterVolume(voice_tag):
"""
:doc: preference_functions
This returns the volume associated with voice tag, a number
between 0.0 and 1.0, which is interpreted as a fraction of the
mixer volume for the `voice` channel.
"""
return persistent._character_volume.get(voice_tag, 1.0)
@renpy.pure
class PlayCharacterVoice(Action, FieldEquality):
"""
@@ -309,6 +320,7 @@ init -1500 python:
for tlid in [
renpy.game.context().translate_identifier,
renpy.game.context().alternate_translate_identifier,
renpy.game.context().deferred_translate_identifier,
]:
if tlid is None:
@@ -330,7 +342,7 @@ init -1500 python:
break
self.tlid = renpy.game.context().translate_identifier
self.tlid = renpy.game.context().translate_identifier or renpy.game.context().deferred_translate_identifier
if self.filename:
self.sustain = False
@@ -432,6 +444,8 @@ init -1500 python hide:
else:
_voice.play = None
renpy.game.context().deferred_translate_identifier = None
_voice.auto_file = vi.auto_filename
_voice.sustain = vi.sustain
_voice.tlid = vi.tlid
@@ -517,7 +531,7 @@ python early hide:
return fn
def execute_voice(fn):
fn = eval(fn)
fn = _audio_eval(fn)
voice(fn)
def lint_voice(fn):
+13
View File
@@ -954,6 +954,9 @@ ftfont_scale = { }
# This is used to scale the ascent and descent of a font.
ftfont_vertical_extent_scale = { }
# The default shader.
default_shader = "renpy.geometry"
def say_attribute_transition_callback(*args):
"""
@@ -993,6 +996,16 @@ disable_input = False
# also determine the order of their render.
keep_side_render_order = True
# Should this game enable and require gl2?
gl2 = False
# Does this game use the depth buffer? If so, how many bits of depth should
# it use?
depth_size = None
# A list of screens to remove when the context is copied.
context_copy_remove_screens = [ "notify" ]
del os
del collections
+4
View File
@@ -26,6 +26,7 @@ from renpy.minstore import *
# But please note that this will not be available in the body
# of user code, unless we re-import it.
import renpy.display
import renpy.audio
import renpy.text
import renpy.display.im as im
@@ -208,6 +209,7 @@ MultipleTransition = renpy.curry.curry(renpy.display.transition.MultipleTransiti
ComposeTransition = renpy.curry.curry(renpy.display.transition.ComposeTransition)
Pause = renpy.curry.curry(renpy.display.transition.NoTransition)
SubTransition = renpy.curry.curry(renpy.display.transition.SubTransition)
# Misc.
ADVSpeaker = ADVCharacter = renpy.character.ADVCharacter
Speaker = Character = renpy.character.Character
@@ -217,6 +219,8 @@ MultiPersistent = renpy.persistent.MultiPersistent
Action = renpy.ui.Action
BarValue = renpy.ui.BarValue
AudioData = renpy.audio.audio.AudioData
# NOTE: When exporting something from here, decide if we need to add it to
# renpy.pyanalysis.pure_functions.
+137 -44
View File
@@ -356,6 +356,23 @@ def run_periodic(var, st):
return var.periodic(st)
def get_tooltip(action):
if isinstance(action, (list, tuple)):
for i in action:
rv = get_tooltip(i)
if rv is not None:
return rv
return None
func = getattr(action, "get_tooltip", None)
if func is None:
return None
return func()
def is_selected(action):
"""
:name: renpy.is_selected
@@ -603,7 +620,7 @@ class SayBehavior(renpy.display.layout.Null):
if not renpy.config.enable_rollback_side:
rollback_side = "disable"
if renpy.mobile:
if renpy.exports.mobile:
rollback_side = renpy.game.preferences.mobile_rollback_side
else:
rollback_side = renpy.game.preferences.desktop_rollback_side
@@ -650,7 +667,7 @@ class SayBehavior(renpy.display.layout.Null):
elif renpy.game.context().seen_current(True):
return True
else:
renpy.config.skipping = False
renpy.config.skipping = None
renpy.exports.restart_interaction()
else:
@@ -685,6 +702,9 @@ class Button(renpy.display.layout.Window):
keysym = None
alternate_keysym = None
# This locks the displayable against further change.
locked = False
def __init__(self, child=None, style='button', clicked=None,
hovered=None, unhovered=None, action=None, role=None,
time_policy=None, keymap={}, alternate=None,
@@ -722,6 +742,20 @@ class Button(renpy.display.layout.Window):
return self
def _get_tooltip(self):
if self._tooltip is not None:
return self._tooltip
return get_tooltip(self.action)
def _in_current_store(self):
rv = self._copy()
rv.style = self.style.copy()
rv.set_style_prefix(self.style.prefix, True)
rv.focusable = False
rv.locked = True
return rv
def predict_one_action(self):
predict_action(self.clicked)
predict_action(self.hovered)
@@ -817,41 +851,46 @@ class Button(renpy.display.layout.Window):
def per_interact(self):
if self.action is not None:
if self.is_selected():
role = 'selected_'
if not self.locked:
if self.action is not None:
if self.is_selected():
role = 'selected_'
else:
role = ''
if self.is_sensitive():
clicked = self.action
else:
clicked = None
role = ''
else:
role = ''
clicked = self.clicked
if self.is_sensitive():
clicked = self.action
if self.role_parameter is not None:
role = self.role_parameter
if (role != self.role) or (clicked is not self.clicked):
renpy.display.render.invalidate(self)
self.role = role
self.clicked = clicked
if self.clicked is not None:
self.set_style_prefix(self.role + "idle_", True)
self.focusable = True
else:
clicked = None
role = ''
else:
role = ''
clicked = self.clicked
if self.role_parameter is not None:
role = self.role_parameter
if (role != self.role) or (clicked is not self.clicked):
renpy.display.render.invalidate(self)
self.role = role
self.clicked = clicked
if self.clicked is not None:
self.set_style_prefix(self.role + "idle_", True)
self.focusable = True
else:
self.set_style_prefix(self.role + "insensitive_", True)
self.focusable = False
self.set_style_prefix(self.role + "insensitive_", True)
self.focusable = False
super(Button, self).per_interact()
def event(self, ev, x, y, st):
if self.locked:
return None
def handle_click(action):
renpy.exports.play(self.style.activate_sound)
@@ -915,7 +954,7 @@ class Button(renpy.display.layout.Window):
if (self.clicked is not None) and map_event(ev, "button_ignore"):
raise renpy.display.core.IgnoreEvent()
if (self.clicked is not None) and map_event(ev, "button_alternate_ignore"):
if (self.alternate is not None) and map_event(ev, "button_alternate_ignore"):
raise renpy.display.core.IgnoreEvent()
# If clicked,
@@ -1088,6 +1127,7 @@ class Input(renpy.text.text.Text): # @UndefinedVariable
default = u""
edit_text = u""
value = None
shown = False
def __init__(self,
default="",
@@ -1148,15 +1188,10 @@ class Input(renpy.text.text.Text): # @UndefinedVariable
self.content = replaces.content
self.editable = replaces.editable
self.caret_pos = replaces.caret_pos
self.shown = replaces.shown
self.update_text(self.content, self.editable)
def _show(self):
if self.default != self.content:
self.content = self.default
self.caret_pos = len(self.content)
self.update_text(self.content, self.editable)
def update_text(self, new_content, editable, check_size=False):
edit = renpy.display.interface.text_editing
@@ -1249,6 +1284,18 @@ class Input(renpy.text.text.Text): # @UndefinedVariable
if self.value.default and (default_input_value is None):
default_input_value = self.value
if not self.shown:
if self.value is not None:
default = self.value.get_text()
self.default = unicode(default)
self.content = self.default
self.caret_pos = len(self.content)
self.update_text(self.content, self.editable)
self.shown = True
def event(self, ev, x, y, st):
self.old_caret_pos = self.caret_pos
@@ -1347,7 +1394,10 @@ class Input(renpy.text.text.Text): # @UndefinedVariable
if ev.unicode and ord(ev.unicode[0]) >= 32:
raw_text = ev.unicode
elif renpy.display.interface.text_event_in_queue():
raw_text = ''
raise renpy.display.core.IgnoreEvent()
elif (32 <= ev.key < 127) and not (ev.mod & (pygame.KMOD_ALT | pygame.KMOD_META)):
# Ignore printable keycodes without unicode.
raise renpy.display.core.IgnoreEvent()
if raw_text is not None:
@@ -1405,7 +1455,9 @@ class Adjustment(renpy.object.Object):
"""
def __init__(self, range=1, value=0, step=None, page=None, changed=None, adjustable=None, ranged=None): # @ReservedAssignment
force_step = False
def __init__(self, range=1, value=0, step=None, page=None, changed=None, adjustable=None, ranged=None, force_step=False): # @ReservedAssignment
"""
The following parameters correspond to fields or properties on
the adjustment object:
@@ -1433,12 +1485,12 @@ class Adjustment(renpy.object.Object):
The following parameters control the behavior of the adjustment.
`adjustable`
If True, this adjustment can be changed by a bar. If False,
it can't.
If True, this adjustment can be changed by a bar. If False,
it can't.
It defaults to being adjustable if a `changed` function
is given or if the adjustment is associated with a viewport,
and not adjustable otherwise.
It defaults to being adjustable if a `changed` function
is given or if the adjustment is associated with a viewport,
and not adjustable otherwise.
`changed`
This function is called with the new value when the value of
@@ -1448,6 +1500,16 @@ class Adjustment(renpy.object.Object):
This function is called with the adjustment object when
the range of the adjustment is set by a viewport.
`force_step`
If True and this adjustment changes by dragging associated
viewport or a bar, value will be changed only if the drag
reached next step.
If "release" and this adjustment changes by dragging associated
viewport or a bar, after the release, value will be
rounded to the nearest step.
If False, this adjustment will changes by dragging, ignoring
the step value.
.. method:: change(value)
Changes the value of the adjustment to `value`, updating
@@ -1467,9 +1529,27 @@ class Adjustment(renpy.object.Object):
self.changed = changed
self.adjustable = adjustable
self.ranged = ranged
self.force_step = force_step
def round_value(self, value, release):
# Prevent deadlock border points
if value <= 0:
return 0
elif value >= self._range:
return self._range
if self.force_step is False:
return value
if (not release) and self.force_step == "release":
return value
return type(self.value)(self.step * round(float(value) / self.step))
def get_value(self):
if self._value > self._range:
if self._value <= 0:
return 0
if self._value >= self._range:
return self._range
return self._value
@@ -1596,6 +1676,10 @@ class Bar(renpy.display.core.Displayable):
adjustment = value.get_adjustment()
renpy.game.interface.timeout(0)
tooltip = value.get_tooltip()
if tooltip is not None:
properties.setdefault("tooltip", tooltip)
else:
adjustment = Adjustment(range, value, step=step, page=page, changed=changed)
@@ -1880,9 +1964,18 @@ class Bar(renpy.display.core.Displayable):
renpy.display.tts.speak(renpy.minstore.__("deactivate"))
self.set_style_prefix("hover_", True)
renpy.display.focus.set_grab(None)
ignore_event = True
# Invoke rounding adjustment on bar release
value = self.adjustment.round_value(value, release=True)
if value != old_value:
rv = self.adjustment.change(value)
if rv is not None:
return rv
raise renpy.display.core.IgnoreEvent()
if value != old_value:
value = self.adjustment.round_value(value, release=False)
rv = self.adjustment.change(value)
if rv is not None:
return rv
+28 -15
View File
@@ -316,7 +316,7 @@ class Displayable(renpy.object.Object):
def __ne__(self, o):
return not (self == o)
def __init__(self, focus=None, default=False, style='default', _args=None, tooltip=None, **properties):
def __init__(self, focus=None, default=False, style='default', _args=None, tooltip=None, default_focus=False, **properties):
global default_style
@@ -326,7 +326,7 @@ class Displayable(renpy.object.Object):
self.style = renpy.style.Style(style, properties) # @UndefinedVariable
self.focus_name = focus
self.default = default
self.default = default or default_focus
self._tooltip = tooltip
if _args is not None:
@@ -367,6 +367,13 @@ class Displayable(renpy.object.Object):
return self
def _get_tooltip(self):
"""
Returns the tooltip of this displayable.
"""
return self._tooltip
def _in_current_store(self):
"""
Returns a version of this displayable that will not change as it is
@@ -1406,15 +1413,13 @@ class SceneLists(renpy.object.Object):
else:
at = 0
surf = renpy.display.render.render(sle.displayable, width, height, st, at)
surf = renpy.display.render.render_for_size(sle.displayable, width, height, st, at)
sw = surf.width
sh = surf.height
x, y = place(width, height, sw, sh, sle.displayable.get_placement())
surf.kill()
return (x, y, sw, sh)
@@ -1916,6 +1921,10 @@ class Interface(object):
renderers = [ "gl", "angle", "sw" ]
else:
renderers = [ "gl", "sw" ]
if renpy.config.gl2:
renderers = [ "gl2", "egl2" ] + renderers
else:
renderers = [ renderer, "sw" ]
@@ -1963,6 +1972,9 @@ class Interface(object):
return rv
def kill_textures(self):
if renpy.display.draw is not None:
renpy.display.draw.kill_textures()
renpy.display.render.free_memory()
renpy.text.text.layout_cache_clear()
@@ -1972,7 +1984,6 @@ class Interface(object):
"""
self.kill_textures()
renpy.display.im.cache.clear()
renpy.display.module.bo_cache = None
@@ -1985,14 +1996,16 @@ class Interface(object):
if renpy.display.draw and renpy.display.draw.info["renderer"] == "sw":
renpy.display.video.movie_stop(clear=False)
renpy.display.render.free_memory()
renpy.text.text.layout_cache_clear()
renpy.display.module.bo_cache = None
if self.display_reset:
pygame.key.stop_text_input() # @UndefinedVariable
pygame.key.set_text_input_rect(None) # @UndefinedVariable
self.text_rect = None
renpy.display.draw.deinit()
if renpy.display.draw.info["renderer"] == "angle":
renpy.display.draw.quit()
@@ -2000,13 +2013,7 @@ class Interface(object):
# minimized state on windows.
pygame.display.quit()
renpy.display.render.free_memory()
renpy.display.im.cache.clear()
renpy.text.text.layout_cache_clear()
renpy.display.module.bo_cache = None
self.kill_textures_and_surfaces()
self.kill_textures_and_surfaces()
self.old_text_rect = None
self.display_reset = False
@@ -2037,6 +2044,7 @@ class Interface(object):
for draw in draws:
if draw.set_mode(virtual_size, physical_size, fullscreen):
renpy.display.draw = draw
renpy.display.render.models = draw.info.get("models", False)
break
else:
# pygame.display.quit()
@@ -3414,6 +3422,11 @@ class Interface(object):
size = (ev.w // self.dpi_scale, ev.h // self.dpi_scale)
# Refresh fullscreen status (e.g. user pressed Esc. in browser)
main_window = pygame.display.get_window()
self.fullscreen = main_window is not None and bool(main_window.get_window_flags() & (pygame.WINDOW_FULLSCREEN_DESKTOP|pygame.WINDOW_FULLSCREEN))
renpy.game.preferences.fullscreen = self.fullscreen
if pygame.display.get_surface().get_size() != ev.size:
self.set_mode(size)
+38 -16
View File
@@ -88,7 +88,8 @@ class Drag(renpy.display.core.Displayable, renpy.python.RevertableObject):
When a Drag is first rendered, if it's position cannot be determined
from the DragGroup it is in, the position of its upper-left corner
is computed using the standard layout algorithm. Once that position
has been computed, the layout properties are ignored in favor of the
position stored inside the Drag.
`d`
If present, the child of this Drag. Drags use the child style
@@ -408,12 +409,31 @@ class Drag(renpy.display.core.Displayable, renpy.python.RevertableObject):
if self.drag_group is not None:
self.drag_group.lower_children([ self ])
def update_style_prefix(self):
"""
This updates the style prefix for all Drag's associated
with this drag movement.
"""
# We may not be in the drag_joined group.
self.set_style_prefix("idle_", True)
# Set the style for joined_set
for i in [i[0] for i in self.drag_joined(self)]:
i.set_style_prefix("selected_hover_", True)
if self.last_drop is not None:
self.last_drop.set_style_prefix("selected_idle_", True)
def visit(self):
return [ self.child ]
def focus(self, default=False):
super(Drag, self).focus(default)
# Update state back after restart_interaction
if default and self.drag_moved:
self.update_style_prefix()
rv = None
if not default:
@@ -601,10 +621,12 @@ class Drag(renpy.display.core.Displayable, renpy.python.RevertableObject):
raise renpy.display.core.IgnoreEvent()
if ((self.alternate is not None) and
if (
(self.alternate is not None) and
renpy.display.touch and
(self.click_time is not None) and
((st - self.click_time) > renpy.config.longpress_duration)):
((st - self.click_time) > renpy.config.longpress_duration)
):
self.click_time = None
@@ -612,6 +634,8 @@ class Drag(renpy.display.core.Displayable, renpy.python.RevertableObject):
if rv is not None:
return rv
renpy.exports.vibrate(renpy.config.longpress_vibrate)
# Handle clicking on droppables.
if not grabbed:
if self.clicked is not None and map_event(ev, "drag_deactivate"):
@@ -631,17 +655,10 @@ class Drag(renpy.display.core.Displayable, renpy.python.RevertableObject):
handled = True
if not self.drag_moved and (self.start_x != par_x or self.start_y != par_y):
if (not self.drag_moved) and (self.start_x != par_x or self.start_y != par_y):
self.drag_moved = True
self.click_time = None
# We may not be in the drag_joined group.
self.set_style_prefix("idle_", True)
# Set the style.
for i in joined:
i.set_style_prefix("selected_hover_", True)
# Raise the joined items.
if self.drag_raise and self.drag_group is not None:
self.drag_group.raise_children(joined)
@@ -684,11 +701,11 @@ class Drag(renpy.display.core.Displayable, renpy.python.RevertableObject):
if self.last_drop is not None:
self.last_drop.set_style_prefix("idle_", True)
if drop is not None:
drop.set_style_prefix("selected_idle_", True)
self.last_drop = drop
if self.drag_moved:
self.update_style_prefix()
if map_event(ev, 'drag_deactivate'):
self.click_time = None
@@ -843,8 +860,9 @@ class DragGroup(renpy.display.layout.MultiBox):
def raise_children(self, l):
"""
Raises the children in `l` to the top of this drag_group, using the
order given in l for those children.
Raises the children in the list `l` to the top of this drag group.
Each is raised in the order that it appears in `l`, which means that
the last element of `l` will be raised closest to the player.
"""
self.sorted = False
@@ -857,6 +875,10 @@ class DragGroup(renpy.display.layout.MultiBox):
def lower_children(self, l):
"""
Lowers the children in the list `l` to the bottom of this drag group.
Each is lowered in the order that it appears in `l`, which means that
the last element of `l` will be the lowest of the children.
Lowers the children in `l` to the bottom of this drag group, with
the one at the bottom being the lowest.
"""
+12
View File
@@ -149,10 +149,12 @@ def init_emulator():
if name == "touch":
emulator = touch_emulator
overlay = [ renpy.store.DynamicDisplayable(dynamic_keyboard) ]
elif name == "ios-touch":
emulator = touch_emulator
overlay = [ renpy.store.DynamicDisplayable(dynamic_keyboard) ]
ios = True
elif name == "tv":
emulator = tv_emulator
overlay = [ renpy.display.motion.Transform(
@@ -161,6 +163,16 @@ def init_emulator():
yalign=0.5,
size=(int(renpy.config.screen_height * 16.0 / 9.0), renpy.config.screen_height),
) ]
else:
emulator = null_emulator
overlay = [ ]
if emulator is not null_emulator:
renpy.exports.windows = False
renpy.exports.linux = False
renpy.exports.macintosh = False
renpy.exports.web = False
renpy.exports.android = renpy.exports.variant("android")
renpy.exports.ios = renpy.exports.variant("ios")
renpy.exports.mobile = renpy.exports.android or renpy.exports.ios # @UndefinedVariable
+17 -7
View File
@@ -106,7 +106,7 @@ def set_focused(widget, arg, screen):
if widget is None:
new_tooltip = None
else:
new_tooltip = widget._tooltip
new_tooltip = widget._get_tooltip()
if tooltip != new_tooltip:
tooltip = new_tooltip
@@ -281,16 +281,26 @@ def before_interact(roots):
else:
current = None
# Otherwise, focus the default widget, or nothing.
# Otherwise, focus the default widget.
if current is None:
defaults = [ ]
for f, n, screen in fwn:
if f.default:
current = f
set_focused(f, None, screen)
break
else:
set_focused(None, None, None)
defaults.append((f.default, f, screen))
if defaults:
if len(defaults) > 1:
defaults.sort()
_, f, screen = defaults[-1]
current = f
set_focused(f, None, screen)
if current is None:
set_focused(None, None, None)
# Finally, mark the current widget as the focused widget, and
# all other widgets as unfocused.
+2 -1
View File
@@ -442,6 +442,8 @@ class Cache(object):
self.preload_lock.wait()
self.preload_lock.release()
self.preload_thread_pass()
def preload_thread_pass(self):
while self.preloads and self.keep_preloading:
@@ -530,7 +532,6 @@ def free_memory():
Frees some memory.
"""
renpy.display.draw.free_memory()
cache.clear()
+20 -8
View File
@@ -229,7 +229,7 @@ def get_ordered_image_attributes(tag, attributes=(), sort=None):
for attr in attrcount:
if attr not in rv:
l.append((attrtotalpos[attr] / attrcount[attr], sort(attr), attr))
l.append((attrtotalpos[attr] // attrcount[attr], sort(attr), attr))
l.sort()
for i in l:
@@ -558,12 +558,6 @@ class DynamicImage(renpy.display.core.Displayable):
self.name = name
if scope is not None:
self.find_target(scope)
self._uses_scope = True
else:
self._uses_scope = False
if isinstance(name, basestring) and ("[prefix_" in name):
self._duplicatable = True
@@ -572,6 +566,12 @@ class DynamicImage(renpy.display.core.Displayable):
if ("[prefix_" in i):
self._duplicatable = True
if scope is not None:
self.find_target(scope)
self._uses_scope = True
else:
self._uses_scope = False
def _scope(self, scope, update):
return self.find_target(scope, update)
@@ -609,13 +609,24 @@ class DynamicImage(renpy.display.core.Displayable):
else:
return self
def set_style_prefix(self, prefix, root):
if (prefix != self.style.prefix) and self._duplicatable:
self.target = None
self.raw_target = None
super(DynamicImage, self).set_style_prefix(prefix, root)
def find_target(self, scope=None, update=True):
if self.locked and (self.target is not None):
return
if self._args.prefix is None:
prefix = ""
if self._duplicatable:
prefix = self.style.prefix
else:
prefix = ""
else:
prefix = self._args.prefix
@@ -675,6 +686,7 @@ class DynamicImage(renpy.display.core.Displayable):
rv = self._copy(args)
rv.target = None
rv.raw_target = None
# This does not set _duplicatable, since it should always remain the
# same.
return rv
+72 -18
View File
@@ -152,8 +152,8 @@ class Frame(renpy.display.core.Displayable):
An image manipulator that will be resized by this frame.
`left`
The size of the border on the left side. This can also be an
:func:`Borders` object, in which case that object is use in place
The size of the border on the left side. This can also be a
:func:`Borders` object, in which case that object is used in place
of the other parameters.
`top`
@@ -167,8 +167,10 @@ class Frame(renpy.display.core.Displayable):
The side of the border on the bottom. If None, defaults to `top`.
`tile`
If true, tiling is used to resize sections of the image,
rather than scaling.
If set to True, tiling is used to resize sections of the image,
rather than scaling. If set to the string "integer", the nearest
integer number of tiles will be used in each direction. That set of
full tiles will then be scaled up or down to fit the required area.
::
@@ -180,6 +182,7 @@ class Frame(renpy.display.core.Displayable):
__version__ = 1
properties = { }
tile_ratio = 0.5
def after_upgrade(self, version):
if version < 2:
@@ -188,7 +191,9 @@ class Frame(renpy.display.core.Displayable):
self.top = self.yborder
self.bottom = self.yborder
def __init__(self, image, left=None, top=None, right=None, bottom=None, xborder=0, yborder=0, bilinear=True, tile=False, **properties):
def __init__(self, image, left=None, top=None, right=None, bottom=None,
xborder=0, yborder=0, bilinear=True, tile=False,
tile_ratio=0.5, **properties):
super(Frame, self).__init__(**properties)
self.image = renpy.easy.displayable(image)
@@ -203,6 +208,9 @@ class Frame(renpy.display.core.Displayable):
bottom = insets.bottom
self.tile = tile
# When tile="integer" the proportion of an edge tile that determines
# whether to use less tiles and stretch or more tiles and shrink
self.tile_ratio = float(tile_ratio)
# Compat for old argument names.
if left is None:
@@ -227,7 +235,9 @@ class Frame(renpy.display.core.Displayable):
self.top,
self.right,
self.bottom,
" tile" if self.tile else "")
(" tile ({})".format(self.tile_ratio) if self.tile == "integer"
else " tile" if self.tile
else ""))
def __eq__(self, o):
if not self._equals(o):
@@ -248,6 +258,9 @@ class Frame(renpy.display.core.Displayable):
if self.tile != o.tile:
return False
if self.tile_ratio != o.tile_ratio:
return False
return True
def render(self, width, height, st, at):
@@ -345,18 +358,36 @@ class Frame(renpy.display.core.Displayable):
if csw != cdw or csh != cdh:
if self.tile:
newcr = Render(cdw, cdh)
ctw, cth = cdw, cdh
xtiles = max(1, cdw // csw + (1 if cdw % csw else 0))
ytiles = max(1, cdh // csh + (1 if cdh % csh else 0))
if cdw % csw or cdh % csh:
# Area is not an exact integer number of tiles
if self.tile == "integer":
if cdw % csw / float(csw) < self.tile_ratio:
xtiles = max(1, xtiles-1)
if cdh % csh / float(csh) < self.tile_ratio:
ytiles = max(1, ytiles-1)
# Set size of the used tiles (ready to scale)
ctw, cth = csw * xtiles, csh * ytiles
newcr = Render(ctw, cth)
newcr.xclipping = True
newcr.yclipping = True
for x in xrange(0, cdw, csw):
for y in xrange(0, cdh, csh):
newcr.blit(cr, (x, y))
for x in xrange(0, xtiles):
for y in xrange(0, ytiles):
newcr.blit(cr, (x * csw, y * csh))
csw, csh = ctw, cth
cr = newcr
else:
if csw != cdw or csh != cdh:
# Subsurface needs scaling
newcr = Render(cdw, cdh)
newcr.forward = Matrix2D(1.0 * csw / cdw, 0, 0, 1.0 * csh / cdh)
newcr.reverse = Matrix2D(1.0 * cdw / csw, 0, 0, 1.0 * cdh / csh)
@@ -465,19 +496,42 @@ class Frame(renpy.display.core.Displayable):
# Scale or tile if we have to.
if dstsize != srcsize:
if self.tile:
tilew, tileh = srcsize
dstw, dsth = dstsize
surf2 = renpy.display.pgrender.surface_unscaled(dstsize, surf)
xtiles = max(
1, dstw // tilew + (1 if dstw % tilew else 0))
ytiles = max(
1, dsth // tileh + (1 if dsth % tileh else 0))
for y in range(0, dsth, tileh):
for x in range(0, dstw, tilew):
surf2.blit(surf, (x, y))
if dstw % tilew or dsth % tileh:
# Area is not an exact integer number of tiles
surf = surf2
if self.tile == "integer":
if dstw % tilew / float(tilew) < self.tile_ratio:
xtiles = max(1, xtiles-1)
if dsth % tileh / float(tileh) < self.tile_ratio:
ytiles = max(1, ytiles-1)
else:
# Tile at least one tile in each direction
surf2 = renpy.display.pgrender.surface_unscaled(
(tilew * xtiles, tileh * ytiles), surf)
for y in range(0, ytiles):
for x in range(0, xtiles):
surf2.blit(surf, (x*tilew, y*tileh))
if self.tile is True:
# Trim the tiled surface to required size
surf = surf2.subsurface((0, 0, dstw, dsth))
else:
# Using integer full 'tiles' per side
srcsize = (tilew * xtiles, tileh * ytiles)
surf = surf2
if dstsize != srcsize:
surf2 = renpy.display.scale.real_transform_scale(surf, dstsize)
surf = surf2
+32 -11
View File
@@ -1038,7 +1038,7 @@ class SizeGroup(renpy.object.Object):
maxwidth = 0
for i in self.members:
rend = i.render(width, height, st, at)
rend = renpy.display.render.render_for_size(i, width, height, st, at)
maxwidth = max(rend.width, maxwidth)
self._width = maxwidth
@@ -1096,6 +1096,9 @@ class Window(Container):
if size_group and size_group in size_groups:
xminimum = max(xminimum, size_groups[size_group].width(width, height, st, at))
width = max(xminimum, width)
height = max(yminimum, height)
left_margin = scale(style.left_margin, width)
left_padding = scale(style.left_padding, width)
@@ -1227,6 +1230,8 @@ class DynamicDisplayable(renpy.display.core.Displayable):
nosave = [ 'child' ]
_duplicatable = True
def after_setstate(self):
self.child = None
@@ -1245,12 +1250,25 @@ class DynamicDisplayable(renpy.display.core.Displayable):
self.args = args
self.kwargs = kwargs
def _duplicate(self, args):
rv = self._copy(args)
if rv.child is not None and rv.child._duplicateable:
rv.child = rv.child._duplicate(args)
return rv
def visit(self):
return [ ]
def update(self, st, at):
child, redraw = self.function(st, at, *self.args, **self.kwargs)
child = renpy.easy.displayable(child)
if child._duplicatable:
child = child._duplicate(self._args)
child._unique()
child.visit_all(lambda c : c.per_interact())
self.child = child
@@ -1525,6 +1543,9 @@ class Side(Container):
def render(self, width, height, st, at):
if renpy.config.developer and len(self.positions) != len(self.children):
raise Exception("A side has the wrong number of children.")
pos_d = { }
pos_i = { }
@@ -1567,10 +1588,8 @@ class Side(Container):
if pos not in pos_d:
return owidth, oheight
rend = render(pos_d[pos], width, height, st, at)
rv = max(owidth, rend.width), max(oheight, rend.height)
rend.kill()
return rv
rend = renpy.display.render.render_for_size(pos_d[pos], width, height, st, at)
return max(owidth, rend.width), max(oheight, rend.height)
cwidth, cheight = sizeit('c', width, height, 0, 0)
cwidth, top = sizeit('t', cwidth, height, cwidth, top)
@@ -1852,19 +1871,21 @@ class Flatten(Container):
cr = renpy.display.render.render(self.child, width, height, st, at)
cw, ch = cr.get_size()
tex = cr.render_to_texture(True)
rv = renpy.display.render.Render(cw, ch)
rv.blit(tex, (0, 0))
rv.depends_on(cr, focus=True)
rv.blit(cr, (0, 0))
rv.reverse = renpy.display.draw.draw_to_virt
rv.forward = renpy.display.render.IDENTITY
rv.operation = renpy.display.render.FLATTEN
rv.mesh = True
rv.shaders = ( "renpy.texture", )
self.offsets = [ (0, 0) ]
return rv
def get_placement(self):
return self.child.get_placement()
class AlphaMask(Container):
"""
+44
View File
@@ -0,0 +1,44 @@
cdef class Matrix:
cdef float m[0]
cdef public float xdx
cdef public float xdy
cdef public float xdz
cdef public float xdw
cdef public float ydx
cdef public float ydy
cdef public float ydz
cdef public float ydw
cdef public float zdx
cdef public float zdy
cdef public float zdz
cdef public float zdw
cdef public float wdx
cdef public float wdy
cdef public float wdz
cdef public float wdw
cdef inline void transform4(Matrix self, float *ox, float *oy, float *oz, float *ow, float x, float y, float z, float w):
ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw
ow[0] = x * self.wdx + y * self.wdy + z * self.wdz + w * self.wdw
cdef inline void transform3(Matrix self, float *ox, float *oy, float *oz, float x, float y, float z, float w):
ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw
cdef inline void transform2(Matrix self, float *ox, float *oy, float x, float y, float z, float w):
ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
cpdef bint is_unit_aligned(Matrix self)
cdef class Matrix2D(Matrix):
pass
+191
View File
@@ -0,0 +1,191 @@
from __future__ import print_function
from libc.string cimport memset
from libc.math cimport sin, cos, M_PI as pi
cdef float *aligned_1 = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]
cdef float *aligned_2 = [ 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]
fields = [
"xdx", "xdy", "xdz", "xdw",
"ydx", "ydy", "ydz", "ydw",
"zdx", "zdy", "zdz", "zdw",
"wdx", "wdy", "wdz", "wdw",
]
cdef class Matrix:
"""
Represents a 4x4 matrix.
"""
def __init__(Matrix self, l):
memset(self.m, 0, sizeof(float) * 16)
if l is None:
return
cdef int lenl = len(l)
if lenl == 4:
(self.xdx, self.xdy,
self.ydx, self.ydy) = l
self.ydy = 1.0
self.wdw = 1.0
elif lenl == 9:
(self.xdx, self.xdy, self.xdz,
self.ydx, self.ydy, self.ydz,
self.zdx, self.zdy, self.zdz) = l
self.wdw = 1.0
elif lenl == 16:
(self.xdx, self.xdy, self.xdz, self.xdw,
self.ydx, self.ydy, self.ydz, self.ydw,
self.zdx, self.zdy, self.zdz, self.zdw,
self.wdx, self.wdy, self.wdz, self.wdw) = l
else:
raise Exception("Unsupported matrix length {} (must be 4, 9, or 16).".format(len(l)))
def __getstate__(self):
rv = { }
for i in range(16):
rv[fields[i]] = self.m[i]
return rv
def __setstate__(self, state):
memset(self.m, 0, sizeof(float) * 16)
self.zdz = 1.0
self.wdw = 1.0
for i in range(16):
if fields[i] in state:
self.m[i] = state[fields[i]]
def __mul__(Matrix self, Matrix other):
cdef Matrix rv = Matrix(None)
rv.xdx = other.wdx*self.xdw + other.xdx*self.xdx + other.ydx*self.xdy + other.zdx*self.xdz
rv.xdy = other.wdy*self.xdw + other.xdy*self.xdx + other.ydy*self.xdy + other.zdy*self.xdz
rv.xdz = other.wdz*self.xdw + other.xdz*self.xdx + other.ydz*self.xdy + other.zdz*self.xdz
rv.xdw = other.wdw*self.xdw + other.xdw*self.xdx + other.ydw*self.xdy + other.zdw*self.xdz
rv.ydx = other.wdx*self.ydw + other.xdx*self.ydx + other.ydx*self.ydy + other.zdx*self.ydz
rv.ydy = other.wdy*self.ydw + other.xdy*self.ydx + other.ydy*self.ydy + other.zdy*self.ydz
rv.ydz = other.wdz*self.ydw + other.xdz*self.ydx + other.ydz*self.ydy + other.zdz*self.ydz
rv.ydw = other.wdw*self.ydw + other.xdw*self.ydx + other.ydw*self.ydy + other.zdw*self.ydz
rv.zdx = other.wdx*self.zdw + other.xdx*self.zdx + other.ydx*self.zdy + other.zdx*self.zdz
rv.zdy = other.wdy*self.zdw + other.xdy*self.zdx + other.ydy*self.zdy + other.zdy*self.zdz
rv.zdz = other.wdz*self.zdw + other.xdz*self.zdx + other.ydz*self.zdy + other.zdz*self.zdz
rv.zdw = other.wdw*self.zdw + other.xdw*self.zdx + other.ydw*self.zdy + other.zdw*self.zdz
rv.wdx = other.wdx*self.wdw + other.xdx*self.wdx + other.ydx*self.wdy + other.zdx*self.wdz
rv.wdy = other.wdy*self.wdw + other.xdy*self.wdx + other.ydy*self.wdy + other.zdy*self.wdz
rv.wdz = other.wdz*self.wdw + other.xdz*self.wdx + other.ydz*self.wdy + other.zdz*self.wdz
rv.wdw = other.wdw*self.wdw + other.xdw*self.wdx + other.ydw*self.wdy + other.zdw*self.wdz
return rv
def __getitem__(Matrix self, int index):
if 0 <= index < 16:
return self.m[index]
raise IndexError("Matrix index out of range.")
def __setitem__(Matrix self, int index, float value):
if 0 <= index < 16:
self.m[index] = value
return
raise IndexError("Matrix index out of range.")
def __repr__(Matrix self):
cdef int x, y
rv = "Matrix(["
for 0 <= y < 4:
if y:
rv += "\n "
for 0 <= x < 4:
rv += "{:8.5f}, ".format(self.m[x + y * 4])
return rv + "])"
def transform(Matrix self, float x, float y, float z=0.0, float w=1.0, int components=2):
cdef float ox, oy, oz, ow
self.transform4(&ox, &oy, &oz, &ow, x, y, z, w)
if components == 2:
return (ox, oy)
elif components == 3:
return (ox, oy, oz)
elif components == 4:
return (ox, oy, oz, ow)
def __richcmp__(Matrix self, Matrix other, op):
if op != 2:
return NotImplemented
if self is other:
return True
cdef int i
cdef double total
total = 0
for 0 < i < 16:
total += abs(self.m[i] - other.m[i])
return total < .0001
cpdef bint is_unit_aligned(Matrix self):
"""
Returns true if exactly one of abs(xdx) or abs(xdy) is 1.0, and
the same for xdy and ydy. This is intended to report if a matrix
is aligned to the axes.
"""
cdef int i
cdef float v
cdef float total_1
cdef float total_2
total_1 = 0
total_2 = 0
for 0 < i < 16:
v = abs(self.m[i])
total_1 += abs(v - aligned_1[i])
total_2 += abs(v - aligned_2[i])
return (total_1 < .0001) or (total_2 < .0001)
cdef class Matrix2D(Matrix):
def __init__(Matrix2D self, double xdx, double xdy, double ydx, double ydy):
memset(self.m, 0, sizeof(float) * 16)
self.xdx = xdx
self.xdy = xdy
self.ydx = ydx
self.ydy = ydy
self.zdz = 1.0
self.wdw = 1.0
include "matrix_functions.pxi"
+141
View File
@@ -0,0 +1,141 @@
def identity():
"""
Returns an identity matrix.
"""
cdef Matrix rv = Matrix(None)
rv.xdx = 1.00000000000000
rv.ydy = 1.00000000000000
rv.zdz = 1.00000000000000
rv.wdw = 1.00000000000000
return rv
def offset(float x, float y, float z):
"""
Returns a matrix that offsets the vertex by a fixed amount.
"""
cdef Matrix rv = Matrix(None)
rv.xdx = 1.00000000000000
rv.xdw = x
rv.ydy = 1.00000000000000
rv.ydw = y
rv.zdz = 1.00000000000000
rv.zdw = z
rv.wdw = 1.00000000000000
return rv
def rotate(float x, float y, float z):
"""
Returns a matrix that rotates the displayable around the
origin.
`x`, `y`, `x`
The amount to rotate around the origin, in degrees.
"""
cdef float sinx = sin(pi*x/180)
cdef float cosx = cos(pi*x/180)
cdef float siny = sin(pi*y/180)
cdef float cosy = cos(pi*y/180)
cdef float sinz = sin(pi*z/180)
cdef float cosz = cos(pi*z/180)
cdef Matrix rv = Matrix(None)
rv.xdx = cosy*cosz
rv.xdy = -cosx*sinz + cosz*sinx*siny
rv.xdz = cosx*cosz*siny + sinx*sinz
rv.ydx = cosy*sinz
rv.ydy = cosx*cosz + sinx*siny*sinz
rv.ydz = cosx*siny*sinz - cosz*sinx
rv.zdx = -siny
rv.zdy = cosy*sinx
rv.zdz = cosx*cosy
rv.wdw = 1
return rv
def perspective(float w, float h, float n, float p, float f):
"""
Returns the Ren'Py projection matrix. This is a view into a 3d space
where (0, 0) is the top left corner (`w`/2, `h`/2) is the center, and
(`w`,`h`) is the bottom right, when the z coordinate is 0.
`w`, `h`
The width and height of the input plane, in pixels.
`n`
The distance of the near plane from the camera.
`p`
The distance of the 1:1 plane from the camera. This is where 1 pixel
is one coordinate unit.
`f`
The distance of the far plane from the camera.
"""
cdef Matrix rv = Matrix(None)
rv.xdx = p
rv.xdz = -w/2
rv.ydy = p
rv.ydz = -h/2
rv.zdz = -(f + n)/(f - n)
rv.zdw = (-2*f*n + p*(f + n))/(f - n)
rv.wdz = -1.00000000000000
rv.wdw = p
return rv
def screen_projection(float w, float h):
"""
This generates a matrix that projects the Ren'Py space, where (0, 0) is the
top left and (`w`, `h`) is the bottom right, into the OpenGL viewport, where
(-1.0, 1.0) is the top left and (1.0, -1.0) is the bottom.
Generates the matrix that projects the Ren'Py screen to the OpenGL screen.
"""
cdef Matrix rv = Matrix(None)
rv.xdx = 2/w
rv.xdw = -1.00000000000000
rv.ydy = -2/h
rv.ydw = 1.00000000000000
rv.zdz = 1.00000000000000
rv.wdw = 1.00000000000000
return rv
def texture_projection(float w, float h):
"""
This generates a matrix that project the Ren'Py space, where (0, 0) is the
top left and (`w`, `h`) is the bottom right, into the OpenGL render-to-texture
space, where (-1.0, -1.0) is the top left and (1.0, 1.0) is the bottom.
Generates the matrix that projects the Ren'Py screen to the OpenGL screen.
"""
cdef Matrix rv = Matrix(None)
rv.xdx = 2/w
rv.xdw = -1.00000000000000
rv.ydy = 2/h
rv.ydw = -1.00000000000000
rv.zdz = 1.00000000000000
rv.wdw = 1.00000000000000
return rv
+1 -2
View File
@@ -171,8 +171,7 @@ class SpriteManager(renpy.display.core.Displayable):
SpriteManagers have the following fields:
`width`, `height`
The width and height of this SpriteManager, in pixels.
The width and height of this SpriteManager, in pixels.
SpriteManagers have the following methods:
+45 -9
View File
@@ -19,14 +19,8 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
cdef class Matrix2D:
cdef public double xdx
cdef public double xdy
cdef public double ydx
cdef public double ydy
cpdef tuple transform(Matrix2D self, double x, double y)
cpdef bint is_unit_aligned(Matrix2D self)
from renpy.display.matrix cimport Matrix, Matrix2D
cdef class Render:
@@ -39,14 +33,27 @@ cdef class Render:
cdef public set parents
cdef public list depends_on_list
# gl, sw: The drawing operation and its parameters.
cdef public int operation
cdef public double operation_complete
cdef public bint operation_alpha
cdef public object operation_parameter
cdef public Matrix2D forward, reverse
# The transform toward texture space
cdef public Matrix forward
# The transform toward screen space.
cdef public Matrix reverse
# Alpha multiplication - this is multipled with r, g, b, and a, to reduce
# the alpha of this Render and its children.
cdef public double alpha
# Over multiplication - this is multiplied with a. This is really (1-additive),
# such that if this is 0.0, additive blending occurs.
cdef public double over
# True if child textures should be rendered in nearest-neighbor mode.
cdef public object nearest
cdef public list focuses
@@ -62,12 +69,41 @@ cdef class Render:
cdef public bint xclipping
cdef public bint yclipping
# gl, sw: Caching of render-to-texture.
cdef public object surface, alpha_surface, half_cache
cdef public bint modal
cdef public bint text_input
# gl2 ######################################################################
# The mesh. If this is not None, the children are all rendered to Textures,
# and used to form a model. If this is True, the Mesh is taken from the first
# child's Texture, otherwise this must be a Mesh.
cdef public object mesh
# A tuple of shaders that will be used when rendering, or None.
cdef public tuple shaders
# A dictionary containing uniforms that will be used when rendering, or
# None.
cdef public dict uniforms
# Properties that control rendering.
cdef public dict properties
# Used to cache the result of rendering this Render to a texture.
cdef public object cached_texture
# Used to cache the model.
cdef public object cached_model
# True if the texture has been loaded.
cdef public bint loaded
# operations ###############################################################
cpdef int blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
cpdef int subpixel_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
cpdef int absolute_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
+106 -103
View File
@@ -22,6 +22,14 @@
from __future__ import print_function
from renpy.display.matrix import Matrix, Matrix2D
from renpy.display.matrix cimport Matrix, Matrix2D
# This is required to get these to re-export despite having been defined
# in cython.
globals()["Matrix"] = Matrix
globals()["Matrix2D"] = Matrix2D
import collections
import pygame_sdl2 as pygame
import threading
@@ -56,6 +64,13 @@ frame_time = 0
# Are we doing a per_frame update?
per_frame = False
# Are we rendering for the purpose of sizing something.
sizing = False
# This is true if we're using a renderer that supports models,
# false otherwise.
models = False
def adjust_render_cache_times(old_time, new_time):
"""
This adjusts the render cache such that if a render starts at
@@ -258,30 +273,57 @@ cpdef render(d, object widtho, object heighto, double st, double at):
rv.render_of.append(d)
renpy.plog(4, "after clipping")
render_cache_d[wh] = rv
if wh is not orig_wh:
render_cache_d[orig_wh] = rv
if not sizing:
# This lookup is needed because invalidations are possible.
render_cache_d = render_cache[id_d]
render_cache_d[wh] = rv
if wh is not orig_wh:
render_cache_d[orig_wh] = rv
renpy.plog(2, "end render {!r}", d)
return rv
def render_for_size(d, width, height, st, at):
"""
This returns a render of `d` that's useful for getting the size or
screen location, but not for actual rendering.
"""
global sizing
id_d = id(d)
orig_wh = (width, height, frame_time-st, frame_time-at)
render_cache_d = render_cache[id_d]
rv = render_cache_d.get(orig_wh, None)
if rv is not None:
return rv
old_sizing = sizing
sizing = True
try:
return render(d, width, height, st, at)
finally:
sizing = old_sizing
def invalidate(d):
"""
Removes d from the render cache. If we're not in a redraw, triggers
a redraw to start.
"""
for v in render_cache[id(d)].values():
v.kill_cache()
if per_frame:
if (not rendering) and (not per_frame) and (not sizing):
redraw(d, 0)
return
if not rendering:
redraw(d, 0)
for v in render_cache[id(d)].values():
v.kill_cache()
def check_redraws():
"""
@@ -380,74 +422,6 @@ def redraw(d, when):
redraw_queue.append((when + renpy.game.interface.frame_time, d))
cdef class Matrix2D:
"""
This represents a 2d matrix that can be used to transform
points and things like that.
"""
def __getstate__(self):
return dict(
xdx = self.xdx,
xdy = self.xdy,
ydx = self.ydx,
ydy = self.ydy)
def __setstate__(self, state):
self.xdx = state['xdx']
self.xdy = state['xdy']
self.ydx = state['ydx']
self.ydy = state['ydy']
def __init__(Matrix2D self, double xdx, double xdy, double ydx, double ydy):
self.xdx = xdx
self.xdy = xdy
self.ydx = ydx
self.ydy = ydy
cpdef tuple transform(Matrix2D self, double x, double y):
return (x * self.xdx + y * self.xdy), (x * self.ydx + y * self.ydy)
def __mul__(Matrix2D self, Matrix2D other):
return Matrix2D(
other.xdx * self.xdx + other.xdy * self.ydx,
other.xdx * self.xdy + other.xdy * self.ydy,
other.ydx * self.xdx + other.ydy * self.ydx,
other.ydx * self.xdy + other.ydy * self.ydy)
def __repr__(self):
return "Matrix2D(xdx=%f, xdy=%f, ydx=%f, ydy=%f)" % (self.xdx, self.xdy, self.ydx, self.ydy)
def __richcmp__(self, other, op):
if op != 2:
return NotImplemented
if self is other:
return True
return (
abs(self.xdx - other.xdx) +
abs(self.xdy - other.xdy) +
abs(self.ydx - other.ydx) +
abs(self.ydy - other.ydy)) < .00001
cpdef bint is_unit_aligned(Matrix2D self):
"""
Returns true if exactly one of abs(xdx) or abs(xdy) is 1.0, and
the same for xdy and ydy. This is intended to report if a matrix
is aligned to the axes.
(It will also return true for something like xdx=1, xdy=0, ydx=1, xdy=1,
but that should never happen.)
"""
cdef bint unit_xdx = .99999 < abs(self.xdx) < 1.00001
cdef bint unit_xdy = .99999 < abs(self.xdy) < 1.00001
cdef bint unit_ydx = .99999 < abs(self.ydx) < 1.00001
cdef bint unit_ydy = .99999 < abs(self.ydy) < 1.00001
return (unit_xdx ^ unit_xdy) and (unit_ydx ^ unit_ydy)
IDENTITY = Matrix2D(1, 0, 0, 1)
@@ -600,6 +574,7 @@ BLIT = 0
DISSOLVE = 1
IMAGEDISSOLVE = 2
PIXELLATE = 3
FLATTEN = 4
cdef class Render:
@@ -619,7 +594,6 @@ cdef class Render:
# Is has this render been removed from the cache?
self.cache_killed = False
self.width = width
self.height = height
@@ -629,25 +603,6 @@ cdef class Render:
# back to front.
self.children = [ ]
# The set of renders that either have us as children, or depend on
# us.
self.parents = set()
# The renders we depend on, including our children.
self.depends_on_list = [ ]
# The operation we're performing. (BLIT, DISSOLVE, OR IMAGE_DISSOLVE)
self.operation = BLIT
# The fraction of the operation that is complete.
self.operation_complete = 0.0
# Should the dissolve operations preserve alpha?
self.operation_alpha = False
# The parameter to the operation.
self.operation_parameter = 0
# Forward is used to transform from screen coordinates to child
# coordinates.
# Reverse is used to transform from child coordinates to screen
@@ -700,6 +655,33 @@ cdef class Render:
self.xclipping = False
self.yclipping = False
# Are we modal?
self.modal = False
# Are we a text input?
self.text_input = False
# gl, sw
# The set of renders that either have us as children, or depend on
# us.
self.parents = set()
# The renders we depend on, including our children.
self.depends_on_list = [ ]
# The operation we're performing. (BLIT, DISSOLVE, OR IMAGE_DISSOLVE)
self.operation = BLIT
# The fraction of the operation that is complete.
self.operation_complete = 0.0
# Should the dissolve operations preserve alpha?
self.operation_alpha = False
# The parameter to the operation.
self.operation_parameter = 0
# Caches of the texture created by rendering this surface.
self.surface = None
self.alpha_surface = None
@@ -708,11 +690,31 @@ cdef class Render:
# (This is set in gldraw.)
self.half_cache = None
# Are we modal?
self.modal = False
# gl2
# Are we a text input?
self.text_input = False
# The mesh. If this is not None, the children are all rendered to Textures,
# and used to form a model. If this is True, the Mesh is taken from the first
# child's Texture, otherwise this must be a Mesh.
self.mesh = None
# A tuple of shaders that will be used when rendering, or None.
self.shaders = None
# A dictionary containing uniforms that will be used when rendering, or
# None.
self.uniforms = None
# Properties that are used for rendering.
self.properties = None
# Used to cache the result of rendering this Render to a texture.
self.cached_texture = None
# Used to cache the model.
self.cached_model = None
# Have the textures been loaded?
self.loaded = False
live_renders.append(self)
@@ -1025,6 +1027,7 @@ cdef class Render:
rv.operation_alpha = self.operation_alpha
rv.operation_complete = self.operation_complete
rv.nearest = self.nearest
rv.text_input = self.text_input
return rv
@@ -1379,7 +1382,7 @@ cdef class Render:
return Canvas(surf)
def screen_rect(self, double sx, double sy, Matrix2D transform):
def screen_rect(self, double sx, double sy, Matrix transform):
"""
Returns the rectangle, in screen-space coordinates, that will be covered
by this render when it's drawn to the screen at sx, sy, with the transform
+28 -13
View File
@@ -680,7 +680,11 @@ class ScreenDisplayable(renpy.display.layout.Container):
rv.focus_screen = self
hiding = (self.phase == OLD) or (self.phase == HIDE)
sensitive = renpy.python.py_eval(self.screen.sensitive)
if self.screen is None:
sensitive = False
else:
sensitive = renpy.python.py_eval(self.screen.sensitive, locals=self.scope)
rv.blit(child, (0, 0), focus=sensitive and not hiding, main=not hiding)
rv.modal = self.modal and not hiding
@@ -698,8 +702,11 @@ class ScreenDisplayable(renpy.display.layout.Container):
if (self.phase == OLD) or (self.phase == HIDE):
return
if not renpy.python.py_eval(self.screen.sensitive):
return
if not self.screen:
return None
if not renpy.python.py_eval(self.screen.sensitive, locals=self.scope):
ev = renpy.display.interface.time_event
try:
push_current_screen(self)
@@ -908,17 +915,25 @@ def prepare_screens():
predict_cache.clear()
if not analyzed:
analyze_screens()
old_predicting = renpy.display.predict.predicting
renpy.display.predict.predicting = True
for s in sorted_variants():
if s.ast is None:
continue
try:
s.ast.unprepare_screen()
s.ast.prepare_screen()
if not analyzed:
analyze_screens()
prepared = True
for s in sorted_variants():
if s.ast is None:
continue
s.ast.unprepare_screen()
s.ast.prepare_screen()
prepared = True
finally:
renpy.display.predict.predicting = old_predicting
if renpy.config.developer and use_cycle:
raise Exception("The following screens use each other in a loop: " + ", ".join(use_cycle) +". This is not allowed.")
@@ -1071,8 +1086,8 @@ def show_screen(_screen_name, *_args, **kwargs):
If true, the screen will be automatically hidden at the end of
the current interaction.
Keyword arguments not beginning with underscore (_) are used to
initialize the screen's scope.
Non-keyword arguments, and keyword arguments that do not begin with
an underscore, are passed to the screen.
"""
_layer = kwargs.pop("_layer", None)
+11 -16
View File
@@ -28,7 +28,7 @@ import weakref
import time
import os
from renpy.display.render import blit_lock, IDENTITY, BLIT, DISSOLVE, IMAGEDISSOLVE, PIXELLATE
from renpy.display.render import blit_lock, IDENTITY, BLIT, DISSOLVE, IMAGEDISSOLVE, PIXELLATE, FLATTEN
# A map from cached surface to rle version of cached surface.
rle_cache = weakref.WeakKeyDictionary()
@@ -310,11 +310,11 @@ def draw_special(what, dest, x, y):
ramp = "\x00" * 256
for i in xrange(0, ramplen):
ramp += chr(255 * i / ramplen)
ramp += chr(255 * i // ramplen)
ramp += "\xff" * 256
step = int( what.operation_complete * (256 + ramplen) )
step = int(what.operation_complete * (256 + ramplen))
ramp = ramp[step:step+256]
renpy.display.module.imageblend(
@@ -338,6 +338,10 @@ def draw_special(what, dest, x, y):
dest.subsurface((0, 0, w, h)),
px, px, px, px)
elif what.operation == FLATTEN:
surf = what.children[0][0].render_to_texture(dest.get_masks()[3])
dest.subsurface((0, 0, w, h)).blit(surf, (0, 0))
else:
raise Exception("Unknown operation: %d" % what.operation)
@@ -635,8 +639,8 @@ def draw_transformed(dest, clip, what, xo, yo, alpha, forward, reverse):
cxo, cyo = reverse.transform(cxo, cyo)
if what.forward:
child_forward = forward * what.forward
child_reverse = what.reverse * reverse
child_forward = what.forward * forward
child_reverse = reverse * what.reverse
else:
child_forward = forward
child_reverse = reverse
@@ -1108,22 +1112,13 @@ class SWDraw(object):
self.mutated_surface(surf)
return surf
def free_memory(self):
def kill_textures(self):
"""
Frees up memory.
Kills all textures and caches of textures.
"""
rle_cache.clear()
def deinit(self):
"""
Called when we're restarted.
"""
renpy.display.render.free_memory()
return
def quit(self): # @ReservedAssignment
"""
Shuts down the drawing system.
-3
View File
@@ -993,9 +993,6 @@ class Transform(Container):
rv.take_execution_state(self)
rv._unique()
if rv.child and rv.child._duplicatable:
rv.child = rv.child._duplicate(None)
return rv
def _in_current_store(self):
+39
View File
@@ -369,6 +369,19 @@ class Dissolve(Transition):
rv.operation_alpha = self.alpha or renpy.config.dissolve_force_alpha
rv.operation_complete = complete
if renpy.display.render.models:
target = rv.get_size()
if top.get_size() != target:
top = top.subsurface((0, 0, width, height))
if bottom.get_size() != target:
bottom = bottom.subsurface((0, 0, width, height))
rv.mesh = True
rv.shaders = ( "renpy.dissolve", )
rv.uniforms = { "uDissolve" : complete }
rv.blit(bottom, (0, 0), focus=False, main=False)
rv.blit(top, (0, 0), focus=True, main=True)
@@ -509,6 +522,32 @@ class ImageDissolve(Transition):
rv.operation_complete = complete
rv.operation_parameter = self.ramplen
if renpy.display.render.models:
target = rv.get_size()
if image.get_size() != target:
image = image.subsurface((0, 0, width, height))
if top.get_size() != target:
top = top.subsurface((0, 0, width, height))
if bottom.get_size() != target:
bottom = bottom.subsurface((0, 0, width, height))
ramp = self.ramplen
# Prevent a DBZ if the user gives us a 0 ramp.
if ramp < 1:
ramp = 1
# Compute the offset to apply to the alpha.
start = -1.0
end = ramp / 256.0
offset = start + ( end - start) * complete
rv.mesh = True
rv.shaders = ( "renpy.imagedissolve", )
rv.uniforms = { "uDissolveOffset" : offset, "uDissolveMultiplier" : 256.0 / ramp }
rv.blit(image, (0, 0), focus=False, main=False)
rv.blit(bottom, (0, 0), focus=False, main=False)
rv.blit(top, (0, 0), focus=True, main=True)
+34 -12
View File
@@ -106,10 +106,10 @@ class Viewport(renpy.display.layout.Container):
self._show()
if isinstance(replaces, Viewport):
if isinstance(replaces, Viewport) and replaces.offsets:
self.xadjustment.range = replaces.xadjustment.range
self.yadjustment.range = replaces.yadjustment.range
self.xadjustment.value = replaces.xadjustment.value
self.yadjustment.range = replaces.yadjustment.range
self.yadjustment.value = replaces.yadjustment.value
self.xoffset = replaces.xoffset
self.yoffset = replaces.yoffset
@@ -206,7 +206,7 @@ class Viewport(renpy.display.layout.Container):
width = max(width, self.style.xminimum)
height = max(height, self.style.yminimum)
if self.set_adjustments:
if (not renpy.display.render.sizing) and self.set_adjustments:
xarange = max(cw - width, 0)
@@ -278,7 +278,7 @@ class Viewport(renpy.display.layout.Container):
return rv
def check_edge_redraw(self, st):
def check_edge_redraw(self, st, reset_st=True):
redraw = False
if (self.edge_xspeed > 0) and (self.xadjustment.value < self.xadjustment.range):
@@ -293,7 +293,8 @@ class Viewport(renpy.display.layout.Container):
if redraw:
renpy.display.render.redraw(self, 0)
self.edge_last_st = st
if reset_st or self.edge_last_st is None:
self.edge_last_st = st
else:
self.edge_last_st = None
@@ -309,22 +310,43 @@ class Viewport(renpy.display.layout.Container):
if self.draggable and renpy.display.focus.get_grab() == self:
old_xvalue = self.xadjustment.value
old_yvalue = self.yadjustment.value
if renpy.display.behavior.map_event(ev, 'viewport_drag_end'):
renpy.display.focus.set_grab(None)
# Invoke rounding adjustment on viewport release
xvalue = self.xadjustment.round_value(old_xvalue, release=True)
self.xadjustment.change(xvalue)
yvalue = self.yadjustment.round_value(old_yvalue, release=True)
self.yadjustment.change(yvalue)
raise renpy.display.core.IgnoreEvent()
oldx, oldy = self.drag_position
dx = x - oldx
dy = y - oldy
self.xadjustment.change(self.xadjustment.value - dx)
self.yadjustment.change(self.yadjustment.value - dy)
new_xvalue = self.xadjustment.round_value(old_xvalue - dx, release=False)
if old_xvalue == new_xvalue:
newx = oldx
else:
self.xadjustment.change(new_xvalue)
newx = x
self.drag_position = (x, y) # W0201
new_yvalue = self.yadjustment.round_value(old_yvalue - dy, release=False)
if old_yvalue == new_yvalue:
newy = oldy
else:
self.yadjustment.change(new_yvalue)
newy = y
if renpy.display.behavior.map_event(ev, 'viewport_drag_end'):
renpy.display.focus.set_grab(None)
raise renpy.display.core.IgnoreEvent()
self.drag_position = (newx, newy) # W0201
if not ((0 <= x < self.width) and (0 <= y <= self.height)):
self.edge_xspeed = 0
self.edge_yspeed = 0
self.edge_last_st = None
inside = False
@@ -474,7 +496,7 @@ class Viewport(renpy.display.layout.Container):
self.edge_yspeed = self.edge_speed * self.edge_function(yspeed)
if xspeed or yspeed:
self.check_edge_redraw(st)
self.check_edge_redraw(st, reset_st=False)
else:
self.edge_last_st = None

Some files were not shown because too many files have changed in this diff Show More