Compare commits

...

33 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
Andy_kl 836238de5c CDSL displayables should allow 'if' statements inside self. 2019-07-12 00:06:40 +03:00
16 changed files with 156 additions and 75 deletions
+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(
+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 "Меню"
+1 -1
View File
@@ -40,7 +40,7 @@ except ImportError:
vc_version = 0
# The tuple giving the version number.
version_tuple = (7, 3, 3, vc_version)
version_tuple = (7, 3, 4, vc_version)
# The name of this version.
version_name = "The world (wide web) is not enough."
+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
+29 -12
View File
@@ -409,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:
@@ -636,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)
@@ -691,8 +703,8 @@ class Drag(renpy.display.core.Displayable, renpy.python.RevertableObject):
self.last_drop = drop
if drop is not None:
drop.set_style_prefix("selected_idle_", True)
if self.drag_moved:
self.update_style_prefix()
if map_event(ev, 'drag_deactivate'):
@@ -848,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
@@ -862,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.
"""
+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
+2 -2
View File
@@ -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(
+4
View File
@@ -196,6 +196,7 @@ cdef class GLDraw:
self.did_init = False
if renpy.windows and (self.old_fullscreen is not None):
renpy.display.interface.kill_textures_and_surfaces()
pygame.display.quit()
pygame.display.init()
@@ -930,6 +931,9 @@ cdef class GLDraw:
p /= 2
pc = self.get_half(pc)
elif rend.operation == FLATTEN:
child.render_to_texture(True)
if render_what:
what.render_to_texture(True)
+9 -7
View File
@@ -95,17 +95,19 @@ class FboRtt(Rtt):
to render the texture.
"""
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo)
try:
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo)
environ.viewport(0, 0, w, h)
environ.ortho(x, x + w, y, y + h, -1, 1)
environ.viewport(0, 0, w, h)
environ.ortho(x, x + w, y, y + h, -1, 1)
draw_func(x, y, w, h)
draw_func(x, y, w, h)
glBindTexture(GL_TEXTURE_2D, texture)
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, w, h, 0)
glBindTexture(GL_TEXTURE_2D, texture)
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, w, h, 0)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, root_fbo)
finally:
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, root_fbo)
def get_size_limit(self, dimension):
+3 -3
View File
@@ -275,7 +275,7 @@ def image_exists(name, expression, tag, precise=True):
if image_exists_precise(name):
return
report("'{}' is not an image.".format(" ".join(name)) )
report("'%s' is not an image.", " ".join(name))
# Only check each file once.
@@ -617,8 +617,8 @@ def check_label(node):
def check_screen(node):
if (node.screen.parameters is None) and renpy.config.lint_screens_without_parameters:
report("The screen {} has not been given a parameter list.".format(node.screen.name))
add("This can be fixed by writing 'screen {}():' instead.".format(node.screen.name))
report("The screen %s has not been given a parameter list.", node.screen.name)
add("This can be fixed by writing 'screen %s():' instead.", node.screen.name)
def check_styles():
+1 -1
View File
@@ -116,7 +116,7 @@ def save_dump(roots, log):
size = 1
elif isinstance(o, (str, unicode)):
size = len(o) / 40 + 1
size = len(o) // 40 + 1
elif isinstance(o, (tuple, list)):
size = 1
+4
View File
@@ -523,6 +523,8 @@ def register_sl_displayable(*args, **kwargs):
for i in all_statements:
rv.add(i)
rv.add(if_statement)
return rv
@@ -945,6 +947,8 @@ class CustomParser(Parser):
for i in all_statements:
self.add(i)
self.add(if_statement)
global parser
parser = None
+31 -1
View File
@@ -2,6 +2,36 @@
Full Changelog
==============
.. _renpy-7.3.4:
7.3.4
=====
Fixes
-----
This release fixes major graphics glitches that were introduced in 7.3.3.
* On Windows, textures would fail to be reloaded when switching from fullscreen
to windowed mode or vice-versa. This would cause the wrong texture to be
displayed.
* On all platforms, graphical glitches could occur when :func:`Flatten`
was used.
Other Changes
-------------
Dynamic images can now include "[prefix_]" everywhere, and especially when
``add`` has been used to add a dynamic image to buttons, drags, and similar
focusable objects.
Creator-defined screen language statements may now take ``if``
statements as children.
The drag and drop system has been improved to better interact with updated
screens.
.. _renpy-7.3.3:
7.3.3
@@ -315,7 +345,7 @@ take a zorder argument.
Ren'Py will now play a mono sound file with the same volume as a stereo
sound file, rather than sending half the energy to each ear.
The new :func:`config.load_failed_label` specifies a label that is jumped
The new :var:`config.load_failed_label` specifies a label that is jumped
to when a load fails because Ren'Py can no longer find the current statement.
This makes it possible to a game to implement its own recovery mechanism.
+10 -10
View File
@@ -168,7 +168,7 @@ These control transitions between various screens.
This should be a function that takes four arguments, the image tag
being shown, a `mode` parameter, a `set` containing pre-transition tags
and a `set` containing post-transition tags. Where the value of the
`mode` paramater is one of:
`mode` parameter is one of:
* "permanent", for permanent attribute change (one that lasts longer
than the current say statement).
@@ -179,7 +179,7 @@ These control transitions between various screens.
part is restored at the end of the current say statement).
* "restore", for when a temporary (or both) change is being restored.
This should return a 2-component tuple, consiting of:
This should return a 2-component tuple, consisting of:
* The transition to use, or None if no transition should occur.
* The layer the transition should be on, either a string or None. This is
@@ -316,7 +316,7 @@ Occasionally Used
.. var:: config.context_callback = None
This is a callback that is called when Ren'Py enteres a new context,
This is a callback that is called when Ren'Py enters a new context,
such as a menu context.
.. var:: config.context_copy_remove_screens = [ 'notify' ]
@@ -353,7 +353,7 @@ Occasionally Used
.. var:: config.default_tag_layer = "master"
The layer an image is show on if its tag is not found in config.tag_layer.
The layer an image is shown on if its tag is not found in config.tag_layer.
.. var:: config.default_transform = ...
@@ -361,7 +361,7 @@ Occasionally Used
the transform properties are taken from this transform and used to
initialize the values of the displayable's transform.
The default default transform is :var:`center`.
The default transform is :var:`center`.
.. var:: config.defer_styles = False
@@ -578,7 +578,7 @@ Occasionally Used
A function that determines the language the game should use,
based on the the user's locale.
It takes 2 arguments strings that give the the ISO code of the locale
It takes 2 string arguments that give the ISO code of the locale
and the ISO code of the region.
It should return a string giving the name of a translation to use, or
@@ -786,7 +786,7 @@ Occasionally Used
If not None, this should be a function that takes the speaking character,
followed by positional and keyword arguments. It's called whenever a
say statement occurs with the arguments to that say statment. This
say statement occurs with the arguments to that say statement. This
always includes an interact argument, and can include others provided
in the say statement.
@@ -1195,7 +1195,7 @@ Rarely or Internally Used
.. var:: config.longpress_duration = 0.5
The amount of time the player must press the screen for for a longpress
The amount of time the player must press the screen for a longpress
to be recognized on a touch device.
.. var:: config.longpress_radius = 15
@@ -1325,7 +1325,7 @@ Rarely or Internally Used
.. var:: config.rollback_side_size = .2
If the rollback side is enabled, the fraction of of the screen on the
If the rollback side is enabled, the fraction of the screen on the
rollback side that, when clicked or touched, causes a rollback to
occur.
@@ -1557,5 +1557,5 @@ Ren'Py management of the Python garbage collector.
.. var:: config.gc_print_unreachable = False
If True, Ren'Py will print to its console and logs informaton about the
If True, Ren'Py will print to its console and logs information about the
objects that are triggering collections.
+4 -1
View File
@@ -38,6 +38,9 @@ string is given, a dynamic image is created. A dynamic image has
of each interaction (such as say statements and menus). The resulting
string is processed according to the rules above.
When a string has "[prefix_"] in it, that iso replaced with each of the
style prefixes associated with the current displayable.
.. _images:
Images
@@ -241,7 +244,7 @@ images as appropriate. Placeholders are used automatically when an undefined
image is used in developer mode. Placeholder displayables can also be used
manually when the defaults are inappropriate. ::
# By default, the girl placeholer will be used.
# By default, the girl placeholder will be used.
image sue = Placeholder("boy")
label start: