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

Asteroids

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



Joined: 17 Feb 2007
Posts: 139
Location: Washington, DC

PostPosted: Sun Feb 25, 2007 5:31 pm    Post subject: Asteroids Reply with quote

Hello,

I am new to D and very excited about learning the language. The Arc library looks like it has a lot of promise. Hopefully people will have time to continue its development....

In any case, I'm having problems compiling the Asteroids example, using the newest release of DMD and ArcLib .1...


Code:

arc/gfx/texture.d(119): Error: cannot implicitly convert expression (delTex) of type uint[] to uint*
arc/gfx/texture.d(164): Error: cannot implicitly convert expression (argFullPath) of type char[] to char*


Any ideas?

Thanks,
Mason
Back to top
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Sun Feb 25, 2007 7:42 pm    Post subject: Reply with quote

It looks like this code hasn't been updated since DMD 0.177 was released:
Quote:
Arrays no longer implicitly convert to pointers unless -d is used.


You might try compiling with the "-d" switch.

Otherwise, you can add casts for the offending lines:
Code:
cast(uint*)
cast(char*)
Back to top
View user's profile Send private message AIM Address
ChristianK



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

PostPosted: Mon Feb 26, 2007 1:55 am    Post subject: Reply with quote

jcc is correct: Arc 0.1 hasn't been updated for the newer versions of D, mainly because it always looks as if Arc 0.2 would be done really soon.... Smile

If you don't mind things changing once in a while, I'd recommend using the in-development code from our SVN repository. I'm afraid the asteroids example in examples/asteroids isn't as well documented as the old one yet, but it works.

In order to try the new asteroids, you also need to check out the graphics and sounds from downloads/astbin into the examples/asteroids/astbin directory.

If you need any more help, let me know!
Back to top
View user's profile Send private message
zzzzrrr



Joined: 17 Feb 2007
Posts: 139
Location: Washington, DC

PostPosted: Mon Feb 26, 2007 2:54 pm    Post subject: Reply with quote

ChristianK wrote:


If you need any more help, let me know!


Great, thanks for the feedback!
Back to top
View user's profile Send private message
zzzzrrr



Joined: 17 Feb 2007
Posts: 139
Location: Washington, DC

PostPosted: Mon Feb 26, 2007 3:06 pm    Post subject: Reply with quote

ChristianK wrote:

If you need any more help, let me know!


Actually, I have a question about the Asteroid class in asteroidfield.d

What is the advantage of creating each asteroid object as
Code:
dlinkedlist!(Asteroid) asteroids;
asteroids.add(ast);


Instead of making a dynamic object array, and then using .length to add more asteroids?

I.e.

Code:

Asteroid[] asteroids;
asteroids.length = NUMBER OF ASTEROIDS;
or
asteroids.length = asteroids.length + 1;


Is "dlinkedlist!(Asteroid) asteroids" a way of creating a Tuple?

Thanks,
Mason
Back to top
View user's profile Send private message
ChristianK



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

PostPosted: Mon Feb 26, 2007 3:27 pm    Post subject: Reply with quote

Are you talking about the 0.1 asteroids or the svn trunk? In trunk, asteroidfield.d is actually unused - I only left it in there since not all features are in the new version yet.

Regardless of that, the answer is that dlinkedlist offers easy and fast insertion and especially deletion of elements from the middle of the list. Built-in arrays only offer that for the end of the array. It's got nothing to do with tuples.

If we switch to Tango, we'll get rid of it and encourage using one of their storage classes (like LinkSeq or TreeBag) instead.
Back to top
View user's profile Send private message
zzzzrrr



Joined: 17 Feb 2007
Posts: 139
Location: Washington, DC

PostPosted: Mon Feb 26, 2007 6:37 pm    Post subject: Reply with quote

ChristianK wrote:
the answer is that dlinkedlist offers easy and fast insertion and especially deletion of elements from the middle of the list. Built-in arrays only offer that for the end of the array.


Great, thanks a lot for pointing me in the right direction. I'm going to study up on collection classes.

Quote:

If we switch to Tango, we'll get rid of it and encourage using one of their storage classes (like LinkSeq or TreeBag) instead.


I think Tango is definitely the way to go. From everything I have read and observed on the D forums, Tango has many distinct advantages over Phobos. The built in collection classes are my first practical example. Unfortunately it's still in the beta stage and not all of the dsource projects fully support it yet....

I would totally jump into Tango if Derelict and Arclib fully supported it!!!

Thanks,
Mason
Back to top
View user's profile Send private message
ChristianK



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

PostPosted: Tue Feb 27, 2007 7:07 am    Post subject: Reply with quote

Quote:
I would totally jump into Tango if Derelict and Arclib fully supported it!!!


Clay and me agreed that deciding about and possibly switching to Tango is something we'll do right before the Arc 0.2 release.

The problem is that it looks like some extra work to support Tango and Phobos at the same time. And if we just switch to Tango, Arc won't work with an out-of-the-box DMD anymore...
Back to top
View user's profile Send private message
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Tue Feb 27, 2007 3:04 pm    Post subject: Reply with quote

ChristianK wrote:
Quote:
I would totally jump into Tango if Derelict and Arclib fully supported it!!!


Clay and me agreed that deciding about and possibly switching to Tango is something we'll do right before the Arc 0.2 release.

The problem is that it looks like some extra work to support Tango and Phobos at the same time. And if we just switch to Tango, Arc won't work with an out-of-the-box DMD anymore...


We on the Tango team would of course love it if ArcLib was ported to Tango, and will be of assistance in that process if/when you choose to go that route. As for the out-of-the-box DMD issue, we hope to have a solution for that too at some point, at least by Tango 1.0.
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Tue Feb 27, 2007 4:22 pm    Post subject: Reply with quote

I'd rather support just one or the other, probably leaning towards tango.
Back to top
View user's profile Send private message AIM Address
zzzzrrr



Joined: 17 Feb 2007
Posts: 139
Location: Washington, DC

PostPosted: Tue Feb 27, 2007 5:37 pm    Post subject: Reply with quote

clayasaurus wrote:
I'd rather support just one or the other, probably leaning towards tango.


I vote for Tango. It seems to be best way to go! Hopefully Tango 1.0 won't be too far down the road.
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