Code Cleaning, todos added
This commit is contained in:
@@ -53,16 +53,16 @@ Starfield STARFIELD_GetDefault(int count){
|
||||
}
|
||||
|
||||
void STARFIELD_Draw(Starfield * strf, SDL_Renderer * renderer){
|
||||
printf("Drawing starfield...\n");
|
||||
int i;
|
||||
|
||||
for (i = 0; i < (strf->StarCount); i++) {
|
||||
STAR_Draw(&((strf->Stars)[i]), renderer);
|
||||
}
|
||||
printf("Starfield drawn!\n");
|
||||
}
|
||||
|
||||
void STARFIELD_Update(Starfield * strf){
|
||||
int i;
|
||||
|
||||
for (i = 0; i < (strf->StarCount); i++) {
|
||||
STAR_Update(&((strf->Stars)[i]));
|
||||
}
|
||||
@@ -95,7 +95,7 @@ void STAR_Update(Star * star){
|
||||
*star = STAR_GetDefault();
|
||||
}
|
||||
double sx = (star->x) / (star->z) * STARFIELD_BoxWidth;// current distance using perspective
|
||||
if (sx > STARFIELD_BoxWidth / 2|| sx < -STARFIELD_BoxWidth / 2)
|
||||
if (sx > STARFIELD_BoxWidth / 2 || sx < -STARFIELD_BoxWidth / 2)
|
||||
(star->OutOfBounds) = true;
|
||||
double sy = (star->y) / (star->z) * STARFIELD_BoxHeight; // current distance using perspective
|
||||
if (sy * 2 > STARFIELD_BoxHeight || sy < -STARFIELD_BoxHeight / 2)
|
||||
|
Reference in New Issue
Block a user