commit 21624171
Started on a new background draw procedure
Changed files
diff --git a/Game/data/sprites/blockattack1.sprite b/Game/data/sprites/blockattack1.sprite
index cff6284..2774d9e 100644
--- a/Game/data/sprites/blockattack1.sprite
+++ b/Game/data/sprites/blockattack1.sprite
@@ -18,6 +18,24 @@
"number_of_frames" : 1,
"frame_time" : 1
},
+"background_sun" : {
+ "texture" : "background_sun",
+ "topx" : 0,
+ "topy" : 0,
+ "height" : 1024,
+ "width" : 1024,
+ "number_of_frames" : 1,
+ "frame_time" : 1
+},
+"background_cloud" : {
+ "texture" : "background_cloud",
+ "topx" : 0,
+ "topy" : 0,
+ "height" : 301,
+ "width" : 511,
+ "number_of_frames" : 1,
+ "frame_time" : 1
+},
"ball_blue" : {
"texture" : "ball_blue",
"topx" : 0,
diff --git a/Game/data/textures/background_cloud.png b/Game/data/textures/background_cloud.png
new file mode 100644
index 0000000..9162656
Binary files /dev/null and b/Game/data/textures/background_cloud.png differ
diff --git a/Game/data/textures/background_sun.png b/Game/data/textures/background_sun.png
new file mode 100644
index 0000000..4e91938
Binary files /dev/null and b/Game/data/textures/background_sun.png differ
diff --git a/source/assets/gfx/backgrounds/background.svg b/source/assets/gfx/backgrounds/background.svg
index d37374f..80dd8ff 100644
--- a/source/assets/gfx/backgrounds/background.svg
+++ b/source/assets/gfx/backgrounds/background.svg
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
@@ -10,7 +11,7 @@
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="svg2"
sodipodi:version="0.32"
- inkscape:version="0.46"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
width="1024"
height="768"
version="1.0"
@@ -53,8 +54,8 @@
</filter>
</defs>
<sodipodi:namedview
- inkscape:window-height="951"
- inkscape:window-width="1280"
+ inkscape:window-height="1016"
+ inkscape:window-width="927"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
guidetolerance="10.0"
@@ -66,18 +67,21 @@
id="base"
showgrid="false"
inkscape:zoom="0.5"
- inkscape:cx="564.234"
- inkscape:cy="314.12607"
- inkscape:window-x="0"
- inkscape:window-y="25"
- inkscape:current-layer="svg2">
+ inkscape:cx="387.28966"
+ inkscape:cy="362.22947"
+ inkscape:window-x="67"
+ inkscape:window-y="27"
+ inkscape:current-layer="svg2"
+ inkscape:window-maximized="0">
<inkscape:grid
type="xygrid"
id="grid3193"
visible="true"
enabled="true"
- spacingx="128px"
- spacingy="128px" />
+ spacingx="128"
+ spacingy="128"
+ originx="0"
+ originy="0" />
</sodipodi:namedview>
<rect
style="opacity:1;fill:#a1dbee;fill-opacity:1;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:16, 16;stroke-dashoffset:0;stroke-opacity:1"
@@ -97,11 +101,14 @@
sodipodi:cy="68.855171"
sodipodi:rx="180.08276"
sodipodi:ry="180.08276"
- d="M 1084.0276,68.855171 A 180.08276,180.08276 0 1 1 723.86206,68.855171 A 180.08276,180.08276 0 1 1 1084.0276,68.855171 z"
- transform="matrix(1.5261598,0,0,1.5261598,-456.19872,25.564281)" />
+ d="M 1084.0276,68.855171 A 180.08276,180.08276 0 0 1 903.94482,248.93793 180.08276,180.08276 0 0 1 723.86206,68.855171 180.08276,180.08276 0 0 1 903.94482,-111.22759 180.08276,180.08276 0 0 1 1084.0276,68.855171 Z"
+ transform="matrix(1.5261598,0,0,1.5261598,-456.19872,25.564281)"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_sun.png"
+ inkscape:export-xdpi="144.22725"
+ inkscape:export-ydpi="144.22725" />
<path
transform="translate(19.42069,61.793103)"
- d="M 1084.0276,68.855171 A 180.08276,180.08276 0 1 1 723.86206,68.855171 A 180.08276,180.08276 0 1 1 1084.0276,68.855171 z"
+ d="M 1084.0276,68.855171 A 180.08276,180.08276 0 0 1 903.94482,248.93793 180.08276,180.08276 0 0 1 723.86206,68.855171 180.08276,180.08276 0 0 1 903.94482,-111.22759 180.08276,180.08276 0 0 1 1084.0276,68.855171 Z"
sodipodi:ry="180.08276"
sodipodi:rx="180.08276"
sodipodi:cy="68.855171"
@@ -116,7 +123,7 @@
style="opacity:1;fill:#f77935;fill-opacity:1;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:16, 16;stroke-dashoffset:0;stroke-opacity:1" />
<path
transform="matrix(0.9262219,0,0,1,33.836039,-13.732501)"
- d="M 861.40233,77.005501 A 23.719774,30.586025 0 1 1 813.96278,77.005501 A 23.719774,30.586025 0 1 1 861.40233,77.005501 z"
+ d="M 861.40233,77.005501 A 23.719774,30.586025 0 0 1 837.68256,107.59153 23.719774,30.586025 0 0 1 813.96278,77.005501 23.719774,30.586025 0 0 1 837.68256,46.419476 23.719774,30.586025 0 0 1 861.40233,77.005501 Z"
sodipodi:ry="30.586025"
sodipodi:rx="23.719774"
sodipodi:cy="77.005501"
@@ -132,7 +139,7 @@
sodipodi:cy="77.005501"
sodipodi:rx="23.719774"
sodipodi:ry="30.586025"
- d="M 861.40233,77.005501 A 23.719774,30.586025 0 1 1 813.96278,77.005501 A 23.719774,30.586025 0 1 1 861.40233,77.005501 z"
+ d="M 861.40233,77.005501 A 23.719774,30.586025 0 0 1 837.68256,107.59153 23.719774,30.586025 0 0 1 813.96278,77.005501 23.719774,30.586025 0 0 1 837.68256,46.419476 23.719774,30.586025 0 0 1 861.40233,77.005501 Z"
transform="matrix(0.9946296,0,0,1.1020408,71.785455,-0.9914533)" />
<path
sodipodi:type="arc"
@@ -142,11 +149,11 @@
sodipodi:cy="77.005501"
sodipodi:rx="23.719774"
sodipodi:ry="30.586025"
- d="M 861.40233,77.005501 A 23.719774,30.586025 0 1 1 813.96278,77.005501 A 23.719774,30.586025 0 1 1 861.40233,77.005501 z"
+ d="M 861.40233,77.005501 A 23.719774,30.586025 0 0 1 837.68256,107.59153 23.719774,30.586025 0 0 1 813.96278,77.005501 23.719774,30.586025 0 0 1 837.68256,46.419476 23.719774,30.586025 0 0 1 861.40233,77.005501 Z"
transform="matrix(0.5510204,0,0,0.5510204,345.51635,33.013387)" />
<path
transform="matrix(0.5773697,0,0,0.5878019,415.69998,50.683724)"
- d="M 861.40233,77.005501 A 23.719774,30.586025 0 1 1 813.96278,77.005501 A 23.719774,30.586025 0 1 1 861.40233,77.005501 z"
+ d="M 861.40233,77.005501 A 23.719774,30.586025 0 0 1 837.68256,107.59153 23.719774,30.586025 0 0 1 813.96278,77.005501 23.719774,30.586025 0 0 1 837.68256,46.419476 23.719774,30.586025 0 0 1 861.40233,77.005501 Z"
sodipodi:ry="30.586025"
sodipodi:rx="23.719774"
sodipodi:cy="77.005501"
diff --git a/source/assets/gfx/backgrounds/background_cloud.svg b/source/assets/gfx/backgrounds/background_cloud.svg
new file mode 100644
index 0000000..ecafbe3
--- /dev/null
+++ b/source/assets/gfx/backgrounds/background_cloud.svg
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="210mm"
+ height="297mm"
+ viewBox="0 0 210 297"
+ version="1.1"
+ id="svg3990"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="background_cloud.svg">
+ <defs
+ id="defs3984" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.35"
+ inkscape:cx="7.0210235"
+ inkscape:cy="560"
+ inkscape:document-units="mm"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="927"
+ inkscape:window-height="1016"
+ inkscape:window-x="993"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0" />
+ <metadata
+ id="metadata3987">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <circle
+ r="7.9375"
+ cy="54.603863"
+ cx="89.136238"
+ style="opacity:1;fill:#dbeff0;fill-opacity:1;stroke:none;stroke-width:4.23333311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.23333333, 4.23333333;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3241"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_cloud.png"
+ inkscape:export-xdpi="244.88148"
+ inkscape:export-ydpi="244.88148" />
+ <circle
+ r="6.2177081"
+ cy="50.502834"
+ cx="99.58728"
+ style="opacity:1;fill:#c8e7ea;fill-opacity:1;stroke:none;stroke-width:4.23333311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.23333333, 4.23333333;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3243"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_cloud.png"
+ inkscape:export-xdpi="244.88148"
+ inkscape:export-ydpi="244.88148" />
+ <circle
+ r="5.1593752"
+ cy="49.179913"
+ cx="107.52478"
+ style="opacity:1;fill:#e5fdff;fill-opacity:1;stroke:none;stroke-width:4.23333311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.23333333, 4.23333333;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3249"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_cloud.png"
+ inkscape:export-xdpi="244.88148"
+ inkscape:export-ydpi="244.88148" />
+ <circle
+ r="8.9296875"
+ cy="54.273144"
+ cx="125.31801"
+ style="opacity:1;fill:#e5fdff;fill-opacity:1;stroke:none;stroke-width:4.23333311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.23333333, 4.23333333;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3257"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_cloud.png"
+ inkscape:export-xdpi="244.88148"
+ inkscape:export-ydpi="244.88148" />
+ <circle
+ r="10.451041"
+ cy="60.424709"
+ cx="103.29144"
+ style="opacity:1;fill:#c9e9ef;fill-opacity:1;stroke:none;stroke-width:4.23333311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.23333333, 4.23333333;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3239"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_cloud.png"
+ inkscape:export-xdpi="244.88148"
+ inkscape:export-ydpi="244.88148" />
+ <circle
+ r="6.8791666"
+ cy="66.245544"
+ cx="94.295609"
+ style="opacity:1;fill:#d7eef3;fill-opacity:1;stroke:none;stroke-width:4.23333311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.23333333, 4.23333333;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3247"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_cloud.png"
+ inkscape:export-xdpi="244.88148"
+ inkscape:export-ydpi="244.88148" />
+ <circle
+ r="7.8052082"
+ cy="53.148663"
+ cx="115.0654"
+ style="opacity:1;fill:#ddf2f3;fill-opacity:1;stroke:none;stroke-width:4.23333311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.23333333, 4.23333333;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3237"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_cloud.png"
+ inkscape:export-xdpi="244.88148"
+ inkscape:export-ydpi="244.88148" />
+ <circle
+ r="7.4744792"
+ cy="67.766891"
+ cx="115.26384"
+ style="opacity:1;fill:#dbeff3;fill-opacity:1;stroke:none;stroke-width:4.23333311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.23333333, 4.23333333;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3251"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_cloud.png"
+ inkscape:export-xdpi="244.88148"
+ inkscape:export-ydpi="244.88148" />
+ <circle
+ r="8.3343754"
+ cy="62.673656"
+ cx="120.88624"
+ style="opacity:1;fill:#d3e8ec;fill-opacity:1;stroke:none;stroke-width:4.23333311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.23333333, 4.23333333;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3253"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_cloud.png"
+ inkscape:export-xdpi="244.88148"
+ inkscape:export-ydpi="244.88148" />
+ </g>
+</svg>
diff --git a/source/assets/gfx/backgrounds/sun.svg b/source/assets/gfx/backgrounds/sun.svg
new file mode 100644
index 0000000..263e9b0
--- /dev/null
+++ b/source/assets/gfx/backgrounds/sun.svg
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="210mm"
+ height="297mm"
+ viewBox="0 0 210 297"
+ version="1.1"
+ id="svg3885"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="sun.svg">
+ <defs
+ id="defs3879">
+ <filter
+ inkscape:collect="always"
+ id="filter3189-3"
+ x="-0.12"
+ width="1.24"
+ y="-0.12"
+ height="1.24">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="18.008276"
+ id="feGaussianBlur3191-6" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.35"
+ inkscape:cx="289.38896"
+ inkscape:cy="560"
+ inkscape:document-units="mm"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="927"
+ inkscape:window-height="1016"
+ inkscape:window-x="993"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0" />
+ <metadata
+ id="metadata3882">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <g
+ id="g3171"
+ transform="matrix(0.26458333,0,0,0.26458333,-145.27737,57.569548)"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_sun.png"
+ inkscape:export-xdpi="144.23"
+ inkscape:export-ydpi="144.23">
+ <circle
+ r="180.08276"
+ cy="68.855171"
+ cx="903.94482"
+ style="opacity:1;fill:#fff839;fill-opacity:0.65596331;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:16, 16;stroke-dashoffset:0;stroke-opacity:1;filter:url(#filter3189-3)"
+ id="path3179-7"
+ transform="matrix(1.5261598,0,0,1.5261598,-456.19872,25.564281)"
+ inkscape:export-filename="/home/poul/programmering/git/blockattack-game/Game/data/textures/background_sun.png"
+ inkscape:export-xdpi="144.22725"
+ inkscape:export-ydpi="144.22725" />
+ <circle
+ r="180.08276"
+ cy="68.855171"
+ cx="903.94482"
+ transform="translate(19.42069,61.793103)"
+ id="path2384"
+ style="opacity:1;fill:#ffec25;fill-opacity:1;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:16, 16;stroke-dashoffset:0;stroke-opacity:1" />
+ <path
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cscc"
+ id="path2386"
+ d="m 775.8067,156.28546 c 2.33031,68.41998 31.14447,124.49841 100.12875,124.49841 68.98426,0 62.81174,-24.8682 65.14204,-93.28818 z"
+ style="opacity:1;fill:#f77935;fill-opacity:1;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:16, 16;stroke-dashoffset:0;stroke-opacity:1" />
+ <ellipse
+ ry="30.586025"
+ rx="23.719774"
+ cy="77.005501"
+ cx="837.68256"
+ transform="matrix(0.9262219,0,0,1,33.836039,-13.732501)"
+ id="path3161"
+ style="opacity:1;fill:#fffdb9;fill-opacity:1;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:16, 16;stroke-dashoffset:0;stroke-opacity:1" />
+ <ellipse
+ ry="30.586025"
+ rx="23.719774"
+ cy="77.005501"
+ cx="837.68256"
+ style="opacity:1;fill:#fffdb9;fill-opacity:1;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:16, 16;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3163"
+ transform="matrix(0.9946296,0,0,1.1020408,71.785455,-0.9914533)" />
+ <ellipse
+ ry="30.586025"
+ rx="23.719774"
+ cy="77.005501"
+ cx="837.68256"
+ style="opacity:1;fill:#132d6b;fill-opacity:1;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:16, 16;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3165"
+ transform="matrix(0.5510204,0,0,0.5510204,345.51635,33.013387)" />
+ <ellipse
+ ry="30.586025"
+ rx="23.719774"
+ cy="77.005501"
+ cx="837.68256"
+ transform="matrix(0.5773697,0,0,0.5878019,415.69998,50.683724)"
+ id="path3167"
+ style="opacity:1;fill:#132d6b;fill-opacity:1;stroke:none;stroke-width:16;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:16, 16;stroke-dashoffset:0;stroke-opacity:1" />
+ </g>
+ </g>
+</svg>
diff --git a/source/code/main.cpp b/source/code/main.cpp
index a91665f..882422f 100644
--- a/source/code/main.cpp
+++ b/source/code/main.cpp
@@ -269,7 +269,10 @@ void DrawBackground(SDL_Renderer* target) {
else {
SDL_GetWindowSize(sdlWindow, &globalData.xsize, &globalData.ysize);
}
- backgroundImage.DrawScaled(target, SDL_GetTicks(), 0, 0, globalData.xsize, globalData.ysize);
+ SDL_SetRenderDrawColor(target, 135, 206, 250, 255);
+ SDL_RenderClear(target);
+ globalData.spriteHolder->GetSprite("background_sun").Draw(globalData.screen, SDL_GetTicks(), globalData.xsize-500, -400);
+ //backgroundImage.DrawScaled(target, SDL_GetTicks(), 0, 0, globalData.xsize, globalData.ysize);
}
/**