Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YGOPRO-520DIY
ygopro
Commits
47e70cc1
Commit
47e70cc1
authored
Apr 16, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'server' of git.mycard.moe:mycard/ygopro into server
parents
4b133226
57ec4313
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1587 additions
and
85 deletions
+1587
-85
.gitlab-ci.yml
.gitlab-ci.yml
+14
-13
.travis.yml
.travis.yml
+2
-2
README.md
README.md
+14
-0
appveyor.yml
appveyor.yml
+13
-4
gframe/game.cpp
gframe/game.cpp
+1
-4
gframe/gframe.cpp
gframe/gframe.cpp
+1
-1
gframe/lzma/premake5.lua
gframe/lzma/premake5.lua
+1
-1
gframe/premake5.lua
gframe/premake5.lua
+112
-0
gframe/spmemvfs/premake5.lua
gframe/spmemvfs/premake5.lua
+7
-0
ocgcore
ocgcore
+1
-1
premake/event/premake5.lua
premake/event/premake5.lua
+2
-1
premake/freetype/premake5.lua
premake/freetype/premake5.lua
+52
-0
premake/irrlicht/irrlicht.patch
premake/irrlicht/irrlicht.patch
+818
-0
premake/irrlicht/premake5.lua
premake/irrlicht/premake5.lua
+327
-0
premake/lua/premake5.lua
premake/lua/premake5.lua
+20
-0
premake/sqlite3/premake5.lua
premake/sqlite3/premake5.lua
+0
-0
premake5.lua
premake5.lua
+200
-57
script
script
+1
-1
strings.conf
strings.conf
+1
-0
No files found.
.gitlab-ci.yml
View file @
47e70cc1
...
...
@@ -14,14 +14,11 @@ mat_common:
-
linux
script
:
# lua
-
wget -O - https://cdn01.moecube.com/ygopro-build-materials/lua-5.3.
5
.tar.gz | tar zfx -
-
mv lua-5.3.
5
/src lua
-
wget -O - https://cdn01.moecube.com/ygopro-build-materials/lua-5.3.
6
.tar.gz | tar zfx -
-
mv lua-5.3.
6
/src lua
# sqlite3
-
wget -O - https://cdn01.moecube.com/ygopro-build-materials/sqlite-autoconf-3360000.tar.gz | tar zfx -
-
mv sqlite-autoconf-3360000 sqlite3
# freetype
#- wget -O - https://cdn01.moecube.com/ygopro-build-materials/freetype-2.10.4.tar.gz | tar zfx -
#- mv freetype-2.10.4 freetype
# premake
-
cp -rf premake/* .;
artifacts
:
...
...
@@ -36,9 +33,8 @@ mat_linux:
-
linux
script
:
-
apt update; apt -y install git wget tar
# - git clone --depth=1 https://code.mycard.moe/mycard/irrlicht-new irrlicht
-
wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-alpha14-linux.tar.gz | tar zfx -
-
env PROCESSOR_COUNT=$(nproc) ./.ci/libevent-prebuild.sh
#- git clone --depth=1 https://code.mycard.moe/mycard/irrlicht irrlicht_linux
-
wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta1-linux.tar.gz | tar zfx -
artifacts
:
paths
:
-
premake5
...
...
@@ -52,11 +48,15 @@ mat_windows:
script
:
-
apt update; apt -y install wget tar patch p7zip-full
# premake5.exe
-
wget https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-
alpha14
-windows.zip
-
7z x -y premake-5.0.0-
alpha14
-windows.zip
-
wget https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-
beta1
-windows.zip
-
7z x -y premake-5.0.0-
beta1
-windows.zip
# event
-
wget -O - https://cdn01.moecube.com/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx -
-
mv libevent-2.0.22-stable event ; cp -rf event/WIN32-Code/* event/include
-
mv libevent-2.0.22-stable event
# sqlite3
-
wget https://cdn01.moecube.com/ygopro-build-materials/sqlite-amalgamation-3310100.zip
-
7z x -y sqlite-amalgamation-3310100.zip
-
mv sqlite-amalgamation-3310100 sqlite3
artifacts
:
paths
:
-
premake5.exe
...
...
@@ -84,7 +84,7 @@ exec_windows:
-
git submodule update --init
-
bash -c 'cp -rf premake/* .'
-
'
.\premake5.exe
vs2019'
-
cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\
yg
o.sln /m /p:Configuration=Release'
-
cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\
YGOPr
o.sln /m /p:Configuration=Release'
-
copy bin\release\ygopro.exe .
artifacts
:
paths
:
...
...
@@ -100,9 +100,10 @@ exec_linux:
dependencies
:
-
mat_common
#- mat_irrklang
-
mat_lua
-
mat_linux
script
:
-
apt update; apt -y install git build-essential
-
apt update; apt -y install git build-essential
libevent-dev libsqlite3-dev
-
git submodule update --init
-
env YGOPRO_LIBEVENT_STATIC_PATH=$PWD/libevent-stable ./premake5 gmake
-
cd build
...
...
.travis.yml
View file @
47e70cc1
...
...
@@ -22,8 +22,8 @@ before_install:
#- sudo ln -s /usr/bin/gcc-6 /usr/local/bin/gcc
#- sudo ln -s /usr/bin/g++-6 /usr/local/bin/g++
#- g++ --version
-
wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-
alpha14/premake-5.0.0-alpha14
-linux.tar.gz | tar zfx -
#- wget -O - https://www.lua.org/ftp/lua-5.3.
5.tar.gz | tar zfx -; cd lua-5.3.5
; sudo make linux install; cd ..
-
wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-
beta1/premake-5.0.0-beta1
-linux.tar.gz | tar zfx -
#- wget -O - https://www.lua.org/ftp/lua-5.3.
6.tar.gz | tar zfx -; cd lua-5.3.6
; sudo make linux install; cd ..
script
:
-
./premake5 gmake
-
cd build
...
...
README.md
View file @
47e70cc1
...
...
@@ -24,6 +24,20 @@
*
sqlite3
*
可参考本项目
[
appveyor.yml
](
https://github.com/mycard/ygopro/blob/server/appveyor.yml
)
中的脚本
### MacOS下编译
*
需要以下组件或工具
*
clang
*
premake5
*
libevent
*
lua5.3
*
sqlite3
*
参考步骤
*
安装libevent sqlite3
*
编译premake5
*
wget https://www.lua.org/ftp/lua-5.4.3.tar.gz && tar xf lua-5.4.3.tar.gz && mv lua-5.4.3 lua && cp premake/lua/
*
lua/
*
./premake5 gmake --cc=clang
*
cd build && make config=release
### 运行
*
使用
[
ygopro-server
](
https://github.com/mycard/ygopro-server
)
运行
*
手动运行的参数是
...
...
appveyor.yml
View file @
47e70cc1
...
...
@@ -7,17 +7,22 @@ install:
-
git submodule update --init --recursive
# environment and system dependency
<<<<<<< HEAD
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-windows.zip ; exit 0"
- 7z x -y premake-5.0.0-alpha14-windows.zip
=======
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-windows.zip ; exit 0"
- 7z x premake-5.0.0-beta1-windows.zip
>
>>>>>>
57ec431355b6eada0eeb74f1a54f0c1e83fa1ba5
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz ; exit 0"
- tar xf libevent-2.0.22-stable.tar.gz
- move libevent-2.0.22-stable event
- xcopy /E event\WIN32-Code event\include
-
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.lua.org/ftp/lua-5.3.
5
.tar.gz ; exit 0"
-
tar xf lua-5.3.
5
.tar.gz
-
move lua-5.3.
5
\src lua
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.lua.org/ftp/lua-5.3.
6
.tar.gz ; exit 0"
- tar xf lua-5.3.
6
.tar.gz
- move lua-5.3.
6
\src lua
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://www.sqlite.org/2020/sqlite-amalgamation-3310100.zip ; exit 0"
- 7z x -y sqlite-amalgamation-3310100.zip
...
...
@@ -89,9 +94,13 @@ deploy:
branch
:
server
cache
:
-
premake-5.0.0-
alpha14
-windows.zip
-
premake-5.0.0-
beta1
-windows.zip
-
libevent-2.0.22-stable.tar.gz
<<<<<<< HEAD
- freetype-2.10.1.tar.gz
- lua-5.3.5.tar.gz
- irrlicht-1.8.4.zip
=======
- lua-5.3.6.tar.gz
>
>>>>>>
57ec431355b6eada0eeb74f1a54f0c1e83fa1ba5
- sqlite-amalgamation-3310100.zip
gframe/game.cpp
View file @
47e70cc1
...
...
@@ -1743,7 +1743,6 @@ void Game::ShowCardInfo(int code, bool resize) {
if
(
!
dataManager
.
GetData
(
code
,
&
cd
))
memset
(
&
cd
,
0
,
sizeof
(
CardData
));
imgCard
->
setImage
(
imageManager
.
GetTexture
(
code
,
true
));
imgCard
->
setScaleImage
(
true
);
if
(
cd
.
alias
!=
0
&&
(
cd
.
alias
-
code
<
CARD_ARTWORK_VERSIONS_OFFSET
||
code
-
cd
.
alias
<
CARD_ARTWORK_VERSIONS_OFFSET
))
myswprintf
(
formatBuffer
,
L"%ls[%08d]"
,
dataManager
.
GetName
(
cd
.
alias
),
cd
.
alias
);
else
myswprintf
(
formatBuffer
,
L"%ls[%08d]"
,
dataManager
.
GetName
(
code
),
code
);
...
...
@@ -1976,9 +1975,7 @@ void Game::initUtils() {
#ifndef YGOPRO_SERVER_MODE
void
Game
::
ClearTextures
()
{
matManager
.
mCard
.
setTexture
(
0
,
0
);
imgCard
->
setImage
(
imageManager
.
tCover
[
0
]);
scrCardText
->
setVisible
(
false
);
imgCard
->
setScaleImage
(
true
);
ClearCardInfo
(
0
);
btnPSAU
->
setImage
();
btnPSDU
->
setImage
();
for
(
int
i
=
0
;
i
<=
4
;
++
i
)
{
...
...
gframe/gframe.cpp
View file @
47e70cc1
...
...
@@ -28,7 +28,7 @@ int main(int argc, char* argv[]) {
#ifndef _WIN32
setlocale
(
LC_CTYPE
,
"UTF-8"
);
#endif
#if
def __APPLE__
#if
defined __APPLE__ && !defined YGOPRO_SERVER_MODE
CFURLRef
bundle_url
=
CFBundleCopyBundleURL
(
CFBundleGetMainBundle
());
CFURLRef
bundle_base_url
=
CFURLCreateCopyDeletingLastPathComponent
(
NULL
,
bundle_url
);
CFRelease
(
bundle_url
);
...
...
gframe/lzma/premake
4
.lua
→
gframe/lzma/premake
5
.lua
View file @
47e70cc1
project
"clzma"
kind
"StaticLib"
files
{
"*
*.c"
,
"*
*.h"
}
files
{
"*
.c"
,
"
*.h"
}
gframe/premake5.lua
0 → 100644
View file @
47e70cc1
include
"lzma/."
if
not
SERVER_MODE
then
include
"spmemvfs/."
end
project
"ygopro"
if
SERVER_MODE
then
kind
"ConsoleApp"
defines
{
"YGOPRO_SERVER_MODE"
}
files
{
"gframe.cpp"
,
"config.h"
,
"game.cpp"
,
"game.h"
,
"myfilesystem.h"
,
"deck_manager.cpp"
,
"deck_manager.h"
,
"data_manager.cpp"
,
"data_manager.h"
,
"replay.cpp"
,
"replay.h"
,
"netserver.cpp"
,
"netserver.h"
,
"single_duel.cpp"
,
"single_duel.h"
,
"tag_duel.cpp"
,
"tag_duel.h"
}
includedirs
{
"../ocgcore"
}
links
{
"ocgcore"
,
"clzma"
,
LUA_LIB_NAME
,
"sqlite3"
,
"event"
}
else
kind
"WindowedApp"
files
{
"*.cpp"
,
"*.h"
}
includedirs
{
"../ocgcore"
}
links
{
"ocgcore"
,
"clzma"
,
"cspmemvfs"
,
LUA_LIB_NAME
,
"sqlite3"
,
"irrlicht"
,
"freetype"
,
"event"
}
end
if
BUILD_EVENT
then
includedirs
{
"../event/include"
}
else
includedirs
{
EVENT_INCLUDE_DIR
}
libdirs
{
EVENT_LIB_DIR
}
end
if
BUILD_IRRLICHT
then
includedirs
{
"../irrlicht/include"
}
else
includedirs
{
IRRLICHT_INCLUDE_DIR
}
libdirs
{
IRRLICHT_LIB_DIR
}
end
if
BUILD_FREETYPE
then
includedirs
{
"../freetype/include"
}
else
includedirs
{
FREETYPE_INCLUDE_DIR
}
libdirs
{
FREETYPE_LIB_DIR
}
end
if
BUILD_SQLITE
then
includedirs
{
"../sqlite3"
}
else
includedirs
{
SQLITE_INCLUDE_DIR
}
libdirs
{
SQLITE_LIB_DIR
}
end
if
USE_IRRKLANG
then
defines
{
"YGOPRO_USE_IRRKLANG"
}
includedirs
{
IRRKLANG_INCLUDE_DIR
}
if
not
IRRKLANG_PRO
then
libdirs
{
IRRKLANG_LIB_DIR
}
end
end
filter
"system:windows"
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
files
"ygopro.rc"
if
not
SERVER_MODE
then
libdirs
{
"$(DXSDK_DIR)Lib/x86"
}
end
if
USE_IRRKLANG
then
links
{
"irrKlang"
}
if
IRRKLANG_PRO
then
defines
{
"IRRKLANG_STATIC"
}
links
{
"ikpmp3"
}
filter
{
"not configurations:Debug"
}
libdirs
{
IRRKLANG_PRO_RELEASE_LIB_DIR
}
filter
{
"configurations:Debug"
}
libdirs
{
IRRKLANG_PRO_DEBUG_LIB_DIR
}
filter
{}
end
end
if
SERVER_MODE
then
links
{
"ws2_32"
}
else
links
{
"opengl32"
,
"ws2_32"
,
"winmm"
,
"gdi32"
,
"kernel32"
,
"user32"
,
"imm32"
}
end
filter
"not action:vs*"
buildoptions
{
"-std=c++14"
,
"-fno-rtti"
}
filter
"not system:windows"
links
{
"event_pthreads"
,
"dl"
,
"pthread"
}
filter
"system:macosx"
if
not
SERVER_MODE
then
links
{
"z"
}
defines
{
"GL_SILENCE_DEPRECATION"
}
end
if
MAC_ARM
then
buildoptions
{
"--target=arm64-apple-macos12"
}
linkoptions
{
"-arch arm64"
}
end
if
USE_IRRKLANG
then
links
{
"irrklang"
}
end
filter
"system:linux"
if
not
SERVER_MODE
then
links
{
"GL"
,
"X11"
,
"Xxf86vm"
}
end
if
USE_IRRKLANG
then
links
{
"IrrKlang"
}
linkoptions
{
IRRKLANG_LINK_RPATH
}
end
gframe/spmemvfs/premake
4
.lua
→
gframe/spmemvfs/premake
5
.lua
View file @
47e70cc1
project
"cspmemvfs"
kind
"StaticLib"
files
{
"*
*.c"
,
"*
*.h"
}
files
{
"*
.c"
,
"
*.h"
}
configuration
"windows"
if
BUILD_SQLITE
then
includedirs
{
"../../sqlite3"
}
configuration
"not windows"
if
BUILD_SQLITE
then
includedirs
{
"../../sqlite3"
}
end
end
ocgcore
@
d71e1ea4
Subproject commit
2615ef6a609576d3fd34be6130620f30a30d21b7
Subproject commit
d71e1ea4fa0564fc49736aa9e7c19afd99210499
premake/event/premake
4
.lua
→
premake/event/premake
5
.lua
View file @
47e70cc1
...
...
@@ -8,5 +8,6 @@ project "event"
"evmap.c"
,
"log.c"
,
"evutil.c"
,
"evutil_rand.c"
,
"strlcpy.c"
,
"signal.c"
,
"event_tagging.c"
,
"http.c"
,
"evdns.c"
,
"evrpc.c"
}
configuration
"windows"
filter
"system:windows"
prebuildcommands
{
"xcopy /E /Y $(ProjectDir)..\\event\\WIN32-Code $(ProjectDir)..\\event\\include"
}
files
{
"win32select.c"
,
"evthread_win32.c"
,
"buffer_iocp.c"
,
"event_iocp.c"
,
"bufferevent_async.c"
}
premake/freetype/premake5.lua
0 → 100644
View file @
47e70cc1
project
"freetype"
kind
"StaticLib"
includedirs
{
"include"
}
defines
{
"FT2_BUILD_LIBRARY"
}
files
{
"src/autofit/autofit.c"
,
"src/base/ftbase.c"
,
"src/base/ftbbox.c"
,
"src/base/ftbdf.c"
,
"src/base/ftbitmap.c"
,
"src/base/ftcid.c"
,
"src/base/ftfstype.c"
,
"src/base/ftgasp.c"
,
"src/base/ftglyph.c"
,
"src/base/ftgxval.c"
,
"src/base/ftinit.c"
,
"src/base/ftmm.c"
,
"src/base/ftotval.c"
,
"src/base/ftpatent.c"
,
"src/base/ftpfr.c"
,
"src/base/ftstroke.c"
,
"src/base/ftsynth.c"
,
"src/base/fttype1.c"
,
"src/base/ftwinfnt.c"
,
"src/bdf/bdf.c"
,
"src/cache/ftcache.c"
,
"src/cff/cff.c"
,
"src/cid/type1cid.c"
,
"src/gzip/ftgzip.c"
,
"src/lzw/ftlzw.c"
,
"src/pcf/pcf.c"
,
"src/pfr/pfr.c"
,
"src/psaux/psaux.c"
,
"src/pshinter/pshinter.c"
,
"src/psnames/psmodule.c"
,
"src/raster/raster.c"
,
"src/sfnt/sfnt.c"
,
"src/sdf/sdf.c"
,
"src/smooth/smooth.c"
,
"src/truetype/truetype.c"
,
"src/type1/type1.c"
,
"src/type42/type42.c"
,
"src/winfonts/winfnt.c"
}
filter
"system:windows"
files
{
"builds/windows/ftsystem.c"
,
"builds/windows/ftdebug.c"
}
filter
"not system:windows"
files
{
"src/base/ftsystem.c"
,
"src/base/ftdebug.c"
}
premake/irrlicht/irrlicht.patch
0 → 100644
View file @
47e70cc1
diff --git a/include/IOSOperator.h b/include/IOSOperator.h
index 2ab75a1..b574950 100644
--- a/include/IOSOperator.h
+++ b/include/IOSOperator.h
@@ -26,11 +26,11 @@
public:
}
//! Copies text to the clipboard
- virtual void copyToClipboard(const c8* text) const = 0;
+ virtual void copyToClipboard(const c16* text) const = 0;
//! Get text from the clipboard
/** \return Returns 0 if no string is in there. */
- virtual const c8* getTextFromClipboard() const = 0;
+ virtual const c16* getTextFromClipboard() const = 0;
//! Get the processor speed in megahertz
/** \param MHz The integer variable to store the speed in.
diff --git a/include/irrString.h b/include/irrString.h
index 43557cd..ffa06bc 100644
--- a/include/irrString.h
+++ b/include/irrString.h
@@ -1360,6 +1360,15 @@
typedef string<c8> stringc;
//! Typedef for wide character strings
typedef string<wchar_t> stringw;
+//! wrap of mbstowcs
+static inline wchar_t* toWideChar(const char* p)
+{
+ size_t lenOld = strlen(p);
+ wchar_t* ws = new wchar_t[lenOld + 1];
+ size_t lenNew = mbstowcs(ws, p, lenOld);
+ ws[lenNew] = 0;
+ return ws;
+}
} // end namespace core
} // end namespace irr
diff --git a/include/irrTypes.h b/include/irrTypes.h
index 403f890..940e859 100644
--- a/include/irrTypes.h
+++ b/include/irrTypes.h
@@ -48,6 +48,9 @@
typedef __int16 s16;
typedef signed short s16;
#endif
+//! 16 bit character variable.
+/** This is a typedef for wchar_t, it ensures portability of the engine. */
+typedef wchar_t c16;
//! 32 bit unsigned variable.
diff --git a/source/Irrlicht/CGUIEditBox.cpp b/source/Irrlicht/CGUIEditBox.cpp
index 395fb69..cc6b75f 100644
--- a/source/Irrlicht/CGUIEditBox.cpp
+++ b/source/Irrlicht/CGUIEditBox.cpp
@@ -287,7 +287,7 @@
bool CGUIEditBox::processKey(const SEvent& event)
const s32 realmbgn = MarkBegin < MarkEnd ? MarkBegin : MarkEnd;
const s32 realmend = MarkBegin < MarkEnd ? MarkEnd : MarkBegin;
- core::stringc s;
+ core::stringw s;
s = Text.subString(realmbgn, realmend - realmbgn).c_str();
Operator->copyToClipboard(s.c_str());
}
@@ -300,7 +300,7 @@
bool CGUIEditBox::processKey(const SEvent& event)
const s32 realmend = MarkBegin < MarkEnd ? MarkEnd : MarkBegin;
// copy
- core::stringc sc;
+ core::stringw sc;
sc = Text.subString(realmbgn, realmend - realmbgn).c_str();
Operator->copyToClipboard(sc.c_str());
@@ -330,16 +330,10 @@
bool CGUIEditBox::processKey(const SEvent& event)
const s32 realmend = MarkBegin < MarkEnd ? MarkEnd : MarkBegin;
// add new character
- const c8* p = Operator->getTextFromClipboard();
+ const c16* p = Operator->getTextFromClipboard();
if (p)
{
- // TODO: we should have such a function in core::string
- size_t lenOld = strlen(p);
- wchar_t *ws = new wchar_t[lenOld + 1];
- size_t len = mbstowcs(ws,p,lenOld);
- ws[len] = 0;
- irr::core::stringw widep(ws);
- delete[] ws;
+ irr::core::stringw widep(p);
if (MarkBegin == MarkEnd)
{
@@ -664,6 +658,16 @@
bool CGUIEditBox::processKey(const SEvent& event)
case KEY_ESCAPE:
case KEY_TAB:
case KEY_SHIFT:
+ case KEY_LSHIFT:
+ case KEY_RSHIFT:
+ case KEY_MENU:
+ case KEY_LMENU:
+ case KEY_RMENU:
+ case KEY_LWIN:
+ case KEY_RWIN:
+ case KEY_CAPITAL:
+ case KEY_NUMLOCK:
+ case KEY_SCROLL:
case KEY_F1:
case KEY_F2:
case KEY_F3:
diff --git a/source/Irrlicht/CGUIListBox.cpp b/source/Irrlicht/CGUIListBox.cpp
index 2c19a43..eb834a4 100644
--- a/source/Irrlicht/CGUIListBox.cpp
+++ b/source/Irrlicht/CGUIListBox.cpp
@@ -425,7 +425,7 @@
bool CGUIListBox::OnEvent(const SEvent& event)
}
case EMIE_MOUSE_MOVED:
- if (Selecting || MoveOverSelect)
+ if (MoveOverSelect)
{
if (isPointInside(p))
{
diff --git a/source/Irrlicht/CIrrDeviceLinux.cpp b/source/Irrlicht/CIrrDeviceLinux.cpp
index 39b1888..d359957 100644
--- a/source/Irrlicht/CIrrDeviceLinux.cpp
+++ b/source/Irrlicht/CIrrDeviceLinux.cpp
@@ -63,6 +63,7 @@
namespace
Atom X_ATOM_TARGETS;
Atom X_ATOM_UTF8_STRING;
Atom X_ATOM_TEXT;
+ Atom X_ATOM_XSEL_DATA;
};
namespace irr
@@ -1106,11 +1107,14 @@
bool CIrrDeviceLinux::run()
{
XEvent respond;
XSelectionRequestEvent *req = &(event.xselectionrequest);
- if ( req->target == XA_STRING)
+ if ( req->target == XA_STRING
+ || req->target == X_ATOM_TEXT
+ || req->target == X_ATOM_UTF8_STRING )
{
XChangeProperty (display,
req->requestor,
- req->property, req->target,
+ req->property,
+ req->target == X_ATOM_TEXT ? XA_STRING : req->target,
8, // format
PropModeReplace,
(unsigned char*) Clipboard.c_str(),
@@ -1124,11 +1128,14 @@
bool CIrrDeviceLinux::run()
data[0] = X_ATOM_TEXT;
data[1] = XA_STRING;
- XChangeProperty (display, req->requestor,
- req->property, req->target,
- 8, PropModeReplace,
- (unsigned char *) &data,
- sizeof (data));
+ XChangeProperty (display,
+ req->requestor,
+ req->property,
+ XA_ATOM,
+ 32, // format
+ PropModeReplace,
+ (unsigned char *) &X_ATOM_UTF8_STRING,
+ 1);
respond.xselection.property = req->property;
}
else
@@ -1875,34 +1882,36 @@
const c8* CIrrDeviceLinux::getTextFromClipboard() const
Clipboard = "";
if (ownerWindow != None )
{
- XConvertSelection (display, X_ATOM_CLIPBOARD, XA_STRING, XA_PRIMARY, ownerWindow, CurrentTime);
- XFlush (display);
-
- // check for data
- Atom type;
- int format;
- unsigned long numItems, bytesLeft, dummy;
- unsigned char *data;
- XGetWindowProperty (display, ownerWindow,
- XA_PRIMARY, // property name
- 0, // offset
- 0, // length (we only check for data, so 0)
+ XConvertSelection (display, X_ATOM_CLIPBOARD, X_ATOM_UTF8_STRING, X_ATOM_XSEL_DATA, window, CurrentTime);
+ XSync (display, 0);
+ XEvent event;
+ do nanosleep ((const struct timespec[]){{0, 1L}}, NULL);
+ while (!XCheckTypedEvent (display, SelectionNotify, &event));
+ if ( (event.xselection.selection == X_ATOM_CLIPBOARD) && event.xselection.property )
+ {
+ Atom type;
+ int format;
+ unsigned long size, dummy;
+ unsigned char *data;
+ int result = XGetWindowProperty (event.xselection.display,
+ event.xselection.requestor,
+ event.xselection.property,
+ 0L, // offset
+ (~0L), // length (max)
0, // Delete 0==false
AnyPropertyType, // AnyPropertyType or property identifier
&type, // return type
&format, // return format
- &numItems, // number items
- &bytesLeft, // remaining bytes for partial reads
+ &size, // number items
+ &dummy, // remaining bytes for partial reads
&data); // data
- if ( bytesLeft > 0 )
- {
- // there is some data to get
- int result = XGetWindowProperty (display, ownerWindow, XA_PRIMARY, 0,
- bytesLeft, 0, AnyPropertyType, &type, &format,
- &numItems, &dummy, &data);
- if (result == Success)
- Clipboard = (irr::c8*)data;
- XFree (data);
+ if ( result == Success
+ && (type == X_ATOM_UTF8_STRING || type == XA_STRING) ) // not implemented: INCR (partial reads)
+ {
+ Clipboard = strndup((char*)data, size);
+ XFree (data);
+ }
+ XDeleteProperty (event.xselection.display, event.xselection.requestor, event.xselection.property);
}
}
@@ -1966,6 +1975,7 @@
void CIrrDeviceLinux::initXAtoms()
X_ATOM_TARGETS = XInternAtom(display, "TARGETS", False);
X_ATOM_UTF8_STRING = XInternAtom (display, "UTF8_STRING", False);
X_ATOM_TEXT = XInternAtom (display, "TEXT", False);
+ X_ATOM_XSEL_DATA = XInternAtom (display, "XSEL_DATA", False);
#endif
}
diff --git a/source/Irrlicht/CIrrDeviceWin32.cpp b/source/Irrlicht/CIrrDeviceWin32.cpp
index 28290cb..76dfea1 100644
--- a/source/Irrlicht/CIrrDeviceWin32.cpp
+++ b/source/Irrlicht/CIrrDeviceWin32.cpp
@@ -20,6 +20,8 @@
#include "COSOperator.h"
#include "dimension2d.h"
#include "IGUISpriteBank.h"
+#include "IGUIEnvironment.h"
+#include "IGUIElement.h"
#include <winuser.h>
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
#ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
@@ -749,6 +751,24 @@
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
return 0;
}
+ dev = getDeviceFromHWnd(hWnd);
+ if (dev)
+ {
+ irr::gui::IGUIElement* ele = dev->getGUIEnvironment()->getFocus();
+ if (!ele || (ele->getType() != irr::gui::EGUIET_EDIT_BOX) || !ele->isEnabled())
+ {
+ HIMC hIMC = ImmGetContext(hWnd);
+ if (hIMC)
+ {
+ ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
+ ImmReleaseContext(hWnd, hIMC);
+ }
+ ImmAssociateContextEx(hWnd, NULL, 0);
+ }
+ else
+ ImmAssociateContextEx(hWnd, NULL, IACE_DEFAULT);
+ }
+
switch (message)
{
case WM_PAINT:
@@ -773,7 +793,11 @@
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
event.KeyInput.Key = (irr::EKEY_CODE)wParam;
event.KeyInput.PressedDown = (message==WM_KEYDOWN || message == WM_SYSKEYDOWN);
+#ifdef MAPVK_VSC_TO_VK_EX
+ const UINT MY_MAPVK_VSC_TO_VK_EX = MAPVK_VSC_TO_VK_EX;
+#else
const UINT MY_MAPVK_VSC_TO_VK_EX = 3; // MAPVK_VSC_TO_VK_EX should be in SDK according to MSDN, but isn't in mine.
+#endif
if ( event.KeyInput.Key == irr::KEY_SHIFT )
{
// this will fail on systems before windows NT/2000/XP, not sure _what_ will return there instead.
@@ -904,6 +928,53 @@
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
KEYBOARD_INPUT_HKL = GetKeyboardLayout(0);
KEYBOARD_INPUT_CODEPAGE = LocaleIdToCodepage( LOWORD(KEYBOARD_INPUT_HKL) );
return 0;
+
+ case WM_IME_STARTCOMPOSITION:
+ {
+ dev = getDeviceFromHWnd(hWnd);
+ irr::gui::IGUIElement* ele = dev->getGUIEnvironment()->getFocus();
+ if (!ele)
+ break;
+ irr::core::position2di pos = ele->getAbsolutePosition().UpperLeftCorner;
+ COMPOSITIONFORM CompForm = { CFS_POINT, { pos.X, pos.Y + ele->getAbsolutePosition().getHeight() } };
+ HIMC hIMC = ImmGetContext(hWnd);
+ ImmSetCompositionWindow(hIMC, &CompForm);
+ ImmReleaseContext(hWnd, hIMC);
+ }
+ break;
+
+ case WM_IME_CHAR:
+ event.EventType = irr::EET_KEY_INPUT_EVENT;
+ event.KeyInput.PressedDown = true;
+#ifdef _UNICODE
+ event.KeyInput.Char = wParam;
+#else
+ BYTE ch[3];
+ if (wParam >> 8) {
+ ch[0] = wParam >> 8;
+ ch[1] = wParam & 0xff;
+ ch[2] = 0;
+ } else {
+ ch[0] = wParam;
+ ch[1] = 0;
+ }
+ WORD unicodeChar;
+ MultiByteToWideChar(
+ KEYBOARD_INPUT_CODEPAGE,
+ MB_PRECOMPOSED, // default
+ (LPCSTR)ch,
+ sizeof(wParam),
+ (WCHAR*)&unicodeChar,
+ 1);
+ event.KeyInput.Char = unicodeChar;
+#endif
+ event.KeyInput.Key = irr::KEY_ACCEPT;
+ event.KeyInput.Shift = 0;
+ event.KeyInput.Control = 0;
+ dev = getDeviceFromHWnd(hWnd);
+ if (dev)
+ dev->postEventFromUser(event);
+ return 0;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
@@ -1797,8 +1868,8 @@
void CIrrDeviceWin32::handleSystemMessages()
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
- // No message translation because we don't use WM_CHAR and it would conflict with our
- // deadkey handling.
+ // conflict with deadkey handling.
+ TranslateMessage(&msg);
if (ExternalWindow && msg.hwnd == HWnd)
WndProc(HWnd, msg.message, msg.wParam, msg.lParam);
diff --git a/source/Irrlicht/COSOperator.cpp b/source/Irrlicht/COSOperator.cpp
index c5e4552..3b00628 100644
--- a/source/Irrlicht/COSOperator.cpp
+++ b/source/Irrlicht/COSOperator.cpp
@@ -9,6 +9,7 @@
#include <windows.h>
#endif
#else
+#include <locale.h>
#include <string.h>
#include <unistd.h>
#ifndef _IRR_SOLARIS_PLATFORM_
@@ -54,9 +55,10 @@
const core::stringc& COSOperator::getOperatingSystemVersion() const
//! copies text to the clipboard
-void COSOperator::copyToClipboard(const c8* text) const
+void COSOperator::copyToClipboard(const c16* text) const
{
- if (strlen(text)==0)
+ size_t len = wcslen(text);
+ if (len==0)
return;
// Windows version
@@ -68,15 +70,15 @@
void COSOperator::copyToClipboard(const c8* text) const
EmptyClipboard();
HGLOBAL clipbuffer;
- char * buffer;
+ wchar_t * buffer;
- clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(text)+1);
- buffer = (char*)GlobalLock(clipbuffer);
+ clipbuffer = GlobalAlloc(GMEM_DDESHARE, sizeof(wchar_t) * (len + 1));
+ buffer = (wchar_t*)GlobalLock(clipbuffer);
- strcpy(buffer, text);
+ wcscpy(buffer, text);
GlobalUnlock(clipbuffer);
- SetClipboardData(CF_TEXT, clipbuffer);
+ SetClipboardData(CF_UNICODETEXT, clipbuffer);
CloseClipboard();
// MacOSX version
@@ -86,7 +88,18 @@
void COSOperator::copyToClipboard(const c8* text) const
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if ( IrrDeviceLinux )
- IrrDeviceLinux->copyToClipboard(text);
+ {
+ size_t wlen = sizeof(wchar_t) * (len + 1);
+ char ctext[wlen];
+
+ char* oldLocale = setlocale(LC_CTYPE, NULL);
+ setlocale(LC_CTYPE, "");
+ size_t lenNew = wcstombs(ctext, text, wlen);
+ ctext[lenNew] = 0;
+ setlocale(LC_CTYPE, oldLocale);
+
+ IrrDeviceLinux->copyToClipboard(ctext);
+ }
#else
#endif
@@ -95,7 +108,7 @@
void COSOperator::copyToClipboard(const c8* text) const
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
-const c8* COSOperator::getTextFromClipboard() const
+const c16* COSOperator::getTextFromClipboard() const
{
#if defined(_IRR_XBOX_PLATFORM_)
return 0;
@@ -103,10 +116,10 @@
const c8* COSOperator::getTextFromClipboard() const
if (!OpenClipboard(NULL))
return 0;
- char * buffer = 0;
+ wchar_t * buffer = 0;
- HANDLE hData = GetClipboardData( CF_TEXT );
- buffer = (char*)GlobalLock( hData );
+ HANDLE hData = GetClipboardData( CF_UNICODETEXT );
+ buffer = (wchar_t*)GlobalLock( hData );
GlobalUnlock( hData );
CloseClipboard();
return buffer;
@@ -116,7 +129,16 @@
const c8* COSOperator::getTextFromClipboard() const
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if ( IrrDeviceLinux )
- return IrrDeviceLinux->getTextFromClipboard();
+ {
+ const c8 * p = IrrDeviceLinux->getTextFromClipboard();
+
+ char* oldLocale = setlocale(LC_CTYPE, NULL);
+ setlocale(LC_CTYPE, "");
+ wchar_t* ws = core::toWideChar(p);
+ setlocale(LC_CTYPE, oldLocale);
+
+ return ws;
+ }
return 0;
#else
diff --git a/source/Irrlicht/COSOperator.h b/source/Irrlicht/COSOperator.h
index 819805f..a86cb6e 100644
--- a/source/Irrlicht/COSOperator.h
+++ b/source/Irrlicht/COSOperator.h
@@ -27,11 +27,11 @@
public:
virtual const core::stringc& getOperatingSystemVersion() const;
//! copies text to the clipboard
- virtual void copyToClipboard(const c8* text) const;
+ virtual void copyToClipboard(const c16* text) const;
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
- virtual const c8* getTextFromClipboard() const;
+ virtual const c16* getTextFromClipboard() const;
//! gets the processor speed in megahertz
//! \param Mhz:
diff --git a/source/Irrlicht/MacOSX/AppDelegate.h b/source/Irrlicht/MacOSX/AppDelegate.h
index ccb116d..29705f2 100644
--- a/source/Irrlicht/MacOSX/AppDelegate.h
+++ b/source/Irrlicht/MacOSX/AppDelegate.h
@@ -10,7 +10,7 @@
#import <Cocoa/Cocoa.h>
#import "CIrrDeviceMacOSX.h"
-@interface AppDelegate : NSObject
+@interface AppDelegate : NSTextView <NSApplicationDelegate>
{
BOOL _quit;
irr::CIrrDeviceMacOSX *_device;
diff --git a/source/Irrlicht/MacOSX/AppDelegate.mm b/source/Irrlicht/MacOSX/AppDelegate.mm
index 14a7f86..37f6a51 100644
--- a/source/Irrlicht/MacOSX/AppDelegate.mm
+++ b/source/Irrlicht/MacOSX/AppDelegate.mm
@@ -74,6 +74,35 @@
return (_quit);
}
+- (void)keyDown:(NSEvent *)event
+{
+ [self interpretKeyEvents:@[event]];
+}
+
+- (void)insertText:(id)string
+{
+ [self setString: @""];
+ if ([string isKindOfClass:[NSAttributedString class]])
+ {
+ _device->handleInputEvent([[string string] UTF8String]);
+ }
+ else
+ {
+ _device->handleInputEvent([string UTF8String]);
+ }
+}
+
+- (void)doCommandBySelector:(SEL)selector
+{
+ _device->processKeyEvent();
+}
+
+- (void)paste:(id)sender
+{
+ // TODO: pass the pasted string. Now we discard it otherwise it will be kept in the editbox.
+ [self setString: @""];
+}
+
@end
#endif // _IRR_COMPILE_WITH_OSX_DEVICE_
diff --git a/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.h b/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.h
index f629588..d2fefae 100644
--- a/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.h
+++ b/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.h
@@ -95,6 +95,8 @@
namespace irr
void setMouseLocation(int x, int y);
void setResize(int width, int height);
void setCursorVisible(bool visible);
+ void handleInputEvent(const char *str);
+ void processKeyEvent();
private:
diff --git a/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm b/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm
index 60da342..8fd8f4a 100644
--- a/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm
+++ b/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm
@@ -592,6 +592,31 @@
void CIrrDeviceMacOSX::closeDevice()
CGLContext = NULL;
}
+void CIrrDeviceMacOSX::processKeyEvent()
+{
+ irr::SEvent ievent;
+ NSEvent *event = [[NSApplication sharedApplication] currentEvent];
+ postKeyEvent(event, ievent, true);
+}
+
+void CIrrDeviceMacOSX::handleInputEvent(const char *cStr)
+{
+ SEvent ievent;
+ irr::core::stringw widep(irr::core::toWideChar(cStr));
+
+ ievent.EventType = irr::EET_KEY_INPUT_EVENT;
+ ievent.KeyInput.Key = (irr::EKEY_CODE)0;
+ ievent.KeyInput.PressedDown = true;
+ ievent.KeyInput.Shift = false;
+ ievent.KeyInput.Control = false;
+
+ for (int i = 0; i < widep.size(); ++i)
+ {
+ ievent.KeyInput.Char = widep[i];
+ postEventFromUser(ievent);
+ }
+}
+
bool CIrrDeviceMacOSX::createWindow()
{
CGDisplayErr error;
@@ -721,14 +746,20 @@
bool CIrrDeviceMacOSX::createWindow()
[Window setDelegate:(id<NSWindowDelegate>)[NSApp delegate]];
if(CreationParams.DriverType == video::EDT_OPENGL)
+ {
+ [[Window contentView] setWantsBestResolutionOpenGLSurface:NO];
[OGLContext setView:[Window contentView]];
+ }
[Window setAcceptsMouseMovedEvents:TRUE];
[Window setIsVisible:TRUE];
[Window makeKeyAndOrderFront:nil];
}
else if(CreationParams.DriverType == video::EDT_OPENGL) //use another window for drawing
+ {
+ [(NSView*)CreationParams.WindowId setWantsBestResolutionOpenGLSurface:NO];
[OGLContext setView:(NSView*)CreationParams.WindowId];
+ }
if (CreationParams.DriverType == video::EDT_OPENGL)
CGLContext = (CGLContextObj) [OGLContext CGLContextObj];
@@ -881,6 +912,8 @@
bool CIrrDeviceMacOSX::createWindow()
newSwapInterval = (CreationParams.Vsync) ? 1 : 0;
CGLSetParameter(CGLContext,kCGLCPSwapInterval,&newSwapInterval);
}
+
+ [[Window contentView] addSubview:(AppDelegate*)[NSApp delegate]];
}
return (result);
@@ -971,6 +1004,41 @@
bool CIrrDeviceMacOSX::run()
os::Timer::tick();
storeMouseLocation();
+ auto focusElement = getGUIEnvironment()->getFocus();
+ bool editing = focusElement && focusElement->getType() == irr::gui::EGUIET_EDIT_BOX;
+ auto textView = (NSTextView*)[NSApp delegate];
+
+ if (!editing)
+ {
+ [textView setHidden:YES];
+ [Window makeFirstResponder:nil];
+ }
+ else
+ {
+ auto crect = focusElement->getAbsolutePosition();
+
+ // ensure font height enough to fill the rect, otherwize ime window will overlaps the edit box
+ [textView setFont:[NSFont userFontOfSize:crect.getHeight() - 5]];
+
+ // change origin from top left to bottom right
+ auto frameHeight = [[textView superview] frame].size.height;
+ NSRect rect = {
+ (frameHeight - crect.LowerRightCorner.Y > crect.getHeight()) ?
+ crect.UpperLeftCorner.X :
+ crect.UpperLeftCorner.X + crect.getWidth() / 2,
+ (frameHeight - crect.LowerRightCorner.Y > crect.getHeight()) ?
+ frameHeight - crect.LowerRightCorner.Y - crect.getHeight() - 1 :
+ frameHeight - crect.LowerRightCorner.Y,
+ crect.getWidth() / 2,
+ crect.getHeight(),
+ };
+ [textView setFrame:rect];
+ [textView setHidden:NO];
+
+ // start to receive input events
+ [Window makeFirstResponder:textView];
+ }
+
event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
if (event != nil)
{
@@ -979,6 +1047,13 @@
bool CIrrDeviceMacOSX::run()
switch([(NSEvent *)event type])
{
case NSKeyDown:
+ if (editing)
+ {
+ // delegate to text edit control to handle text input
+ [NSApp sendEvent:event];
+ break;
+ }
+
postKeyEvent(event,ievent,true);
break;
@@ -1174,13 +1249,11 @@
void CIrrDeviceMacOSX::postKeyEvent(void *event,irr::SEvent &ievent,bool pressed
std::map<int,int>::const_iterator iter;
unsigned int result,c,mkey,mchar;
const unsigned char *cStr;
- BOOL skipCommand;
str = [(NSEvent *)event characters];
if ((str != nil) && ([str length] > 0))
{
mkey = mchar = 0;
- skipCommand = false;
c = [str characterAtIndex:0];
mchar = c;
@@ -1199,19 +1272,11 @@
void CIrrDeviceMacOSX::postKeyEvent(void *event,irr::SEvent &ievent,bool pressed
}
else
{
- cStr = (unsigned char *)[str cStringUsingEncoding:NSWindowsCP1252StringEncoding];
+ cStr = (unsigned char *)[str UTF8String];
if (cStr != NULL && strlen((char*)cStr) > 0)
{
mchar = cStr[0];
mkey = toupper(mchar);
- if ([(NSEvent *)event modifierFlags] & NSCommandKeyMask)
- {
- if (mkey == 'C' || mkey == 'V' || mkey == 'X')
- {
- mchar = 0;
- skipCommand = true;
- }
- }
}
}
}
@@ -1220,14 +1285,9 @@
void CIrrDeviceMacOSX::postKeyEvent(void *event,irr::SEvent &ievent,bool pressed
ievent.KeyInput.Key = (irr::EKEY_CODE)mkey;
ievent.KeyInput.PressedDown = pressed;
ievent.KeyInput.Shift = ([(NSEvent *)event modifierFlags] & NSShiftKeyMask) != 0;
- ievent.KeyInput.Control = ([(NSEvent *)event modifierFlags] & NSControlKeyMask) != 0;
+ ievent.KeyInput.Control = ([(NSEvent *)event modifierFlags] & (NSControlKeyMask | NSCommandKeyMask)) != 0;
ievent.KeyInput.Char = mchar;
- if (skipCommand)
- ievent.KeyInput.Control = true;
- else if ([(NSEvent *)event modifierFlags] & NSCommandKeyMask)
- [NSApp sendEvent:(NSEvent *)event];
-
postEventFromUser(ievent);
}
}
diff --git a/source/Irrlicht/MacOSX/MacOSX.xcodeproj/project.pbxproj b/source/Irrlicht/MacOSX/MacOSX.xcodeproj/project.pbxproj
index 65f4cec..d465792 100644
--- a/source/Irrlicht/MacOSX/MacOSX.xcodeproj/project.pbxproj
+++ b/source/Irrlicht/MacOSX/MacOSX.xcodeproj/project.pbxproj
@@ -6088,10 +6088,12 @@
1DEB922308733DC00010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
+ ARCHS = "$(ARCHS_STANDARD)";
+ GCC_PREPROCESSOR_DEFINITIONS = GLES_SILENCE_DEPRECATION;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = NO;
HEADER_SEARCH_PATHS = ../../../include;
+ MACOSX_DEPLOYMENT_TARGET = 10.10;
OTHER_CFLAGS = (
"-DMACOSX",
"-D_DEBUG",
@@ -6104,16 +6106,18 @@
1DEB922408733DC00010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
+ ARCHS = "$(ARCHS_STANDARD)";
GCC_DYNAMIC_NO_PIC = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_PREPROCESSOR_DEFINITIONS = GLES_SILENCE_DEPRECATION;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = NO;
HEADER_SEARCH_PATHS = ../../../include;
INSTALL_MODE_FLAG = "a+rwx";
+ MACOSX_DEPLOYMENT_TARGET = 10.10;
OTHER_CFLAGS = "-DMACOSX";
PREBINDING = NO;
SDKROOT = "";
diff --git a/source/Irrlicht/MacOSX/OSXClipboard.h b/source/Irrlicht/MacOSX/OSXClipboard.h
index 68f598d..9d6832d 100644
--- a/source/Irrlicht/MacOSX/OSXClipboard.h
+++ b/source/Irrlicht/MacOSX/OSXClipboard.h
@@ -7,8 +7,8 @@
extern "C" {
#endif
- void OSXCopyToClipboard(const char *text);
- char* OSXCopyFromClipboard();
+ void OSXCopyToClipboard(const wchar_t *text);
+ wchar_t* OSXCopyFromClipboard();
#ifdef __cplusplus
}
diff --git a/source/Irrlicht/MacOSX/OSXClipboard.mm b/source/Irrlicht/MacOSX/OSXClipboard.mm
index d549911..1c9dc0f 100644
--- a/source/Irrlicht/MacOSX/OSXClipboard.mm
+++ b/source/Irrlicht/MacOSX/OSXClipboard.mm
@@ -3,34 +3,35 @@
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in Irrlicht.h
+#include "irrString.h"
#include "OSXClipboard.h"
#import <Cocoa/Cocoa.h>
-void OSXCopyToClipboard(const char *text)
+void OSXCopyToClipboard(const wchar_t *text)
{
NSString *str;
NSPasteboard *board;
- if ((text != NULL) && (strlen(text) > 0))
+ if ((text != NULL) && (wcslen(text) > 0))
{
- str = [NSString stringWithCString:text encoding:NSWindowsCP1252StringEncoding];
+ str = [[NSString alloc] initWithBytes:text length:wcslen(text)*sizeof(*text) encoding:NSUTF32LittleEndianStringEncoding];
board = [NSPasteboard generalPasteboard];
[board declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:NSApp];
[board setString:str forType:NSStringPboardType];
}
}
-char* OSXCopyFromClipboard()
+wchar_t* OSXCopyFromClipboard()
{
NSString* str;
NSPasteboard* board;
- char* result;
+ wchar_t* result;
result = NULL;
board = [NSPasteboard generalPasteboard];
str = [board stringForType:NSStringPboardType];
if (str != nil)
- result = (char*)[str cStringUsingEncoding:NSWindowsCP1252StringEncoding];
+ result = (wchar_t*)[str cStringUsingEncoding:NSUTF32LittleEndianStringEncoding];
return (result);
}
premake/irrlicht/premake5.lua
0 → 100644
View file @
47e70cc1
project
"irrlicht"
kind
"StaticLib"
includedirs
{
"include"
,
"source/Irrlicht"
,
"source/Irrlicht/jpeglib"
,
"source/Irrlicht/libpng"
,
"source/Irrlicht/zlib"
}
defines
{
"_IRR_STATIC_LIB_"
}
exceptionhandling
"Off"
rtti
"Off"
files
{
"source/Irrlicht/CCgMaterialRenderer.cpp"
,
"source/Irrlicht/CD3D9CgMaterialRenderer.cpp"
,
"source/Irrlicht/CDefaultSceneNodeAnimatorFactory.cpp"
,
"source/Irrlicht/CDefaultSceneNodeFactory.cpp"
,
"source/Irrlicht/CGeometryCreator.cpp"
,
"source/Irrlicht/CMeshCache.cpp"
,
"source/Irrlicht/CMeshManipulator.cpp"
,
"source/Irrlicht/COpenGLCgMaterialRenderer.cpp"
,
"source/Irrlicht/CSceneManager.cpp"
,
"source/Irrlicht/C3DSMeshFileLoader.cpp"
,
"source/Irrlicht/CSMFMeshFileLoader.cpp"
,
"source/Irrlicht/CAnimatedMeshHalfLife.cpp"
,
"source/Irrlicht/CAnimatedMeshMD2.cpp"
,
"source/Irrlicht/CAnimatedMeshMD3.cpp"
,
"source/Irrlicht/CB3DMeshFileLoader.cpp"
,
"source/Irrlicht/CBSPMeshFileLoader.cpp"
,
"source/Irrlicht/CColladaFileLoader.cpp"
,
"source/Irrlicht/CCSMLoader.cpp"
,
"source/Irrlicht/CDMFLoader.cpp"
,
"source/Irrlicht/CIrrMeshFileLoader.cpp"
,
"source/Irrlicht/CLMTSMeshFileLoader.cpp"
,
"source/Irrlicht/CLWOMeshFileLoader.cpp"
,
"source/Irrlicht/CMD2MeshFileLoader.cpp"
,
"source/Irrlicht/CMD3MeshFileLoader.cpp"
,
"source/Irrlicht/CMS3DMeshFileLoader.cpp"
,
"source/Irrlicht/CMY3DMeshFileLoader.cpp"
,
"source/Irrlicht/COBJMeshFileLoader.cpp"
,
"source/Irrlicht/COCTLoader.cpp"
,
"source/Irrlicht/COgreMeshFileLoader.cpp"
,
"source/Irrlicht/CPLYMeshFileLoader.cpp"
,
"source/Irrlicht/CQ3LevelMesh.cpp"
,
"source/Irrlicht/CSkinnedMesh.cpp"
,
"source/Irrlicht/CSTLMeshFileLoader.cpp"
,
"source/Irrlicht/CXMeshFileLoader.cpp"
,
"source/Irrlicht/CAnimatedMeshSceneNode.cpp"
,
"source/Irrlicht/CBillboardSceneNode.cpp"
,
"source/Irrlicht/CBoneSceneNode.cpp"
,
"source/Irrlicht/CCameraSceneNode.cpp"
,
"source/Irrlicht/CCubeSceneNode.cpp"
,
"source/Irrlicht/CDummyTransformationSceneNode.cpp"
,
"source/Irrlicht/CEmptySceneNode.cpp"
,
"source/Irrlicht/CLightSceneNode.cpp"
,
"source/Irrlicht/CMeshSceneNode.cpp"
,
"source/Irrlicht/COctreeSceneNode.cpp"
,
"source/Irrlicht/CQuake3ShaderSceneNode.cpp"
,
"source/Irrlicht/CShadowVolumeSceneNode.cpp"
,
"source/Irrlicht/CSkyBoxSceneNode.cpp"
,
"source/Irrlicht/CSkyDomeSceneNode.cpp"
,
"source/Irrlicht/CSphereSceneNode.cpp"
,
"source/Irrlicht/CTerrainSceneNode.cpp"
,
"source/Irrlicht/CTextSceneNode.cpp"
,
"source/Irrlicht/CVolumeLightSceneNode.cpp"
,
"source/Irrlicht/CWaterSurfaceSceneNode.cpp"
,
"source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.cpp"
,
"source/Irrlicht/CParticleAttractionAffector.cpp"
,
"source/Irrlicht/CParticleBoxEmitter.cpp"
,
"source/Irrlicht/CParticleCylinderEmitter.cpp"
,
"source/Irrlicht/CParticleFadeOutAffector.cpp"
,
"source/Irrlicht/CParticleGravityAffector.cpp"
,
"source/Irrlicht/CParticleMeshEmitter.cpp"
,
"source/Irrlicht/CParticlePointEmitter.cpp"
,
"source/Irrlicht/CParticleRingEmitter.cpp"
,
"source/Irrlicht/CParticleRotationAffector.cpp"
,
"source/Irrlicht/CParticleScaleAffector.cpp"
,
"source/Irrlicht/CParticleSphereEmitter.cpp"
,
"source/Irrlicht/CParticleSystemSceneNode.cpp"
,
"source/Irrlicht/CMetaTriangleSelector.cpp"
,
"source/Irrlicht/COctreeTriangleSelector.cpp"
,
"source/Irrlicht/CSceneCollisionManager.cpp"
,
"source/Irrlicht/CTerrainTriangleSelector.cpp"
,
"source/Irrlicht/CTriangleBBSelector.cpp"
,
"source/Irrlicht/CTriangleSelector.cpp"
,
"source/Irrlicht/CSceneLoaderIrr.cpp"
,
"source/Irrlicht/CSceneNodeAnimatorCameraFPS.cpp"
,
"source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp"
,
"source/Irrlicht/CSceneNodeAnimatorCollisionResponse.cpp"
,
"source/Irrlicht/CSceneNodeAnimatorDelete.cpp"
,
"source/Irrlicht/CSceneNodeAnimatorFlyCircle.cpp"
,
"source/Irrlicht/CSceneNodeAnimatorFlyStraight.cpp"
,
"source/Irrlicht/CSceneNodeAnimatorFollowSpline.cpp"
,
"source/Irrlicht/CSceneNodeAnimatorRotation.cpp"
,
"source/Irrlicht/CSceneNodeAnimatorTexture.cpp"
,
"source/Irrlicht/CColladaMeshWriter.cpp"
,
"source/Irrlicht/CIrrMeshWriter.cpp"
,
"source/Irrlicht/COBJMeshWriter.cpp"
,
"source/Irrlicht/CPLYMeshWriter.cpp"
,
"source/Irrlicht/CSTLMeshWriter.cpp"
,
"source/Irrlicht/CVideoModeList.cpp"
,
"source/Irrlicht/CSoftwareDriver.cpp"
,
"source/Irrlicht/CSoftwareTexture.cpp"
,
"source/Irrlicht/CTRFlat.cpp"
,
"source/Irrlicht/CTRFlatWire.cpp"
,
"source/Irrlicht/CTRGouraud.cpp"
,
"source/Irrlicht/CTRGouraudWire.cpp"
,
"source/Irrlicht/CTRTextureFlat.cpp"
,
"source/Irrlicht/CTRTextureFlatWire.cpp"
,
"source/Irrlicht/CTRTextureGouraud.cpp"
,
"source/Irrlicht/CTRTextureGouraudAdd.cpp"
,
"source/Irrlicht/CTRTextureGouraudNoZ.cpp"
,
"source/Irrlicht/CTRTextureGouraudWire.cpp"
,
"source/Irrlicht/CZBuffer.cpp"
,
"source/Irrlicht/COpenGLDriver.cpp"
,
"source/Irrlicht/COpenGLExtensionHandler.cpp"
,
"source/Irrlicht/COpenGLNormalMapRenderer.cpp"
,
"source/Irrlicht/COpenGLParallaxMapRenderer.cpp"
,
"source/Irrlicht/COpenGLShaderMaterialRenderer.cpp"
,
"source/Irrlicht/COpenGLSLMaterialRenderer.cpp"
,
"source/Irrlicht/COpenGLTexture.cpp"
,
"source/Irrlicht/CD3D8Driver.cpp"
,
"source/Irrlicht/CD3D8NormalMapRenderer.cpp"
,
"source/Irrlicht/CD3D8ParallaxMapRenderer.cpp"
,
"source/Irrlicht/CD3D8ShaderMaterialRenderer.cpp"
,
"source/Irrlicht/CD3D8Texture.cpp"
,
"source/Irrlicht/CColorConverter.cpp"
,
"source/Irrlicht/CFPSCounter.cpp"
,
"source/Irrlicht/CImage.cpp"
,
"source/Irrlicht/CNullDriver.cpp"
,
"source/Irrlicht/CImageWriterBMP.cpp"
,
"source/Irrlicht/CImageWriterJPG.cpp"
,
"source/Irrlicht/CImageWriterPCX.cpp"
,
"source/Irrlicht/CImageWriterPNG.cpp"
,
"source/Irrlicht/CImageWriterPPM.cpp"
,
"source/Irrlicht/CImageWriterPSD.cpp"
,
"source/Irrlicht/CImageWriterTGA.cpp"
,
"source/Irrlicht/CImageLoaderBMP.cpp"
,
"source/Irrlicht/CImageLoaderDDS.cpp"
,
"source/Irrlicht/CImageLoaderJPG.cpp"
,
"source/Irrlicht/CImageLoaderPCX.cpp"
,
"source/Irrlicht/CImageLoaderPNG.cpp"
,
"source/Irrlicht/CImageLoaderPPM.cpp"
,
"source/Irrlicht/CImageLoaderPSD.cpp"
,
"source/Irrlicht/CImageLoaderRGB.cpp"
,
"source/Irrlicht/CImageLoaderTGA.cpp"
,
"source/Irrlicht/CImageLoaderWAL.cpp"
,
"source/Irrlicht/CD3D9Driver.cpp"
,
"source/Irrlicht/CD3D9HLSLMaterialRenderer.cpp"
,
"source/Irrlicht/CD3D9NormalMapRenderer.cpp"
,
"source/Irrlicht/CD3D9ParallaxMapRenderer.cpp"
,
"source/Irrlicht/CD3D9ShaderMaterialRenderer.cpp"
,
"source/Irrlicht/CD3D9Texture.cpp"
,
"source/Irrlicht/CBurningShader_Raster_Reference.cpp"
,
"source/Irrlicht/CDepthBuffer.cpp"
,
"source/Irrlicht/CSoftwareDriver2.cpp"
,
"source/Irrlicht/CSoftwareTexture2.cpp"
,
"source/Irrlicht/CTRGouraud2.cpp"
,
"source/Irrlicht/CTRGouraudAlpha2.cpp"
,
"source/Irrlicht/CTRGouraudAlphaNoZ2.cpp"
,
"source/Irrlicht/CTRNormalMap.cpp"
,
"source/Irrlicht/CTRStencilShadow.cpp"
,
"source/Irrlicht/CTRTextureBlend.cpp"
,
"source/Irrlicht/CTRTextureDetailMap2.cpp"
,
"source/Irrlicht/CTRTextureGouraud2.cpp"
,
"source/Irrlicht/CTRTextureGouraudAdd2.cpp"
,
"source/Irrlicht/CTRTextureGouraudAddNoZ2.cpp"
,
"source/Irrlicht/CTRTextureGouraudAlpha.cpp"
,
"source/Irrlicht/CTRTextureGouraudAlphaNoZ.cpp"
,
"source/Irrlicht/CTRTextureGouraudNoZ2.cpp"
,
"source/Irrlicht/CTRTextureGouraudVertexAlpha2.cpp"
,
"source/Irrlicht/CTRTextureLightMap2_Add.cpp"
,
"source/Irrlicht/CTRTextureLightMap2_M1.cpp"
,
"source/Irrlicht/CTRTextureLightMap2_M2.cpp"
,
"source/Irrlicht/CTRTextureLightMap2_M4.cpp"
,
"source/Irrlicht/CTRTextureLightMapGouraud2_M4.cpp"
,
"source/Irrlicht/CTRTextureWire2.cpp"
,
"source/Irrlicht/IBurningShader.cpp"
,
"source/Irrlicht/CLogger.cpp"
,
"source/Irrlicht/COSOperator.cpp"
,
"source/Irrlicht/Irrlicht.cpp"
,
"source/Irrlicht/os.cpp"
,
"source/Irrlicht/lzma/LzmaDec.c"
,
"source/Irrlicht/zlib/adler32.c"
,
"source/Irrlicht/zlib/compress.c"
,
"source/Irrlicht/zlib/crc32.c"
,
"source/Irrlicht/zlib/deflate.c"
,
"source/Irrlicht/zlib/inffast.c"
,
"source/Irrlicht/zlib/inflate.c"
,
"source/Irrlicht/zlib/inftrees.c"
,
"source/Irrlicht/zlib/trees.c"
,
"source/Irrlicht/zlib/uncompr.c"
,
"source/Irrlicht/zlib/zutil.c"
,
"source/Irrlicht/jpeglib/jaricom.c"
,
"source/Irrlicht/jpeglib/jcapimin.c"
,
"source/Irrlicht/jpeglib/jcapistd.c"
,
"source/Irrlicht/jpeglib/jcarith.c"
,
"source/Irrlicht/jpeglib/jccoefct.c"
,
"source/Irrlicht/jpeglib/jccolor.c"
,
"source/Irrlicht/jpeglib/jcdctmgr.c"
,
"source/Irrlicht/jpeglib/jchuff.c"
,
"source/Irrlicht/jpeglib/jcinit.c"
,
"source/Irrlicht/jpeglib/jcmainct.c"
,
"source/Irrlicht/jpeglib/jcmarker.c"
,
"source/Irrlicht/jpeglib/jcmaster.c"
,
"source/Irrlicht/jpeglib/jcomapi.c"
,
"source/Irrlicht/jpeglib/jcparam.c"
,
"source/Irrlicht/jpeglib/jcprepct.c"
,
"source/Irrlicht/jpeglib/jcsample.c"
,
"source/Irrlicht/jpeglib/jctrans.c"
,
"source/Irrlicht/jpeglib/jdapimin.c"
,
"source/Irrlicht/jpeglib/jdapistd.c"
,
"source/Irrlicht/jpeglib/jdarith.c"
,
"source/Irrlicht/jpeglib/jdatadst.c"
,
"source/Irrlicht/jpeglib/jdatasrc.c"
,
"source/Irrlicht/jpeglib/jdcoefct.c"
,
"source/Irrlicht/jpeglib/jdcolor.c"
,
"source/Irrlicht/jpeglib/jddctmgr.c"
,
"source/Irrlicht/jpeglib/jdhuff.c"
,
"source/Irrlicht/jpeglib/jdinput.c"
,
"source/Irrlicht/jpeglib/jdmainct.c"
,
"source/Irrlicht/jpeglib/jdmarker.c"
,
"source/Irrlicht/jpeglib/jdmaster.c"
,
"source/Irrlicht/jpeglib/jdmerge.c"
,
"source/Irrlicht/jpeglib/jdpostct.c"
,
"source/Irrlicht/jpeglib/jdsample.c"
,
"source/Irrlicht/jpeglib/jdtrans.c"
,
"source/Irrlicht/jpeglib/jerror.c"
,
"source/Irrlicht/jpeglib/jfdctflt.c"
,
"source/Irrlicht/jpeglib/jfdctfst.c"
,
"source/Irrlicht/jpeglib/jfdctint.c"
,
"source/Irrlicht/jpeglib/jidctflt.c"
,
"source/Irrlicht/jpeglib/jidctfst.c"
,
"source/Irrlicht/jpeglib/jidctint.c"
,
"source/Irrlicht/jpeglib/jmemmgr.c"
,
"source/Irrlicht/jpeglib/jmemnobs.c"
,
"source/Irrlicht/jpeglib/jquant1.c"
,
"source/Irrlicht/jpeglib/jquant2.c"
,
"source/Irrlicht/jpeglib/jutils.c"
,
"source/Irrlicht/libpng/png.c"
,
"source/Irrlicht/libpng/pngerror.c"
,
"source/Irrlicht/libpng/pngget.c"
,
"source/Irrlicht/libpng/pngmem.c"
,
"source/Irrlicht/libpng/pngpread.c"
,
"source/Irrlicht/libpng/pngread.c"
,
"source/Irrlicht/libpng/pngrio.c"
,
"source/Irrlicht/libpng/pngrtran.c"
,
"source/Irrlicht/libpng/pngrutil.c"
,
"source/Irrlicht/libpng/pngset.c"
,
"source/Irrlicht/libpng/pngtrans.c"
,
"source/Irrlicht/libpng/pngwio.c"
,
"source/Irrlicht/libpng/pngwrite.c"
,
"source/Irrlicht/libpng/pngwtran.c"
,
"source/Irrlicht/libpng/pngwutil.c"
,
"source/Irrlicht/aesGladman/aescrypt.cpp"
,
"source/Irrlicht/aesGladman/aeskey.cpp"
,
"source/Irrlicht/aesGladman/aestab.cpp"
,
"source/Irrlicht/aesGladman/fileenc.cpp"
,
"source/Irrlicht/aesGladman/hmac.cpp"
,
"source/Irrlicht/aesGladman/prng.cpp"
,
"source/Irrlicht/aesGladman/pwd2key.cpp"
,
"source/Irrlicht/aesGladman/sha1.cpp"
,
"source/Irrlicht/aesGladman/sha2.cpp"
,
"source/Irrlicht/bzip2/blocksort.c"
,
"source/Irrlicht/bzip2/bzcompress.c"
,
"source/Irrlicht/bzip2/bzlib.c"
,
"source/Irrlicht/bzip2/crctable.c"
,
"source/Irrlicht/bzip2/decompress.c"
,
"source/Irrlicht/bzip2/huffman.c"
,
"source/Irrlicht/bzip2/randtable.c"
,
"source/Irrlicht/CIrrDeviceConsole.cpp"
,
"source/Irrlicht/CIrrDeviceFB.cpp"
,
"source/Irrlicht/CIrrDeviceLinux.cpp"
,
"source/Irrlicht/CIrrDeviceSDL.cpp"
,
"source/Irrlicht/CIrrDeviceStub.cpp"
,
"source/Irrlicht/CIrrDeviceWin32.cpp"
,
"source/Irrlicht/CIrrDeviceWinCE.cpp"
,
"source/Irrlicht/CAttributes.cpp"
,
"source/Irrlicht/CFileList.cpp"
,
"source/Irrlicht/CFileSystem.cpp"
,
"source/Irrlicht/CLimitReadFile.cpp"
,
"source/Irrlicht/CMemoryFile.cpp"
,
"source/Irrlicht/CMountPointReader.cpp"
,
"source/Irrlicht/CNPKReader.cpp"
,
"source/Irrlicht/CPakReader.cpp"
,
"source/Irrlicht/CReadFile.cpp"
,
"source/Irrlicht/CTarReader.cpp"
,
"source/Irrlicht/CWADReader.cpp"
,
"source/Irrlicht/CWriteFile.cpp"
,
"source/Irrlicht/CXMLReader.cpp"
,
"source/Irrlicht/CXMLWriter.cpp"
,
"source/Irrlicht/CZipReader.cpp"
,
"source/Irrlicht/irrXML.cpp"
,
"source/Irrlicht/CDefaultGUIElementFactory.cpp"
,
"source/Irrlicht/CGUIButton.cpp"
,
"source/Irrlicht/CGUICheckBox.cpp"
,
"source/Irrlicht/CGUIColorSelectDialog.cpp"
,
"source/Irrlicht/CGUIComboBox.cpp"
,
"source/Irrlicht/CGUIContextMenu.cpp"
,
"source/Irrlicht/CGUIEditBox.cpp"
,
"source/Irrlicht/CGUIEnvironment.cpp"
,
"source/Irrlicht/CGUIFileOpenDialog.cpp"
,
"source/Irrlicht/CGUIFont.cpp"
,
"source/Irrlicht/CGUIImage.cpp"
,
"source/Irrlicht/CGUIImageList.cpp"
,
"source/Irrlicht/CGUIInOutFader.cpp"
,
"source/Irrlicht/CGUIListBox.cpp"
,
"source/Irrlicht/CGUIMenu.cpp"
,
"source/Irrlicht/CGUIMeshViewer.cpp"
,
"source/Irrlicht/CGUIMessageBox.cpp"
,
"source/Irrlicht/CGUIModalScreen.cpp"
,
"source/Irrlicht/CGUIScrollBar.cpp"
,
"source/Irrlicht/CGUISkin.cpp"
,
"source/Irrlicht/CGUISpinBox.cpp"
,
"source/Irrlicht/CGUISpriteBank.cpp"
,
"source/Irrlicht/CGUIStaticText.cpp"
,
"source/Irrlicht/CGUITabControl.cpp"
,
"source/Irrlicht/CGUITable.cpp"
,
"source/Irrlicht/CGUIToolBar.cpp"
,
"source/Irrlicht/CGUITreeView.cpp"
,
"source/Irrlicht/CGUIWindow.cpp"
}
filter
{
"system:windows"
}
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
includedirs
{
"$(DXSDK_DIR)include"
}
libdirs
{
"$(DXSDK_DIR)Lib/x86"
}
links
{
"imm32"
}
filter
{
"system:linux"
}
links
{
"X11"
,
"Xxf86vm"
}
premake/lua/premake5.lua
0 → 100644
View file @
47e70cc1
project
"lua"
kind
"StaticLib"
files
{
"src/*.c"
,
"src/*.h"
,
"src/*.hpp"
}
removefiles
{
"src/lua.c"
,
"src/luac.c"
}
filter
"action:vs*"
buildoptions
{
"/TP"
}
filter
"not action:vs*"
buildoptions
{
"-x c++"
}
filter
"system:bsd"
defines
{
"LUA_USE_POSIX"
}
filter
"system:macosx"
defines
{
"LUA_USE_MACOSX"
}
filter
"system:linux"
defines
{
"LUA_USE_LINUX"
}
premake/sqlite3/premake
4
.lua
→
premake/sqlite3/premake
5
.lua
View file @
47e70cc1
File moved
premake5.lua
View file @
47e70cc1
solution
"ygo"
-- default global settings
BUILD_LUA
=
true
BUILD_EVENT
=
os
.
istarget
(
"windows"
)
BUILD_FREETYPE
=
os
.
istarget
(
"windows"
)
BUILD_SQLITE
=
os
.
istarget
(
"windows"
)
BUILD_IRRLICHT
=
not
os
.
istarget
(
"macosx"
)
USE_IRRKLANG
=
true
IRRKLANG_PRO
=
false
LUA_LIB_NAME
=
"lua"
SERVER_MODE
=
true
USE_IRRKLANG
=
false
-- read settings from command line or environment variables
newoption
{
trigger
=
"build-lua"
,
category
=
"YGOPro - lua"
,
description
=
""
}
newoption
{
trigger
=
"no-build-lua"
,
category
=
"YGOPro - lua"
,
description
=
""
}
newoption
{
trigger
=
"lua-include-dir"
,
category
=
"YGOPro - lua"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"lua-lib-dir"
,
category
=
"YGOPro - lua"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"lua-lib-name"
,
category
=
"YGOPro - lua"
,
description
=
""
,
value
=
"NAME"
,
default
=
"lua"
}
newoption
{
trigger
=
"build-event"
,
category
=
"YGOPro - event"
,
description
=
""
}
newoption
{
trigger
=
"no-build-event"
,
category
=
"YGOPro - event"
,
description
=
""
}
newoption
{
trigger
=
"event-include-dir"
,
category
=
"YGOPro - event"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"event-lib-dir"
,
category
=
"YGOPro - event"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"build-freetype"
,
category
=
"YGOPro - freetype"
,
description
=
""
}
newoption
{
trigger
=
"no-build-freetype"
,
category
=
"YGOPro - freetype"
,
description
=
""
}
newoption
{
trigger
=
"freetype-include-dir"
,
category
=
"YGOPro - freetype"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"freetype-lib-dir"
,
category
=
"YGOPro - freetype"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"build-sqlite"
,
category
=
"YGOPro - sqlite"
,
description
=
""
}
newoption
{
trigger
=
"no-build-sqlite"
,
category
=
"YGOPro - sqlite"
,
description
=
""
}
newoption
{
trigger
=
"sqlite-include-dir"
,
category
=
"YGOPro - sqlite"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"sqlite-lib-dir"
,
category
=
"YGOPro - sqlite"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"build-irrlicht"
,
category
=
"YGOPro - irrlicht"
,
description
=
""
}
newoption
{
trigger
=
"no-build-irrlicht"
,
category
=
"YGOPro - irrlicht"
,
description
=
""
}
newoption
{
trigger
=
"irrlicht-include-dir"
,
category
=
"YGOPro - irrlicht"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"irrlicht-lib-dir"
,
category
=
"YGOPro - irrlicht"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"use-irrklang"
,
category
=
"YGOPro - irrklang"
,
description
=
""
}
newoption
{
trigger
=
"no-use-irrklang"
,
category
=
"YGOPro - irrklang"
,
description
=
""
}
newoption
{
trigger
=
"irrklang-include-dir"
,
category
=
"YGOPro - irrklang"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"irrklang-lib-dir"
,
category
=
"YGOPro - irrklang"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"irrklang-pro"
,
category
=
"YGOPro - irrklang - pro"
,
description
=
""
}
newoption
{
trigger
=
"no-irrklang-pro"
,
category
=
"YGOPro - irrklang - pro"
,
description
=
""
}
newoption
{
trigger
=
"irrklang-pro-release-lib-dir"
,
category
=
"YGOPro - irrklang - pro"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"irrklang-pro-debug-lib-dir"
,
category
=
"YGOPro - irrklang - pro"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"winxp-support"
,
category
=
"YGOPro"
,
description
=
""
}
newoption
{
trigger
=
"mac-arm"
,
category
=
"YGOPro"
,
description
=
"M1"
}
newoption
{
trigger
=
"server-mode"
,
category
=
"YGOPro"
,
description
=
""
}
function
GetParam
(
param
)
return
_OPTIONS
[
param
]
or
os.getenv
(
string.upper
(
string.gsub
(
param
,
"-"
,
"_"
)))
end
if
GetParam
(
"build-lua"
)
then
BUILD_LUA
=
true
elseif
GetParam
(
"no-build-lua"
)
then
BUILD_LUA
=
false
end
if
not
BUILD_LUA
then
-- at most times you need to change this if you change BUILD_LUA to false
-- make sure your lua lib is built with C++ and version >= 5.3
LUA_INCLUDE_DIR
=
GetParam
(
"lua-include-dir"
)
or
"/usr/local/include/lua"
LUA_LIB_DIR
=
GetParam
(
"lua-lib-dir"
)
or
"/usr/local/lib"
LUA_LIB_NAME
=
GetParam
(
"lua-lib-name"
)
end
if
GetParam
(
"build-event"
)
then
BUILD_EVENT
=
os
.
istarget
(
"windows"
)
-- only on windows for now
elseif
GetParam
(
"no-build-event"
)
then
BUILD_EVENT
=
false
end
if
not
BUILD_EVENT
then
EVENT_INCLUDE_DIR
=
GetParam
(
"event-include-dir"
)
or
"/usr/local/include/event2"
EVENT_LIB_DIR
=
GetParam
(
"event-lib-dir"
)
or
"/usr/local/lib"
end
if
GetParam
(
"build-freetype"
)
then
BUILD_FREETYPE
=
true
elseif
GetParam
(
"no-build-freetype"
)
then
BUILD_FREETYPE
=
false
end
if
not
BUILD_FREETYPE
then
if
os
.
istarget
(
"linux"
)
then
FREETYPE_INCLUDE_DIR
=
"/usr/include/freetype2"
elseif
os
.
istarget
(
"macosx"
)
then
FREETYPE_INCLUDE_DIR
=
"/usr/local/include/freetype2"
end
FREETYPE_INCLUDE_DIR
=
GetParam
(
"freetype-include-dir"
)
or
FREETYPE_INCLUDE_DIR
FREETYPE_LIB_DIR
=
GetParam
(
"freetype-lib-dir"
)
or
"/usr/local/lib"
end
if
GetParam
(
"build-sqlite"
)
then
BUILD_SQLITE
=
true
elseif
GetParam
(
"no-build-sqlite"
)
then
BUILD_SQLITE
=
false
end
if
not
BUILD_SQLITE
then
SQLITE_INCLUDE_DIR
=
GetParam
(
"sqlite-include-dir"
)
or
"/usr/local/include"
SQLITE_LIB_DIR
=
GetParam
(
"sqlite-lib-dir"
)
or
"/usr/local/lib"
end
if
GetParam
(
"build-irrlicht"
)
then
BUILD_IRRLICHT
=
true
elseif
GetParam
(
"no-build-irrlicht"
)
then
BUILD_IRRLICHT
=
false
end
if
not
BUILD_IRRLICHT
then
IRRLICHT_INCLUDE_DIR
=
GetParam
(
"irrlicht-include-dir"
)
or
"/usr/local/include/irrlicht"
IRRLICHT_LIB_DIR
=
GetParam
(
"irrlicht-lib-dir"
)
or
"/usr/local/lib"
end
if
GetParam
(
"use-irrklang"
)
then
USE_IRRKLANG
=
true
elseif
GetParam
(
"no-use-irrklang"
)
then
USE_IRRKLANG
=
false
end
if
USE_IRRKLANG
then
IRRKLANG_INCLUDE_DIR
=
GetParam
(
"irrklang-include-dir"
)
or
"../irrklang/include"
if
os
.
istarget
(
"windows"
)
then
IRRKLANG_LIB_DIR
=
"../irrklang/lib/Win32-visualStudio"
elseif
os
.
istarget
(
"linux"
)
then
IRRKLANG_LIB_DIR
=
"../irrklang/bin/linux-gcc-64"
IRRKLANG_LINK_RPATH
=
"-Wl,-rpath=./irrklang/bin/linux-gcc-64/"
elseif
os
.
istarget
(
"macosx"
)
then
IRRKLANG_LIB_DIR
=
"../irrklang/bin/macosx-gcc"
end
IRRKLANG_LIB_DIR
=
GetParam
(
"irrklang-lib-dir"
)
or
IRRKLANG_LIB_DIR
end
if
GetParam
(
"irrklang-pro"
)
and
os
.
istarget
(
"windows"
)
then
IRRKLANG_PRO
=
true
elseif
GetParam
(
"no-irrklang-pro"
)
then
IRRKLANG_PRO
=
false
end
if
IRRKLANG_PRO
then
-- irrklang pro can't use the pro lib to debug
IRRKLANG_PRO_RELEASE_LIB_DIR
=
GetParam
(
"irrklang-pro-release-lib-dir"
)
or
"../irrklang/lib/Win32-vs2019"
IRRKLANG_PRO_DEBUG_LIB_DIR
=
GetParam
(
"irrklang-pro-debug-lib-dir"
)
or
"../irrklang/lib/Win32-visualStudio-debug"
end
if
GetParam
(
"winxp-support"
)
and
os
.
istarget
(
"windows"
)
then
WINXP_SUPPORT
=
true
end
if
GetParam
(
"mac-arm"
)
and
os
.
istarget
(
"macosx"
)
then
MAC_ARM
=
true
end
if
GetParam
(
"server-mode"
)
then
SERVER_MODE
=
true
end
workspace
"YGOPro"
location
"build"
language
"C++"
objdir
"obj"
...
...
@@ -39,101 +196,87 @@ solution "ygo"
end
end
if
os
.
ishost
(
"windows"
)
then
BUILD_LUA
=
true
end
configurations
{
"Release"
,
"Debug"
}
if
os.getenv
(
"YGOPRO_NO_LUA_SAFE"
)
then
defines
{
"LUA_COMPAT_5_2"
,
"YGOPRO_SERVER_MODE"
}
else
defines
{
"LUA_COMPAT_5_2"
,
"YGOPRO_SERVER_MODE"
,
"YGOPRO_LUA_SAFE"
}
end
configuration
"windows"
defines
{
"WIN32"
,
"_WIN32"
}
startproject
"ygopro"
if
os.getenv
(
"YGOPRO_USE_XP_TOOLSET"
)
then
configuration
{
"windows"
,
"vs2015"
}
toolset
"v140_xp"
configuration
{
"windows"
,
"vs2017"
}
toolset
"v141_xp"
configuration
{
"windows"
,
"vs2019"
}
toolset
"v141_xp"
filter
"system:windows"
defines
{
"WIN32"
,
"_WIN32"
}
if
not
SERVER_MODE
then
entrypoint
"mainCRTStartup"
end
systemversion
"latest"
startproject
"YGOPro"
if
WINXP_SUPPORT
then
defines
{
"WINVER=0x0501"
}
toolset
"v141_xp"
else
defines
{
"WINVER=0x0601"
}
-- WIN7
end
configuration
"bsd"
defines
{
"LUA_USE_POSIX"
}
includedirs
{
"/usr/local/include"
}
filter
"system:macosx"
libdirs
{
"/usr/local/lib"
}
configuration
"macosx"
defines
{
"LUA_USE_MACOSX"
,
"DBL_MAX_10_EXP=+308"
,
"DBL_MANT_DIG=53"
,
"GL_SILENCE_DEPRECATION"
}
if
not
LIBEVENT_ROOT
then
includedirs
{
"/usr/local/include/event2"
}
libdirs
{
"/usr/local/lib"
}
end
buildoptions
{
"-stdlib=libc++"
}
if
MAC_ARM
then
buildoptions
{
"--target=arm64-apple-macos1
1
"
}
buildoptions
{
"--target=arm64-apple-macos1
2
"
}
end
if
not
SERVER_MODE
then
links
{
"OpenGL.framework"
,
"Cocoa.framework"
,
"IOKit.framework"
}
end
configuration
"linux"
defines
{
"LUA_USE_LINUX"
}
filter
"system:linux"
buildoptions
{
"-U_FORTIFY_SOURCE"
}
configuration
"Release"
filter
"configurations:Release"
optimize
"Speed"
targetdir
"bin/release"
configuration
"
Debug"
filter
"configurations:
Debug"
symbols
"On"
defines
"_DEBUG"
targetdir
"bin/debug"
configuration
{
"Release"
,
"vs*"
}
optimize
"Speed"
filter
{
"configurations:Release"
,
"action:vs*"
}
flags
{
"LinkTimeOptimization"
}
staticruntime
"On"
disablewarnings
{
"4244"
,
"4267"
,
"4838"
,
"4577"
,
"4819"
,
"4018"
,
"4996"
,
"4477"
,
"4091"
,
"4828"
,
"4800"
}
configuration
{
"Release"
,
"not
vs*"
}
filter
{
"configurations:Release"
,
"not action:
vs*"
}
symbols
"On"
defines
"NDEBUG"
if
not
MAC_ARM
then
buildoptions
"-march=native"
end
configuration
{
"Debug"
,
"
vs*"
}
filter
{
"configurations:Debug"
,
"action:
vs*"
}
defines
{
"_ITERATOR_DEBUG_LEVEL=0"
}
disablewarnings
{
"4819"
,
"4828"
}
configuration
"
vs*"
filter
"action:
vs*"
vectorextensions
"SSE2"
buildoptions
{
"/utf-8"
}
defines
{
"_CRT_SECURE_NO_WARNINGS"
}
filter
"not action:vs*"
buildoptions
{
"-fno-strict-aliasing"
,
"-Wno-multichar"
,
"-Wno-format-security"
}
configuration
"not vs*"
buildoptions
{
"-fno-strict-aliasing"
,
"-Wno-format-security"
}
configuration
{
"not vs*"
,
"windows"
}
buildoptions
{
"-static-libgcc"
}
startproject
"ygopro"
filter
{}
include
"ocgcore"
include
"gframe"
if
os
.
ishost
(
"windows"
)
then
if
BUILD_LUA
then
include
"lua"
end
if
BUILD_EVENT
then
include
"event"
end
if
BUILD_FREETYPE
and
not
SERVER_MODE
then
include
"freetype"
end
if
BUILD_IRRLICHT
and
not
SERVER_MODE
then
include
"irrlicht"
end
if
BUILD_SQLITE
then
include
"sqlite3"
else
if
BUILD_LUA
then
include
"lua"
end
if
BUILD_SQLITE
then
include
"sqlite3/premake4.lua"
end
end
if
USE_IRRKLANG
and
IRRKLANG_PRO
and
not
SERVER_MODE
then
include
"ikpmp3"
end
script
@
8e1536d0
Subproject commit
97bbddc05f32aeab9127fdb50f93c2de380d51fd
Subproject commit
8e1536d0dd8f08f0cfec0ed723aa1c999f11cac7
strings.conf
View file @
47e70cc1
...
...
@@ -267,6 +267,7 @@
!
system
1190
加入手卡
!
system
1191
送去墓地
!
system
1192
除外
!
system
1193
回到卡组
#menu
!
system
1200
联机模式
!
system
1201
单人模式
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment