View previous topic :: View next topic |
Author |
Message |
zzzzrrr
Joined: 17 Feb 2007 Posts: 139 Location: Washington, DC
|
Posted: Sun Feb 25, 2007 5:31 pm Post subject: Asteroids |
|
|
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 |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Sun Feb 25, 2007 7:42 pm Post subject: |
|
|
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 |
|
|
ChristianK
Joined: 26 Sep 2006 Posts: 159 Location: Berlin, Germany
|
Posted: Mon Feb 26, 2007 1:55 am Post subject: |
|
|
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....
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 |
|
|
zzzzrrr
Joined: 17 Feb 2007 Posts: 139 Location: Washington, DC
|
Posted: Mon Feb 26, 2007 2:54 pm Post subject: |
|
|
ChristianK wrote: |
If you need any more help, let me know! |
Great, thanks for the feedback! |
|
Back to top |
|
|
zzzzrrr
Joined: 17 Feb 2007 Posts: 139 Location: Washington, DC
|
Posted: Mon Feb 26, 2007 3:06 pm Post subject: |
|
|
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 |
|
|
ChristianK
Joined: 26 Sep 2006 Posts: 159 Location: Berlin, Germany
|
Posted: Mon Feb 26, 2007 3:27 pm Post subject: |
|
|
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 |
|
|
zzzzrrr
Joined: 17 Feb 2007 Posts: 139 Location: Washington, DC
|
Posted: Mon Feb 26, 2007 6:37 pm Post subject: |
|
|
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 |
|
|
ChristianK
Joined: 26 Sep 2006 Posts: 159 Location: Berlin, Germany
|
Posted: Tue Feb 27, 2007 7:07 am Post subject: |
|
|
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 |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Tue Feb 27, 2007 3:04 pm Post subject: |
|
|
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 |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Tue Feb 27, 2007 4:22 pm Post subject: |
|
|
I'd rather support just one or the other, probably leaning towards tango. |
|
Back to top |
|
|
zzzzrrr
Joined: 17 Feb 2007 Posts: 139 Location: Washington, DC
|
Posted: Tue Feb 27, 2007 5:37 pm Post subject: |
|
|
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 |
|
|
|