Ticket #54 (closed task: fixed)

Opened 1 year ago

Last modified 1 year ago

Last Minute API review / changes

Reported by: clayasaurus Assigned to: clayasaurus
Priority: major Milestone: 0.2
Component: unspecified Version: svn
Keywords: Cc:

Description

Last Minute API review / changes. The best way to do this is by generating DDoc docs and making sure the api looks right.

Change History

05/22/07 16:50:59 changed by clayasaurus

  • owner changed from ChristianK to clayasaurus.

05/23/07 00:45:45 changed by ChristianK

Two things I'm going to review:

  • joystick: Lutger did an excellent job, I just want to fix some method names for consistency and support the pressed/released/up/down scheme for the buttons.
  • sound: Is there ever a reason not to call process() in all created sounds and isn't the order of these calls unimportant? If it is, I think arc.sound should have a way to register sounds in a way that arc.sound.process() processes all these sounds. The registering could even be automatic if we're careful enough not to prohibit garbage collection with it.

What do you think about the sound thing?

05/24/07 19:23:47 changed by clayasaurus

I got rid of the font.drawMulti stuff.

Font now automatically assumes you want drawMulti all the time, and you just use

font.draw

instead.

05/24/07 19:27:26 changed by clayasaurus

About sound: I do not think order is important. It might be smart to register sounds and have registered sounds constantly processed, if the user desires. The only problem with it is a very slight performance decrease from processing a, for example, game menu sound when the game menu is not even opened.

05/25/07 03:24:49 changed by ChristianK

I think it'll be handy and making things simpler. If the user desires, he can still call each process() seperately and avoid arc.sound.process(). About the performance penalty: I see that currently Sound.process() calls updateBuffers() regardless of it being stopped or not. Is it neccessary? - I have not gone through and understood the OpenAL workings.

06/03/07 03:27:58 changed by ChristianK

Joystick adaptions are done with [1041].

06/03/07 11:42:03 changed by ChristianK

The sound.process idea: It works, but requires the user to explicitly delete Sound classes in the destructor (which becomes legal, since there's a list of all Sound classes around and the gc can't collect them 'by accident').

Pro:

  • arc.sound.process() calls all Sound.process() methods
  • if you don't use arc.sound.process, everything stays the same

Con:

  • if using arc.sound.process(), you need to explicitly delete Sound classes (or else might hear long or looping sounds continue to play)

What's your opinion?

06/03/07 11:47:34 changed by ChristianK

An idea would be to make it more explicit:

class Some
{
  Sound sound;

  this() {
    sound = new Sound(...);
    sound.addToAutoProcessList(); // <- needs shorter method name, obviously ;)
  }

  ~this() { sound.removeFromAutoProcessList(); }
}

This way it'd be less confusing.

06/03/07 20:26:15 changed by clayasaurus

Explicitness is nice.

I don't have any real opinion on the issue as of now, as I haven't really digested the issue very much and nothing obvious is coming to mind.

06/04/07 15:34:33 changed by ChristianK

The sound change was made with [1045]. I'm leaving the ticket open in case there's something left that you wanted to review.

06/21/07 14:32:35 changed by clayasaurus

Deprecated window.clear(). Not necessary anymore.

06/21/07 15:03:42 changed by ChristianK

I'm not sure about deprecating window.clear and moving its functionality to swap... Now swap() doesn't only swap: it also clears!

I agree though that it's a valid thing to have, but the name is off. Maybe keep swap and clear (I think there may be uses for using one but not the other) and add a nextFrame() or something?

06/21/07 15:04:14 changed by ChristianK

Maybe even swapAndClear()... ;)

06/21/07 16:46:39 changed by clayasaurus

added swapClear() and restored clear() and made swap only swap

07/02/07 11:29:36 changed by clayasaurus

I did some major function re-naming in the arc physics system using get/set instead of the property syntax.

I also added a 'setRadius' function for circle and a 'setSize' function for box shapes.

07/16/07 20:01:19 changed by clayasaurus

Hrm... this is probably done for v.2 release.

07/16/07 20:01:28 changed by clayasaurus

  • status changed from new to closed.
  • resolution set to fixed.