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
0fbec561
Commit
0fbec561
authored
Jan 28, 2026
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'salix/patch-thumbnail' into develop
parents
bd721edd
fc6ce975
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
63 deletions
+18
-63
gframe/deck_con.cpp
gframe/deck_con.cpp
+0
-2
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/deck_con.cpp
View file @
0fbec561
...
@@ -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/game.cpp
View file @
0fbec561
...
@@ -1347,8 +1347,6 @@ void Game::LoadConfig() {
...
@@ -1347,8 +1347,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"
))
{
...
@@ -1483,7 +1481,6 @@ void Game::SaveConfig() {
...
@@ -1483,7 +1481,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 @
0fbec561
...
@@ -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 @
0fbec561
...
@@ -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
)
...
@@ -293,18 +271,10 @@ int ImageManager::LoadThumbThread() {
...
@@ -293,18 +271,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
)
{
...
@@ -347,22 +317,14 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -347,22 +317,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
;
}
}
...
@@ -372,7 +334,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
...
@@ -372,7 +334,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 @
0fbec561
...
@@ -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