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
64786a9f
Commit
64786a9f
authored
Jan 29, 2026
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fh' into patch-image-1
parents
066527f7
89f52653
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
56 additions
and
103 deletions
+56
-103
gframe/client_field.cpp
gframe/client_field.cpp
+11
-16
gframe/data_manager.cpp
gframe/data_manager.cpp
+13
-10
gframe/data_manager.h
gframe/data_manager.h
+4
-0
gframe/deck_con.cpp
gframe/deck_con.cpp
+0
-2
gframe/event_handler.cpp
gframe/event_handler.cpp
+10
-14
gframe/game.cpp
gframe/game.cpp
+0
-3
gframe/game.h
gframe/game.h
+0
-1
gframe/image_manager.cpp
gframe/image_manager.cpp
+18
-56
gframe/image_manager.h
gframe/image_manager.h
+0
-1
No files found.
gframe/client_field.cpp
View file @
64786a9f
...
@@ -456,17 +456,15 @@ void ClientField::ShowSelectCard(bool buttonok, bool is_continuous) {
...
@@ -456,17 +456,15 @@ void ClientField::ShowSelectCard(bool buttonok, bool is_continuous) {
if
(
mainGame
->
dInfo
.
curMsg
!=
MSG_SORT_CARD
)
{
if
(
mainGame
->
dInfo
.
curMsg
!=
MSG_SORT_CARD
)
{
// text
// text
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
if
(
select_continuous
)
if
(
select_continuous
)
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
unknown_string
);
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
unknown_string
);
else
if
(
cant_check_grave
&&
selectable_cards
[
i
]
->
location
==
LOCATION_GRAVE
)
else
if
(
cant_check_grave
&&
selectable_cards
[
i
]
->
location
==
LOCATION_GRAVE
)
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
0
));
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
0
));
else
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
else
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
overlayTarget
->
location
,
selectable_cards
[
i
]
->
overlayTarget
->
sequence
),
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
overlayTarget
),
selectable_cards
[
i
]
->
overlayTarget
->
sequence
+
1
,
selectable_cards
[
i
]
->
sequence
+
1
);
selectable_cards
[
i
]
->
overlayTarget
->
sequence
+
1
,
selectable_cards
[
i
]
->
sequence
+
1
);
else
else
myswprintf
(
formatBuffer
,
L"%ls[%d]"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
selectable_cards
[
i
]
->
sequence
),
myswprintf
(
formatBuffer
,
L"%ls[%d]"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]),
selectable_cards
[
i
]
->
sequence
+
1
);
selectable_cards
[
i
]
->
sequence
+
1
);
mainGame
->
stCardPos
[
i
]
->
setText
(
formatBuffer
);
mainGame
->
stCardPos
[
i
]
->
setText
(
formatBuffer
);
// color
// color
if
(
selectable_cards
[
i
]
->
is_selected
)
if
(
selectable_cards
[
i
]
->
is_selected
)
...
@@ -542,8 +540,7 @@ void ClientField::ShowChainCard() {
...
@@ -542,8 +540,7 @@ void ClientField::ShowChainCard() {
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
myswprintf
(
formatBuffer
,
L"%ls[%d]"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
selectable_cards
[
i
]
->
sequence
),
myswprintf
(
formatBuffer
,
L"%ls[%d]"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]),
selectable_cards
[
i
]
->
sequence
+
1
);
selectable_cards
[
i
]
->
sequence
+
1
);
mainGame
->
stCardPos
[
i
]
->
setText
(
formatBuffer
);
mainGame
->
stCardPos
[
i
]
->
setText
(
formatBuffer
);
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
{
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
{
if
(
selectable_cards
[
i
]
->
owner
!=
selectable_cards
[
i
]
->
overlayTarget
->
controler
)
if
(
selectable_cards
[
i
]
->
owner
!=
selectable_cards
[
i
]
->
overlayTarget
->
controler
)
...
@@ -597,13 +594,11 @@ void ClientField::ShowLocationCard() {
...
@@ -597,13 +594,11 @@ void ClientField::ShowLocationCard() {
mainGame
->
btnCardDisplay
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardDisplay
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardDisplay
[
i
]
->
setVisible
(
true
);
mainGame
->
btnCardDisplay
[
i
]
->
setVisible
(
true
);
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
if
(
display_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
if
(
display_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
dataManager
.
FormatLocation
(
display_cards
[
i
]
->
overlayTarget
->
location
,
display_cards
[
i
]
->
overlayTarget
->
sequence
),
dataManager
.
FormatLocation
(
display_cards
[
i
]
->
overlayTarget
),
display_cards
[
i
]
->
overlayTarget
->
sequence
+
1
,
display_cards
[
i
]
->
sequence
+
1
);
display_cards
[
i
]
->
overlayTarget
->
sequence
+
1
,
display_cards
[
i
]
->
sequence
+
1
);
else
else
myswprintf
(
formatBuffer
,
L"%ls[%d]"
,
dataManager
.
FormatLocation
(
display_cards
[
i
]
->
location
,
display_cards
[
i
]
->
sequence
),
myswprintf
(
formatBuffer
,
L"%ls[%d]"
,
dataManager
.
FormatLocation
(
display_cards
[
i
]),
display_cards
[
i
]
->
sequence
+
1
);
display_cards
[
i
]
->
sequence
+
1
);
mainGame
->
stDisplayPos
[
i
]
->
setText
(
formatBuffer
);
mainGame
->
stDisplayPos
[
i
]
->
setText
(
formatBuffer
);
if
(
display_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
{
if
(
display_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
{
if
(
display_cards
[
i
]
->
owner
!=
display_cards
[
i
]
->
overlayTarget
->
controler
)
if
(
display_cards
[
i
]
->
owner
!=
display_cards
[
i
]
->
overlayTarget
->
controler
)
...
...
gframe/data_manager.cpp
View file @
64786a9f
#include "data_manager.h"
#include "data_manager.h"
#include "game.h"
#include "game.h"
#include "client_card.h"
#include "spmemvfs/spmemvfs.h"
#include "spmemvfs/spmemvfs.h"
namespace
ygo
{
namespace
ygo
{
...
@@ -221,8 +222,6 @@ const wchar_t* DataManager::GetDesc(uint32_t strCode) const {
...
@@ -221,8 +222,6 @@ const wchar_t* DataManager::GetDesc(uint32_t strCode) const {
return
unknown_string
;
return
unknown_string
;
}
}
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
const
{
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
const
{
if
(
code
<
0
||
code
>
MAX_STRING_ID
)
return
unknown_string
;
auto
csit
=
_sysStrings
.
find
(
code
);
auto
csit
=
_sysStrings
.
find
(
code
);
if
(
csit
==
_sysStrings
.
end
())
if
(
csit
==
_sysStrings
.
end
())
return
unknown_string
;
return
unknown_string
;
...
@@ -280,11 +279,10 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) const {
...
@@ -280,11 +279,10 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) const {
else
else
return
GetSysString
(
1009
);
return
GetSysString
(
1009
);
}
}
int
i
=
1000
;
int
string_id
=
0
;
int
string_id
=
0
;
for
(
unsigned
filter
=
LOCATION_DECK
;
filter
<=
LOCATION_PZONE
;
filter
<<=
1
,
++
i
)
{
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
if
(
filter
==
location
)
{
if
(
(
0x1U
<<
i
)
==
location
)
{
string_id
=
i
;
string_id
=
STRING_ID_LOCATION
+
i
;
break
;
break
;
}
}
}
}
...
@@ -293,6 +291,11 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) const {
...
@@ -293,6 +291,11 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) const {
else
else
return
unknown_string
;
return
unknown_string
;
}
}
const
wchar_t
*
DataManager
::
FormatLocation
(
ClientCard
*
card
)
const
{
if
(
!
card
)
return
unknown_string
;
return
FormatLocation
(
card
->
location
,
card
->
sequence
);
}
std
::
wstring
DataManager
::
FormatAttribute
(
unsigned
int
attribute
)
const
{
std
::
wstring
DataManager
::
FormatAttribute
(
unsigned
int
attribute
)
const
{
std
::
wstring
buffer
;
std
::
wstring
buffer
;
for
(
int
i
=
0
;
i
<
ATTRIBUTES_COUNT
;
++
i
)
{
for
(
int
i
=
0
;
i
<
ATTRIBUTES_COUNT
;
++
i
)
{
...
@@ -303,7 +306,7 @@ std::wstring DataManager::FormatAttribute(unsigned int attribute) const {
...
@@ -303,7 +306,7 @@ std::wstring DataManager::FormatAttribute(unsigned int attribute) const {
}
}
}
}
if
(
buffer
.
empty
())
if
(
buffer
.
empty
())
return
std
::
wstring
(
unknown_string
)
;
buffer
=
unknown_string
;
return
buffer
;
return
buffer
;
}
}
std
::
wstring
DataManager
::
FormatRace
(
unsigned
int
race
)
const
{
std
::
wstring
DataManager
::
FormatRace
(
unsigned
int
race
)
const
{
...
@@ -316,7 +319,7 @@ std::wstring DataManager::FormatRace(unsigned int race) const {
...
@@ -316,7 +319,7 @@ std::wstring DataManager::FormatRace(unsigned int race) const {
}
}
}
}
if
(
buffer
.
empty
())
if
(
buffer
.
empty
())
return
std
::
wstring
(
unknown_string
)
;
buffer
=
unknown_string
;
return
buffer
;
return
buffer
;
}
}
std
::
wstring
DataManager
::
FormatType
(
unsigned
int
type
)
const
{
std
::
wstring
DataManager
::
FormatType
(
unsigned
int
type
)
const
{
...
@@ -329,7 +332,7 @@ std::wstring DataManager::FormatType(unsigned int type) const {
...
@@ -329,7 +332,7 @@ std::wstring DataManager::FormatType(unsigned int type) const {
}
}
}
}
if
(
buffer
.
empty
())
if
(
buffer
.
empty
())
return
std
::
wstring
(
unknown_string
)
;
buffer
=
unknown_string
;
return
buffer
;
return
buffer
;
}
}
std
::
wstring
DataManager
::
FormatSetName
(
const
uint16_t
setcode
[])
const
{
std
::
wstring
DataManager
::
FormatSetName
(
const
uint16_t
setcode
[])
const
{
...
@@ -343,7 +346,7 @@ std::wstring DataManager::FormatSetName(const uint16_t setcode[]) const {
...
@@ -343,7 +346,7 @@ std::wstring DataManager::FormatSetName(const uint16_t setcode[]) const {
buffer
.
append
(
setname
);
buffer
.
append
(
setname
);
}
}
if
(
buffer
.
empty
())
if
(
buffer
.
empty
())
return
std
::
wstring
(
unknown_string
)
;
buffer
=
unknown_string
;
return
buffer
;
return
buffer
;
}
}
std
::
wstring
DataManager
::
FormatLinkMarker
(
unsigned
int
link_marker
)
const
{
std
::
wstring
DataManager
::
FormatLinkMarker
(
unsigned
int
link_marker
)
const
{
...
...
gframe/data_manager.h
View file @
64786a9f
...
@@ -58,6 +58,8 @@ struct CardString {
...
@@ -58,6 +58,8 @@ struct CardString {
using
code_pointer
=
std
::
unordered_map
<
uint32_t
,
CardDataC
>::
const_iterator
;
using
code_pointer
=
std
::
unordered_map
<
uint32_t
,
CardDataC
>::
const_iterator
;
using
string_pointer
=
std
::
unordered_map
<
uint32_t
,
CardString
>::
const_iterator
;
using
string_pointer
=
std
::
unordered_map
<
uint32_t
,
CardString
>::
const_iterator
;
class
ClientCard
;
class
DataManager
{
class
DataManager
{
public:
public:
DataManager
();
DataManager
();
...
@@ -88,6 +90,7 @@ public:
...
@@ -88,6 +90,7 @@ public:
std
::
vector
<
unsigned
int
>
GetSetCodes
(
std
::
wstring
setname
)
const
;
std
::
vector
<
unsigned
int
>
GetSetCodes
(
std
::
wstring
setname
)
const
;
std
::
wstring
GetNumString
(
int
num
,
bool
bracket
=
false
)
const
;
std
::
wstring
GetNumString
(
int
num
,
bool
bracket
=
false
)
const
;
const
wchar_t
*
FormatLocation
(
int
location
,
int
sequence
)
const
;
const
wchar_t
*
FormatLocation
(
int
location
,
int
sequence
)
const
;
const
wchar_t
*
FormatLocation
(
ClientCard
*
card
)
const
;
std
::
wstring
FormatAttribute
(
unsigned
int
attribute
)
const
;
std
::
wstring
FormatAttribute
(
unsigned
int
attribute
)
const
;
std
::
wstring
FormatRace
(
unsigned
int
race
)
const
;
std
::
wstring
FormatRace
(
unsigned
int
race
)
const
;
std
::
wstring
FormatType
(
unsigned
int
type
)
const
;
std
::
wstring
FormatType
(
unsigned
int
type
)
const
;
...
@@ -102,6 +105,7 @@ public:
...
@@ -102,6 +105,7 @@ public:
const
wchar_t
*
unknown_string
{
L"???"
};
const
wchar_t
*
unknown_string
{
L"???"
};
irr
::
io
::
IFileSystem
*
FileSystem
{};
irr
::
io
::
IFileSystem
*
FileSystem
{};
static
constexpr
int
STRING_ID_LOCATION
=
1000
;
static
constexpr
int
STRING_ID_ATTRIBUTE
=
1010
;
static
constexpr
int
STRING_ID_ATTRIBUTE
=
1010
;
static
constexpr
int
STRING_ID_RACE
=
1020
;
static
constexpr
int
STRING_ID_RACE
=
1020
;
static
constexpr
int
STRING_ID_TYPE
=
1050
;
static
constexpr
int
STRING_ID_TYPE
=
1050
;
...
...
gframe/deck_con.cpp
View file @
64786a9f
...
@@ -1371,8 +1371,6 @@ void DeckBuilder::GetHoveredCard() {
...
@@ -1371,8 +1371,6 @@ void DeckBuilder::GetHoveredCard() {
if
(
!
is_draging
&&
pre_code
!=
hovered_code
)
{
if
(
!
is_draging
&&
pre_code
!=
hovered_code
)
{
if
(
hovered_code
)
if
(
hovered_code
)
mainGame
->
ShowCardInfo
(
hovered_code
);
mainGame
->
ShowCardInfo
(
hovered_code
);
if
(
pre_code
)
imageManager
.
RemoveTexture
(
pre_code
);
}
}
}
}
void
DeckBuilder
::
StartFilter
()
{
void
DeckBuilder
::
StartFilter
()
{
...
...
gframe/event_handler.cpp
View file @
64786a9f
...
@@ -905,17 +905,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -905,17 +905,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
else
else
myswprintf
(
formatBuffer
,
L""
);
myswprintf
(
formatBuffer
,
L""
);
}
else
{
}
else
{
if
(
select_continuous
)
if
(
select_continuous
)
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
unknown_string
);
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
unknown_string
);
else
if
(
cant_check_grave
&&
selectable_cards
[
i
]
->
location
==
LOCATION_GRAVE
)
else
if
(
cant_check_grave
&&
selectable_cards
[
i
]
->
location
==
LOCATION_GRAVE
)
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
0
));
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
0
));
else
if
(
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
else
if
(
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
+
pos
]
->
overlayTarget
->
location
,
selectable_cards
[
i
+
pos
]
->
overlayTarget
->
sequence
),
dataManager
.
FormatLocation
(
selectable_cards
[
i
+
pos
]
->
overlayTarget
),
selectable_cards
[
i
+
pos
]
->
overlayTarget
->
sequence
+
1
,
selectable_cards
[
i
+
pos
]
->
sequence
+
1
);
selectable_cards
[
i
+
pos
]
->
overlayTarget
->
sequence
+
1
,
selectable_cards
[
i
+
pos
]
->
sequence
+
1
);
else
else
myswprintf
(
formatBuffer
,
L"%ls[%d]"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
+
pos
]
->
location
,
selectable_cards
[
i
+
pos
]
->
sequence
),
myswprintf
(
formatBuffer
,
L"%ls[%d]"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
+
pos
]),
selectable_cards
[
i
+
pos
]
->
sequence
+
1
);
selectable_cards
[
i
+
pos
]
->
sequence
+
1
);
}
}
mainGame
->
stCardPos
[
i
]
->
setText
(
formatBuffer
);
mainGame
->
stCardPos
[
i
]
->
setText
(
formatBuffer
);
// color
// color
...
@@ -961,13 +959,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -961,13 +959,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
display_cards
[
i
+
pos
]
->
controler
+
2
]);
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
display_cards
[
i
+
pos
]
->
controler
+
2
]);
mainGame
->
btnCardDisplay
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
30
+
i
*
125
,
55
,
30
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardDisplay
[
i
]
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
30
+
i
*
125
,
55
,
30
+
120
+
i
*
125
,
225
));
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
if
(
display_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
{
if
(
display_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
myswprintf
(
formatBuffer
,
L"%ls[%d](%d)"
,
dataManager
.
FormatLocation
(
display_cards
[
i
+
pos
]
->
overlayTarget
->
location
,
display_cards
[
i
+
pos
]
->
overlayTarget
->
sequence
),
dataManager
.
FormatLocation
(
display_cards
[
i
+
pos
]
->
overlayTarget
),
display_cards
[
i
+
pos
]
->
overlayTarget
->
sequence
+
1
,
display_cards
[
i
+
pos
]
->
sequence
+
1
);
display_cards
[
i
+
pos
]
->
overlayTarget
->
sequence
+
1
,
display_cards
[
i
+
pos
]
->
sequence
+
1
);
else
}
else
myswprintf
(
formatBuffer
,
L"%ls[%d]"
,
dataManager
.
FormatLocation
(
display_cards
[
i
+
pos
]),
display_cards
[
i
+
pos
]
->
sequence
+
1
);
myswprintf
(
formatBuffer
,
L"%ls[%d]"
,
dataManager
.
FormatLocation
(
display_cards
[
i
+
pos
]
->
location
,
display_cards
[
i
+
pos
]
->
sequence
),
display_cards
[
i
+
pos
]
->
sequence
+
1
);
mainGame
->
stDisplayPos
[
i
]
->
setText
(
formatBuffer
);
mainGame
->
stDisplayPos
[
i
]
->
setText
(
formatBuffer
);
if
(
display_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
{
if
(
display_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
{
if
(
display_cards
[
i
+
pos
]
->
owner
!=
display_cards
[
i
+
pos
]
->
overlayTarget
->
controler
)
if
(
display_cards
[
i
+
pos
]
->
owner
!=
display_cards
[
i
+
pos
]
->
overlayTarget
->
controler
)
...
...
gframe/game.cpp
View file @
64786a9f
...
@@ -1324,8 +1324,6 @@ void Game::LoadConfig() {
...
@@ -1324,8 +1324,6 @@ void Game::LoadConfig() {
gameConf
.
antialias
=
std
::
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
antialias
=
std
::
strtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_d3d"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_d3d"
))
{
gameConf
.
use_d3d
=
std
::
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf
.
use_d3d
=
std
::
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_image_scale"
))
{
gameConf
.
use_image_scale
=
std
::
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_image_scale_multi_thread"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_image_scale_multi_thread"
))
{
gameConf
.
use_image_scale_multi_thread
=
std
::
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf
.
use_image_scale_multi_thread
=
std
::
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_image_load_background_thread"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_image_load_background_thread"
))
{
...
@@ -1460,7 +1458,6 @@ void Game::SaveConfig() {
...
@@ -1460,7 +1458,6 @@ void Game::SaveConfig() {
std
::
fprintf
(
fp
,
"#config file
\n
#nickname & gamename should be less than 20 characters
\n
"
);
std
::
fprintf
(
fp
,
"#config file
\n
#nickname & gamename should be less than 20 characters
\n
"
);
char
linebuf
[
CONFIG_LINE_SIZE
];
char
linebuf
[
CONFIG_LINE_SIZE
];
std
::
fprintf
(
fp
,
"use_d3d = %d
\n
"
,
gameConf
.
use_d3d
?
1
:
0
);
std
::
fprintf
(
fp
,
"use_d3d = %d
\n
"
,
gameConf
.
use_d3d
?
1
:
0
);
std
::
fprintf
(
fp
,
"use_image_scale = %d
\n
"
,
gameConf
.
use_image_scale
?
1
:
0
);
std
::
fprintf
(
fp
,
"use_image_scale_multi_thread = %d
\n
"
,
gameConf
.
use_image_scale_multi_thread
?
1
:
0
);
std
::
fprintf
(
fp
,
"use_image_scale_multi_thread = %d
\n
"
,
gameConf
.
use_image_scale_multi_thread
?
1
:
0
);
std
::
fprintf
(
fp
,
"use_image_load_background_thread = %d
\n
"
,
gameConf
.
use_image_load_background_thread
?
1
:
0
);
std
::
fprintf
(
fp
,
"use_image_load_background_thread = %d
\n
"
,
gameConf
.
use_image_load_background_thread
?
1
:
0
);
std
::
fprintf
(
fp
,
"antialias = %d
\n
"
,
gameConf
.
antialias
);
std
::
fprintf
(
fp
,
"antialias = %d
\n
"
,
gameConf
.
antialias
);
...
...
gframe/game.h
View file @
64786a9f
...
@@ -48,7 +48,6 @@ bool IsExtension(const char* filename, const char(&extension)[N]) {
...
@@ -48,7 +48,6 @@ bool IsExtension(const char* filename, const char(&extension)[N]) {
struct
Config
{
struct
Config
{
bool
use_d3d
{
false
};
bool
use_d3d
{
false
};
bool
use_image_scale
{
true
};
bool
use_image_scale_multi_thread
{
true
};
bool
use_image_scale_multi_thread
{
true
};
#ifdef _OPENMP
#ifdef _OPENMP
bool
use_image_load_background_thread
{
false
};
bool
use_image_load_background_thread
{
false
};
...
...
gframe/image_manager.cpp
View file @
64786a9f
...
@@ -80,20 +80,6 @@ void ImageManager::ClearTexture() {
...
@@ -80,20 +80,6 @@ void ImageManager::ClearTexture() {
tThumbLoadingMutex
.
unlock
();
tThumbLoadingMutex
.
unlock
();
tFields
.
clear
();
tFields
.
clear
();
}
}
void
ImageManager
::
RemoveTexture
(
int
code
)
{
auto
tit
=
tMap
[
0
].
find
(
code
);
if
(
tit
!=
tMap
[
0
].
end
())
{
if
(
tit
->
second
)
driver
->
removeTexture
(
tit
->
second
);
tMap
[
0
].
erase
(
tit
);
}
tit
=
tMap
[
1
].
find
(
code
);
if
(
tit
!=
tMap
[
1
].
end
())
{
if
(
tit
->
second
)
driver
->
removeTexture
(
tit
->
second
);
tMap
[
1
].
erase
(
tit
);
}
}
void
ImageManager
::
ResizeTexture
()
{
void
ImageManager
::
ResizeTexture
()
{
irr
::
s32
imgWidth
=
CARD_IMG_WIDTH
*
mainGame
->
xScale
;
irr
::
s32
imgWidth
=
CARD_IMG_WIDTH
*
mainGame
->
xScale
;
irr
::
s32
imgHeight
=
CARD_IMG_HEIGHT
*
mainGame
->
yScale
;
irr
::
s32
imgHeight
=
CARD_IMG_HEIGHT
*
mainGame
->
yScale
;
...
@@ -203,24 +189,20 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
...
@@ -203,24 +189,20 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
}
// end of parallel region
}
// end of parallel region
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureFromFile
(
const
char
*
file
,
irr
::
s32
width
,
irr
::
s32
height
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTextureFromFile
(
const
char
*
file
,
irr
::
s32
width
,
irr
::
s32
height
)
{
if
(
mainGame
->
gameConf
.
use_image_scale
)
{
irr
::
video
::
ITexture
*
texture
;
irr
::
video
::
ITexture
*
texture
;
irr
::
video
::
IImage
*
srcimg
=
driver
->
createImageFromFile
(
file
);
irr
::
video
::
IImage
*
srcimg
=
driver
->
createImageFromFile
(
file
);
if
(
srcimg
==
nullptr
)
if
(
srcimg
==
nullptr
)
return
nullptr
;
return
nullptr
;
if
(
srcimg
->
getDimension
()
==
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
width
,
height
))
{
if
(
srcimg
->
getDimension
()
==
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
width
,
height
))
{
texture
=
driver
->
addTexture
(
file
,
srcimg
);
texture
=
driver
->
addTexture
(
file
,
srcimg
);
}
else
{
irr
::
video
::
IImage
*
destimg
=
driver
->
createImage
(
srcimg
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
width
,
height
));
imageScaleNNAA
(
srcimg
,
destimg
);
texture
=
driver
->
addTexture
(
file
,
destimg
);
destimg
->
drop
();
}
srcimg
->
drop
();
return
texture
;
}
else
{
}
else
{
return
driver
->
getTexture
(
file
);
irr
::
video
::
IImage
*
destimg
=
driver
->
createImage
(
srcimg
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
width
,
height
));
imageScaleNNAA
(
srcimg
,
destimg
);
texture
=
driver
->
addTexture
(
file
,
destimg
);
destimg
->
drop
();
}
}
srcimg
->
drop
();
return
texture
;
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetTexture
(
int
code
,
bool
fit
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetTexture
(
int
code
,
bool
fit
)
{
if
(
code
==
0
)
if
(
code
==
0
)
...
@@ -243,17 +225,13 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
...
@@ -243,17 +225,13 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
mysnprintf
(
file
,
"pics/%d.jpg"
,
code
);
mysnprintf
(
file
,
"pics/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
}
}
if
(
img
==
nullptr
&&
!
mainGame
->
gameConf
.
use_image_scale
)
{
tMap
[
fit
?
1
:
0
][
code
]
=
nullptr
;
return
GetTextureThumb
(
code
);
}
tMap
[
fit
?
1
:
0
][
code
]
=
img
;
tMap
[
fit
?
1
:
0
][
code
]
=
img
;
return
(
img
==
nullptr
)
?
(
fit
?
tUnknownFit
:
tUnknown
)
:
img
;
return
(
img
==
nullptr
)
?
(
fit
?
tUnknownFit
:
tUnknown
)
:
img
;
}
}
if
(
tit
->
second
)
if
(
tit
->
second
)
return
tit
->
second
;
return
tit
->
second
;
else
else
return
mainGame
->
gameConf
.
use_image_scale
?
(
fit
?
tUnknownFit
:
tUnknown
)
:
GetTextureThumb
(
code
)
;
return
fit
?
tUnknownFit
:
tUnknown
;
}
}
irr
::
video
::
ITexture
*
ImageManager
::
GetBigPicture
(
int
code
,
float
zoom
)
{
irr
::
video
::
ITexture
*
ImageManager
::
GetBigPicture
(
int
code
,
float
zoom
)
{
if
(
code
==
0
)
if
(
code
==
0
)
...
@@ -298,18 +276,10 @@ int ImageManager::LoadThumbThread() {
...
@@ -298,18 +276,10 @@ int ImageManager::LoadThumbThread() {
imageManager
.
tThumbLoadingCodes
.
pop
();
imageManager
.
tThumbLoadingCodes
.
pop
();
imageManager
.
tThumbLoadingMutex
.
unlock
();
imageManager
.
tThumbLoadingMutex
.
unlock
();
char
file
[
256
];
char
file
[
256
];
mysnprintf
(
file
,
"expansions/pics/thumbnail
/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics
/%d.jpg"
,
code
);
irr
::
video
::
IImage
*
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
irr
::
video
::
IImage
*
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
if
(
img
==
nullptr
)
{
if
(
img
==
nullptr
)
{
mysnprintf
(
file
,
"pics/thumbnail/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"pics/%d.jpg"
,
code
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
nullptr
&&
mainGame
->
gameConf
.
use_image_scale
)
{
mysnprintf
(
file
,
"expansions/pics/%d.jpg"
,
code
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
==
nullptr
&&
mainGame
->
gameConf
.
use_image_scale
)
{
mysnprintf
(
file
,
"pics/%d.jpg"
,
code
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
}
if
(
img
!=
nullptr
)
{
if
(
img
!=
nullptr
)
{
...
@@ -348,22 +318,14 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -348,22 +318,14 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
auto
tit
=
tThumb
.
find
(
code
);
auto
tit
=
tThumb
.
find
(
code
);
if
(
tit
==
tThumb
.
end
()
&&
!
mainGame
->
gameConf
.
use_image_load_background_thread
)
{
if
(
tit
==
tThumb
.
end
()
&&
!
mainGame
->
gameConf
.
use_image_load_background_thread
)
{
char
file
[
256
];
char
file
[
256
];
mysnprintf
(
file
,
"expansions/pics/thumbnail
/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"expansions/pics
/%d.jpg"
,
code
);
int
width
=
CARD_THUMB_WIDTH
*
mainGame
->
xScale
;
int
width
=
CARD_THUMB_WIDTH
*
mainGame
->
xScale
;
int
height
=
CARD_THUMB_HEIGHT
*
mainGame
->
yScale
;
int
height
=
CARD_THUMB_HEIGHT
*
mainGame
->
yScale
;
irr
::
video
::
ITexture
*
img
=
GetTextureFromFile
(
file
,
width
,
height
);
irr
::
video
::
ITexture
*
img
=
GetTextureFromFile
(
file
,
width
,
height
);
if
(
img
==
NULL
)
{
if
(
img
==
NULL
)
{
mysnprintf
(
file
,
"pics/thumbnail
/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"pics
/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
}
}
if
(
img
==
NULL
&&
mainGame
->
gameConf
.
use_image_scale
)
{
mysnprintf
(
file
,
"expansions/pics/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
if
(
img
==
NULL
)
{
mysnprintf
(
file
,
"pics/%d.jpg"
,
code
);
img
=
GetTextureFromFile
(
file
,
width
,
height
);
}
}
tThumb
[
code
]
=
img
;
tThumb
[
code
]
=
img
;
return
(
img
==
NULL
)
?
tUnknownThumb
:
img
;
return
(
img
==
NULL
)
?
tUnknownThumb
:
img
;
}
}
...
@@ -373,7 +335,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -373,7 +335,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
if
(
lit
!=
tThumbLoading
.
end
())
{
if
(
lit
!=
tThumbLoading
.
end
())
{
if
(
lit
->
second
!=
nullptr
)
{
if
(
lit
->
second
!=
nullptr
)
{
char
file
[
256
];
char
file
[
256
];
mysnprintf
(
file
,
"pics/thumbnail
/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"pics
/%d.jpg"
,
code
);
irr
::
video
::
ITexture
*
texture
=
driver
->
addTexture
(
file
,
lit
->
second
);
// textures must be added in the main thread due to OpenGL
irr
::
video
::
ITexture
*
texture
=
driver
->
addTexture
(
file
,
lit
->
second
);
// textures must be added in the main thread due to OpenGL
lit
->
second
->
drop
();
lit
->
second
->
drop
();
tThumb
[
code
]
=
texture
;
tThumb
[
code
]
=
texture
;
...
...
gframe/image_manager.h
View file @
64786a9f
...
@@ -14,7 +14,6 @@ public:
...
@@ -14,7 +14,6 @@ public:
bool
Initial
();
bool
Initial
();
void
SetDevice
(
irr
::
IrrlichtDevice
*
dev
);
void
SetDevice
(
irr
::
IrrlichtDevice
*
dev
);
void
ClearTexture
();
void
ClearTexture
();
void
RemoveTexture
(
int
code
);
void
ResizeTexture
();
void
ResizeTexture
();
irr
::
video
::
ITexture
*
GetTextureFromFile
(
const
char
*
file
,
irr
::
s32
width
,
irr
::
s32
height
);
irr
::
video
::
ITexture
*
GetTextureFromFile
(
const
char
*
file
,
irr
::
s32
width
,
irr
::
s32
height
);
irr
::
video
::
ITexture
*
GetTexture
(
int
code
,
bool
fit
=
false
);
irr
::
video
::
ITexture
*
GetTexture
(
int
code
,
bool
fit
=
false
);
...
...
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