pingus-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Collider and Mover code


From: David Philippi
Subject: Re: Collider and Mover code
Date: Sat, 25 Jan 2003 11:26:25 +0100
User-agent: KMail/1.4.1

On Saturday 25 January 2003 04:33, Gervase Lam wrote:
> needs another code review.

Let's start with the suggestions/corrections:

- templates parameters should be named by using typename instead of class, 
there are cases where this is much easier to read

mover.hxx:
- the template requires an #include vector.hxx since you actually use one

collider.hxx:
- this one doesn't requires an #include vector.hxx, it may be moved to 
collider.cxx as well as the world.hxx

upright_pingu_collider.cxx
- either use bool collide or return true/false - right now the bool is 
useless. Using a compiler with named return value optimization collided=true; 
break; and a return collided at the end or using direct returns should create 
identical code
- the static_cast<float>(pingu_height) is redundant - pos.y is a float so the 
result type of pos.y - pingu_height is already float. You only need to cast 
if there's no float involved otherwise

linear_mover.hxx
- why are the Collider parameters passed by value instead of const reference?
- why does the for loop in update use a float as counter?

Bye David





reply via email to

[Prev in Thread] Current Thread [Next in Thread]