Re: [AD] Triggers under Linux

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I agree, float is probably bad there. I'm for bool myself then, makes
it clear that it's just, well, a boolean value.

On Mon, Mar 16, 2015 at 1:35 PM, Trent Gamblin <trent@xxxxxxxxxx> wrote:
> I have an objection to float though. Currently all Allegro games do this:
>
> if (state.button[x]) {
> }
>
> In my opinion doing that with a float is bad form. But if it breaks code (I
> don't see how but if) we should keep it as an int and just use 0 or 1.
>
>
> On 2015-03-16 4:38 AM, Elias Pschernig wrote:
>
> On Mon, Mar 16, 2015 at 5:00 AM, Trent Gamblin <trent@xxxxxxxxxx> wrote:
>>
>> On 2015-03-15 5:10 PM, Elias Pschernig wrote:
>> > As for the button state in ALLEGRO_JOYSTICK_STATE, maybe let's change
>> > it to float in the range 0..1 and also report a float in
>> > ALLEGRO_JOYSTICK_BUTTON_DOWN... even if nothing can have in between
>> > values right now, I just feel it's more consistent.
>>
>> Hold on, wait what? Why use a float when a boolean is sufficient. That's
>> plain bad, unless and until we decide to use actual floating point
>> values...
>>
>
> Boolean sounds even better to me, yes. Right now it has a range of 0..32767
> though, so clearly whoever originally wrote this intended for a range of
> values - and in that case I say we make it a float like the axes - but
> either is fine to me, just how it is currently is bad.
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
>
>
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> --
> https://lists.sourceforge.net/lists/listinfo/alleg-developers




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/