cleaned up redundant code for video motion sensing

pull/89/head
jmoenig 2019-05-08 15:01:47 +02:00
rodzic f1e49f7cde
commit 20e2d70723
3 zmienionych plików z 2 dodań i 55 usunięć

Wyświetl plik

@ -1723,19 +1723,6 @@ SyntaxElementMorph.prototype.labelPart = function (spec) {
// 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':
part = new InputSlotMorph(
null,
@ -2409,9 +2396,7 @@ SyntaxElementMorph.prototype.endLayout = function () {
%f - round function slot, unevaluated if replaced,
%r - round reporter slot
%p - hexagonal predicate slot
%vid - chameleon colored rectangular drop-down for video modes // +++ check these
%motype - chameleon colored rectangular drop-down for motion type
%on - chameleon colored rectangular drop-down for motion detection scope
%vid - chameleon colored rectangular drop-down for video modes
rings:

Wyświetl plik

@ -1375,13 +1375,6 @@ SpriteMorph.prototype.initBlocks = function () {
spec: 'video %vid on %self',
defaults: [['motion'], ['myself']]
},
/* // +++ to be removed
reportMotionOnStage: {
type: 'reporter',
category: 'sensing',
spec: 'video %motype on stage'
}
*/
};
};

Wyświetl plik

@ -4442,13 +4442,7 @@ Process.prototype.doSetVideoTransparency = function(factor) {
}
};
/* // +++ to be removed
Process.prototype.reportMotionOnStage = function(motionType) {
return this.reportMotionOn(motionType, 'stage');
};
*/
Process.prototype.reportVideo = function(attribute, name) { // +++
Process.prototype.reportVideo = function(attribute, name) {
var thisObj = this.blockReceiver(),
stage = thisObj.parentThatIsA(StageMorph),
thatObj = this.getOtherObject(name, thisObj, stage);
@ -4457,7 +4451,6 @@ Process.prototype.reportVideo = function(attribute, name) { // +++
return null;
}
switch (this.inputOption(attribute)) {
case 'motion':
if (thatObj instanceof SpriteMorph) {
@ -4475,30 +4468,6 @@ Process.prototype.reportVideo = function(attribute, name) { // +++
return stage.videoMotion.motionDirection;
}
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