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
89f52653
Commit
89f52653
authored
Jan 29, 2026
by
salix5
Committed by
GitHub
Jan 29, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove: pics/thumbnail, use_image_scale, ImageManager::RemoveTexture (#2868)
parent
39475480
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 @
89f52653
...
...
@@ -1371,8 +1371,6 @@ void DeckBuilder::GetHoveredCard() {
if
(
!
is_draging
&&
pre_code
!=
hovered_code
)
{
if
(
hovered_code
)
mainGame
->
ShowCardInfo
(
hovered_code
);
if
(
pre_code
)
imageManager
.
RemoveTexture
(
pre_code
);
}
}
void
DeckBuilder
::
StartFilter
()
{
...
...
gframe/game.cpp
View file @
89f52653
...
...
@@ -1324,8 +1324,6 @@ void Game::LoadConfig() {
gameConf
.
antialias
=
std
::
strtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_d3d"
))
{
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"
))
{
gameConf
.
use_image_scale_multi_thread
=
std
::
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_image_load_background_thread"
))
{
...
...
@@ -1460,7 +1458,6 @@ void Game::SaveConfig() {
std
::
fprintf
(
fp
,
"#config file
\n
#nickname & gamename should be less than 20 characters
\n
"
);
char
linebuf
[
CONFIG_LINE_SIZE
];
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_load_background_thread = %d
\n
"
,
gameConf
.
use_image_load_background_thread
?
1
:
0
);
std
::
fprintf
(
fp
,
"antialias = %d
\n
"
,
gameConf
.
antialias
);
...
...
gframe/game.h
View file @
89f52653
...
...
@@ -48,7 +48,6 @@ bool IsExtension(const char* filename, const char(&extension)[N]) {
struct
Config
{
bool
use_d3d
{
false
};
bool
use_image_scale
{
true
};
bool
use_image_scale_multi_thread
{
true
};
#ifdef _OPENMP
bool
use_image_load_background_thread
{
false
};
...
...
gframe/image_manager.cpp
View file @
89f52653
...
...
@@ -80,20 +80,6 @@ void ImageManager::ClearTexture() {
tThumbLoadingMutex
.
unlock
();
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
()
{
irr
::
s32
imgWidth
=
CARD_IMG_WIDTH
*
mainGame
->
xScale
;
irr
::
s32
imgHeight
=
CARD_IMG_HEIGHT
*
mainGame
->
yScale
;
...
...
@@ -203,24 +189,20 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
}
// end of parallel region
}
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
::
IImage
*
srcimg
=
driver
->
createImageFromFile
(
file
);
if
(
srcimg
==
nullptr
)
return
nullptr
;
if
(
srcimg
->
getDimension
()
==
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
width
,
height
))
{
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
;
irr
::
video
::
ITexture
*
texture
;
irr
::
video
::
IImage
*
srcimg
=
driver
->
createImageFromFile
(
file
);
if
(
srcimg
==
nullptr
)
return
nullptr
;
if
(
srcimg
->
getDimension
()
==
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
width
,
height
))
{
texture
=
driver
->
addTexture
(
file
,
srcimg
);
}
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
)
{
if
(
code
==
0
)
...
...
@@ -243,17 +225,13 @@ irr::video::ITexture* ImageManager::GetTexture(int code, bool fit) {
mysnprintf
(
file
,
"pics/%d.jpg"
,
code
);
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
;
return
(
img
==
nullptr
)
?
(
fit
?
tUnknownFit
:
tUnknown
)
:
img
;
}
if
(
tit
->
second
)
return
tit
->
second
;
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
)
{
if
(
code
==
0
)
...
...
@@ -293,18 +271,10 @@ int ImageManager::LoadThumbThread() {
imageManager
.
tThumbLoadingCodes
.
pop
();
imageManager
.
tThumbLoadingMutex
.
unlock
();
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
);
if
(
img
==
nullptr
)
{
mysnprintf
(
file
,
"pics/thumbnail/%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
);
std
::
snprintf
(
file
,
sizeof
file
,
"pics/%d.jpg"
,
code
);
img
=
imageManager
.
driver
->
createImageFromFile
(
file
);
}
if
(
img
!=
nullptr
)
{
...
...
@@ -347,22 +317,14 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
auto
tit
=
tThumb
.
find
(
code
);
if
(
tit
==
tThumb
.
end
()
&&
!
mainGame
->
gameConf
.
use_image_load_background_thread
)
{
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
height
=
CARD_THUMB_HEIGHT
*
mainGame
->
yScale
;
irr
::
video
::
ITexture
*
img
=
GetTextureFromFile
(
file
,
width
,
height
);
if
(
img
==
NULL
)
{
mysnprintf
(
file
,
"pics/thumbnail
/%d.jpg"
,
code
);
std
::
snprintf
(
file
,
sizeof
file
,
"pics
/%d.jpg"
,
code
);
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
;
return
(
img
==
NULL
)
?
tUnknownThumb
:
img
;
}
...
...
@@ -372,7 +334,7 @@ irr::video::ITexture* ImageManager::GetTextureThumb(int code) {
if
(
lit
!=
tThumbLoading
.
end
())
{
if
(
lit
->
second
!=
nullptr
)
{
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
lit
->
second
->
drop
();
tThumb
[
code
]
=
texture
;
...
...
gframe/image_manager.h
View file @
89f52653
...
...
@@ -14,7 +14,6 @@ public:
bool
Initial
();
void
SetDevice
(
irr
::
IrrlichtDevice
*
dev
);
void
ClearTexture
();
void
RemoveTexture
(
int
code
);
void
ResizeTexture
();
irr
::
video
::
ITexture
*
GetTextureFromFile
(
const
char
*
file
,
irr
::
s32
width
,
irr
::
s32
height
);
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