nous grafics
This commit is contained in:
@@ -222,4 +222,43 @@ hiScoreEntry_t sortHiScoreTable(hiScoreEntry_t entry1, hiScoreEntry_t entry2)
|
||||
}
|
||||
|
||||
return entry2;
|
||||
}
|
||||
|
||||
// Dibuja un circulo
|
||||
void DrawCircle(SDL_Renderer * renderer, int32_t centerX, int32_t centerY, int32_t radius)
|
||||
{
|
||||
const int32_t diameter = (radius * 2);
|
||||
|
||||
int32_t x = (radius - 1);
|
||||
int32_t y = 0;
|
||||
int32_t tx = 1;
|
||||
int32_t ty = 1;
|
||||
int32_t error = (tx - diameter);
|
||||
|
||||
while (x >= y)
|
||||
{
|
||||
// Each of the following renders an octant of the circle
|
||||
SDL_RenderDrawPoint(renderer, centerX + x, centerY - y);
|
||||
SDL_RenderDrawPoint(renderer, centerX + x, centerY + y);
|
||||
SDL_RenderDrawPoint(renderer, centerX - x, centerY - y);
|
||||
SDL_RenderDrawPoint(renderer, centerX - x, centerY + y);
|
||||
SDL_RenderDrawPoint(renderer, centerX + y, centerY - x);
|
||||
SDL_RenderDrawPoint(renderer, centerX + y, centerY + x);
|
||||
SDL_RenderDrawPoint(renderer, centerX - y, centerY - x);
|
||||
SDL_RenderDrawPoint(renderer, centerX - y, centerY + x);
|
||||
|
||||
if (error <= 0)
|
||||
{
|
||||
++y;
|
||||
error += ty;
|
||||
ty += 2;
|
||||
}
|
||||
|
||||
if (error > 0)
|
||||
{
|
||||
--x;
|
||||
tx += 2;
|
||||
error += (tx - diameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,8 +194,10 @@ struct param_t
|
||||
SDL_Rect scoreboard; // Posición y tamaño del marcador
|
||||
|
||||
// TITLE
|
||||
int pressStart; // Posición del texto para empezar a jugar
|
||||
int titleCounter; // Tiempo de inactividad del titulo
|
||||
int pressStart; // Posición del texto para empezar a jugar
|
||||
int titleCounter; // Tiempo de inactividad del titulo
|
||||
int arcadeEdition; // Posición del bitmap
|
||||
int titleCC; // Posición del bitmap
|
||||
|
||||
// BACKGROUND
|
||||
color_t backgroundAttenuateColor;
|
||||
@@ -249,4 +251,7 @@ JA_Music_t *getMusic(std::vector<music_file_t> music, std::string name);
|
||||
// Ordena las entradas de la tabla de records
|
||||
hiScoreEntry_t sortHiScoreTable(hiScoreEntry_t entry1, hiScoreEntry_t entry2);
|
||||
|
||||
// Dibuja un circulo
|
||||
void DrawCircle(SDL_Renderer *renderer, int32_t centerX, int32_t centerY, int32_t radius);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user