sonolus.py 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sonolus.py might be problematic. Click here for more details.
- sonolus/backend/blocks.py +756 -756
- sonolus/backend/excepthook.py +37 -37
- sonolus/backend/finalize.py +77 -69
- sonolus/backend/interpret.py +7 -7
- sonolus/backend/ir.py +29 -3
- sonolus/backend/mode.py +24 -24
- sonolus/backend/node.py +40 -40
- sonolus/backend/ops.py +197 -197
- sonolus/backend/optimize/__init__.py +0 -0
- sonolus/backend/optimize/allocate.py +126 -0
- sonolus/backend/optimize/constant_evaluation.py +374 -0
- sonolus/backend/optimize/copy_coalesce.py +85 -0
- sonolus/backend/optimize/dead_code.py +185 -0
- sonolus/backend/optimize/dominance.py +96 -0
- sonolus/backend/{flow.py → optimize/flow.py} +122 -92
- sonolus/backend/optimize/inlining.py +137 -0
- sonolus/backend/optimize/liveness.py +177 -0
- sonolus/backend/optimize/optimize.py +44 -0
- sonolus/backend/optimize/passes.py +52 -0
- sonolus/backend/optimize/simplify.py +191 -0
- sonolus/backend/optimize/ssa.py +200 -0
- sonolus/backend/place.py +17 -25
- sonolus/backend/utils.py +58 -48
- sonolus/backend/visitor.py +1151 -882
- sonolus/build/cli.py +7 -1
- sonolus/build/compile.py +88 -90
- sonolus/build/engine.py +10 -5
- sonolus/build/level.py +24 -23
- sonolus/build/node.py +43 -43
- sonolus/script/archetype.py +438 -139
- sonolus/script/array.py +27 -10
- sonolus/script/array_like.py +297 -0
- sonolus/script/bucket.py +253 -191
- sonolus/script/containers.py +257 -51
- sonolus/script/debug.py +26 -10
- sonolus/script/easing.py +365 -0
- sonolus/script/effect.py +191 -131
- sonolus/script/engine.py +71 -4
- sonolus/script/globals.py +303 -269
- sonolus/script/instruction.py +205 -151
- sonolus/script/internal/__init__.py +5 -5
- sonolus/script/internal/builtin_impls.py +255 -144
- sonolus/script/{callbacks.py → internal/callbacks.py} +127 -127
- sonolus/script/internal/constant.py +139 -0
- sonolus/script/internal/context.py +26 -9
- sonolus/script/internal/descriptor.py +17 -17
- sonolus/script/internal/dict_impl.py +65 -0
- sonolus/script/internal/generic.py +6 -9
- sonolus/script/internal/impl.py +38 -13
- sonolus/script/internal/introspection.py +17 -14
- sonolus/script/internal/math_impls.py +121 -0
- sonolus/script/internal/native.py +40 -38
- sonolus/script/internal/random.py +67 -0
- sonolus/script/internal/range.py +81 -0
- sonolus/script/internal/transient.py +51 -0
- sonolus/script/internal/tuple_impl.py +113 -0
- sonolus/script/internal/value.py +3 -3
- sonolus/script/interval.py +338 -112
- sonolus/script/iterator.py +167 -214
- sonolus/script/level.py +24 -0
- sonolus/script/num.py +80 -48
- sonolus/script/options.py +257 -191
- sonolus/script/particle.py +190 -157
- sonolus/script/pointer.py +30 -30
- sonolus/script/print.py +102 -81
- sonolus/script/project.py +8 -0
- sonolus/script/quad.py +263 -0
- sonolus/script/record.py +47 -16
- sonolus/script/runtime.py +52 -1
- sonolus/script/sprite.py +418 -333
- sonolus/script/text.py +409 -407
- sonolus/script/timing.py +114 -42
- sonolus/script/transform.py +332 -48
- sonolus/script/ui.py +216 -160
- sonolus/script/values.py +6 -13
- sonolus/script/vec.py +196 -78
- {sonolus_py-0.1.3.dist-info → sonolus_py-0.1.5.dist-info}/METADATA +1 -1
- sonolus_py-0.1.5.dist-info/RECORD +89 -0
- {sonolus_py-0.1.3.dist-info → sonolus_py-0.1.5.dist-info}/WHEEL +1 -1
- {sonolus_py-0.1.3.dist-info → sonolus_py-0.1.5.dist-info}/licenses/LICENSE +21 -21
- sonolus/backend/allocate.py +0 -51
- sonolus/backend/optimize.py +0 -9
- sonolus/backend/passes.py +0 -6
- sonolus/backend/simplify.py +0 -30
- sonolus/script/comptime.py +0 -160
- sonolus/script/graphics.py +0 -150
- sonolus/script/math.py +0 -92
- sonolus/script/range.py +0 -58
- sonolus_py-0.1.3.dist-info/RECORD +0 -75
- {sonolus_py-0.1.3.dist-info → sonolus_py-0.1.5.dist-info}/entry_points.txt +0 -0
sonolus/script/engine.py
CHANGED
|
@@ -4,7 +4,7 @@ from collections.abc import Callable
|
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
6
|
from sonolus.build.collection import Asset
|
|
7
|
-
from sonolus.script.archetype import
|
|
7
|
+
from sonolus.script.archetype import PlayArchetype, PreviewArchetype, WatchArchetype, _BaseArchetype
|
|
8
8
|
from sonolus.script.bucket import Buckets, EmptyBuckets
|
|
9
9
|
from sonolus.script.effect import Effects, EmptyEffects
|
|
10
10
|
from sonolus.script.instruction import (
|
|
@@ -20,6 +20,21 @@ from sonolus.script.ui import UiConfig
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class Engine:
|
|
23
|
+
"""A Sonolus.py engine.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
name: The name of the engine.
|
|
27
|
+
title: The title of the engine.
|
|
28
|
+
subtitle: The subtitle of the engine.
|
|
29
|
+
author: The author of the engine.
|
|
30
|
+
skin: The default skin for the engine.
|
|
31
|
+
background: The default background for the engine.
|
|
32
|
+
effect: The default effect for the engine.
|
|
33
|
+
particle: The default particle for the engine.
|
|
34
|
+
thumbnail: The thumbnail for the engine.
|
|
35
|
+
data: The engine's modes and configurations.
|
|
36
|
+
"""
|
|
37
|
+
|
|
23
38
|
version = 12
|
|
24
39
|
|
|
25
40
|
def __init__(
|
|
@@ -53,10 +68,20 @@ def default_callback() -> Any:
|
|
|
53
68
|
|
|
54
69
|
|
|
55
70
|
class PlayMode:
|
|
71
|
+
"""A play mode definition.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
archetypes: A list of play archetypes.
|
|
75
|
+
skin: The skin for the play mode.
|
|
76
|
+
effects: The effects for the play mode.
|
|
77
|
+
particles: The particles for the play mode.
|
|
78
|
+
buckets: The buckets for the play mode.
|
|
79
|
+
"""
|
|
80
|
+
|
|
56
81
|
def __init__(
|
|
57
82
|
self,
|
|
58
83
|
*,
|
|
59
|
-
archetypes: list[type[
|
|
84
|
+
archetypes: list[type[_BaseArchetype]] | None = None,
|
|
60
85
|
skin: Skin = EmptySkin,
|
|
61
86
|
effects: Effects = EmptyEffects,
|
|
62
87
|
particles: Particles = EmptyParticles,
|
|
@@ -74,10 +99,21 @@ class PlayMode:
|
|
|
74
99
|
|
|
75
100
|
|
|
76
101
|
class WatchMode:
|
|
102
|
+
"""A watch mode definition.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
archetypes: A list of watch archetypes.
|
|
106
|
+
skin: The skin for the watch mode.
|
|
107
|
+
effects: The effects for the watch mode.
|
|
108
|
+
particles: The particles for the watch mode.
|
|
109
|
+
buckets: The buckets for the watch mode.
|
|
110
|
+
update_spawn: A callback returning the spawn time used by archetypes.
|
|
111
|
+
"""
|
|
112
|
+
|
|
77
113
|
def __init__(
|
|
78
114
|
self,
|
|
79
115
|
*,
|
|
80
|
-
archetypes: list[type[
|
|
116
|
+
archetypes: list[type[_BaseArchetype]] | None = None,
|
|
81
117
|
skin: Skin = EmptySkin,
|
|
82
118
|
effects: Effects = EmptyEffects,
|
|
83
119
|
particles: Particles = EmptyParticles,
|
|
@@ -97,10 +133,17 @@ class WatchMode:
|
|
|
97
133
|
|
|
98
134
|
|
|
99
135
|
class PreviewMode:
|
|
136
|
+
"""A preview mode definition.
|
|
137
|
+
|
|
138
|
+
Args:
|
|
139
|
+
archetypes: A list of preview archetypes.
|
|
140
|
+
skin: The skin for the preview mode.
|
|
141
|
+
"""
|
|
142
|
+
|
|
100
143
|
def __init__(
|
|
101
144
|
self,
|
|
102
145
|
*,
|
|
103
|
-
archetypes: list[type[
|
|
146
|
+
archetypes: list[type[_BaseArchetype]] | None = None,
|
|
104
147
|
skin: Skin = EmptySkin,
|
|
105
148
|
) -> None:
|
|
106
149
|
self.archetypes = archetypes or []
|
|
@@ -112,6 +155,19 @@ class PreviewMode:
|
|
|
112
155
|
|
|
113
156
|
|
|
114
157
|
class TutorialMode:
|
|
158
|
+
"""A tutorial mode definition.
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
skin: The skin for the tutorial mode.
|
|
162
|
+
effects: The effects for the tutorial mode.
|
|
163
|
+
particles: The particles for the tutorial mode.
|
|
164
|
+
instructions: The instructions for the tutorial mode.
|
|
165
|
+
instruction_icons: The instruction icons for the tutorial mode.
|
|
166
|
+
preprocess: A callback to be called before the tutorial starts.
|
|
167
|
+
navigate: A callback to be called when the user navigates.
|
|
168
|
+
update: A callback to be called each frame.
|
|
169
|
+
"""
|
|
170
|
+
|
|
115
171
|
def __init__(
|
|
116
172
|
self,
|
|
117
173
|
*,
|
|
@@ -135,6 +191,17 @@ class TutorialMode:
|
|
|
135
191
|
|
|
136
192
|
|
|
137
193
|
class EngineData:
|
|
194
|
+
"""A Sonolus.py engine's modes and configurations.
|
|
195
|
+
|
|
196
|
+
Args:
|
|
197
|
+
ui: The UI configuration.
|
|
198
|
+
options: The options for the engine.
|
|
199
|
+
play: The play mode configuration.
|
|
200
|
+
watch: The watch mode configuration.
|
|
201
|
+
preview: The preview mode configuration.
|
|
202
|
+
tutorial: The tutorial mode configuration.
|
|
203
|
+
"""
|
|
204
|
+
|
|
138
205
|
def __init__(
|
|
139
206
|
self,
|
|
140
207
|
*,
|