Make the code compile
This commit is contained in:
parent
5cc1e108e6
commit
315a2ebb1a
1 changed files with 20 additions and 16 deletions
|
@ -1,5 +1,17 @@
|
|||
#include "../includes/quadtree.hpp"
|
||||
|
||||
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
||||
Uint32 r_mask = 0xff000000;
|
||||
Uint32 g_mask = 0x00ff0000;
|
||||
Uint32 b_mask = 0x0000ff00;
|
||||
Uint32 a_mask = 0x000000ff;
|
||||
#else
|
||||
Uint32 r_mask = 0x000000ff;
|
||||
Uint32 g_mask = 0x0000ff00;
|
||||
Uint32 b_mask = 0x00ff0000;
|
||||
Uint32 a_mask = 0xff000000;
|
||||
#endif
|
||||
|
||||
QuadTree::QuadTree(SDL_Surface * image, short niveau_p): niveau(niveau_p), couleur(calculeCouleur(image)), dimensions(image->w, image->h),
|
||||
nord_ouest(nullptr), nord_est(nullptr), sud_ouest(nullptr), sud_est(nullptr) {
|
||||
if(!verificationEgalitee(image)) {
|
||||
|
@ -46,9 +58,15 @@ SDL_Surface * QuadTree::image(short niveau_p) {
|
|||
return nouvelle_image;
|
||||
}
|
||||
|
||||
SDL_Color QuadTree::calculeCouleur(SDL_Surface *) { /* return SDL_Color(); */ }
|
||||
SDL_Color QuadTree::calculeCouleur(SDL_Surface *) {
|
||||
// Temporaire
|
||||
return SDL_Color();
|
||||
}
|
||||
|
||||
bool QuadTree::verificationEgalitee(SDL_Surface *) { /* return true; */ }
|
||||
bool QuadTree::verificationEgalitee(SDL_Surface *) {
|
||||
// Temporaire
|
||||
return true;
|
||||
}
|
||||
|
||||
std::array<SDL_Surface *, 4> QuadTree::coupeEnQuatre(SDL_Surface * s) {
|
||||
// Coordonnées des extrémités de chaque quadrant
|
||||
|
@ -58,20 +76,6 @@ std::array<SDL_Surface *, 4> QuadTree::coupeEnQuatre(SDL_Surface * s) {
|
|||
coordonnes_quadrants[2] = {s->w / 2, 0 , s->w , s->h / 2};
|
||||
coordonnes_quadrants[3] = {s->w / 2, s->h / 2, s->w , s->h};
|
||||
|
||||
// Masque dépend de l'ordre des octets de la machine
|
||||
Uint32 r_mask, g_mask, b_mask, a_mask;
|
||||
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {
|
||||
r_mask = 0xff000000;
|
||||
g_mask = 0x00ff0000;
|
||||
b_mask = 0x0000ff00;
|
||||
a_mask = 0x000000ff;
|
||||
} else {
|
||||
r_mask = 0x000000ff;
|
||||
g_mask = 0x0000ff00;
|
||||
b_mask = 0x00ff0000;
|
||||
a_mask = 0xff000000;
|
||||
}
|
||||
|
||||
std::array<SDL_Surface *, 4> resultat;
|
||||
for(Uint32 i = 0; i < 4; ++i) {
|
||||
// Création d'une nouvelle surface
|
||||
|
|
Reference in a new issue