diff --git a/app/app.iml b/app/app.iml index 1c81077..947c09c 100644 --- a/app/app.iml +++ b/app/app.iml @@ -57,6 +57,7 @@ + diff --git a/app/build.gradle b/app/build.gradle index 9fdd221..0fa412f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -30,6 +30,20 @@ task createVersionXML { } preBuild.dependsOn createVersionXML +// +// Convert SVG images from art directory into PNG files. +// +task generateDrawablesFromArt { + doLast { + def p = 'make -C app/src/main/art RES=../res TMP=../../../build/art'.execute() + p.consumeProcessOutput() + p.waitFor() + if ( p.exitValue() ) + throw new GradleException("Generation of art failed.") + } +} +preBuild.dependsOn generateDrawablesFromArt + android { compileSdkVersion 10 buildToolsVersion "21.1.1" diff --git a/app/src/main/art/Makefile b/app/src/main/art/Makefile new file mode 100644 index 0000000..cb3e2ef --- /dev/null +++ b/app/src/main/art/Makefile @@ -0,0 +1,100 @@ +XMLS = xmlstarlet ed -P -N svg=http://www.w3.org/2000/svg +LAYER_ON = -u //*/svg:g[@inkscape:label=\"$(1)\"]/@style -v display:inline +LAYER_OFF = -u //*/svg:g[@inkscape:label=\"$(1)\"]/@style -v display:none +S2P = inkscape --without-gui +SIZE = --export-width=$(1) --export-height=$(2) +#S2P = imagemagick -background none +#SIZE = -resize $(1)x$(2) + +TMP = tmp +RES = res + +DIR = $(TMP) $(RES) $(RES)/drawable $(RES)/drawable-ldpi \ + $(RES)/drawable-mdpi $(RES)/drawable-hdpi $(RES)/drawable-xhdpi + +png = bingo.png box.png floor.png goal.png splash.png \ + wall.png worker.png worker_select.png + +pngx = icon.png icon_debug.png next.png prev.png reset.png undo.png \ + lock.png unlock.png unlocking.png + +all: $(DIR)\ + $(addprefix $(RES)/drawable/,$(png)) \ + $(addprefix $(RES)/drawable-ldpi/,$(pngx)) \ + $(addprefix $(RES)/drawable-mdpi/,$(pngx)) \ + $(addprefix $(RES)/drawable-hdpi/,$(pngx)) \ + $(addprefix $(RES)/drawable-xhdpi/,$(pngx)) + +$(DIR) : + mkdir $@ + +$(RES)/drawable/%.png : $(TMP)/%.svg + $(S2P) --export-png=$@ --file=$< + +$(RES)/drawable-ldpi/%.png : $(TMP)/%.svg + $(S2P) $(call SIZE,36,36) --export-png=$@ --file=$< + +$(RES)/drawable-mdpi/%.png : $(TMP)/%.svg + $(S2P) $(call SIZE,48,48) --export-png=$@ --file=$< + +$(RES)/drawable-hdpi/%.png : $(TMP)/%.svg + $(S2P) $(call SIZE,72,72) --export-png=$@ --file=$< + +$(RES)/drawable-xhdpi/%.png : $(TMP)/%.svg + $(S2P) $(call SIZE,96,96) --export-png=$@ --file=$< + +$(TMP)/%.svg : %.svg + cp $< $@ + +$(TMP)/icon.svg : icon.svg + $(XMLS) $(call LAYER_OFF,"Debug") $< > $@ + +$(TMP)/icon_debug.svg : icon.svg + $(XMLS) $(call LAYER_ON,"Debug") $< > $@ + +$(TMP)/worker.svg : worker.svg + $(XMLS) $(call LAYER_OFF,"Hands") $< > $@ + +$(TMP)/worker_select.svg : worker.svg + $(XMLS) $(call LAYER_ON,"Hands") $< > $@ + +$(TMP)/floor.svg : floor.svg + $(XMLS) $(call LAYER_OFF,"Goal") $< > $@ + +$(TMP)/goal.svg : floor.svg + $(XMLS) $(call LAYER_ON,"Goal") $< > $@ + +$(TMP)/lock.svg : lock.svg + $(XMLS) $(call LAYER_ON,"lock") $< > $@ + +$(TMP)/unlock.svg : lock.svg + $(XMLS) $(call LAYER_ON,"unlock") $< > $@ + +$(TMP)/unlocking.svg : lock.svg + $(XMLS) $(call LAYER_ON,"unlocking") $< > $@ + +$(TMP)/prev.svg : buttons.svg + $(XMLS) $(call LAYER_ON,"Prev Smooth") $< > $@ + +$(TMP)/next.svg : buttons.svg + $(XMLS) $(call LAYER_ON,"Next Smooth") $< > $@ + +$(TMP)/reset.svg : buttons.svg + $(XMLS) $(call LAYER_ON,"Reset Smooth") $< > $@ + +$(TMP)/undo.svg : buttons.svg + $(XMLS) $(call LAYER_ON,"Undo Smooth") $< > $@ + + + +# def cfg = 'imagemagick -background none -resize '+w+'x'+h+' - ' + png +# def sizes = [ 'ldpi':[36,36], +# 'mdpi':[48,48], +# 'hdpi':[72,72], +# 'xhdpi':[96,96] ] + +# def sizes2= [ 'ldpi':[22,36], +# 'mdpi':[29,48], +# 'hdpi':[43,72], +# 'xhdpi':[58,96] ] + diff --git a/app/src/main/art/bingo.svg b/app/src/main/art/bingo.svg index c9719a3..ad79ad4 100644 --- a/app/src/main/art/bingo.svg +++ b/app/src/main/art/bingo.svg @@ -9,11 +9,11 @@ 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="744.09448819" - height="1052.3622047" + width="500" + height="500" id="svg2" version="1.1" - inkscape:version="0.48.4 r9939" + inkscape:version="0.48.5 r10040" sodipodi:docname="bingo.svg" inkscape:export-filename="C:\Users\vahagnk\devel\_private\org.dyndns.vahagn.sokoban\art\bingo.png" inkscape:export-xdpi="89.873062" @@ -27,21 +27,25 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1.4283557" - inkscape:cx="534.28726" - inkscape:cy="478.14229" + inkscape:zoom="0.71417785" + inkscape:cx="153.09914" + inkscape:cy="72.742182" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" inkscape:snap-global="false" - inkscape:window-width="1920" - inkscape:window-height="1018" - inkscape:window-x="-8" + inkscape:window-width="1680" + inkscape:window-height="1028" + inkscape:window-x="1672" inkscape:window-y="-8" inkscape:window-maximized="1"> + id="grid3079" + empspacing="5" + visible="true" + enabled="true" + snapvisiblegridlinesonly="true" /> @@ -51,115 +55,116 @@ image/svg+xml - + + id="layer1" + transform="translate(0,-552.36217)"> + x="-0.22199483" + y="552.52313" /> + x="17.019796" + y="555.72852" /> + x="-0.39702842" + y="552.46313" /> + x="-0.42704245" + y="614.60229" /> + x="-0.42704245" + y="677.21362" /> + x="-0.36698386" + y="741.00989" /> + x="-0.52222675" + y="803.52155" /> + x="-0.3503823" + y="866.67078" /> + x="-0.24752279" + y="930.15588" /> + x="-0.44684836" + y="992.48291" /> diff --git a/app/src/main/art/box.svg b/app/src/main/art/box.svg index 66aa659..f707e02 100644 --- a/app/src/main/art/box.svg +++ b/app/src/main/art/box.svg @@ -9,11 +9,11 @@ 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="744.09448819" - height="1052.3622047" + width="500" + height="500" id="svg2" version="1.1" - inkscape:version="0.48.4 r9939" + inkscape:version="0.48.5 r10040" sodipodi:docname="box.svg" inkscape:export-filename="C:\Users\vahagnk\devel\_private\org.dyndns.vahagn.sokoban\art\box.png" inkscape:export-xdpi="89.873062" @@ -27,21 +27,25 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1.4283557" - inkscape:cx="313.36866" - inkscape:cy="490.25008" + inkscape:zoom="1.1301775" + inkscape:cx="56.319409" + inkscape:cy="241.66791" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" inkscape:snap-global="false" - inkscape:window-width="1920" - inkscape:window-height="1018" - inkscape:window-x="-8" + inkscape:window-width="1680" + inkscape:window-height="1028" + inkscape:window-x="1672" inkscape:window-y="-8" inkscape:window-maximized="1"> + id="grid3079" + empspacing="5" + visible="true" + enabled="true" + snapvisiblegridlinesonly="true" /> @@ -58,108 +62,109 @@ + id="layer1" + transform="translate(0,-552.36217)"> + x="-0.12822925" + y="552.77655" /> + x="17.113562" + y="555.98193" /> + x="-0.3032628" + y="552.71649" /> + x="-0.33327684" + y="614.85571" /> + x="-0.33327684" + y="677.46704" /> + x="-0.27321824" + y="741.26331" /> + x="-0.42846116" + y="803.77496" /> + x="-0.25661668" + y="866.92419" /> + x="-0.1537572" + y="930.4093" /> + x="-0.35308275" + y="992.73633" /> diff --git a/app/src/main/art/buttons.svg b/app/src/main/art/buttons.svg index 5fea6d0..268ae20 100644 --- a/app/src/main/art/buttons.svg +++ b/app/src/main/art/buttons.svg @@ -27,15 +27,15 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.29" - inkscape:cx="217.24802" + inkscape:cx="128.10073" inkscape:cy="230.02585" inkscape:document-units="px" - inkscape:current-layer="layer4" + inkscape:current-layer="g4047" showgrid="true" inkscape:snap-global="false" - inkscape:window-width="1920" - inkscape:window-height="1018" - inkscape:window-x="-8" + inkscape:window-width="1680" + inkscape:window-height="1028" + inkscape:window-x="1672" inkscape:window-y="-8" inkscape:window-maximized="1" showguides="true" @@ -322,7 +322,7 @@ sodipodi:insensitive="true" inkscape:groupmode="layer" id="g4047" - inkscape:label="Undo Smoth" + inkscape:label="Undo Smooth" transform="translate(0,-552.36217)" style="display:none"> + inkscape:window-maximized="1" + borderlayer="true" + inkscape:showpageshadow="false" + showborder="true"> image/svg+xml - + @@ -253,9 +255,9 @@ inkscape:groupmode="layer" id="layer5" inkscape:label="Goal" - style="opacity:0.33628319;display:inline"> + style="opacity:1;display:inline">