kopia lustrzana https://github.com/backface/turtlestitch
cleaned up redundant code for video motion sensing
rodzic
f1e49f7cde
commit
20e2d70723
|
@ -1723,19 +1723,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
|
||||||
|
|
||||||
// Video motion
|
// Video motion
|
||||||
|
|
||||||
/* // +++ to be removed
|
|
||||||
case '%vid': // video modes
|
|
||||||
part = new InputSlotMorph(
|
|
||||||
null,
|
|
||||||
false, {
|
|
||||||
on: ['on'],
|
|
||||||
off: ['off'],
|
|
||||||
'on-flipped': ['on-flipped']
|
|
||||||
},
|
|
||||||
true
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
*/
|
|
||||||
case '%vid':
|
case '%vid':
|
||||||
part = new InputSlotMorph(
|
part = new InputSlotMorph(
|
||||||
null,
|
null,
|
||||||
|
@ -2409,9 +2396,7 @@ SyntaxElementMorph.prototype.endLayout = function () {
|
||||||
%f - round function slot, unevaluated if replaced,
|
%f - round function slot, unevaluated if replaced,
|
||||||
%r - round reporter slot
|
%r - round reporter slot
|
||||||
%p - hexagonal predicate slot
|
%p - hexagonal predicate slot
|
||||||
%vid - chameleon colored rectangular drop-down for video modes // +++ check these
|
%vid - chameleon colored rectangular drop-down for video modes
|
||||||
%motype - chameleon colored rectangular drop-down for motion type
|
|
||||||
%on - chameleon colored rectangular drop-down for motion detection scope
|
|
||||||
|
|
||||||
rings:
|
rings:
|
||||||
|
|
||||||
|
|
|
@ -1375,13 +1375,6 @@ SpriteMorph.prototype.initBlocks = function () {
|
||||||
spec: 'video %vid on %self',
|
spec: 'video %vid on %self',
|
||||||
defaults: [['motion'], ['myself']]
|
defaults: [['motion'], ['myself']]
|
||||||
},
|
},
|
||||||
/* // +++ to be removed
|
|
||||||
reportMotionOnStage: {
|
|
||||||
type: 'reporter',
|
|
||||||
category: 'sensing',
|
|
||||||
spec: 'video %motype on stage'
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4442,13 +4442,7 @@ Process.prototype.doSetVideoTransparency = function(factor) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* // +++ to be removed
|
Process.prototype.reportVideo = function(attribute, name) {
|
||||||
Process.prototype.reportMotionOnStage = function(motionType) {
|
|
||||||
return this.reportMotionOn(motionType, 'stage');
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
Process.prototype.reportVideo = function(attribute, name) { // +++
|
|
||||||
var thisObj = this.blockReceiver(),
|
var thisObj = this.blockReceiver(),
|
||||||
stage = thisObj.parentThatIsA(StageMorph),
|
stage = thisObj.parentThatIsA(StageMorph),
|
||||||
thatObj = this.getOtherObject(name, thisObj, stage);
|
thatObj = this.getOtherObject(name, thisObj, stage);
|
||||||
|
@ -4457,7 +4451,6 @@ Process.prototype.reportVideo = function(attribute, name) { // +++
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch (this.inputOption(attribute)) {
|
switch (this.inputOption(attribute)) {
|
||||||
case 'motion':
|
case 'motion':
|
||||||
if (thatObj instanceof SpriteMorph) {
|
if (thatObj instanceof SpriteMorph) {
|
||||||
|
@ -4475,30 +4468,6 @@ Process.prototype.reportVideo = function(attribute, name) { // +++
|
||||||
return stage.videoMotion.motionDirection;
|
return stage.videoMotion.motionDirection;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* // +++ remove
|
|
||||||
switch (this.inputOption(on)) {
|
|
||||||
case 'stage':
|
|
||||||
stage.videoMotion.getStageMotion();
|
|
||||||
if (this.inputOption(motionType) === 'direction') {
|
|
||||||
result = stage.videoMotion.motionDirection;
|
|
||||||
}
|
|
||||||
if (this.inputOption(motionType) === 'motion') {
|
|
||||||
result = stage.videoMotion.motionAmount;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'this sprite':
|
|
||||||
stage.videoMotion.getLocalMotion(sprite);
|
|
||||||
if (this.inputOption(motionType) === 'direction') {
|
|
||||||
result = sprite.motionDirection;
|
|
||||||
}
|
|
||||||
if (this.inputOption(motionType) === 'motion') {
|
|
||||||
result = sprite.motionAmount;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Process code mapping
|
// Process code mapping
|
||||||
|
|
Ładowanie…
Reference in New Issue