Improve the penguin mesh and texture.

master
poikilos 2021-03-23 22:56:38 -04:00
parent e50e1196dc
commit 3a0b230488
6 changed files with 105 additions and 41 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 772 KiB

After

Width:  |  Height:  |  Size: 746 KiB

View File

@ -17,7 +17,14 @@ fi
# chmod +x install.sh
echo
echo
if [ -z "$PREFIX" ]; then PREFIX=/usr/local; fi
# if [ -z "$PREFIX" ]; then PREFIX=$HOME/.local; fi
if [ -z "$PREFIX" ]; then
PREFIX=/usr/local
if [ "@$USER" != "@root" ]; then
PREFIX="$HOME/.local"
echo "* The user is not root, so the prefix became \"$PREFIX\". Specify PREFIX in the environment to override automatically setting it."
fi
fi
dest_bin_dir="$PREFIX/bin"
dest_share_dir="$PREFIX/share"
project_unix_name=b3view
@ -29,8 +36,24 @@ icon_name="b3view.png"
icon_src_path="$DIST_DIR/icons/$icon_name"
shortcut_name="org.poikilos.b3view.desktop"
shortcut_src_path="$DIST_DIR/applications/$shortcut_name"
icons_root=$PREFIX/share/pixmaps
applications_path=$PREFIX/share/applications
icons_root=$dest_share_dir/pixmaps
applications_path=$dest_share_dir/applications
my_share_dir="$dest_share_dir/$project_unix_name"
mkdir -p "$my_share_dir/meshes"
mkdir -p "$my_share_dir/textures"
for resource in b3view/textures/penguin.png b3view/meshes/penguin-lowpoly-poikilos.b3d
do
src="dist/share/$resource"
dst="$dest_share_dir/$resource"
cp "$src" "$dst"
if [ $? -ne 0 ]; then
echo "Error: 'cp \"$src\" \"$dst\"' failed."
exit 1
else
echo "* installed \"$dst\""
fi
done
mimes_path="$DIST_DIR/share/mime/packages"
USER_MIMETYPES_DB_PATH=$HOME/.local/share/mime
@ -127,6 +150,10 @@ fi
if [ ! -d "$applications_path" ]; then
mkdir -p "$applications_path"
if [ $? -ne 0 ]; then
echo "Error: 'mkdir -p \"$applications_path\"' failed."
exit 1
fi
fi
# if [ "@$PROFILE_ENABLE" = "@true" ]; then
@ -168,14 +195,31 @@ install_mime() {
exit 1
fi
try_dest="$MIMETYPES_DB_PATH/packages/$mime_name"
if [ ! -f "$mime_path" ]; then
echo "* There is no source mime type at \"$mime_path\" yet."
fi
DEST_OP=
if [ ! -f "$try_dest" ]; then
# echo "* There is no destination mime type at \"$try_dest\" yet."
DEST_OP=add
else
if diff -q $mime_path $try_dest; then
echo "(You already have an identical $try_dest)"
else
DEST_OP=update
fi
fi
if [ ! -z "$DEST_OP" ]; then
cp -f "$mime_path" "$MIMETYPES_DB_PATH/packages/"
if [ $? -ne 0 ]; then
if [ -f "$MIMETYPES_DB_PATH/packages/$mime_name" ]; then
echo "Successfully copied '$MIMETYPES_DB_PATH/packages/$mime_name'"
echo "WARNING: cp failed the existing '$MIMETYPES_DB_PATH/packages/$mime_name' will be used"
# rm -f "$MIMETYPES_DB_PATH/packages/$mime_name"
update_mime_enable=true
else
echo "Error: 'cp -f \"$mime_path\" \"$MIMETYPES_DB_PATH/packages/\"' failed."
exit 1
fi
fi
fi
}
@ -214,6 +258,11 @@ try_dest="$MIMETYPES_DB_PATH/packages/$mime_name"
if [ "@$update_mime_enable" = "@true" ]; then
echo "Updating mime type database '$MIMETYPES_DB_PATH'..."
update-mime-database "$MIMETYPES_DB_PATH" # must contain packages
if [ $? -ne 0 ]; then
echo "Error: 'update-mime-database \"$MIMETYPES_DB_PATH\"' failed."
exit 1
fi
fi
echo "Done."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 772 KiB

Binary file not shown.

View File

@ -1,12 +1,27 @@
#!/bin/sh
src=projects/textures/penguin.png
dst=../../dist/share/b3view/textures/penguin.png
update_file(){
src="$1"
dst="$2"
op="cp"
if [ ! -z "$3" ]; then
op=mv
fi
if [ ! -f "$src" ]; then
echo "* There is nothing to do because there is no \"$src\". See the xcf file there instead. To use this script, export it to png where there is no png then run this script."
exit 0
echo "* There is nothing to do because there is no \"$src\". See the project file there instead. To use this script, export it to png where there is no png then run this script."
return 0
fi
if [ ! -f "$dst" ]; then
echo "Error: There is no \"$dst\" to update, so for safety nothing will be done."
exit 1
return 1
fi
cp "$src" "$dst"
$op "$src" "$dst"
if [ $? -eq 0 ]; then
echo "* updated \"$dst\""
else
echo "Error: '$op \"$src\" \"$dst\"' failed."
fi
}
update_file projects/textures/penguin.png dist/share/b3view/textures/penguin.png
update_file projects/meshes/penguin-lowpoly-poikilos.b3d dist/share/b3view/meshes/penguin-lowpoly-poikilos.b3d mv