Code:
If Total_Frames <> 0 Then
For i = 0 To 31
'// Test to see if this LED is already on the screen (don't blit again if so)
If LED(Frame_Data(Current_Frame, i)) <> LED(Frame_Data(Last_Blitted_Frame, i)) _
Or Not Run_ROM Then
BitBlt Tree_PCB.hDC, Tree_X(i), Tree_Y(i), 22, 22, LED_Mask.hDC, 0, 0, MergePaint
BitBlt Tree_PCB.hDC, Tree_X(i), Tree_Y(i), 22, 22, LED(Frame_Data(Current_Frame, i)).hDC, 0, 0, SrcAnd
End If
Next
End If
Tree_X(0) = 162
Tree_Y(0) = 2
Tree_X(1) = 190
Tree_Y(1) = 42
Tree_X(2) = 218
Tree_Y(2) = 82
Tree_X(3) = 180
Tree_Y(3) = 83
Tree_X(4) = 203
Tree_Y(4) = 123
Tree_X(5) = 226
Tree_Y(5) = 163
Tree_X(6) = 249
Tree_Y(6) = 203
Tree_X(7) = 205
Tree_Y(7) = 204
Tree_X(8) = 230
The above procedure relies mostly on a hard coded arrangement. The two single dimension arrays Tree_X() & Tree_Y() contains all fixed values that actually saves a lot of calculating. Hard coding is definitely a worth while consideration. So instead of making the PIC do (2 + 2), why not just assign 4 to the variable. (Anyhow this is my final comment about this, it's completely off topic) Sorry
Bookmarks