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
8d44a578
Commit
8d44a578
authored
Apr 16, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work on those vars
parent
7133f918
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
42 additions
and
124 deletions
+42
-124
.ci/exec-macos-platform.sh
.ci/exec-macos-platform.sh
+1
-5
.gitlab-ci.yml
.gitlab-ci.yml
+8
-9
gframe/deck_con.cpp
gframe/deck_con.cpp
+3
-3
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+6
-6
gframe/duelclient.cpp
gframe/duelclient.cpp
+2
-2
gframe/game.cpp
gframe/game.cpp
+3
-3
gframe/game.h
gframe/game.h
+18
-2
gframe/premake4.lua
gframe/premake4.lua
+0
-93
premake5.lua
premake5.lua
+1
-1
No files found.
.ci/exec-macos-platform.sh
View file @
8d44a578
...
...
@@ -10,11 +10,7 @@ export IRRLICHT_LIB_DIR=$PWD/irrlicht
git submodule update
--init
if
[[
$TARGET_PLATFORM
==
"x86"
]]
;
then
./premake5 gmake
--cc
=
clang
--build-freetype
--build-sqlite
--build-ikpmp3
else
./premake5 gmake
--cc
=
clang
--build-freetype
--build-sqlite
--no-use-irrklang
fi
./premake5 gmake
--cc
=
clang
--build-freetype
--build-sqlite
cd
build
make
config
=
release
-j4
...
...
.gitlab-ci.yml
View file @
8d44a578
...
...
@@ -131,6 +131,8 @@ mat_windows:
._exec_build
:
stage
:
build
variables
:
YGOPRO_NO_LUA_SAFE
:
'
1'
# on client no lua safe
cache
:
key
:
"
$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths
:
...
...
@@ -145,14 +147,11 @@ exec_windows:
-
mat_common
-
mat_irrklang
-
mat_windows
variables
:
irrklang_pro
:
'
1'
USE_IRRKLANG
:
"
1"
script
:
-
git submodule update --init
-
bash -c 'cp -rf premake/* .'
-
'
.\premake5.exe
vs2019
--irrklang-pro'
-
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
:
...
...
@@ -162,9 +161,6 @@ exec_linux:
extends
:
._exec_build
tags
:
-
linux
variables
:
YGOPRO_BUILD_ALL
:
'
1'
USE_IRRKLANG
:
"
1"
dependencies
:
-
mat_common
-
mat_irrklang
...
...
@@ -206,7 +202,8 @@ exec_macos_platform_x86:
-
mat_common
-
mat_macos_platform_x86
variables
:
TARGET_ARCH
:
x86
TARGET_PLATFORM
:
x86
BUILD_IKPMP3
:
'
1'
exec_macos_platform_m1
:
extends
:
._exec_macos_platform
...
...
@@ -215,7 +212,9 @@ exec_macos_platform_m1:
-
mat_common
-
mat_macos_platform_m1
variables
:
TARGET_ARCH
:
m1
TARGET_PLATFORM
:
m1
MAC_ARM
:
'
1'
NO_USE_IRRKLANG
:
'
1'
exec_macos
:
stage
:
combine
...
...
gframe/deck_con.cpp
View file @
8d44a578
...
...
@@ -1766,7 +1766,7 @@ bool DeckBuilder::push_main(code_pointer pointer, int seq) {
if
(
pointer
->
second
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
return
false
;
auto
&
container
=
deckManager
.
current_deck
.
main
;
int
maxc
=
mainGame
->
is_siding
?
64
:
60
;
int
maxc
=
mainGame
->
is_siding
?
YGOPRO_MAX_DECK
+
5
:
YGOPRO_MAX_DECK
;
if
((
int
)
container
.
size
()
>=
maxc
)
return
false
;
if
(
seq
>=
0
&&
seq
<
(
int
)
container
.
size
())
...
...
@@ -1781,7 +1781,7 @@ bool DeckBuilder::push_extra(code_pointer pointer, int seq) {
if
(
!
(
pointer
->
second
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
)))
return
false
;
auto
&
container
=
deckManager
.
current_deck
.
extra
;
int
maxc
=
mainGame
->
is_siding
?
20
:
15
;
int
maxc
=
mainGame
->
is_siding
?
YGOPRO_MAX_EXTRA
+
5
:
YGOPRO_MAX_EXTRA
;
if
((
int
)
container
.
size
()
>=
maxc
)
return
false
;
if
(
seq
>=
0
&&
seq
<
(
int
)
container
.
size
())
...
...
@@ -1794,7 +1794,7 @@ bool DeckBuilder::push_extra(code_pointer pointer, int seq) {
}
bool
DeckBuilder
::
push_side
(
code_pointer
pointer
,
int
seq
)
{
auto
&
container
=
deckManager
.
current_deck
.
side
;
int
maxc
=
mainGame
->
is_siding
?
20
:
15
;
int
maxc
=
mainGame
->
is_siding
?
YGOPRO_MAX_SIDE
+
5
:
YGOPRO_MAX_SIDE
;
if
((
int
)
container
.
size
()
>=
maxc
)
return
false
;
if
(
seq
>=
0
&&
seq
<
(
int
)
container
.
size
())
...
...
gframe/deck_manager.cpp
View file @
8d44a578
...
...
@@ -89,11 +89,11 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, int rule) {
if
(
!
list
)
return
0
;
int
dc
=
0
;
if
(
deck
.
main
.
size
()
<
40
||
deck
.
main
.
size
()
>
60
)
if
(
deck
.
main
.
size
()
<
YGOPRO_MMIN_DECK
||
deck
.
main
.
size
()
>
YGOPRO_MAX_DECK
)
return
(
DECKERROR_MAINCOUNT
<<
28
)
+
deck
.
main
.
size
();
if
(
deck
.
extra
.
size
()
>
15
)
if
(
deck
.
extra
.
size
()
>
YGOPRO_MAX_EXTRA
)
return
(
DECKERROR_EXTRACOUNT
<<
28
)
+
deck
.
extra
.
size
();
if
(
deck
.
side
.
size
()
>
15
)
if
(
deck
.
side
.
size
()
>
YGOPRO_MAX_SIDE
)
return
(
DECKERROR_SIDECOUNT
<<
28
)
+
deck
.
side
.
size
();
const
int
rule_map
[
6
]
=
{
AVAIL_OCG
,
AVAIL_TCG
,
AVAIL_SC
,
AVAIL_CUSTOM
,
AVAIL_OCGTCG
,
0
};
int
avail
=
rule_map
[
rule
];
...
...
@@ -157,10 +157,10 @@ int DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec) {
if
(
cd
.
type
&
TYPE_TOKEN
)
continue
;
else
if
(
cd
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
{
if
(
deck
.
extra
.
size
()
>=
15
)
if
(
deck
.
extra
.
size
()
>=
YGOPRO_MAX_EXTRA
)
continue
;
deck
.
extra
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
//verified by GetData()
}
else
if
(
deck
.
main
.
size
()
<
60
)
{
}
else
if
(
deck
.
main
.
size
()
<
YGOPRO_MAX_DECK
)
{
deck
.
main
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
}
}
...
...
@@ -172,7 +172,7 @@ int DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec) {
}
if
(
cd
.
type
&
TYPE_TOKEN
)
continue
;
if
(
deck
.
side
.
size
()
<
15
)
if
(
deck
.
side
.
size
()
<
YGOPRO_MAX_SIDE
)
deck
.
side
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
//verified by GetData()
}
return
errorcode
;
...
...
gframe/duelclient.cpp
View file @
8d44a578
...
...
@@ -539,7 +539,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
str
.
append
(
msgbuf
);
myswprintf
(
msgbuf
,
L"%ls%d
\n
"
,
dataManager
.
GetSysString
(
1233
),
pkt
->
info
.
draw_count
);
str
.
append
(
msgbuf
);
if
(
pkt
->
info
.
duel_rule
!=
DEFAULT_DUEL_RULE
)
{
if
(
pkt
->
info
.
duel_rule
!=
YGOPRO_
DEFAULT_DUEL_RULE
)
{
myswprintf
(
msgbuf
,
L"*%ls
\n
"
,
dataManager
.
GetSysString
(
1260
+
pkt
->
info
.
duel_rule
-
1
));
str
.
append
(
msgbuf
);
}
...
...
@@ -4326,7 +4326,7 @@ void DuelClient::BroadcastReply(evutil_socket_t fd, short events, void * arg) {
hoststr
.
append
(
L"]["
);
if
(
pHP
->
host
.
draw_count
==
1
&&
pHP
->
host
.
start_hand
==
5
&&
pHP
->
host
.
start_lp
==
8000
&&
!
pHP
->
host
.
no_check_deck
&&
!
pHP
->
host
.
no_shuffle_deck
&&
pHP
->
host
.
duel_rule
==
DEFAULT_DUEL_RULE
)
&&
pHP
->
host
.
duel_rule
==
YGOPRO_
DEFAULT_DUEL_RULE
)
hoststr
.
append
(
dataManager
.
GetSysString
(
1247
));
else
hoststr
.
append
(
dataManager
.
GetSysString
(
1248
));
hoststr
.
append
(
L"]"
);
...
...
gframe/game.cpp
View file @
8d44a578
...
...
@@ -1408,7 +1408,7 @@ bool Game::LoadConfigFromFile(const char* file) {
}
else
if
(
!
strcmp
(
strbuf
,
"default_rule"
))
{
gameConf
.
default_rule
=
atoi
(
valbuf
);
if
(
gameConf
.
default_rule
<=
0
)
gameConf
.
default_rule
=
DEFAULT_DUEL_RULE
;
gameConf
.
default_rule
=
YGOPRO_
DEFAULT_DUEL_RULE
;
}
else
if
(
!
strcmp
(
strbuf
,
"hide_setname"
))
{
gameConf
.
hide_setname
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"hide_hint_button"
))
{
...
...
@@ -1517,7 +1517,7 @@ void Game::LoadConfig() {
gameConf
.
chkIgnore2
=
0
;
gameConf
.
use_lflist
=
1
;
gameConf
.
default_lflist
=
0
;
gameConf
.
default_rule
=
DEFAULT_DUEL_RULE
;
gameConf
.
default_rule
=
YGOPRO_
DEFAULT_DUEL_RULE
;
gameConf
.
hide_setname
=
0
;
gameConf
.
hide_hint_button
=
0
;
gameConf
.
control_mode
=
0
;
...
...
@@ -1651,7 +1651,7 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"mute_spectators = %d
\n
"
,
(
chkIgnore2
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"use_lflist = %d
\n
"
,
gameConf
.
use_lflist
);
fprintf
(
fp
,
"default_lflist = %d
\n
"
,
gameConf
.
default_lflist
);
fprintf
(
fp
,
"default_rule = %d
\n
"
,
gameConf
.
default_rule
==
DEFAULT_DUEL_RULE
?
0
:
gameConf
.
default_rule
);
fprintf
(
fp
,
"default_rule = %d
\n
"
,
gameConf
.
default_rule
==
YGOPRO_
DEFAULT_DUEL_RULE
?
0
:
gameConf
.
default_rule
);
fprintf
(
fp
,
"hide_setname = %d
\n
"
,
gameConf
.
hide_setname
);
fprintf
(
fp
,
"hide_hint_button = %d
\n
"
,
gameConf
.
hide_hint_button
);
fprintf
(
fp
,
"#control_mode = 0: Key A/S/D/R Chain Buttons. control_mode = 1: MouseLeft/MouseRight/NULL/F9 Without Chain Buttons
\n
"
);
...
...
gframe/game.h
View file @
8d44a578
...
...
@@ -864,8 +864,24 @@ extern Game* mainGame;
#define AVAIL_SC 0x8
#define AVAIL_OCGTCG (AVAIL_OCG|AVAIL_TCG)
#ifndef DEFAULT_DUEL_RULE
#define DEFAULT_DUEL_RULE 5
#ifndef YGOPRO_DEFAULT_DUEL_RULE
#define YGOPRO_DEFAULT_DUEL_RULE 5
#endif
#ifndef YGOPRO_MAX_DECK
#define YGOPRO_MAX_DECK 60
#endif
#ifndef YGOPRO_MMIN_DECK
#define YGOPRO_MMIN_DECK 40
#endif
#ifndef YGOPRO_MAX_EXTRA
#define YGOPRO_MAX_EXTRA 15
#endif
#ifndef YGOPRO_MAX_SIDE
#define YGOPRO_MAX_SIDE 15
#endif
#define CARD_ARTWORK_VERSIONS_OFFSET 10
...
...
gframe/premake4.lua
deleted
100644 → 0
View file @
7133f918
include
"lzma/."
include
"spmemvfs/."
project
"ygopro"
kind
"WindowedApp"
files
{
"**.cpp"
,
"**.cc"
,
"**.c"
,
"**.h"
}
excludes
{
"lzma/**"
,
"spmemvfs/**"
}
includedirs
{
"../ocgcore"
,
"../irrlicht/include"
}
links
{
"ocgcore"
,
"clzma"
,
"cspmemvfs"
,
"Irrlicht"
,
"sqlite3"
,
"freetype"
,
"event"
}
if
USE_IRRKLANG
then
defines
{
"YGOPRO_USE_IRRKLANG"
}
links
{
"ikpmp3"
}
includedirs
{
"../irrklang/include"
}
if
IRRKLANG_PRO
then
defines
{
"IRRKLANG_STATIC"
}
end
end
if
os.getenv
(
"YGOPRO_COMPAT_MYCARD"
)
then
defines
{
"YGOPRO_COMPAT_MYCARD"
}
end
if
os.getenv
(
"YGOPRO_MESSAGE_DEBUG"
)
then
defines
{
"YGOPRO_MESSAGE_DEBUG"
}
end
local
mr
=
os.getenv
(
"YGOPRO_DEFAULT_DUEL_RULE"
)
if
mr
and
tonumber
(
mr
)
then
defines
{
"DEFAULT_DUEL_RULE="
..
tonumber
(
mr
)
}
end
configuration
"windows"
files
"ygopro.rc"
excludes
"CGUIButton.cpp"
includedirs
{
"../freetype/include"
,
"../event/include"
,
"../sqlite3"
}
links
{
"lua"
}
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
if
USE_IRRKLANG
then
links
{
"irrKlang"
}
if
not
IRRKLANG_PRO
then
libdirs
{
"../irrklang/lib/Win32-visualStudio"
}
end
end
links
{
"opengl32"
,
"ws2_32"
,
"winmm"
,
"gdi32"
,
"kernel32"
,
"user32"
,
"imm32"
}
if
IRRKLANG_PRO
then
configuration
{
"windows"
,
"not vs2017"
,
"not vs2019"
}
libdirs
{
"../irrklang/lib/Win32-visualStudio"
}
configuration
{
"windows"
,
"vs2017"
}
libdirs
{
"../irrklang/lib/Win32-vs2017"
}
configuration
{
"windows"
,
"vs2019"
}
libdirs
{
"../irrklang/lib/Win32-vs2019"
}
end
configuration
{
"windows"
,
"not vs*"
}
includedirs
{
"/mingw/include/irrlicht"
,
"/mingw/include/freetype2"
}
configuration
"not vs*"
buildoptions
{
"-std=c++14"
,
"-fno-rtti"
}
configuration
"not windows"
excludes
{
"COSOperator.*"
}
links
{
"dl"
,
"pthread"
}
if
LIBEVENT_ROOT
then
includedirs
{
LIBEVENT_ROOT
..
"/include"
}
libdirs
{
LIBEVENT_ROOT
..
"/lib/"
}
end
links
{
"event_pthreads"
}
if
BUILD_SQLITE
then
includedirs
{
"../sqlite3"
}
end
if
BUILD_FREETYPE
then
includedirs
{
"../freetype/include"
}
else
includedirs
{
"/usr/include/freetype2"
}
end
configuration
{
"not windows"
,
"not macosx"
}
links
"GL"
configuration
"linux"
linkoptions
{
"-static-libstdc++"
,
"-static-libgcc"
,
"-Wl,-rpath=./lib/"
}
if
BUILD_LUA
then
links
{
"lua"
}
else
links
{
"lua5.3-c++"
}
end
links
{
"X11"
,
"Xxf86vm"
}
if
USE_IRRKLANG
then
links
{
"IrrKlang"
}
libdirs
{
"../irrklang/bin/linux-gcc-64"
}
end
configuration
"macosx"
links
{
"lua"
,
"z"
}
libdirs
{
"../irrlicht"
}
if
MAC_ARM
then
buildoptions
{
"--target=arm64-apple-macos11"
}
linkoptions
{
"-arch arm64"
}
end
if
USE_IRRKLANG
then
links
{
"irrklang"
}
libdirs
{
"../irrklang/bin/macosx-gcc"
}
end
premake5.lua
View file @
8d44a578
...
...
@@ -57,7 +57,7 @@ boolOptions = {
"compat-mycard"
,
"no-lua-safe"
,
"message-debug"
,
"default-rule"
,
"default-
duel-
rule"
,
}
for
_
,
boolOption
in
ipairs
(
boolOptions
)
do
...
...
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