Code Cleaning, todos added

This commit is contained in:
Michael Chen
2017-12-27 00:42:06 +01:00
parent 7cc0621aa5
commit 1b53c9f862
5 changed files with 68 additions and 63 deletions

View File

@@ -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)