歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

移植仙劍游戲到RedHat

仙劍移植之 x86
平台:x86PC 機 RedHat5.5 操作系統

資源介紹:解壓 sdl.tar 包後, 有 data.tar lib.tar sdlpal.tar 三個壓縮包, data.tar 是仙劍的運行資源,lib.tar 是仙劍的編譯和運行需要的庫,sdlpal.tar 是仙劍的源碼。

【嵌入式】仙劍游戲移植源碼與依賴庫源碼 下載見 http://www.linuxidc.com/Linux/2012-12/75555.htm

一、首先編譯安裝仙劍編譯和運行需要的庫
1.安裝 freetype
[root@localhost lib]# tar -zxvf freetype-2.3.11.tar.gz
[root@localhost lib]# cd freetype-2.3.11
[root@localhost freetype-2.3.11]# ./configure
[root@localhost freetype-2.3.11]# make -j4
[root@localhost freetype-2.3.11]# make install
2.安裝 zlib
[root@localhost lib]# tar -zxvf zlib-1.2.3.tar.gz
[root@localhost lib]# cd zlib-1.2.3
[root@localhost zlib-1.2.3]# ./configure --enable-shared
[root@localhost zlib-1.2.3]# make -j4
[root@localhost zlib-1.2.3]# make install
3.安裝 libiconv
[root@localhost lib]# tar -zxvf libiconv-1.13.1.tar.gz
[root@localhost lib]# cd libiconv-1.13.1
[root@localhost libiconv-1.13.1]# ./configure
[root@localhost libiconv-1.13.1]# make -j4
[root@localhost libiconv-1.13.1]# make install
4.安裝 libmad
[root@localhost lib]# tar -zxvf libmad-0.15.1b.tar.gz
[root@localhost lib]# cd libmad-0.15.1b
[root@localhost libmad-0.15.1b]# ./configure
[root@localhost libmad-0.15.1b]# make -j4
[root@localhost libmad-0.15.1b]# make install
5.安裝 jpegsrc
[root@localhost lib]# tar -zxvf jpegsrc.v6b.tar.gz
[root@localhost lib]# cd jpeg-6b/
[root@localhost jpeg-6b]# ./configure
[root@localhost jpeg-6b]# mkdir -p /usr/local/man/man1
[root@localhost jpeg-6b]# make -j4
[root@localhost jpeg-6b]# make install6.安裝 libpng
[root@localhost lib]# tar -jxvf libpng-1.2.19.tar.bz2
[root@localhost lib]# cd libpng-1.2.19
[root@localhost libpng-1.2.19]# ./configure
[root@localhost libpng-1.2.19]# make -j4
[root@localhost libpng-1.2.19]# make install
7.安裝 SDL
[root@localhost lib]# tar -zxvf SDL-1.2.14.tar.gz
[root@localhost lib]# cd SDL-1.2.14
[root@localhost SDL-1.2.14]# ./configure
[root@localhost SDL-1.2.14]# make -j4
[root@localhost SDL-1.2.14]# make install
8.安裝 SDL_ttf
[root@localhost lib]# tar -zxvf SDL_ttf-2.0.9.tar.gz
[root@localhost lib]# cd SDL_ttf-2.0.9
[root@localhost SDL_ttf-2.0.9]# ./configure
[root@localhost SDL_ttf-2.0.9]# make -j4
[root@localhost SDL_ttf-2.0.9]# make install
9.安裝 SDL_image
[root@localhost lib]# tar -zxvf SDL_image-1.2.8.tar.gz
[root@localhost lib]# cd SDL_image-1.2.8
[root@localhost SDL_image-1.2.8]# ./configure
[root@localhost SDL_image-1.2.8]# make -j4
[root@localhost SDL_image-1.2.8]# make install
10.安裝 SDL_mixer
[root@localhost lib]# tar -zxvf SDL_mixer-1.2.9.tar.gz
[root@localhost lib]# cd SDL_mixer-1.2.9
[root@localhost SDL_mixer-1.2.9]# ./configure --enable-music-mp3-mad-gpl
--enable-music-mp3=no
[root@localhost SDL_mixer-1.2.9]# make -j4
[root@localhost SDL_mixer-1.2.9]# make install

二、編譯仙劍
[root@localhost sdl]# cd sdlpal
[root@localhost sdlpal]# make -j4

三、把編譯好的仙劍可執行程序拷貝到仙劍的運行資源目錄下
[root@localhost sdlpal]# cp dist/Debug/GNU-Linux-x86/sdlpal ../data/
[root@localhost sdlpal]# cd ../data/四、運行資源文件都必須小寫
[root@localhost data]# mv WOR16.FON wor16.fon
[root@localhost data]# mv M.MSG m.msg

四、運行仙劍
[root@localhost data]# ./sdlpal

Copyright © Linux教程網 All Rights Reserved