Modifications are involved in dxsprite units in delphix.

Source: Internet
Author: User

1: fgroupnumber has no value anywhere. Therefore, the best position for assigning a value to fgroupnumber is the tsprite. setgroupnumber process. Therefore, the followingCodeIs the modified Code:

Procedure Tsprite. setgroupnumber (agroupnumber: integer );
Begin
If (Agroupnumber <> Groupnumber) And
(Engine <>   Nil ) Then
Begin
If Groupnumber > =   0   Then
Engine. Groups [groupnumber]. Remove (Self );
If Agroupnumber > =   0   Then
Begin
Engine. Groups [agroupnumber]. Add (Self );
// Add By zhaogw: Update fgroupnumber Is No way
Fgroupnumber: = Agroupnumber;
End ;
End ;
End ; { Setgroupnumber }

 

2: Where there is a bug: The tspriteengine. getgroup process. The error is caused by an incorrect judgment condition. The modified code is as follows:

 

Function Tspriteengine. getgroup (Index: integer): tlist;
Begin
// If (Index > =   0 ) Or (Index < Fgroupcount) Then Edit by zhaogw, this Is Old
If (Index > =   0 ) And (Index < Fgroupcount) Then
Result: = Fgroups [Index]
Else
Result: =   Nil ;
End ; { Getgroup }

 

Here it turns out to be the condition for determining or. After using or, it is obviously infinite. Therefore, we should change or to and here.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.