diff --git a/Game/data/sprites/blockattack1.sprite b/Game/data/sprites/blockattack1.sprite index bc19114..99ffa67 100644 --- a/Game/data/sprites/blockattack1.sprite +++ b/Game/data/sprites/blockattack1.sprite @@ -18,6 +18,15 @@ "number_of_frames" : 1, "frame_time" : 1 }, +"background_sixteen_nine" : { + "texture" : "background_sixteen_nine", + "topx" : 0, + "topy" : 0, + "height" : 768, + "width" : 1366, + "number_of_frames" : 1, + "frame_time" : 1 +}, "background_sun" : { "texture" : "background_sun", "topx" : 0, diff --git a/Game/data/textures/background_sixteen_nine.png b/Game/data/textures/background_sixteen_nine.png new file mode 100644 index 0000000..483f2d8 Binary files /dev/null and b/Game/data/textures/background_sixteen_nine.png differ diff --git a/source/AUTH b/source/AUTH index bdb80e1..ab1f219 100644 --- a/source/AUTH +++ b/source/AUTH @@ -17,6 +17,7 @@ penguinattack.ttf Dustin Norlander - GPLv2 /textures/ back_board.png qubodup background.png qubodup +background_sixteen_nine.png Poul Sander (based of qubodup's background.png) ball_blue.png qubodup ball_gray.png qubodup ball_green.png qubodup diff --git a/source/assets/gfx/backgrounds/background_sixteen_nine.svg b/source/assets/gfx/backgrounds/background_sixteen_nine.svg new file mode 100644 index 0000000..9801c47 --- /dev/null +++ b/source/assets/gfx/backgrounds/background_sixteen_nine.svg @@ -0,0 +1,391 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/code/main.cpp b/source/code/main.cpp index be89989..e261ecc 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp @@ -132,6 +132,7 @@ static int InitImages(sago::SagoSpriteHolder& holder) { bricks[6] = holder.GetSprite("block_grey"); bomb = holder.GetSprite("block_bomb"); backgroundImage = holder.GetSprite("background"); + backgroundSixteenNineImage = holder.GetSprite("background_sixteen_nine"); globalData.bHighScore = holder.GetSprite("b_highscore"); globalData.bBack = holder.GetSprite("b_blank"); bForward = holder.GetSprite("b_forward"); @@ -281,7 +282,12 @@ void DrawBackground(SDL_Renderer* target) { SDL_RenderClear(target); //globalData.spriteHolder->GetSprite("background_sun").DrawScaled(globalData.screen, SDL_GetTicks(), globalData.xsize-320, -200, 600, 600); //globalData.spriteHolder->GetSprite("background_ground").DrawScaled(globalData.screen, SDL_GetTicks(), 0, globalData.ysize-200, globalData.xsize, 200); - backgroundImage.DrawScaled(target, SDL_GetTicks(), 0, 0, globalData.xsize, globalData.ysize); + if ( (double)globalData.xsize/globalData.ysize > 1.5) { + backgroundSixteenNineImage.DrawScaled(target, SDL_GetTicks(), 0, 0, globalData.xsize, globalData.ysize); + } + else { + backgroundImage.DrawScaled(target, SDL_GetTicks(), 0, 0, globalData.xsize, globalData.ysize); + } } /** diff --git a/source/code/mainVars.inc b/source/code/mainVars.inc index bb438f5..5e10d2a 100644 --- a/source/code/mainVars.inc +++ b/source/code/mainVars.inc @@ -47,6 +47,7 @@ const char sharedir[] = SHAREDIR; //All graphic in the game: sago::SagoSprite backgroundImage; //Stores the background image +sago::SagoSprite backgroundSixteenNineImage; // For 16:9 format sago::SagoSprite bExit; static sago::SagoSprite backBoard; //Stores the background to the board static sago::SagoSprite bForward; //The "forward" button