- LÖVE on Raspbian Stretch lite (without X) -
縦スクロールシューティングゲームっぽいサンプル が非常に興味深かったので、 LÖVE - Free 2D Game Engine を Raspberry Pi Zero W でビルドしてみました。
【方針】name, version, vendor, device = love.graphics.getRendererInfo()という関数で、
name: OpenGL ES version: OpenGL ES 2.0 vendor: Broadcom device: VideoCore IV HWとなってますので、おそらくは… (だと良いなぁ)
% sudo apt install automake % sudo apt install libudev-dev % sudo apt install libasound2-dev % sudo apt install libdbus-1-dev % sudo apt install libfreeimage-dev % sudo apt install libsndfile1-dev % sudo apt install libtiff5-dev % sudo apt install libwebp-dev
% sudo apt install cmake
% sudo apt install libmodplug-dev % sudo apt install libphysfs-dev % sudo apt install libluajit-5.1-dev % sudo apt install libmpg123-dev
% mkdir ~/tmp % cd ~/tmp
% wget -nd -N https://www.libsdl.org/release/SDL2-2.0.7.tar.gz % wget -nd -N https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.2.tar.gz % wget -nd -N https://www.libsdl.org/projects/smpeg/release/smpeg2-2.0.0.tar.gz % wget -nd -N https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.2.tar.gz % wget -nd -N https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.0.1.tar.gz % wget -nd -N https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
% wget -nd -N http://kcat.strangesoft.net/openal-releases/openal-soft-1.18.2.tar.bz2
% wget -nd -N http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
% wget -nd -N https://bitbucket.org/rude/love/downloads/love-0.10.2-linux-src.tar.gz
% mkdir ~/src
% cd ~/src % tar xpf ~/tmp/SDL2-2.0.7.tar.gz % cd SDL2-2.0.7 % mkdir build % cd build % ../configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl % make % sudo make install
% cd ~/src % tar xpf ~/tmp/SDL2_image-2.0.2.tar.gz % cd SDL2_image-2.0.2 % mkdir build % cd build % ../configure % make % sudo make install
% cd ~/src % tar xpf ~/tmp/smpeg2-2.0.0.tar.gz % cd smpeg2-2.0.0audio/hufftable.cpp を修正します。
*************** *** 9,14 **** --- 9,15 ---- #include "config.h" #endif + #include <climits> #include "MPEGaudio.h" static const unsigned int *************** *** 550,560 **** const HUFFMANCODETABLE MPEGaudio::ht[HTN]= { ! { 0, 0-1, 0-1, 0, 0, htd33}, { 1, 2-1, 2-1, 0, 7,htd01}, { 2, 3-1, 3-1, 0, 17,htd02}, { 3, 3-1, 3-1, 0, 17,htd03}, ! { 4, 0-1, 0-1, 0, 0, htd33}, { 5, 4-1, 4-1, 0, 31,htd05}, { 6, 4-1, 4-1, 0, 31,htd06}, { 7, 6-1, 6-1, 0, 71,htd07}, --- 551,561 ---- const HUFFMANCODETABLE MPEGaudio::ht[HTN]= { ! { 0, UINT_MAX, UINT_MAX, 0, 0, htd33}, { 1, 2-1, 2-1, 0, 7,htd01}, { 2, 3-1, 3-1, 0, 17,htd02}, { 3, 3-1, 3-1, 0, 17,htd03}, ! { 4, UINT_MAX, UINT_MAX, 0, 0, htd33}, { 5, 4-1, 4-1, 0, 31,htd05}, { 6, 4-1, 4-1, 0, 31,htd06}, { 7, 6-1, 6-1, 0, 71,htd07}, *************** *** 564,570 **** {11, 8-1, 8-1, 0,127,htd11}, {12, 8-1, 8-1, 0,127,htd12}, {13,16-1,16-1, 0,511,htd13}, ! {14, 0-1, 0-1, 0, 0, htd33}, {15,16-1,16-1, 0,511,htd15}, {16,16-1,16-1, 1,511,htd16}, {17,16-1,16-1, 2,511,htd16}, --- 565,571 ---- {11, 8-1, 8-1, 0,127,htd11}, {12, 8-1, 8-1, 0,127,htd12}, {13,16-1,16-1, 0,511,htd13}, ! {14, UINT_MAX, UINT_MAX, 0, 0, htd33}, {15,16-1,16-1, 0,511,htd15}, {16,16-1,16-1, 1,511,htd16}, {17,16-1,16-1, 2,511,htd16},
% mkdir build % cd build % ../configure % make % sudo make install
% cd ~/src % tar xpf ~/tmp/SDL2_mixer-2.0.2.tar.gz % cd SDL2_mixer-2.0.2 % mkdir build % cd build % ../configure % make % sudo make install
% cd ~/src % tar xpf ~/tmp/SDL2_net-2.0.1.tar.gz % cd SDL2_net-2.0.1 % mkdir build % cd build % ../configure % make % sudo make install
% cd ~/src % tar xpf ~/tmp/SDL2_ttf-2.0.14.tar.gz % cd SDL2_ttf-2.0.14 % mkdir build % cd build % sed -i -e 's/have_opengl=yes/have_opengl=no/' ../configure % ../configure % make % sudo make install
% cd ~/src % tar xpf ~/tmp/openal-soft-1.18.2.tar.bz2 % cd openal-soft-1.18.2/build % cmake .. % make % sudo make install
% cd ~/src % tar xpf ~/tmp/libtheora-1.1.1.tar.bz2 % cd libtheora-1.1.1examples/png2theora.c を修正します。
*************** *** 462,470 **** png_set_strip_alpha(png_ptr); row_data = (png_bytep)png_malloc(png_ptr, ! 3*height*width*png_sizeof(*row_data)); row_pointers = (png_bytep *)png_malloc(png_ptr, ! height*png_sizeof(*row_pointers)); for(y = 0; y < height; y++) { row_pointers[y] = row_data + y*(3*width); } --- 462,470 ---- png_set_strip_alpha(png_ptr); row_data = (png_bytep)png_malloc(png_ptr, ! 3*height*width*sizeof(*row_data)); row_pointers = (png_bytep *)png_malloc(png_ptr, ! height*sizeof(*row_pointers)); for(y = 0; y < height; y++) { row_pointers[y] = row_data + y*(3*width); }
% ./configure % make % sudo make install
% cd ~/src % tar xpf ~/tmp/love-0.10.2-linux-src.tar.gz % cd love-0.10.2 % ./configure --prefix=/usr/local % make % sudo make install
% sudo /sbin/ldconfiggit で縦スクロールシューティングゲームっぽいサンプルを取得し実行します。
% sudo apt install git % cd ~/src % git clone https://github.com/mieki256/love2d_stg_sample02.git % love love2d_stg_sample02
This page is written in Japanese.
(c) Sano Yukihiko