(a) there was a bug in the video logic, because of a failure to move a
code change from the os-x logic to the iphone logic we were not
correctly calculating the first addressable byte of the Display
bitmap. What was happening is we were starting at the four byte header
of the OOPS. This resulted in the top/left pixel being black, or red.
and what Jeff finally noticed was the right most column being rendered
as the left most column.
Using the os-x code fixed the problem.
(b) The NIB file was not setup to handle multi-touch. This also
required a code change to setup the SqueakUIView as multi-touch
aware. The rest of the event logic was setup to deal with multi-touch
events. However the Smalltalk event code assumes one event in the set.
To exploit multi-touch you need to have different Smalltalk code.
I'm handling multi-touch in my experimental Etoys code. I had to add one field to the event though, otherwise it's impossible to track touch events reliably:
--- platforms/Mac OSObjC/vm/iPhone/Classes/sqSqueakIPhoneApplication+events.m (revision 196)
+++ platforms/Mac OSObjC/vm/iPhone/Classes/sqSqueakIPhoneApplication+events.m (working copy)
@@ -113,10 +113,10 @@
sqInt count = [touches count],arrayIndex=0,squeakMSTimeNow = ioMSecs(),action;
UITouch *touch;
- sqInt previousLocationInViewY,previousLocationInViewX,locationInViewX,locationInViewY,squeakMSTime, view, window, tapCount, phase,timeStamp,storageArea,containerArray;
+ sqInt previousLocationInViewY,previousLocationInViewX,locationInViewX,locationInViewY,squeakMSTime, view, window, tapCount, phase,timeStamp,storageArea,containerArray,touchId;
interpreterProxy->pushRemappableOop(interpreterProxy->instantiateClassindexableSize(interpreterProxy->classArray(), count));
for (touch in touches) {
- interpreterProxy->pushRemappableOop(interpreterProxy->instantiateClassindexableSize(interpreterProxy->classArray(), 10));
+ interpreterProxy->pushRemappableOop(interpreterProxy->instantiateClassindexableSize(interpreterProxy->classArray(), 11));
interpreterProxy->pushRemappableOop(interpreterProxy->integerObjectOf(squeakMSTimeNow));
interpreterProxy->pushRemappableOop(interpreterProxy->floatObjectOf([touch timestamp]));
interpreterProxy->pushRemappableOop(interpreterProxy->integerObjectOf((signed)[touch phase]));
@@ -127,6 +127,8 @@
interpreterProxy->pushRemappableOop(interpreterProxy->floatObjectOf([touch locationInView:[gDelegateApp mainView]].y));
interpreterProxy->pushRemappableOop(interpreterProxy->floatObjectOf([touch previousLocationInView:[gDelegateApp mainView]].x));
interpreterProxy->pushRemappableOop(interpreterProxy->floatObjectOf([touch previousLocationInView:[gDelegateApp mainView]].y));
+ interpreterProxy->pushRemappableOop(interpreterProxy->positive64BitIntegerFor((sqLong)touch));
+ touchId = interpreterProxy->popRemappableOop();
previousLocationInViewY = interpreterProxy->popRemappableOop();
previousLocationInViewX = interpreterProxy->popRemappableOop();
locationInViewY = interpreterProxy->popRemappableOop();
@@ -149,6 +151,7 @@
interpreterProxy->storePointerofObjectwithValue(7, storageArea, locationInViewY);
interpreterProxy->storePointerofObjectwithValue(8, storageArea, previousLocationInViewX);
interpreterProxy->storePointerofObjectwithValue(9, storageArea, previousLocationInViewY);
+ interpreterProxy->storePointerofObjectwithValue(10, storageArea, touchId);
interpreterProxy->storePointerofObjectwithValue(arrayIndex++, containerArray, storageArea);
interpreterProxy->pushRemappableOop(containerArray);
}
- Bert -