Skip to content

Commit d5222bd

Browse files
committed
feat: fork to self add xmake build script
1 parent 6b098c7 commit d5222bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+113
-42
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
build
2+
3rd/*
3+
!3rd/fetch.lua
4+
!3rd/copy.lua
5+
!3rd/xmake.lua
6+
!3rd/pre
7+
!3rd/.include
8+
.xmake

README.old

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
ONScripter
22

3-
0. �Ϥ����
3+
0. はじめに
44

5-
�ⶶľ������ NScripter �Ѥ˺������줿������ץȤ��ȼ��˲�ᤷ�Ƽ¹Ԥ��ޤ���
5+
高橋直樹氏作の NScripter 用に作成されたスクリプトを独自に解釈して実行します。
66

77

8-
1. ư��Ķ�
8+
1. 動作環境
99

10-
libjpeg 6b, bzip2-1.0.5, SDL-1.2.14, SDL_image-1.2.10, SDL_mixer-1.2.8, SDL_ttf-2.0.9, �ڤ� SMPEG-0.4.5 ��ư���Ķ��Ǥ���
11-
Linux 2.6.32 + Xvnc4 + g++ (gcc 4.4.4) �dz�ȯ���Ƥ��ޤ���
12-
Linux, Windows Vista (Visual Studio 2008 C++), Android (HTC Desire), iPad2 ���ư���ǧ�򤷤Ƥ��ޤ���
13-
����¾��MacOS X, MacOS 9, Android(Nexus One, Emulator), iPhone, iPad, PSP, FreeBSD, Solaris(on SPARC), Tru64 UNIX, OS/Warp, iPod, PocketPC, Playstation3, Wii, GP2X, NetWalker, Dreamcast ��Ǥ�ư�����򤤤������Ƥ��ޤ���
10+
libjpeg 6b, bzip2-1.0.5, SDL-1.2.14, SDL_image-1.2.10, SDL_mixer-1.2.8, SDL_ttf-2.0.9, 及び SMPEG-0.4.5 が動作する環境です。
11+
Linux 2.6.32 + Xvnc4 + g++ (gcc 4.4.4) で開発しています。
12+
Linux, Windows Vista (Visual Studio 2008 C++), Android (HTC Desire), iPad2 上で動作確認をしています。
13+
その他、MacOS X, MacOS 9, Android(Nexus One, Emulator), iPhone, iPad, PSP, FreeBSD, Solaris(on SPARC), Tru64 UNIX, OS/Warp, iPod, PocketPC, Playstation3, Wii, GP2X, NetWalker, Dreamcast 上での動作報告をいただいています。
1414

1515

16-
2. ����ѥ��롦��ư��ˡ
16+
2. コンパイル・起動方法
1717

18-
����ѥ��롦��ư��ˡ�ϰʲ����̤�Ǥ���
19-
��������onscripter ��¹Ԥ������ default.ttf, ������ץ�, ���������֤��ʤ���Ф����ޤ���
20-
�ܤ�����Ʊ���� www/onscripter.html �򻲾Ȥ��Ƥ���������
18+
コンパイル・起動方法は以下の通りです。
19+
ただし、onscripter を実行する場所に default.ttf, スクリプト, アーカイブがなければいけません。
20+
詳しくは同梱の www/onscripter.html を参照してください。
2121

22-
Linux �⤷���� FreeBSD, Solaris �ξ��
22+
Linux もしくは FreeBSD, Solaris の場合
2323
$ make -f Makefile.Linux
2424
$ onscripter
2525

26-
Windows �ξ�� (DOS �ץ���ץȤ�)
27-
$ libjpeg 6b, bzip2, SDL �� SMPEG �Υ��󥹥ȡ�����˹�碌�� Makefile.Win ����
26+
Windows の場合 (DOS プロンプトで)
27+
$ libjpeg 6b, bzip2, SDL SMPEG のインストール場所に合わせて Makefile.Win を修正
2828
$ nmake -f Makefile.Win
2929
$ onscripter.exe
3030

31-
MacOS X ��
31+
MacOS X の場合
3232
$ make -f Makefile.MacOSX
3333
$ onscripter
3434

35-
Zaurus (SL-5500, SL-A300, SL-B500, SL-C700) ��
36-
�̤Υޥ���(Linux ��)��ǥ���������ѥ���
35+
Zaurus (SL-5500, SL-A300, SL-B500, SL-C700) の場合
36+
別のマシン(Linux 等)上でクロスコンパイル
3737
$ make -f Makefile.ARMLinux
38-
Zaurus �� Qtopia �夫��¹�
38+
Zaurus Qtopia 上から実行
3939
$ onscripter
4040

41-
����ʳ��Υץ�åȥե�����Ǥϡ�Makefile.Linux ������ˤ��� Makefile.### ���äƤ���������
41+
それ以外のプラットフォームでは、Makefile.Linux を雛形にして Makefile.### を作ってください。
4242

43-
ONScripter �ϡ������ȥǥ��쥯�ȥ�� 0.txt �⤷���� nscript.dat ��ưŪ���ɤ߹��ߡ�����ˤ������äƥ����ȥǥ��쥯�ȥ�� arc.sar �⤷���� arc.nsa ���ɤ߹��ߤޤ���
43+
ONScripter は、カレントディレクトリの 0.txt もしくは nscript.dat を自動的に読み込み、それにしたがってカレントディレクトリの arc.sar もしくは arc.nsa を読み込みます。
4444

4545

46-
3. Ϣ����
46+
3. 連絡先
4747

48-
�ܥ��եȥ������˴ؤ����䤤��碌��
48+
本ソフトウェアに関する問い合わせは
4949

5050
5151

52-
�ޤ��Żҥ᡼��ˤƤ��ꤤ���ޤ���
52+
まで電子メールにてお願いします。
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

ONScripter.h renamed to src/ONScripter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
#if defined(USE_SMPEG)
3838
#include <smpeg.h>
39-
#endif
39+
#endif
4040

4141
#define DEFAULT_VIDEO_SURFACE_FLAG (SDL_SWSURFACE)
4242

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Utils.h renamed to src/Utils.h

-16
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,6 @@ namespace utils{
8585
template<class T> T clamp(T x, T min, T max){
8686
return x < min ? min : (x > max ? max : x);
8787
}
88-
89-
template <typename From>
90-
class auto_cast {
91-
public:
92-
explicit constexpr auto_cast(From const& t) noexcept
93-
: val { t }
94-
{}
95-
96-
template <typename To>
97-
constexpr operator To() const noexcept(noexcept(static_cast<To>(std::declval<From>()))) {
98-
return static_cast<To>(val);
99-
}
100-
101-
private:
102-
From const& val;
103-
};
10488
}
10589

10690
#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

renderer/gles_renderer.cpp renamed to src/renderer/gles_renderer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ GlesRenderer::GlesRenderer(SDL_Window *window, SDL_Texture *texture, const float
9191
#else
9292
#define SDL_PROC(ret,func,params) \
9393
do { \
94-
func = utils::auto_cast(SDL_GL_GetProcAddress(#func)); \
94+
func = static_cast<func##_T>(SDL_GL_GetProcAddress(#func)); \
9595
if ( ! func ) { \
9696
SDL_SetError("Couldn't load GLES2 function %s: %s", #func, SDL_GetError()); \
9797
utils::printError("Couldn't load GLES2 function %s: %s", #func, SDL_GetError()); \

renderer/gles_renderer.h renamed to src/renderer/gles_renderer.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ class GlesRenderer {
3636
int output_size[2];
3737
bool _pause = false;
3838
#if !(defined(IOS) || defined(ANDROID))
39-
#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;
39+
#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;\
40+
typedef ret (APIENTRY *func##_T) params;
41+
4042
#include "gles2funcs.h"
4143
#undef SDL_PROC
4244
#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

version.h renamed to src/version.h

File renamed without changes.
File renamed without changes.
File renamed without changes.

nscriptdecode.cpp renamed to tools/nscriptdecode.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include <stdio.h>
2+
3+
24
int main(int argc,char *argv[]){
35
FILE *pFile = fopen(*(argv+1), "rb");
46
if(pFile != nullptr){

sarconv.cpp renamed to tools/sarconv.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#include <sys/types.h>
2828
#include <sys/stat.h>
2929
#include "SarReader.h"
30+
#include "coding2utf16.h"
31+
32+
33+
Coding2UTF16 *coding2utf16;
3034

3135
extern int scale_ratio_upper;
3236
extern int scale_ratio_lower;

sardec.cpp renamed to tools/sardec.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@
2929
#include <sys/stat.h>
3030
#include <errno.h>
3131
#include "SarReader.h"
32+
#include "coding2utf16.h"
3233
#ifdef _WIN32
3334
#include <direct.h>
3435
inline int mkdir(const char *pathname, int unused){
3536
return _mkdir(pathname);
3637
}
3738
#endif
3839

40+
Coding2UTF16 *coding2utf16;
41+
3942
extern int errno;
4043

4144
int main( int argc, char **argv )
File renamed without changes.

xmake.lua

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
add_rules("mode.debug", "mode.release")
2+
3+
add_requires("libsdl", "libsdl_image", "libsdl_ttf", "libsdl_mixer", "bzip2", "libjpeg")
4+
add_includedirs("src")
5+
add_defines("XMD_H=1")
6+
add_cxxflags("/UNICODE")
7+
add_defines("UNICODE", "_UNICODE")
8+
9+
target("nsaconv")
10+
set_kind("binary")
11+
add_packages("bzip2", "libjpeg")
12+
add_files(
13+
"tools/nsaconv.cpp",
14+
"src/coding2utf16.cpp",
15+
"src/conv_shared.cpp",
16+
"src/gbk2utf16.cpp",
17+
"src/NsaReader.cpp",
18+
"src/SarReader.cpp",
19+
"src/DirectReader.cpp",
20+
"src/resize_image.cpp"
21+
)
22+
23+
target("nsadec")
24+
set_kind("binary")
25+
add_packages("bzip2")
26+
add_files(
27+
"tools/nsadec.cpp",
28+
"src/coding2utf16.cpp",
29+
"src/NsaReader.cpp",
30+
"src/DirectReader.cpp",
31+
"src/SarReader.cpp"
32+
)
33+
34+
target("nscriptdecode")
35+
set_kind("binary")
36+
add_files(
37+
"tools/nscriptdecode.cpp"
38+
)
39+
40+
target("sarconv")
41+
set_kind("binary")
42+
add_packages("bzip2", "libjpeg")
43+
add_files(
44+
"tools/sarconv.cpp",
45+
"src/coding2utf16.cpp",
46+
"src/DirectReader.cpp",
47+
"src/SarReader.cpp",
48+
"src/conv_shared.cpp",
49+
"src/resize_image.cpp"
50+
)
51+
52+
target("sardec")
53+
set_kind("binary")
54+
add_packages("bzip2")
55+
add_files(
56+
"tools/sardec.cpp",
57+
"src/SarReader.cpp",
58+
"src/coding2utf16.cpp",
59+
"src/DirectReader.cpp"
60+
)
61+
62+
target("onscripter")
63+
set_kind("binary")
64+
add_packages("bzip2", "libjpeg")
65+
add_packages("libsdl", "libsdl_image", "libsdl_ttf", "libsdl_mixer")
66+
add_defines("USE_BUILTIN_LAYER_EFFECTS=1", "USE_BUILTIN_EFFECTS=1")
67+
add_files("src/*.cpp", "src/renderer/*.cpp", "src/builtin_dll/*.cpp")
68+
remove_files("src/AVIWrapper.cpp", "src/LUAHandler.cpp")

0 commit comments

Comments
 (0)