Skip to content

Commit

Permalink
Merge pull request OpenBrickProtocolFoundation#109 from mgerhold/logo
Browse files Browse the repository at this point in the history
Add New Logo
  • Loading branch information
Totto16 authored Dec 31, 2023
2 parents dab059c + b045a2c commit 33e1a6f
Show file tree
Hide file tree
Showing 25 changed files with 41,423 additions and 11 deletions.
23,094 changes: 23,094 additions & 0 deletions assets/OOPetris.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18,274 changes: 18,274 additions & 0 deletions assets/icon/OOPetris.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/icon_144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/icon_160.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/icon_192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/icon_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/icon_256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/icon_48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/icon_512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/icon_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/icon_72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon/icon_96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/icon/test_192.png
Binary file not shown.
Binary file removed assets/icon/test_96.png
Binary file not shown.
27 changes: 20 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ deps += dependency(
default_options: ['tests=false'],
)

deps += dependency('nlohmann_json', required: true, native: native)
deps += dependency(
'nlohmann_json',
required: true,
native: native,
)

deps += dependency(
'tl-optional',
Expand All @@ -185,7 +189,7 @@ deps += dependency(
required: true,
fallback: ['magic_enum'],
native: native,
default_options:['test=false']
default_options: ['test=false'],
)
deps += dependency(
'argparse',
Expand Down Expand Up @@ -219,7 +223,11 @@ if (meson.is_cross_build() and host_machine.system() == 'switch')
library_dirs = meson.get_external_property('library_dirs')

foreach dep : switch_dependencies
deps += cpp.find_library(dep, required: true, dirs: library_dirs)
deps += cpp.find_library(
dep,
required: true,
dirs: library_dirs,
)
endforeach


Expand Down Expand Up @@ -325,13 +333,18 @@ elif meson.is_cross_build() and host_machine.system() == 'switch'

default_icon = meson.get_external_property('libnx') / 'default_icon.jpg'

APP_ICON = meson.get_external_property('APP_ICON', default_icon)
app_icon = meson.get_external_property('APP_ICON', default_icon)

if not fs.exists(app_icon)
error('APP_ICON should exist, but doesn\'t: \'' + app_icon + '\'')
endif

if not fs.exists(APP_ICON)
error('APP_ICON should exist, but doesn\'t: \'' + APP_ICON + '\'')
if not fs.is_absolute(app_icon)
app_icon = meson.project_source_root() / app_icon
endif

NROFLAGS += '--icon=' + APP_ICON

NROFLAGS += '--icon=' + app_icon


romfs_dir = meson.get_external_property('romfs_dir')
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions platforms/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,20 @@ done
# TODO only copy the supported music ones (atm we need both for i686 flac is needed!)

cp -r ./assets/ platforms/android/app/src/main

# copy icons to correct dir

DESC_ARRAY=(m h xh xxh xxxh)
RES_ARRAY=(48 72 96 144 192)

for IDX in "${!DESC_ARRAY[@]}"; do

DESC="${DESC_ARRAY[$IDX]}"
RES="${RES_ARRAY[$IDX]}"

export DESC_DIR="platforms/android/app/src/main/res/mipmap-${DESC}dpi"

mkdir -p "$DESC_DIR"
cp -r "./assets/icon/icon_$RES.png" "${DESC_DIR}/ic_launcher.png"

done
1 change: 1 addition & 0 deletions platforms/build-switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ needs_exe_wrapper = true
library_dirs= ['$LIBNX_LIB', '$PORTLIBS_LIB']
romfs_dir='$ROMFS'
libnx='$LIBNX'
APP_ICON='$ROMFS/assets/icon/icon_512.png'
USE_NACP = true
APP_TITLE = 'oopetris'
Expand Down
10 changes: 6 additions & 4 deletions platforms/flatpak-icon-helper.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/usr/bin/env bash

APP_NAME="com.github.mgerhold.OOPetris"

function process_icon() {
SRC=$1
RES=$(echo "$SRC" | awk -F_ '{ print $2 }' | awk -F. '{ print $1 }' | awk '{ print $1 }')

DEST_DIR="/app/share/icons/hicolor/${RES}x${RES}/apps"
mkdir -p "$DEST_DIR"
cp "$SRC" "$DEST_DIR/com.github.mgerhold.OOPetris.png"
cp "$SRC" "$DEST_DIR/$APP_NAME.png"
}

export -f process_icon

#TODO get real logo and use more sizes!
find ../assets/icon/ -name "test_*.png" -exec bash -c 'process_icon "$@";' -- {} \;
find ../assets/icon/ -name "icon_*.png" -exec bash -c 'process_icon "$@";' -- {} \;

## TODO svg /app/share/icons/hicolor/scalable/apps/com.github.mgerhold.OOPetris.svg
mkdir -p "/app/share/icons/hicolor/scalable/apps/"
cp "../assets/icon/OOPetris.svg" "/app/share/icons/hicolor/scalable/apps/$APP_NAME.svg"
11 changes: 11 additions & 0 deletions platforms/make-icons.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

for RES in 24 48 64 72 96 128 144 160 192 256 512; do

inkscape "--export-width=$RES" "--export-height=$RES" --export-type=png "--export-filename=../assets/icon/icon_$RES.png" "../assets/OOPetris.svg"

done

#TODO: this doesn't work correctly!
MAX_RES="4096"
inkscape "--export-width=$MAX_RES" "--export-height=$MAX_RES" --export-type=svg "--export-filename=../assets/icon/OOPetris.svg" "../assets/OOPetris.svg"

0 comments on commit 33e1a6f

Please sign in to comment.