mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Proofing/review: Remove filler words, adhere to style guide
This commit is contained in:
@@ -54,7 +54,7 @@ Toolchain
|
||||
~~~~~~~~~
|
||||
|
||||
We usually try to keep the Godot Android build code up to date, but
|
||||
Google changes their toolchain versions very often, so if compilation
|
||||
Google changes their toolchain versions often, so if compilation
|
||||
fails due to wrong toolchain version, go to your NDK directory and check
|
||||
the current number, then set the following environment variable:
|
||||
|
||||
@@ -142,9 +142,8 @@ were compiled against the same version/commit as the editor. If you are
|
||||
using official binaries for the editor, make sure to install the matching
|
||||
export templates, or to build your own from the same version.
|
||||
|
||||
When exporting your game, Godot opens the APK, changes a few things inside,
|
||||
adds your file and spits it back. It's really handy! (and required some
|
||||
reverse engineering of the format).
|
||||
When exporting your game, Godot opens the APK, changes a few things inside and
|
||||
adds your files.
|
||||
|
||||
Installing the templates
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -99,7 +99,7 @@ Create a new Windows App project using the "App for OpenGL ES
|
||||
``Visual C++/Windows/Universal`` category.
|
||||
|
||||
This is a base project with the ANGLE dependencies already set up. However, by
|
||||
default it picks the debug version of the DLLs which usually have a very poor
|
||||
default it picks the debug version of the DLLs which usually have poor
|
||||
performance. So in the "Binaries" filter, click in each of the DLLs there
|
||||
and in the "Properties" window and change the relative path from
|
||||
``Debug_Win32`` to ``Release_Win32`` (or ``Release_ARM`` for devices).
|
||||
|
||||
@@ -334,7 +334,7 @@ make sure that you have installed Pywin32 so that parallel (-j) builds
|
||||
work properly.
|
||||
|
||||
If you need to edit the compilation commands, they are located in
|
||||
"Godot" project settings, NMAKE sheet. SCons is called at the very end of
|
||||
"Godot" project settings, NMAKE sheet. SCons is called at the end of
|
||||
the commands. If you make a mistake, copy the command from one of the
|
||||
other build configurations (debug, release_debug, release) or
|
||||
architectures (Win32/x64). They are equivalent.
|
||||
|
||||
@@ -41,12 +41,12 @@ Memory model
|
||||
|
||||
PC is a wonderful architecture. Computers often have gigabytes of RAM,
|
||||
terabytes of storage and gigahertz of CPU, and when an application needs
|
||||
more resources the OS will just swap out the inactive ones. Other
|
||||
more resources the OS will swap out the inactive ones. Other
|
||||
architectures (like mobile or consoles) are in general more limited.
|
||||
|
||||
The most common memory model is the heap, where an application will
|
||||
request a region of memory, and the underlying OS will try to fit it
|
||||
somewhere and return it. This often works best and is very flexible,
|
||||
somewhere and return it. This often works best and is flexible,
|
||||
but over time and with abuse, this can lead to segmentation.
|
||||
|
||||
Segmentation slowly creates holes that are too small for most common
|
||||
@@ -59,7 +59,7 @@ However, in many studies and tests, it is shown that given enough
|
||||
memory, if the maximum allocation size is below a given threshold in
|
||||
proportion to the maximum heap size and proportion of memory intended to
|
||||
be unused, segmentation will not be a problem over time as it will
|
||||
remain constant. In other words, just leave 10-20% of your memory free
|
||||
remain constant. In other words, leave 10-20% of your memory free
|
||||
and perform all small allocations and you are fine.
|
||||
|
||||
Godot ensures that all objects that can be allocated dynamically are
|
||||
@@ -103,14 +103,14 @@ which are equivalent to new, delete, new[] and delete[].
|
||||
memnew/memdelete also use a little C++ magic and notify Objects right
|
||||
after they are created, and right before they are deleted.
|
||||
|
||||
For dynamic memory, the DVector<> template is provided. Just use it
|
||||
like:
|
||||
For dynamic memory, the DVector<> template is provided. Use it
|
||||
like this:
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
DVector<int>
|
||||
|
||||
DVector is just a standard vector class, it can be accessed using the []
|
||||
DVector is a standard vector class, it can be accessed using the []
|
||||
operator, but that's probably slow for large amount of accesses (as it
|
||||
has to lock internally). A few helpers exist for this:
|
||||
|
||||
@@ -145,7 +145,7 @@ Godot provides also a set of common containers:
|
||||
- Set
|
||||
- Map
|
||||
|
||||
They are very simple and aim to be as minimal as possible, as templates
|
||||
They are simple and aim to be as minimal as possible, as templates
|
||||
in C++ are often inlined and make the binary size much fatter, both in
|
||||
debug symbols and code. List, Set and Map can be iterated using
|
||||
pointers, like this:
|
||||
@@ -189,7 +189,7 @@ StringName
|
||||
|
||||
StringNames are like a String, but they are unique. Creating a
|
||||
StringName from a string results in a unique internal pointer for all
|
||||
equal strings. StringNames are really useful for using strings as
|
||||
equal strings. StringNames are useful for using strings as
|
||||
identifier, as comparing them is basically comparing a pointer.
|
||||
|
||||
Creation of a StringName (especially a new one) is slow, but comparison
|
||||
@@ -204,7 +204,7 @@ Math types
|
||||
----------
|
||||
|
||||
There are several linear math types available in the core/math
|
||||
directory, they are basically just that.
|
||||
directory.
|
||||
|
||||
References:
|
||||
~~~~~~~~~~~
|
||||
|
||||
@@ -202,7 +202,7 @@ SDK library
|
||||
|
||||
So, finally it's time to add the SDK library. The library can come in
|
||||
two flavors, a JAR file or an Android project for ant. JAR is the
|
||||
easiest to integrate, just put it in the module directory and add it:
|
||||
easiest to integrate, put it in the module directory and add it:
|
||||
|
||||
.. code:: python
|
||||
|
||||
@@ -263,7 +263,7 @@ This will cause your module to be included, the .jar will be copied to
|
||||
the java folder, the .java will be copied to the sources folder, etc.
|
||||
Each time you modify the .java, scons must be called.
|
||||
|
||||
Afterwards, just continue the steps for compiling android :ref:`doc_compiling_for_android`.
|
||||
Afterwards, continue the steps for compiling android :ref:`doc_compiling_for_android`.
|
||||
|
||||
Using the module
|
||||
~~~~~~~~~~~~~~~~
|
||||
@@ -285,7 +285,7 @@ More than one singleton module can be enabled by separating with commas:
|
||||
|
||||
modules="org/godotengine/godot/MySingleton,corg/godotengine/godot/MyOtherSingleton"
|
||||
|
||||
Then just request the singleton Java object from Globals like this:
|
||||
Then request the singleton Java object from Globals like this:
|
||||
|
||||
::
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ this module:
|
||||
# SCsub
|
||||
Import('env')
|
||||
|
||||
env.add_source_files(env.modules_sources,"*.cpp") # just add all cpp files to the build
|
||||
env.add_source_files(env.modules_sources,"*.cpp") # Add all cpp files to the build
|
||||
|
||||
With multiple sources, you can also add each file individually to a Python
|
||||
string list:
|
||||
@@ -227,8 +227,7 @@ your module will be included.
|
||||
Using the module
|
||||
----------------
|
||||
|
||||
Using your newly created module is very easy, from any script you can
|
||||
now do:
|
||||
You can now use your newly created moedule from any script:
|
||||
|
||||
::
|
||||
|
||||
@@ -406,15 +405,14 @@ one of the ``ClassName.xml`` files and recompile the engine from now on.
|
||||
Summing up
|
||||
----------
|
||||
|
||||
As you see, it's really easy to develop Godot in C++. Just write your
|
||||
stuff normally and remember to:
|
||||
Remember to:
|
||||
|
||||
- use ``GDCLASS`` macro for inheritance, so Godot can wrap it
|
||||
- use ``_bind_methods`` to bind your functions to scripting, and to
|
||||
allow them to work as callbacks for signals.
|
||||
|
||||
But this is not all, depending what you do, you will be greeted with
|
||||
some surprises.
|
||||
some (hopefully positive) surprises.
|
||||
|
||||
- If you inherit from :ref:`class_Node` (or any derived node type, such as
|
||||
Sprite), your new class will appear in the editor, in the inheritance
|
||||
|
||||
@@ -204,7 +204,7 @@ example:
|
||||
|
||||
If cast fails, NULL is returned. This system uses RTTI, but it also
|
||||
works fine (although a bit slower) when RTTI is disabled. This is useful
|
||||
on platforms where a very small binary size is ideal, such as HTML5 or
|
||||
on platforms where a small binary size is ideal, such as HTML5 or
|
||||
consoles (with low memory footprint).
|
||||
|
||||
Signals
|
||||
|
||||
@@ -105,7 +105,7 @@ Internal Resources
|
||||
|
||||
A TSCN file can contain meshes, materials and other data, and these are
|
||||
contained in the internal resources section of the file. The heading
|
||||
for an internal resource looks very similar to those of external resources, but
|
||||
for an internal resource looks similar to those of external resources, but
|
||||
does not have a path. Internal resources also have :code:`key=value` pairs
|
||||
under each heading. For example, a capsule collision shape looks like:
|
||||
|
||||
@@ -155,7 +155,7 @@ root's name. If it is a direct child of the scene root, it should be
|
||||
[node name="Finger" parent="Arm/Hand" type="Spatial"]
|
||||
|
||||
Similar to the internal resource, the content for each node is currently
|
||||
undocumented. Fortunately it is very easy to find out because you can simply
|
||||
undocumented. Fortunately it is easy to find out because you can simply
|
||||
save a file with that node in it. Some example nodes are:
|
||||
|
||||
::
|
||||
|
||||
Reference in New Issue
Block a user