hi hi, back here. another week working one ScummVM.
due to the final exam, i didn’t work whole heartly on ScummVM in the past week. But exam-period will come to end in a few days. So no worry is needed.
I just read the npjg’s blog yesterday. And found a lot of useful info through his blog which helps me understand a lot of concepts in director. By reading his blog, i’ve also get to know the history of how director is developed, and how those modules are created for.
I will keep reading those blogs. And sev recommend a book which contains the knowledge for understand how lingo worked. Also sev have gave me a link for a book which is about QuickDraw in macintosh, and that book is also mentioned by the blog of npjg. Looks like i really have a lot of thing to read and refer to. Although reading English books is a little hard for me(due to the very slow reading speed), i would still try my best to do it. Standing on the should of gaints, with those books and predecessors’ experiences, i’m very confident about the GSoC project.
Since those blogs are useful to me, then i will try to add some detailed info when i’m writing blogs for the future students.
A very brief summary for my past week work is fixing user interface in apartment. Fixing those widgets will help me getting closer to director.
I’ve added checkBox type for macbutton, allowing macbutton drawing different style marks for checkbox. We have already have the crosshair style mark, so it would be very easy to implement other style. I’ve found a common point when i was implementing checkBoxType. With the experience of fixing selEnd and selStart, i found those arrtibutes are movie-globally(scope is a movie). e.g. when you at a single movie, and when you are setting those attributes, all of the widgets will get affected. Thus i create a new function called updateGlobalAttr which will tell those widgets the real time global attr. And that could be optimized by telling widgets only when our global attributes are changed. We may get some same global attributes in the fuluture, thus we can simply extend this function to get the correct behaviour.
While i was checking the sprites size in every frame for finding a better solution to deal with sprites size. I found that even a stable widget which should the same size at every frame, those size of sprites will still change when changing the frame. And another interesting found is the first frame we saw that sprites has the correct size. Thus i just use the first sprites size to represent for all same cast members. with that, i was able to give a ok solution for temporary. But i know that won’t be the end, we still need to find some generic solutions for all those sprites, but not checking it everywhere.
And while i was fixing the zoombox, i creat screen for director which allows drawing the zoombox on it. With this, we can add more effects on screen just like how we are drawing the zoombox. But i think the way we are drawing zoombox still need to be refactored.
I’ve modified the mouse button event handling of director. Introducing two variables to it, one is for the hilite sprite, and the other is for the event sprite. Previously, if you hold the mouse button and move the cursor out of the bounds, that widget will invert incorrectly. I’ve checked how the mac director behaves, and bring the same behaviour to our director.
When dealing with the cursor, i found there is a interesting bug. if we are in the beam cursor surface, then macwindowmanager will force us to convert to the normal cursor, because it thought that beam cursor was caused by editable widget. Thus, i amend the wm to make it dealing with beam cursor more specifically. And we shall restore the cursor type when we are poping the cursor. Keeping the code logic follows it’s definition will always give us a good result.
I’ve amend the mactext for dealing with different encodeType. Previously, we just simply use UTF. And sev tolds me that there are plainByteMode for mactext. Thus i’ve modified the ctor of mactext, if we are passing the String instead of U32String, then we better specify the encodeType for the correct behaviour. For director, we are using kMacCentralEurope to encode.
I’ve created a test for testing our fonts handling. By reading the books of QuickDraw, i’ve amend the vertical offsets calculating for mactext by using ascent instead of text height to calc the offset. And that gives us a very correct behaviour when dealing with text with multi fonts and multi size.
while i was fixing the user interface, i’ve also fixed and implemented some lingo commands. And by fixing how we are dealing with the mask sprites. We are finally able to make the indicator work now. But with just one defect which is we are not able to update the text sprites immediatly when we are sliding the bar. I found how we are dealing with the setText for text castmember is we modified it’s text and set _modified to true. Then that castmember will create a new widget with correct text in next frame. I’ve added a widget pointer from castmember to widget. By creating a link from cast to widget, we are able to update widgets directly and immediately. Then we are able to bring a brand new indicators to director.
It is worth to mention that i didn’t handle that link to widget very correctly, and that crashed the buildbot. Today with sev and rvanlaar’s help, i managed to know how to check the buildbots. And i’ve fixed that problem by releasing the widget when we are changing the sprites. Because new widget and new castmember is coming, and we have to release the old one to free the slots.
Quite busy week. Still very happy when i’m coding and learning. Looking forward to the future work.