Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/SynthLab/SynthLabConstants.py
diff options
context:
space:
mode:
authoramartin <olpc@localhost.localdomain>2007-01-23 23:02:19 (GMT)
committer amartin <olpc@localhost.localdomain>2007-01-23 23:02:19 (GMT)
commit0701b52b495c7a3aaf62ecc4eab52ca1ddae136f (patch)
tree69c38dabe3882ba5a5b8dd7242a53643585c47ef /SynthLab/SynthLabConstants.py
parent95d5c857729d03e474f04538c11df9ccf9c9eada (diff)
SynthLab spiffy quick drawing
Diffstat (limited to 'SynthLab/SynthLabConstants.py')
-rwxr-xr-xSynthLab/SynthLabConstants.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/SynthLab/SynthLabConstants.py b/SynthLab/SynthLabConstants.py
index b95abdb..23c5b06 100755
--- a/SynthLab/SynthLabConstants.py
+++ b/SynthLab/SynthLabConstants.py
@@ -1,7 +1,30 @@
class SynthLabConstants:
PIC_SIZE = 80
- HALF_SIZE = PIC_SIZE / 2
+ HALF_SIZE = PIC_SIZE // 2
+
+ GT_CONTROL_OUTPUT = 0
+ GT_CONTROL_INPUT = 1
+ GT_SOUND_OUTPUT = 2
+ GT_SOUND_INPUT = 3
+ # GATE_MAP[objecttype][gatetype][gatenum] = [ sx, sy, ex, ey, (x,y) ]
+ # gate locations relative to object center
+ GATE_MAP = [ [ [ [-6,28,6,40] ] ],
+ [ [], [[-31,-40,-18,-28], [-16,-40,-3,-28], [2,-40,15,-28], [19,-40,32,-28]], [[-6,28,7,40]] ],
+ [ [], [[28,-26,40,-13], [28,-13,40,0], [28,0,40,13], [28,13,40,26]], [[-6,28,7,40]], [[-6,-40,7,-28]] ],
+ [ [], [], [], [[-6,-40,7,-28]] ] ]
+ # insert locations into map
+ for oT in GATE_MAP:
+ for gT in oT:
+ for m in gT:
+ x = (m[2]+m[0])//2
+ y = (m[3]+m[1])//2
+ # snap to edges
+ if x < -HALF_SIZE+7: x = -HALF_SIZE
+ elif x > HALF_SIZE-7: x = HALF_SIZE
+ if y < -HALF_SIZE+7: y = -HALF_SIZE
+ elif y > HALF_SIZE-7: y = HALF_SIZE
+ m.append( ( x, y ) )
INIT_LOCATIONS = [ [55,750], [135,750], [215,750], [295, 750], [420,750], [500,750], [580,750], [660, 750], [785,750], [865,750], [945,750], [1025, 750], [540, 645]]