Compare commits
13 Commits
6.16.2.490
...
6.17
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a19c95b60 | |||
| 2269a3a70c | |||
| afa4d561c6 | |||
| b0524459b6 | |||
| 5142810101 | |||
| 365544d62f | |||
| 3e77dafbc7 | |||
| ec45a88c61 | |||
| 9c6b3ca4d0 | |||
| d4eefdc3ab | |||
| 2771c25f37 | |||
| 46137dd7cf | |||
| 006efeb15f |
@@ -46,6 +46,7 @@ styles.txt
|
||||
/module/gen
|
||||
/editra
|
||||
/launcher/game/theme
|
||||
/launcher/game/script_version.rpy
|
||||
|
||||
dl
|
||||
renpy/vc_version.py
|
||||
|
||||
+5
-5
@@ -93,8 +93,12 @@ def main():
|
||||
# Compile all the python files.
|
||||
compileall.compile_dir("renpy/", ddir="renpy/", force=1, quiet=1)
|
||||
|
||||
# Compile the various games
|
||||
# Generate launcher/game/script_version.rpy
|
||||
with open("launcher/game/script_version.rpy", "w") as f:
|
||||
f.write("init -999 python:\n")
|
||||
f.write(" config.script_version = {!r}\n".format(renpy.version_tuple[:3])) # @UndefinedVariable
|
||||
|
||||
# Compile the various games.
|
||||
if not args.fast:
|
||||
for i in [ 'tutorial', 'launcher', 'templates/english', 'templates/japanese', 'the_question' ]:
|
||||
print "Compiling", i
|
||||
@@ -217,9 +221,5 @@ def main():
|
||||
else:
|
||||
print "RAPT build succeeded."
|
||||
|
||||
print
|
||||
print "Did you run me with renpython -O?"
|
||||
print "Did you update renpy.py and launcher/script_version.rpy?"
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -166,6 +166,10 @@ init python:
|
||||
|
||||
def fail(self, prompt):
|
||||
prompt = re.sub(r'(http://\S+)', r'{a=\1}\1{/a}', prompt)
|
||||
|
||||
# Open android.txt in the editor.
|
||||
editor.EditAbsolute(self.filename)()
|
||||
|
||||
interface.error(prompt, label="android")
|
||||
|
||||
def success(self, prompt):
|
||||
|
||||
@@ -558,13 +558,20 @@ init python in distribute:
|
||||
Add Ren'Py-generic files to the project.
|
||||
"""
|
||||
|
||||
if not os.path.exists(os.path.join(self.project.path, "game", "script_version.rpy")):
|
||||
self.add_file("all", "game/script_version.rpy", os.path.join(config.gamedir, "script_version.rpy"))
|
||||
SCRIPT_VERSION_RPY = os.path.join(config.gamedir, "script_version.rpy")
|
||||
SCRIPT_VERSION_RPYC = os.path.join(config.gamedir, "script_version.rpy")
|
||||
LICENSE_TXT = os.path.join(config.renpy_base, "LICENSE.txt")
|
||||
|
||||
if not os.path.exists(os.path.join(self.project.path, "game", "script_version.rpyc")):
|
||||
self.add_file("all", "game/script_version.rpyc", os.path.join(config.gamedir, "script_version.rpyc"))
|
||||
if os.path.exists(SCRIPT_VERSION_RPY):
|
||||
if not os.path.exists(os.path.join(self.project.path, "game", "script_version.rpy")):
|
||||
self.add_file("all", "game/script_version.rpy", SCRIPT_VERSION_RPY)
|
||||
|
||||
self.add_file("renpy", "renpy/LICENSE.txt", os.path.join(config.renpy_base, "LICENSE.txt"))
|
||||
if os.path.exists(SCRIPT_VERSION_RPYC):
|
||||
if not os.path.exists(os.path.join(self.project.path, "game", "script_version.rpyc")):
|
||||
self.add_file("all", "game/script_version.rpyc", SCRIPT_VERSION_RPYC)
|
||||
|
||||
if os.path.exists(LICENSE_TXT):
|
||||
self.add_file("renpy", "renpy/LICENSE.txt", LICENSE_TXT)
|
||||
|
||||
|
||||
def write_plist(self):
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
init -999:
|
||||
$ config.script_version = (6, 16, 2)
|
||||
+6
-7
@@ -31,14 +31,13 @@ try:
|
||||
except ImportError:
|
||||
vc_version = 0
|
||||
|
||||
# The tuple giving the version. This needs to be updated when
|
||||
# we bump the version.
|
||||
#
|
||||
# Be sure to change script_version in launcher/game/script_version.rpy.
|
||||
# Be sure to change config.version in tutorial/game/options.rpy.
|
||||
version_tuple = (6, 16, 2, vc_version)
|
||||
# The tuple giving the version number.
|
||||
version_tuple = (6, 17, 0, vc_version)
|
||||
|
||||
# A verbose string computed from that version.
|
||||
# The name of this version.
|
||||
version_name = "In This Decade..."
|
||||
|
||||
# A verbose string giving the version.
|
||||
version = "Ren'Py " + ".".join(str(i) for i in version_tuple)
|
||||
|
||||
# Other versions.
|
||||
|
||||
@@ -112,7 +112,11 @@ init -1500 python in build:
|
||||
|
||||
(".android.json", "android"),
|
||||
("android-icon.png", "android"),
|
||||
("android-presplash.jpg", "android"),
|
||||
("android-*-icon.png", "android"),
|
||||
("android-*-presplash.jpg", "android"),
|
||||
("ouya-icon.png", "android"),
|
||||
("ouya_icon.png", "android"),
|
||||
])
|
||||
|
||||
base_patterns = [ ]
|
||||
|
||||
+29
-18
@@ -504,6 +504,8 @@ def input(prompt, default='', allow=None, exclude='{}', length=None, with_none=N
|
||||
|
||||
def menu(items, set_expr):
|
||||
"""
|
||||
:undocumented:
|
||||
|
||||
Displays a menu, and returns to the user the value of the selected
|
||||
choice. Also handles conditions and the menuset.
|
||||
"""
|
||||
@@ -609,20 +611,24 @@ def display_menu(items,
|
||||
predict_only=False,
|
||||
**kwargs):
|
||||
"""
|
||||
Displays a menu containing the given items, returning the value of
|
||||
the item the user selects.
|
||||
:doc: se_menu
|
||||
:args: (items, interact=True, screen="choice")
|
||||
|
||||
@param items: A list of tuples that are the items to be added to
|
||||
this menu. The first element of a tuple is a string that is used
|
||||
for this menuitem. The second element is the value to be returned
|
||||
if this item is selected, or None if this item is a non-selectable
|
||||
caption.
|
||||
This displays a menu to the user. `items` should be a list of 2-item tuples.
|
||||
In each tuple, the first item is a textual label, and the second item is
|
||||
the value to be returned if that item is selected. If the value is None,
|
||||
the first item is used as a menu caption.
|
||||
|
||||
@param interact: If True, then an interaction occurs. If False, no suc
|
||||
interaction occurs, and the user should call ui.interact() manually.
|
||||
This function takes many arguments, of which only a few are documented.
|
||||
Except for `items`, all arguments should be given as keyword arguments.
|
||||
|
||||
@param with_none: If True, performs a with None after the input. If None,
|
||||
takes the value from config.implicit_with_none.
|
||||
`interact`
|
||||
If false, the menu is displayed, but no interaction is performed.
|
||||
|
||||
`screen`
|
||||
The name of the screen used to display the menu.
|
||||
|
||||
In each pair the first element of which is a textual label, and the second item
|
||||
"""
|
||||
|
||||
if interact:
|
||||
@@ -1195,7 +1201,7 @@ def screenshot(filename):
|
||||
|
||||
def version(tuple=False): #@ReservedAssignment
|
||||
"""
|
||||
:doc: `other`
|
||||
:doc: other
|
||||
|
||||
If `tuple` is false, returns a string containing "Ren'Py ", followed by
|
||||
the current version of Ren'Py.
|
||||
@@ -1219,13 +1225,18 @@ def module_version():
|
||||
|
||||
def transition(trans, layer=None, always=False, force=False):
|
||||
"""
|
||||
Sets the transition that will be used for the next
|
||||
interaction. This is useful when the next interaction doesn't take
|
||||
a with clause, as is the case with pause, input, and imagemap.
|
||||
:doc: other
|
||||
:args: (trans, layer=None, always=False)
|
||||
|
||||
@param layer: If the layer setting is not None, then the transition
|
||||
will be applied only to the layer named. Please note that only some
|
||||
transitions can be applied to specific layers.
|
||||
Sets the transition that will be used during the next interaction.
|
||||
|
||||
`layer`
|
||||
The layer the transition applies to. If None, the transition
|
||||
applies to the entire scene.
|
||||
|
||||
`always`
|
||||
If false, this respects the transition preference. If true, the
|
||||
transition is always run.
|
||||
"""
|
||||
|
||||
if not always and not renpy.game.preferences.transitions:
|
||||
|
||||
@@ -671,6 +671,8 @@ cdef class GLDraw:
|
||||
ELSE:
|
||||
egl_swap()
|
||||
|
||||
gltexture.cleanup()
|
||||
|
||||
gl_check("draw_screen")
|
||||
|
||||
cpdef int draw_render_textures(GLDraw self, what, bint non_aligned):
|
||||
|
||||
+43
-5
@@ -43,7 +43,7 @@ MAX_SIZE = 1024
|
||||
SIZES = [ 64 ]
|
||||
|
||||
# A list of texture number allocated.
|
||||
texture_numbers = [ ]
|
||||
texture_numbers = set()
|
||||
|
||||
cdef GLenum tex_format = GL_RGBA
|
||||
cdef GLenum tex_internalformat = GL_RGBA
|
||||
@@ -443,8 +443,9 @@ cdef class TextureCore:
|
||||
This allocates a texture number, if necessary.
|
||||
"""
|
||||
|
||||
cdef unsigned int texnums[1]
|
||||
global total_texture_size
|
||||
|
||||
cdef unsigned int texnums[1]
|
||||
|
||||
if self.number != -1:
|
||||
return 0
|
||||
@@ -454,10 +455,30 @@ cdef class TextureCore:
|
||||
self.number = texnums[0]
|
||||
self.format = 0
|
||||
|
||||
texture_numbers.append(texnums[0])
|
||||
texture_numbers.add(texnums[0])
|
||||
total_texture_size += self.width * self.height * 4
|
||||
|
||||
return 0
|
||||
|
||||
def deallocate(self):
|
||||
"""
|
||||
Deallocates this texture. The texture must have been removed from a
|
||||
free list before this is called.
|
||||
"""
|
||||
|
||||
global total_texture_size
|
||||
|
||||
if self.number == -1:
|
||||
return
|
||||
|
||||
cdef GLuint texnums[1]
|
||||
|
||||
texnums[0] = self.number
|
||||
glDeleteTextures(1, texnums)
|
||||
|
||||
texture_numbers.remove(self.number)
|
||||
total_texture_size -= self.width * self.height * 4
|
||||
|
||||
class Texture(TextureCore):
|
||||
"""
|
||||
We need to be a real python class, not a C extension, to ensure that
|
||||
@@ -498,7 +519,6 @@ def alloc_texture(width, height):
|
||||
rv = l.pop()
|
||||
else:
|
||||
rv = Texture(width, height)
|
||||
total_texture_size += width * height * 4
|
||||
|
||||
rv.free_list = l
|
||||
|
||||
@@ -507,6 +527,7 @@ def alloc_texture(width, height):
|
||||
|
||||
def dealloc_textures():
|
||||
global texture_numbers
|
||||
global total_texture_size
|
||||
|
||||
cdef GLuint texnums[1]
|
||||
|
||||
@@ -515,9 +536,26 @@ def dealloc_textures():
|
||||
|
||||
glDeleteTextures(1, texnums)
|
||||
|
||||
texture_numbers = [ ]
|
||||
texture_numbers = set()
|
||||
free_textures.clear()
|
||||
|
||||
total_texture_size = 0
|
||||
|
||||
def cleanup():
|
||||
"""
|
||||
This is called once per frame.
|
||||
"""
|
||||
|
||||
# If we have more than one of a texture size, deallocate the last one of
|
||||
# that size. This prevents us from leaking memory via textures, while
|
||||
# making it unlikely we'll constantly allocate/deallocate textures.
|
||||
|
||||
for l in free_textures.values():
|
||||
if len(l) > 1:
|
||||
t = l.pop()
|
||||
t.deallocate()
|
||||
|
||||
|
||||
|
||||
def compute_subrow(row, offset, width):
|
||||
"""
|
||||
|
||||
+17
-3
@@ -4,6 +4,9 @@ import collections
|
||||
import keyword
|
||||
import renpy
|
||||
import shutil
|
||||
import StringIO
|
||||
import os
|
||||
|
||||
import __builtin__
|
||||
|
||||
# Keywords in the Ren'Py script language.
|
||||
@@ -225,9 +228,9 @@ def write_line_buffer():
|
||||
|
||||
for k, v in line_buffer.iteritems():
|
||||
|
||||
print "Generating", k
|
||||
# f = file("source/inc/" + k, "w")
|
||||
|
||||
f = file("source/inc/" + k, "w")
|
||||
f = StringIO.StringIO()
|
||||
|
||||
print >>f, ".. Automatically generated file - do not modify."
|
||||
print >>f
|
||||
@@ -235,7 +238,18 @@ def write_line_buffer():
|
||||
for l in v:
|
||||
print >>f, l
|
||||
|
||||
f.close()
|
||||
s = f.getvalue()
|
||||
|
||||
if os.path.exists("source/inc/" + k):
|
||||
with open("source/inc/" + k) as f:
|
||||
if f.read() == s:
|
||||
print "Retaining", k
|
||||
continue
|
||||
|
||||
print "Generating", k
|
||||
|
||||
with open("source/inc/" + k, "w") as f:
|
||||
f.write(s)
|
||||
|
||||
def write_reserved(module, dest, ignore_builtins):
|
||||
|
||||
|
||||
@@ -135,8 +135,10 @@ file mygame-release.apk into your Android Device. You will then need to find
|
||||
the .apk file in your Android device using a file manager application and
|
||||
open it to install the game.
|
||||
|
||||
|
||||
|
||||
Viewing Debug Output
|
||||
--------------------
|
||||
====================
|
||||
|
||||
Debug output can be found by running the adb command manually from
|
||||
the terminal. After installing the SDK, the adb command can be
|
||||
@@ -147,14 +149,44 @@ To view output from Ren'Py, consider a command line like:
|
||||
|
||||
adb logcat -s python:*
|
||||
|
||||
Icon and Presplash Images
|
||||
=========================
|
||||
|
||||
There are several special files that are used to set the icon and
|
||||
presplash images used by the package. These files should be placed
|
||||
in the base directory.
|
||||
|
||||
android-icon.png
|
||||
The icon that's used for the app in the Android launcher. This icon is
|
||||
automatically scaled down to the appropriate size, and should be larger
|
||||
that 144x144.
|
||||
|
||||
android-`density`-icon.png
|
||||
If present, these are used in preference to android-icon.png for screens
|
||||
of the given densities. This allows for pixel-perfect icons. Available
|
||||
screen densities and the corresponding icon sizes are:
|
||||
|
||||
* ldpi (36x36)
|
||||
* mdpi (48x48)
|
||||
* hdpi (72x72)
|
||||
* xhdpi (96x96)
|
||||
* xxhdpi (144x144)
|
||||
|
||||
android-presplash.jpg
|
||||
The image that's used when the app is loading. This should be surrounded
|
||||
by a monocolored border. That border is expanded to fill the screen.
|
||||
|
||||
ouya-icon.png
|
||||
A 732x412 icon that's used on the OUYA console.
|
||||
|
||||
|
||||
Google Play Expansion APKs
|
||||
--------------------------
|
||||
==========================
|
||||
|
||||
Ren'Py optionally supports the use of expansion APKs when used on a device
|
||||
supporting Google Play. Expansion APs allow Google Play to host games
|
||||
larger than 50MB in size. Please see:
|
||||
|
||||
|
||||
http://developer.android.com/google/play/expansion-files.html
|
||||
|
||||
For information about expansion APKs work. Right now, only the
|
||||
|
||||
@@ -98,8 +98,5 @@ also test on real hardware. The emulators do not deal with some human-factors
|
||||
issues, like the size of a user's fingers.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.. include:: android-packaging.rst
|
||||
|
||||
|
||||
@@ -178,6 +178,26 @@
|
||||
Attempts to set the size of the physical window to `size`. This has the
|
||||
side effect of taking the screen out of fullscreen mode.
|
||||
|
||||
.. function:: renpy.transition(trans, layer=None, always=False)
|
||||
|
||||
Sets the transition that will be used during the next interaction.
|
||||
|
||||
`layer`
|
||||
The layer the transition applies to. If None, the transition
|
||||
applies to the entire scene.
|
||||
|
||||
`always`
|
||||
If false, this respects the transition preference. If true, the
|
||||
transition is always run.
|
||||
|
||||
.. function:: renpy.version(tuple=False)
|
||||
|
||||
If `tuple` is false, returns a string containing "Ren'Py ", followed by
|
||||
the current version of Ren'Py.
|
||||
|
||||
If `tuple` is true, returns a string giving each component of the
|
||||
version as an integer.
|
||||
|
||||
.. function:: renpy.vibrate(duration)
|
||||
|
||||
Causes the device to vibrate for `duration` seconds. Currently, this
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
* left
|
||||
* library
|
||||
* main_menu
|
||||
* menu
|
||||
* :func:`menu`
|
||||
* mouse_visible
|
||||
* move
|
||||
* moveinbottom
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
.. Automatically generated file - do not modify.
|
||||
|
||||
.. function:: menu(items, interact=True, screen="choice")
|
||||
|
||||
This displays a menu to the user. `items` should be a list of 2-item tuples.
|
||||
In each tuple, the first item is a textual label, and the second item is
|
||||
the value to be returned if that item is selected. If the value is None,
|
||||
the first item is used as a menu caption.
|
||||
|
||||
This function takes many arguments, of which only a few are documented.
|
||||
Except for `items`, all arguments should be given as keyword arguments.
|
||||
|
||||
`interact`
|
||||
If false, the menu is displayed, but no interaction is performed.
|
||||
|
||||
`screen`
|
||||
The name of the screen used to display the menu.
|
||||
|
||||
In each pair the first element of which is a textual label, and the second item
|
||||
|
||||
.. function:: renpy.display_menu(items, interact=True, screen="choice")
|
||||
|
||||
This displays a menu to the user. `items` should be a list of 2-item tuples.
|
||||
In each tuple, the first item is a textual label, and the second item is
|
||||
the value to be returned if that item is selected. If the value is None,
|
||||
the first item is used as a menu caption.
|
||||
|
||||
This function takes many arguments, of which only a few are documented.
|
||||
Except for `items`, all arguments should be given as keyword arguments.
|
||||
|
||||
`interact`
|
||||
If false, the menu is displayed, but no interaction is performed.
|
||||
|
||||
`screen`
|
||||
The name of the screen used to display the menu.
|
||||
|
||||
In each pair the first element of which is a textual label, and the second item
|
||||
|
||||
@@ -58,6 +58,13 @@ arguments, or pass them to a character function. Doing this will
|
||||
allow the game to continue working if Ren'Py adds additional keyword
|
||||
arguments to character calls.
|
||||
|
||||
Choice Menus
|
||||
============
|
||||
|
||||
The menu statement has an equivalent Python function.
|
||||
|
||||
.. include:: inc/se_menu
|
||||
|
||||
|
||||
Displaying Images
|
||||
=================
|
||||
|
||||
@@ -28,7 +28,10 @@ init -1 python hide:
|
||||
# These control the name and version of the game, that are reported
|
||||
# with tracebacks and other debugging logs.
|
||||
config.name = "Ren'Py Tutorial"
|
||||
config.version = "6.16 \"In the Arena\""
|
||||
config.version = '{}.{} "{}"'.format(
|
||||
renpy.renpy.version_tuple[0],
|
||||
renpy.renpy.version_tuple[1],
|
||||
renpy.renpy.version_name)
|
||||
|
||||
## We then want to call a theme function. themes.roundrect is
|
||||
## a theme that features the use of rounded rectangles. It's
|
||||
@@ -243,22 +246,22 @@ init -1 python hide:
|
||||
|
||||
## Used when showing NVL-mode text directly after ADV-mode text.
|
||||
config.adv_nvl_transition = dissolve
|
||||
|
||||
|
||||
## Used when showing ADV-mode text directly after NVL-mode text.
|
||||
config.nvl_adv_transition = dissolve
|
||||
|
||||
|
||||
## Used when yesno is shown.
|
||||
config.enter_yesno_transition = None
|
||||
|
||||
## Used when the yesno is hidden.
|
||||
config.exit_yesno_transition = None
|
||||
|
||||
|
||||
## Used when entering a replay
|
||||
config.enter_replay_transition = None
|
||||
|
||||
|
||||
## Used when exiting a replay
|
||||
config.exit_replay_transition = None
|
||||
|
||||
|
||||
## Used when the image is changed by a say statement with image attributes.
|
||||
config.say_attribute_transition = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user