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
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
MyCard
ygopro
Commits
3014b62d
Commit
3014b62d
authored
May 26, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'patch-event-2.1.12-win' of
https://github.com/mercury233/ygopro
into develop
parents
2d447dc3
47859b49
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
86 additions
and
24 deletions
+86
-24
.github/workflows/build.yml
.github/workflows/build.yml
+0
-1
gframe/drawing.cpp
gframe/drawing.cpp
+4
-0
gframe/image_manager.cpp
gframe/image_manager.cpp
+40
-0
gframe/image_manager.h
gframe/image_manager.h
+5
-5
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+10
-9
gframe/menu_handler.h
gframe/menu_handler.h
+2
-1
gframe/premake5.lua
gframe/premake5.lua
+1
-1
gframe/replay.cpp
gframe/replay.cpp
+5
-1
gframe/replay.h
gframe/replay.h
+1
-0
gframe/replay_mode.h
gframe/replay_mode.h
+0
-1
premake/event/premake5.lua
premake/event/premake5.lua
+7
-2
premake5.lua
premake5.lua
+11
-3
No files found.
.github/workflows/build.yml
View file @
3014b62d
...
@@ -56,7 +56,6 @@ jobs:
...
@@ -56,7 +56,6 @@ jobs:
run
:
|
run
:
|
tar xf ${{ steps.libevent.outputs.filepath }}
tar xf ${{ steps.libevent.outputs.filepath }}
move libevent-2.1.12-stable event
move libevent-2.1.12-stable event
xcopy /E event\WIN32-Code event\include
-
name
:
Download freetype
-
name
:
Download freetype
id
:
freetype
id
:
freetype
...
...
gframe/drawing.cpp
View file @
3014b62d
...
@@ -1262,7 +1262,11 @@ void Game::DrawDeckBd() {
...
@@ -1262,7 +1262,11 @@ void Game::DrawDeckBd() {
driver
->
draw2DRectangle
(
Resize
(
805
,
160
,
1020
,
630
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangle
(
Resize
(
805
,
160
,
1020
,
630
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
804
,
159
,
1020
,
630
));
driver
->
draw2DRectangleOutline
(
Resize
(
804
,
159
,
1020
,
630
));
}
}
<<<<<<<
HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>>
47859
b49df470c09130a8ed4cb9922ab8036c538
constexpr
int
MAX_RESULT
=
9
;
constexpr
int
MAX_RESULT
=
9
;
#else
#else
constexpr
int
MAX_RESULT
=
7
;
constexpr
int
MAX_RESULT
=
7
;
...
...
gframe/image_manager.cpp
View file @
3014b62d
#include "image_manager.h"
#include "image_manager.h"
#include "game.h"
#include "game.h"
<<<<<<<
HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>>
47859
b49df470c09130a8ed4cb9922ab8036c538
#include <thread>
#include <thread>
#endif
#endif
#ifdef _OPENMP
#ifdef _OPENMP
...
@@ -22,7 +26,11 @@ bool ImageManager::Initial() {
...
@@ -22,7 +26,11 @@ bool ImageManager::Initial() {
tUnknownFit
=
nullptr
;
tUnknownFit
=
nullptr
;
tUnknownThumb
=
nullptr
;
tUnknownThumb
=
nullptr
;
tBigPicture
=
nullptr
;
tBigPicture
=
nullptr
;
<<<<<<<
HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>>
47859
b49df470c09130a8ed4cb9922ab8036c538
tLoading
=
nullptr
;
tLoading
=
nullptr
;
tThumbLoadingThreadRunning
=
false
;
tThumbLoadingThreadRunning
=
false
;
#endif
#endif
...
@@ -66,7 +74,11 @@ void ImageManager::ClearTexture() {
...
@@ -66,7 +74,11 @@ void ImageManager::ClearTexture() {
driver
->
removeTexture
(
tit
->
second
);
driver
->
removeTexture
(
tit
->
second
);
}
}
for
(
auto
tit
=
tThumb
.
begin
();
tit
!=
tThumb
.
end
();
++
tit
)
{
for
(
auto
tit
=
tThumb
.
begin
();
tit
!=
tThumb
.
end
();
++
tit
)
{
<<<<<<<
HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>>
47859
b49df470c09130a8ed4cb9922ab8036c538
if
(
tit
->
second
&&
tit
->
second
!=
tLoading
)
if
(
tit
->
second
&&
tit
->
second
!=
tLoading
)
#else
#else
if
(
tit
->
second
)
if
(
tit
->
second
)
...
@@ -80,7 +92,11 @@ void ImageManager::ClearTexture() {
...
@@ -80,7 +92,11 @@ void ImageManager::ClearTexture() {
tMap
[
0
].
clear
();
tMap
[
0
].
clear
();
tMap
[
1
].
clear
();
tMap
[
1
].
clear
();
tThumb
.
clear
();
tThumb
.
clear
();
<<<<<<<
HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>>
47859
b49df470c09130a8ed4cb9922ab8036c538
tThumbLoadingMutex
.
lock
();
tThumbLoadingMutex
.
lock
();
tThumbLoading
.
clear
();
tThumbLoading
.
clear
();
while
(
!
tThumbLoadingCodes
.
empty
())
while
(
!
tThumbLoadingCodes
.
empty
())
...
@@ -123,7 +139,11 @@ void ImageManager::ResizeTexture() {
...
@@ -123,7 +139,11 @@ void ImageManager::ResizeTexture() {
driver
->
removeTexture
(
tUnknown
);
driver
->
removeTexture
(
tUnknown
);
driver
->
removeTexture
(
tUnknownFit
);
driver
->
removeTexture
(
tUnknownFit
);
driver
->
removeTexture
(
tUnknownThumb
);
driver
->
removeTexture
(
tUnknownThumb
);
<<<<<<<
HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>>
47859
b49df470c09130a8ed4cb9922ab8036c538
driver
->
removeTexture
(
tLoading
);
driver
->
removeTexture
(
tLoading
);
tLoading
=
GetTextureFromFile
(
"textures/cover.jpg"
,
imgWidthThumb
,
imgHeightThumb
);
tLoading
=
GetTextureFromFile
(
"textures/cover.jpg"
,
imgWidthThumb
,
imgHeightThumb
);
#endif
#endif
...
@@ -298,7 +318,11 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
...
@@ -298,7 +318,11 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
tBigPicture
=
texture
;
tBigPicture
=
texture
;
return
texture
;
return
texture
;
}
}
<<<<<<<
HEAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
#ifdef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#ifdef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>>
47859
b49df470c09130a8ed4cb9922ab8036c538
int
ImageManager
::
LoadThumbThread
()
{
int
ImageManager
::
LoadThumbThread
()
{
while
(
true
)
{
while
(
true
)
{
imageManager
.
tThumbLoadingMutex
.
lock
();
imageManager
.
tThumbLoadingMutex
.
lock
();
...
@@ -354,11 +378,19 @@ int ImageManager::LoadThumbThread() {
...
@@ -354,11 +378,19 @@ int ImageManager::LoadThumbThread() {
imageManager
.
tThumbLoadingMutex
.
unlock
();
imageManager
.
tThumbLoadingMutex
.
unlock
();
return
0
;
return
0
;
}
}
<<<<<<<
HEAD
#endif // YGOPRO_USE_THUMB_LOAD_THERAD
#endif // YGOPRO_USE_THUMB_LOAD_THERAD
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureThumb
(
int
code
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureThumb
(
int
code
)
{
if
(
code
==
0
)
if
(
code
==
0
)
return
tUnknownThumb
;
return
tUnknownThumb
;
#ifndef YGOPRO_USE_THUMB_LOAD_THERAD
#ifndef YGOPRO_USE_THUMB_LOAD_THERAD
=======
#endif // YGOPRO_USE_THUMB_LOAD_THREAD
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureThumb
(
int
code
)
{
if
(
code
==
0
)
return
tUnknownThumb
;
#ifndef YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>>
47859
b49df470c09130a8ed4cb9922ab8036c538
auto
tit
=
tThumb
.
find
(
code
);
auto
tit
=
tThumb
.
find
(
code
);
if
(
tit
==
tThumb
.
end
())
{
if
(
tit
==
tThumb
.
end
())
{
char
file
[
256
];
char
file
[
256
];
...
@@ -381,7 +413,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -381,7 +413,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
tThumb
[
code
]
=
img
;
tThumb
[
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknownThumb
:
img
;
return
(
img
==
NULL
)
?
tUnknownThumb
:
img
;
}
}
<<<<<<<
HEAD
#else // YGOPRO_USE_THUMB_LOAD_THERAD
#else // YGOPRO_USE_THUMB_LOAD_THERAD
=======
#else // YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>>
47859
b49df470c09130a8ed4cb9922ab8036c538
imageManager
.
tThumbLoadingMutex
.
lock
();
imageManager
.
tThumbLoadingMutex
.
lock
();
auto
lit
=
tThumbLoading
.
find
(
code
);
auto
lit
=
tThumbLoading
.
find
(
code
);
if
(
lit
!=
tThumbLoading
.
end
())
{
if
(
lit
!=
tThumbLoading
.
end
())
{
...
@@ -409,7 +445,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -409,7 +445,11 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
imageManager
.
tThumbLoadingMutex
.
unlock
();
imageManager
.
tThumbLoadingMutex
.
unlock
();
return
tLoading
;
return
tLoading
;
}
}
<<<<<<<
HEAD
#endif // YGOPRO_USE_THUMB_LOAD_THERAD
#endif // YGOPRO_USE_THUMB_LOAD_THERAD
=======
#endif // YGOPRO_USE_THUMB_LOAD_THREAD
>>>>>>>
47859
b49df470c09130a8ed4cb9922ab8036c538
if
(
tit
->
second
)
if
(
tit
->
second
)
return
tit
->
second
;
return
tit
->
second
;
else
else
...
...
gframe/image_manager.h
View file @
3014b62d
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
#define IMAGEMANAGER_H
#define IMAGEMANAGER_H
#ifndef _OPENMP
#ifndef _OPENMP
#define YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#define YGOPRO_USE_THUMB_LOAD_TH
RE
AD
#endif
#endif
#include "config.h"
#include "config.h"
#include "data_manager.h"
#include "data_manager.h"
#include <unordered_map>
#include <unordered_map>
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
#include <queue>
#include <queue>
#include <mutex>
#include <mutex>
#endif
#endif
...
@@ -27,14 +27,14 @@ public:
...
@@ -27,14 +27,14 @@ public:
irr
::
video
::
ITexture
*
GetBigPicture
(
int
code
,
float
zoom
);
irr
::
video
::
ITexture
*
GetBigPicture
(
int
code
,
float
zoom
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureThumb
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
irr
::
video
::
ITexture
*
GetTextureField
(
int
code
);
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
static
int
LoadThumbThread
();
static
int
LoadThumbThread
();
#endif
#endif
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tMap
[
2
];
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tMap
[
2
];
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tThumb
;
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tThumb
;
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tFields
;
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tFields
;
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
std
::
unordered_map
<
int
,
irr
::
video
::
IImage
*>
tThumbLoading
;
std
::
unordered_map
<
int
,
irr
::
video
::
IImage
*>
tThumbLoading
;
std
::
queue
<
int
>
tThumbLoadingCodes
;
std
::
queue
<
int
>
tThumbLoadingCodes
;
std
::
mutex
tThumbLoadingMutex
;
std
::
mutex
tThumbLoadingMutex
;
...
@@ -47,7 +47,7 @@ public:
...
@@ -47,7 +47,7 @@ public:
irr
::
video
::
ITexture
*
tUnknownFit
;
irr
::
video
::
ITexture
*
tUnknownFit
;
irr
::
video
::
ITexture
*
tUnknownThumb
;
irr
::
video
::
ITexture
*
tUnknownThumb
;
irr
::
video
::
ITexture
*
tBigPicture
;
irr
::
video
::
ITexture
*
tBigPicture
;
#ifdef YGOPRO_USE_THUMB_LOAD_TH
ER
AD
#ifdef YGOPRO_USE_THUMB_LOAD_TH
RE
AD
irr
::
video
::
ITexture
*
tLoading
;
irr
::
video
::
ITexture
*
tLoading
;
#endif
#endif
irr
::
video
::
ITexture
*
tAct
;
irr
::
video
::
ITexture
*
tAct
;
...
...
gframe/menu_handler.cpp
View file @
3014b62d
...
@@ -232,6 +232,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -232,6 +232,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
break
;
}
}
case
BUTTON_LOAD_REPLAY
:
{
case
BUTTON_LOAD_REPLAY
:
{
int
start_turn
=
1
;
if
(
open_file
)
{
if
(
open_file
)
{
ReplayMode
::
cur_replay
.
OpenReplay
(
open_file_name
);
ReplayMode
::
cur_replay
.
OpenReplay
(
open_file_name
);
open_file
=
false
;
open_file
=
false
;
...
@@ -243,6 +244,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -243,6 +244,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
myswprintf
(
replay_path
,
L"./replay/%ls"
,
mainGame
->
lstReplayList
->
getListItem
(
selected
));
myswprintf
(
replay_path
,
L"./replay/%ls"
,
mainGame
->
lstReplayList
->
getListItem
(
selected
));
if
(
!
ReplayMode
::
cur_replay
.
OpenReplay
(
replay_path
))
if
(
!
ReplayMode
::
cur_replay
.
OpenReplay
(
replay_path
))
break
;
break
;
start_turn
=
std
::
wcstol
(
mainGame
->
ebRepStartTurn
->
getText
(),
nullptr
,
10
);
}
}
mainGame
->
ClearCardInfo
();
mainGame
->
ClearCardInfo
();
mainGame
->
wCardImg
->
setVisible
(
true
);
mainGame
->
wCardImg
->
setVisible
(
true
);
...
@@ -257,7 +259,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -257,7 +259,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
dField
.
Clear
();
mainGame
->
dField
.
Clear
();
mainGame
->
HideElement
(
mainGame
->
wReplay
);
mainGame
->
HideElement
(
mainGame
->
wReplay
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
dField
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
dField
);
unsigned
int
start_turn
=
std
::
wcstol
(
mainGame
->
ebRepStartTurn
->
getText
(),
nullptr
,
10
);
if
(
start_turn
==
1
)
if
(
start_turn
==
1
)
start_turn
=
0
;
start_turn
=
0
;
ReplayMode
::
StartReplay
(
start_turn
);
ReplayMode
::
StartReplay
(
start_turn
);
...
@@ -526,27 +527,27 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -526,27 +527,27 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
break
;
wchar_t
replay_path
[
256
]{};
wchar_t
replay_path
[
256
]{};
myswprintf
(
replay_path
,
L"./replay/%ls"
,
mainGame
->
lstReplayList
->
getListItem
(
sel
));
myswprintf
(
replay_path
,
L"./replay/%ls"
,
mainGame
->
lstReplayList
->
getListItem
(
sel
));
if
(
!
ReplayMode
::
cur
_replay
.
OpenReplay
(
replay_path
))
{
if
(
!
temp
_replay
.
OpenReplay
(
replay_path
))
{
mainGame
->
stReplayInfo
->
setText
(
L"Error"
);
mainGame
->
stReplayInfo
->
setText
(
L"Error"
);
break
;
break
;
}
}
wchar_t
infobuf
[
256
]{};
wchar_t
infobuf
[
256
]{};
std
::
wstring
repinfo
;
std
::
wstring
repinfo
;
time_t
curtime
;
time_t
curtime
;
if
(
ReplayMode
::
cur
_replay
.
pheader
.
flag
&
REPLAY_UNIFORM
)
if
(
temp
_replay
.
pheader
.
flag
&
REPLAY_UNIFORM
)
curtime
=
ReplayMode
::
cur
_replay
.
pheader
.
start_time
;
curtime
=
temp
_replay
.
pheader
.
start_time
;
else
else
curtime
=
ReplayMode
::
cur
_replay
.
pheader
.
seed
;
curtime
=
temp
_replay
.
pheader
.
seed
;
std
::
wcsftime
(
infobuf
,
sizeof
infobuf
/
sizeof
infobuf
[
0
],
L"%Y/%m/%d %H:%M:%S
\n
"
,
std
::
localtime
(
&
curtime
));
std
::
wcsftime
(
infobuf
,
sizeof
infobuf
/
sizeof
infobuf
[
0
],
L"%Y/%m/%d %H:%M:%S
\n
"
,
std
::
localtime
(
&
curtime
));
repinfo
.
append
(
infobuf
);
repinfo
.
append
(
infobuf
);
if
(
ReplayMode
::
cur
_replay
.
pheader
.
flag
&
REPLAY_SINGLE_MODE
)
{
if
(
temp
_replay
.
pheader
.
flag
&
REPLAY_SINGLE_MODE
)
{
wchar_t
path
[
256
]{};
wchar_t
path
[
256
]{};
BufferIO
::
DecodeUTF8
(
ReplayMode
::
cur
_replay
.
script_name
.
c_str
(),
path
);
BufferIO
::
DecodeUTF8
(
temp
_replay
.
script_name
.
c_str
(),
path
);
repinfo
.
append
(
path
);
repinfo
.
append
(
path
);
repinfo
.
append
(
L"
\n
"
);
repinfo
.
append
(
L"
\n
"
);
}
}
const
auto
&
player_names
=
ReplayMode
::
cur
_replay
.
players
;
const
auto
&
player_names
=
temp
_replay
.
players
;
if
(
ReplayMode
::
cur
_replay
.
pheader
.
flag
&
REPLAY_TAG
)
if
(
temp
_replay
.
pheader
.
flag
&
REPLAY_TAG
)
myswprintf
(
infobuf
,
L"%ls
\n
%ls
\n
===VS===
\n
%ls
\n
%ls
\n
"
,
player_names
[
0
].
c_str
(),
player_names
[
1
].
c_str
(),
player_names
[
2
].
c_str
(),
player_names
[
3
].
c_str
());
myswprintf
(
infobuf
,
L"%ls
\n
%ls
\n
===VS===
\n
%ls
\n
%ls
\n
"
,
player_names
[
0
].
c_str
(),
player_names
[
1
].
c_str
(),
player_names
[
2
].
c_str
(),
player_names
[
3
].
c_str
());
else
else
myswprintf
(
infobuf
,
L"%ls
\n
===VS===
\n
%ls
\n
"
,
player_names
[
0
].
c_str
(),
player_names
[
1
].
c_str
());
myswprintf
(
infobuf
,
L"%ls
\n
===VS===
\n
%ls
\n
"
,
player_names
[
0
].
c_str
(),
player_names
[
1
].
c_str
());
...
...
gframe/menu_handler.h
View file @
3014b62d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#define MENU_HANDLER_H
#define MENU_HANDLER_H
#include <irrlicht.h>
#include <irrlicht.h>
#include "replay.h"
namespace
ygo
{
namespace
ygo
{
...
@@ -10,7 +11,7 @@ public:
...
@@ -10,7 +11,7 @@ public:
bool
OnEvent
(
const
irr
::
SEvent
&
event
)
override
;
bool
OnEvent
(
const
irr
::
SEvent
&
event
)
override
;
irr
::
s32
prev_operation
{
0
};
irr
::
s32
prev_operation
{
0
};
int
prev_sel
{
-
1
};
int
prev_sel
{
-
1
};
Replay
temp_replay
;
};
};
}
}
...
...
gframe/premake5.lua
View file @
3014b62d
...
@@ -69,7 +69,7 @@ project "YGOPro"
...
@@ -69,7 +69,7 @@ project "YGOPro"
filter
"system:windows"
filter
"system:windows"
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
files
"ygopro.rc"
files
"ygopro.rc"
links
{
"opengl32"
,
"ws2_32"
,
"winmm"
,
"gdi32"
,
"kernel32"
,
"user32"
,
"imm32"
}
links
{
"opengl32"
,
"ws2_32"
,
"winmm"
,
"gdi32"
,
"kernel32"
,
"user32"
,
"imm32"
,
"iphlpapi"
}
if
USE_AUDIO
and
AUDIO_LIB
==
"irrklang"
then
if
USE_AUDIO
and
AUDIO_LIB
==
"irrklang"
then
links
{
"irrKlang"
}
links
{
"irrKlang"
}
if
IRRKLANG_PRO
then
if
IRRKLANG_PRO
then
...
...
gframe/replay.cpp
View file @
3014b62d
...
@@ -227,7 +227,11 @@ void Replay::Reset() {
...
@@ -227,7 +227,11 @@ void Replay::Reset() {
script_name
.
clear
();
script_name
.
clear
();
}
}
void
Replay
::
SkipInfo
(){
void
Replay
::
SkipInfo
(){
data_position
+=
info_offset
;
if
(
data_position
==
0
)
data_position
+=
info_offset
;
}
bool
Replay
::
IsReplaying
()
const
{
return
is_replaying
;
}
}
bool
Replay
::
ReadInfo
()
{
bool
Replay
::
ReadInfo
()
{
int
player_count
=
(
pheader
.
flag
&
REPLAY_TAG
)
?
4
:
2
;
int
player_count
=
(
pheader
.
flag
&
REPLAY_TAG
)
?
4
:
2
;
...
...
gframe/replay.h
View file @
3014b62d
...
@@ -81,6 +81,7 @@ public:
...
@@ -81,6 +81,7 @@ public:
void
Rewind
();
void
Rewind
();
void
Reset
();
void
Reset
();
void
SkipInfo
();
void
SkipInfo
();
bool
IsReplaying
()
const
;
FILE
*
fp
{
nullptr
};
FILE
*
fp
{
nullptr
};
#ifdef _WIN32
#ifdef _WIN32
...
...
gframe/replay_mode.h
View file @
3014b62d
...
@@ -25,7 +25,6 @@ private:
...
@@ -25,7 +25,6 @@ private:
public:
public:
static
Replay
cur_replay
;
static
Replay
cur_replay
;
public:
static
bool
StartReplay
(
int
skipturn
);
static
bool
StartReplay
(
int
skipturn
);
static
void
StopReplay
(
bool
is_exiting
=
false
);
static
void
StopReplay
(
bool
is_exiting
=
false
);
static
void
SwapField
();
static
void
SwapField
();
...
...
premake/event/premake5.lua
View file @
3014b62d
...
@@ -8,7 +8,12 @@ project "event"
...
@@ -8,7 +8,12 @@ project "event"
"evmap.c"
,
"log.c"
,
"evutil.c"
,
"evutil_rand.c"
,
"strlcpy.c"
,
"signal.c"
,
"evmap.c"
,
"log.c"
,
"evutil.c"
,
"evutil_rand.c"
,
"strlcpy.c"
,
"signal.c"
,
"event_tagging.c"
,
"http.c"
,
"evdns.c"
,
"evrpc.c"
}
"event_tagging.c"
,
"http.c"
,
"evdns.c"
,
"evrpc.c"
}
if
os
.
isfile
(
"evutil_time.c"
)
then
files
{
"evutil_time.c"
}
end
filter
"system:windows"
filter
"system:windows"
prebuildcommands
{
"xcopy /E /Y $(ProjectDir)..\\event\\WIN32-Code $(ProjectDir)..\\event\\include"
}
prebuildcommands
{
"xcopy /E /Y $(ProjectDir)..\\event\\WIN32-Code $(ProjectDir)..\\event\\include"
,
"xcopy /E /Y $(ProjectDir)..\\event\\WIN32-Code\\nmake $(ProjectDir)..\\event\\include"
}
files
{
"win32select.c"
,
"evthread_win32.c"
,
"buffer_iocp.c"
,
"event_iocp.c"
,
"bufferevent_async.c"
}
files
{
"win32select.c"
,
"evthread_win32.c"
,
"buffer_iocp.c"
,
"event_iocp.c"
,
"bufferevent_async.c"
}
defines
{
"
WIN32"
}
-- quirk of old libevent
defines
{
"
UINT32_MAX=0xffffffffui32"
}
-- quirk of libevent 2.1.2
premake5.lua
View file @
3014b62d
...
@@ -77,6 +77,14 @@ function GetParam(param)
...
@@ -77,6 +77,14 @@ function GetParam(param)
return
_OPTIONS
[
param
]
or
os.getenv
(
string.upper
(
string.gsub
(
param
,
"-"
,
"_"
)))
return
_OPTIONS
[
param
]
or
os.getenv
(
string.upper
(
string.gsub
(
param
,
"-"
,
"_"
)))
end
end
function
FindHeaderWithSubDir
(
header
,
subdir
)
local
result
=
os
.
findheader
(
header
)
if
result
and
subdir
then
result
=
path
.
join
(
result
,
subdir
)
end
return
result
end
if
GetParam
(
"build-lua"
)
then
if
GetParam
(
"build-lua"
)
then
BUILD_LUA
=
true
BUILD_LUA
=
true
elseif
GetParam
(
"no-build-lua"
)
then
elseif
GetParam
(
"no-build-lua"
)
then
...
@@ -106,7 +114,7 @@ elseif GetParam("no-build-freetype") then
...
@@ -106,7 +114,7 @@ elseif GetParam("no-build-freetype") then
BUILD_FREETYPE
=
false
BUILD_FREETYPE
=
false
end
end
if
not
BUILD_FREETYPE
then
if
not
BUILD_FREETYPE
then
FREETYPE_INCLUDE_DIR
=
GetParam
(
"freetype-include-dir"
)
or
os
.
findheader
(
"freetype2/ft2build.h"
)
..
"/freetype2"
FREETYPE_INCLUDE_DIR
=
GetParam
(
"freetype-include-dir"
)
or
FindHeaderWithSubDir
(
"freetype2/ft2build.h"
,
"freetype2"
)
FREETYPE_LIB_DIR
=
GetParam
(
"freetype-lib-dir"
)
or
os
.
findlib
(
"freetype"
)
FREETYPE_LIB_DIR
=
GetParam
(
"freetype-lib-dir"
)
or
os
.
findlib
(
"freetype"
)
end
end
...
@@ -163,9 +171,9 @@ if USE_AUDIO then
...
@@ -163,9 +171,9 @@ if USE_AUDIO then
MINIAUDIO_BUILD_OPUS_VORBIS
=
true
MINIAUDIO_BUILD_OPUS_VORBIS
=
true
end
end
if
not
MINIAUDIO_BUILD_OPUS_VORBIS
then
if
not
MINIAUDIO_BUILD_OPUS_VORBIS
then
OPUS_INCLUDE_DIR
=
GetParam
(
"opus-include-dir"
)
or
os
.
findheader
(
"opus/opus.h"
)
..
"/opus"
OPUS_INCLUDE_DIR
=
GetParam
(
"opus-include-dir"
)
or
FindHeaderWithSubDir
(
"opus/opus.h"
,
"opus"
)
OPUS_LIB_DIR
=
GetParam
(
"opus-lib-dir"
)
or
os
.
findlib
(
"opus"
)
OPUS_LIB_DIR
=
GetParam
(
"opus-lib-dir"
)
or
os
.
findlib
(
"opus"
)
OPUSFILE_INCLUDE_DIR
=
GetParam
(
"opusfile-include-dir"
)
or
os
.
findheader
(
"opus/opusfile.h"
)
..
"/opus"
OPUSFILE_INCLUDE_DIR
=
GetParam
(
"opusfile-include-dir"
)
or
FindHeaderWithSubDir
(
"opus/opusfile.h"
,
"opus"
)
OPUSFILE_LIB_DIR
=
GetParam
(
"opusfile-lib-dir"
)
or
os
.
findlib
(
"opusfile"
)
OPUSFILE_LIB_DIR
=
GetParam
(
"opusfile-lib-dir"
)
or
os
.
findlib
(
"opusfile"
)
VORBIS_INCLUDE_DIR
=
GetParam
(
"vorbis-include-dir"
)
or
os
.
findheader
(
"vorbis/vorbisfile.h"
)
VORBIS_INCLUDE_DIR
=
GetParam
(
"vorbis-include-dir"
)
or
os
.
findheader
(
"vorbis/vorbisfile.h"
)
VORBIS_LIB_DIR
=
GetParam
(
"vorbis-lib-dir"
)
or
os
.
findlib
(
"vorbis"
)
VORBIS_LIB_DIR
=
GetParam
(
"vorbis-lib-dir"
)
or
os
.
findlib
(
"vorbis"
)
...
...
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