FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Patch series against current Arc

 
Post new topic   Reply to topic     Forum Index -> ArcLib
View previous topic :: View next topic  
Author Message
Brix



Joined: 28 Oct 2006
Posts: 21
Location: EU, Denmark, Lyngby.

PostPosted: Wed Apr 11, 2007 9:56 am    Post subject: Patch series against current Arc Reply with quote

I've just upgraded my project to newest Arc trunk (r866), it would seem that somebody has forgotten parts of some earlier patches, as trunk isn't compilable in its current state?

Anyway, here is the patches I currently use:
http://brix-verden.dk/d/arc/

They make trunk compilable, fixes the toRadians function (wrong name) in arc/sprite/sprite.d, and makes the Color struct usable with fonts.

- Brix
Back to top
View user's profile Send private message MSN Messenger
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Wed Apr 11, 2007 10:03 am    Post subject: Reply with quote

Thanks for those patches. I'm out for the day, but will look at them tomorrow. Indeed, I haven't checked consistency of the arc/sprite directory for all recent changes. I usually just compile some unittests and the asteroids example to see if things still work.

However, I'm glad to see you managed to get sprite to work again this easily.
Back to top
View user's profile Send private message
Brix



Joined: 28 Oct 2006
Posts: 21
Location: EU, Denmark, Lyngby.

PostPosted: Wed Apr 11, 2007 11:45 am    Post subject: Reply with quote

I've just updated my patches against your texture updates (r867).
You forgot to change the normal image.draw function, so I've fixed this in my patches, and my project is now able to use 800x600 images perfectly. Smile

- Brix
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Wed Apr 11, 2007 11:57 am    Post subject: Reply with quote

If it is not fixed by then, I'll use these patches on the weekend.

If you have time, maybe you can create a Sprite unittest for us to use? I would but my time is limited, I might also try to make one this weekend though if its not done before then. A sprite unitttest would make sure we would make sure that the sprite class works with all the changes going on in the trunk.

Also...

Overall, I think I might want to go back to the old

func(r,g,b,a)

instead of

func(color)

because r, g, b, a values are just that much more versatile.

Thanks for using Arc! : )
Back to top
View user's profile Send private message AIM Address
Brix



Joined: 28 Oct 2006
Posts: 21
Location: EU, Denmark, Lyngby.

PostPosted: Wed Apr 11, 2007 12:31 pm    Post subject: Reply with quote

clayasaurus wrote:
If you have time, maybe you can create a Sprite unittest for us to use?

The main problem I've experienced with the sprite class, is that it couldn't compile. So I guess a simple test that touches the different functions, will do, like:

Code:
import arc.window, arc.sprite.sprite;

void main(char[][] args)
{
    arc.window.open("Sprite test", 800, 600, false);
    auto test = new Sprite("resource.png",COLLISION_TYPE.BOX);
    test.setX(50);
    test.setY(50);   
    test.draw;
}


Or maybe having an all.d file which imports all of Arc, so one can run build or rebuild on it?

clayasaurus wrote:
Overall, I think I might want to go back to the old

func(r,g,b,a)

instead of

func(color)

because r, g, b, a values are just that much more versatile.

I don't agree on that, I find that I often use and save colors in classes, and
Code:
Color myCol1, myCol2;

is way better than
Code:
ushort r1,r2,g1,g2,b1,b2,a1,a2;

atleast from my point of view.

Before I started using D, I mainly used C++ with Clanlib for game programming. In Clanlib one always passes Color objects around, and I've always had good experiences with it. Smile

- Brix
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Wed Apr 11, 2007 3:08 pm    Post subject: Reply with quote

A sprite unittest is simply a main.d like file that tests all of the sprites functions possible and make the program crash if the unittest doesn't work right (best crash w/ err message Wink )

I'll get it done this weekend I suppose.

When there are extensive changes made to the trunk, we like to test our code with the unittests because the unittests are designed to test each feature of one specific section of the library, if something goes wrong it is easy to tell or the unittest is designed to tell us what went wrong.

I guess we can use the color object for passing around, if you really find them that useful. Smile Just sometimes seems like a hack to use

draw(Color(1,1,1,1))


and a lot of work to use
Color c = Color(255,0,0,255);

draw(c);
Back to top
View user's profile Send private message AIM Address
ChristianK



Joined: 26 Sep 2006
Posts: 159
Location: Berlin, Germany

PostPosted: Thu Apr 12, 2007 4:54 am    Post subject: Reply with quote

I've applied the patches.

I added the Color struct and switched (most of) the drawing functions to use them specifically to simplify declaring and passing them. The reasoning is really the same as with Point and Rect. It also has the advantage that we could add a set of standard colors to arc.draw.color.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> ArcLib All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group