[sdljava-users] Here is my patch for the week
Status: Beta
Brought to you by:
ivan_ganza
|
From: Chris D. <Des...@nt...> - 2005-03-18 22:56:52
|
Hi everybody ;)
The attached patch fixes a minor bug in SDLRect regarding the use of
SDLPoint, introduces scaling and descaling methods in SDLRect. Also
cleans up a lot of Javadoc comments which took me a while to do,
including spelling mistakes and anomalies.
The scaling and descaling stuff is especially useful for me, since I
have a grid, with grid objects on that grid, and the grid rect is stored
in a field within each grid object. When a grid object is created, I
have to generate the grid rect by scaling the surface height and width
down using the grid point size. This might make things easier for me and
other people to do such things later on.
There are also the getRect() methods in SDLSurface which have proven
their use time and time again in pygame. This allows you to create a new
SDLRect which has the height and width of the surface, and x = 0, y = 0,
or the same but with a user-defined x and y, or the same but using an
SDLPoint to specify the topleft point.
Anyway, I hope you find these changes useful ;)
Regards,
Chris
--
|>>>
Dessimat0r /`\ |
"We cannot turn back time, but we can _ _|_ _
move it forwards with our own hands." |;|_|;|_|;|
\\. . /
[www: http://codeknight.net ] \\: . /
[e-mail: des...@nt... ] ||: U | /`\
[icq: 21477909 ] ||:. |
[msn: des...@nt... ] \,/ ||: U.|
||: | \,/
||: , |
____--`~--- '--~~__ __ ----~ - ~`---,
-~--~ ~---__ ,--~' ~~----___
|