Mantis - Croquet
Viewing Issue Advanced Details
306 Jasmine major always 10-08-04 18:19 10-17-04 19:23
mpm  
Croqueteer  
normal  
resolved  
fixed  
none    
none  
0000306: Ceating a new mesh with TPainter causes error fir other people in the scene
After connecting to another person running Croquet you can consistently get
  Error: Undefined Objects are not indexable
in TMesh>>initBounds
follwed by
  Error: Attempt to evaluate a block that is already being...

if you use the TPainter to make a drawing and then 'keep' it to create a
mesh in all connected worlds.

Notes
(0000427)
Croqueteer   
10-17-04 19:23   
When you see something like:

    tex := TTexture meta new initializeWithForm: bbForm mipmap: true shrinkFit: true extension: #colorKeyZero.

This would appear at first glance to be a proper meta message. I thought so at first as well. It isn't.

The first part is fine -
    TTexture meta new

sends a meta message of #new to the class TTexture. This returns a texture. We then send a message:
    #initializeWithForm: bbForm mipmap: true shrinkFit: true extension: #colorKeyZero.

to this new texture. Notice that THIS message is not replicated. Oops. The (current) proper way to do this is:

    tex := TTexture meta new.
    tex meta initializeWithForm: bbForm mipmap: true shrinkFit: true extension: #colorKeyZero.

or this:

    tex := TTexture meta new meta initializeWithForm: bbForm mipmap: true shrinkFit: true extension: #colorKeyZero.

This seems unfortunate to me. The intent of

    tex := TTexture meta new initializeWithForm: bbForm mipmap: true shrinkFit: true extension: #colorKeyZero.

seems quite clear to me. Unfortunately, you can't just have

    TTexture meta new

return a TMeta object, as we don't know if we will have a followon message or not. If we don't then

    tex := TTexture meta new.

sets tex to a meta object which will always replicate ANY message sent to it. While that is perhaps useful in some cases, it is probably not usually a good idea.

For new, keep an eye on this pattern. We should really think about how we might like to change this. This particular problem was in at least two places in this fix.