Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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
fallenstardust
YGOMobile-Cn-Ko-En
Commits
26a52ce9
Commit
26a52ce9
authored
Mar 18, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace using namespace in config.h
parent
bf35e600
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
534 additions
and
556 deletions
+534
-556
Classes/gframe/CGUIImageButton.cpp
Classes/gframe/CGUIImageButton.cpp
+6
-6
Classes/gframe/CGUITTFont.cpp
Classes/gframe/CGUITTFont.cpp
+28
-35
Classes/gframe/client_card.cpp
Classes/gframe/client_card.cpp
+1
-1
Classes/gframe/client_card.h
Classes/gframe/client_card.h
+3
-3
Classes/gframe/client_field.cpp
Classes/gframe/client_field.cpp
+4
-4
Classes/gframe/config.h
Classes/gframe/config.h
+3
-8
Classes/gframe/data_manager.cpp
Classes/gframe/data_manager.cpp
+3
-3
Classes/gframe/deck_con.cpp
Classes/gframe/deck_con.cpp
+3
-3
Classes/gframe/deck_manager.cpp
Classes/gframe/deck_manager.cpp
+5
-5
Classes/gframe/deck_manager.h
Classes/gframe/deck_manager.h
+1
-1
Classes/gframe/drawing.cpp
Classes/gframe/drawing.cpp
+126
-126
Classes/gframe/duelclient.cpp
Classes/gframe/duelclient.cpp
+11
-11
Classes/gframe/event_handler.cpp
Classes/gframe/event_handler.cpp
+37
-37
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+236
-245
Classes/gframe/game.h
Classes/gframe/game.h
+52
-53
Classes/gframe/gframe.cpp
Classes/gframe/gframe.cpp
+4
-4
Classes/gframe/image_manager.cpp
Classes/gframe/image_manager.cpp
+1
-1
Classes/gframe/image_manager.h
Classes/gframe/image_manager.h
+1
-1
Classes/gframe/menu_handler.cpp
Classes/gframe/menu_handler.cpp
+5
-5
Classes/gframe/replay_mode.h
Classes/gframe/replay_mode.h
+1
-1
Classes/gframe/single_mode.h
Classes/gframe/single_mode.h
+1
-1
Classes/gframe/utils.cpp
Classes/gframe/utils.cpp
+1
-1
libcore/android/TouchEventTransferAndroid.cpp
libcore/android/TouchEventTransferAndroid.cpp
+1
-1
No files found.
Classes/gframe/CGUIImageButton.cpp
View file @
26a52ce9
...
@@ -52,8 +52,8 @@ void Draw2DImageRotation(video::IVideoDriver* driver, video::ITexture* image, co
...
@@ -52,8 +52,8 @@ void Draw2DImageRotation(video::IVideoDriver* driver, video::ITexture* image, co
material
.
TextureLayer
[
0
].
Texture
=
image
;
material
.
TextureLayer
[
0
].
Texture
=
image
;
#if defined(_IRR_ANDROID_PLATFORM_)
#if defined(_IRR_ANDROID_PLATFORM_)
if
(
!
ygo
::
mainGame
->
isNPOTSupported
)
{
if
(
!
ygo
::
mainGame
->
isNPOTSupported
)
{
material
.
TextureLayer
[
0
].
TextureWrapU
=
ETC_CLAMP_TO_EDGE
;
material
.
TextureLayer
[
0
].
TextureWrapU
=
irr
::
video
::
ETC_CLAMP_TO_EDGE
;
material
.
TextureLayer
[
0
].
TextureWrapV
=
ETC_CLAMP_TO_EDGE
;
material
.
TextureLayer
[
0
].
TextureWrapV
=
irr
::
video
::
ETC_CLAMP_TO_EDGE
;
}
}
if
(
useAlphaChannel
)
if
(
useAlphaChannel
)
material
.
MaterialType
=
(
video
::
E_MATERIAL_TYPE
)
ygo
::
mainGame
->
ogles2TrasparentAlpha
;
material
.
MaterialType
=
(
video
::
E_MATERIAL_TYPE
)
ygo
::
mainGame
->
ogles2TrasparentAlpha
;
...
@@ -102,8 +102,8 @@ void Draw2DImageQuad(video::IVideoDriver* driver, video::ITexture* image, core::
...
@@ -102,8 +102,8 @@ void Draw2DImageQuad(video::IVideoDriver* driver, video::ITexture* image, core::
material
.
TextureLayer
[
0
].
Texture
=
image
;
material
.
TextureLayer
[
0
].
Texture
=
image
;
#if defined(_IRR_ANDROID_PLATFORM_)
#if defined(_IRR_ANDROID_PLATFORM_)
if
(
!
ygo
::
mainGame
->
isNPOTSupported
)
{
if
(
!
ygo
::
mainGame
->
isNPOTSupported
)
{
material
.
TextureLayer
[
0
].
TextureWrapU
=
ETC_CLAMP_TO_EDGE
;
material
.
TextureLayer
[
0
].
TextureWrapU
=
irr
::
video
::
ETC_CLAMP_TO_EDGE
;
material
.
TextureLayer
[
0
].
TextureWrapV
=
ETC_CLAMP_TO_EDGE
;
material
.
TextureLayer
[
0
].
TextureWrapV
=
irr
::
video
::
ETC_CLAMP_TO_EDGE
;
}
}
if
(
useAlphaChannel
)
if
(
useAlphaChannel
)
material
.
MaterialType
=
(
video
::
E_MATERIAL_TYPE
)
ygo
::
mainGame
->
ogles2TrasparentAlpha
;
material
.
MaterialType
=
(
video
::
E_MATERIAL_TYPE
)
ygo
::
mainGame
->
ogles2TrasparentAlpha
;
...
@@ -136,8 +136,8 @@ void CGUIImageButton::draw() {
...
@@ -136,8 +136,8 @@ void CGUIImageButton::draw() {
return
;
return
;
IGUISkin
*
skin
=
Environment
->
getSkin
();
IGUISkin
*
skin
=
Environment
->
getSkin
();
video
::
IVideoDriver
*
driver
=
Environment
->
getVideoDriver
();
video
::
IVideoDriver
*
driver
=
Environment
->
getVideoDriver
();
core
::
vector2di
center
=
AbsoluteRect
.
getCenter
();
irr
::
core
::
vector2di
center
=
AbsoluteRect
.
getCenter
();
core
::
vector2di
pos
=
center
;
irr
::
core
::
vector2di
pos
=
center
;
pos
.
X
-=
(
s32
)(
ImageRect
.
getWidth
()
*
imageScale
.
X
*
0.5
f
);
pos
.
X
-=
(
s32
)(
ImageRect
.
getWidth
()
*
imageScale
.
X
*
0.5
f
);
pos
.
Y
-=
(
s32
)(
ImageRect
.
getHeight
()
*
imageScale
.
Y
*
0.5
f
);
pos
.
Y
-=
(
s32
)(
ImageRect
.
getHeight
()
*
imageScale
.
Y
*
0.5
f
);
if
(
Pressed
)
{
if
(
Pressed
)
{
...
...
Classes/gframe/CGUITTFont.cpp
View file @
26a52ce9
...
@@ -561,7 +561,7 @@ void CGUITTFont::drawUstring(const core::ustring& utext, const core::rect<s32>&p
...
@@ -561,7 +561,7 @@ void CGUITTFont::drawUstring(const core::ustring& utext, const core::rect<s32>&p
// Determine rendering information.
// Determine rendering information.
SGUITTGlyph
&
glyph
=
Glyphs
[
n
-
1
];
SGUITTGlyph
&
glyph
=
Glyphs
[
n
-
1
];
CGUITTGlyphPage
*
const
page
=
Glyph_Pages
[
glyph
.
glyph_page
];
CGUITTGlyphPage
*
const
page
=
Glyph_Pages
[
glyph
.
glyph_page
];
page
->
render_positions
.
push_back
(
core
::
vector2di
(
offset
.
X
+
offx
,
offset
.
Y
+
offy
));
page
->
render_positions
.
push_back
(
irr
::
core
::
vector2di
(
offset
.
X
+
offx
,
offset
.
Y
+
offy
));
page
->
render_source_rects
.
push_back
(
glyph
.
source_rect
);
page
->
render_source_rects
.
push_back
(
glyph
.
source_rect
);
Render_Map
.
set
(
glyph
.
glyph_page
,
page
);
Render_Map
.
set
(
glyph
.
glyph_page
,
page
);
}
}
...
@@ -832,7 +832,7 @@ video::IImage* CGUITTFont::createTextureFromChar(const uchar32_t& ch) {
...
@@ -832,7 +832,7 @@ video::IImage* CGUITTFont::createTextureFromChar(const uchar32_t& ch) {
// Copy the image data out of the page texture.
// Copy the image data out of the page texture.
core
::
dimension2du
glyph_size
(
glyph
.
source_rect
.
getSize
());
core
::
dimension2du
glyph_size
(
glyph
.
source_rect
.
getSize
());
video
::
IImage
*
image
=
Driver
->
createImage
(
format
,
glyph_size
);
video
::
IImage
*
image
=
Driver
->
createImage
(
format
,
glyph_size
);
pageholder
->
copyTo
(
image
,
core
::
vector2di
(
0
,
0
),
glyph
.
source_rect
);
pageholder
->
copyTo
(
image
,
irr
::
core
::
vector2di
(
0
,
0
),
glyph
.
source_rect
);
tex
->
unlock
();
tex
->
unlock
();
return
image
;
return
image
;
...
@@ -854,17 +854,14 @@ void CGUITTFont::createSharedPlane() {
...
@@ -854,17 +854,14 @@ void CGUITTFont::createSharedPlane() {
0---1
0---1
*/
*/
using
namespace
core
;
video
::
S3DVertex
vertices
[
4
];
using
namespace
video
;
using
namespace
scene
;
S3DVertex
vertices
[
4
];
u16
indices
[
6
]
=
{
0
,
2
,
3
,
3
,
1
,
0
};
u16
indices
[
6
]
=
{
0
,
2
,
3
,
3
,
1
,
0
};
vertices
[
0
]
=
S3DVertex
(
vector3df
(
0
,
-
1
,
0
),
vector3df
(
0
,
0
,
-
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
1
));
vertices
[
0
]
=
video
::
S3DVertex
(
core
::
vector3df
(
0
,
-
1
,
0
),
core
::
vector3df
(
0
,
0
,
-
1
),
video
::
SColor
(
255
,
255
,
255
,
255
),
core
::
vector2df
(
0
,
1
));
vertices
[
1
]
=
S3DVertex
(
vector3df
(
1
,
-
1
,
0
),
vector3df
(
0
,
0
,
-
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
1
));
vertices
[
1
]
=
video
::
S3DVertex
(
core
::
vector3df
(
1
,
-
1
,
0
),
core
::
vector3df
(
0
,
0
,
-
1
),
video
::
SColor
(
255
,
255
,
255
,
255
),
core
::
vector2df
(
1
,
1
));
vertices
[
2
]
=
S3DVertex
(
vector3df
(
0
,
0
,
0
),
vector3df
(
0
,
0
,
-
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
0
,
0
));
vertices
[
2
]
=
video
::
S3DVertex
(
core
::
vector3df
(
0
,
0
,
0
),
core
::
vector3df
(
0
,
0
,
-
1
),
video
::
SColor
(
255
,
255
,
255
,
255
),
core
::
vector2df
(
0
,
0
));
vertices
[
3
]
=
S3DVertex
(
vector3df
(
1
,
0
,
0
),
vector3df
(
0
,
0
,
-
1
),
SColor
(
255
,
255
,
255
,
255
),
vector2df
(
1
,
0
));
vertices
[
3
]
=
video
::
S3DVertex
(
core
::
vector3df
(
1
,
0
,
0
),
core
::
vector3df
(
0
,
0
,
-
1
),
video
::
SColor
(
255
,
255
,
255
,
255
),
core
::
vector2df
(
1
,
0
));
SMeshBuffer
*
buf
=
new
SMeshBuffer
();
scene
::
SMeshBuffer
*
buf
=
new
scene
::
SMeshBuffer
();
buf
->
append
(
vertices
,
4
,
indices
,
6
);
buf
->
append
(
vertices
,
4
,
indices
,
6
);
shared_plane_
.
addMeshBuffer
(
buf
);
shared_plane_
.
addMeshBuffer
(
buf
);
...
@@ -882,11 +879,7 @@ core::dimension2d<u32> CGUITTFont::getDimensionUntilEndOfLine(const wchar_t* p)
...
@@ -882,11 +879,7 @@ core::dimension2d<u32> CGUITTFont::getDimensionUntilEndOfLine(const wchar_t* p)
}
}
core
::
array
<
scene
::
ISceneNode
*>
CGUITTFont
::
addTextSceneNode
(
const
wchar_t
*
text
,
scene
::
ISceneManager
*
smgr
,
scene
::
ISceneNode
*
parent
,
const
video
::
SColor
&
color
,
bool
center
)
{
core
::
array
<
scene
::
ISceneNode
*>
CGUITTFont
::
addTextSceneNode
(
const
wchar_t
*
text
,
scene
::
ISceneManager
*
smgr
,
scene
::
ISceneNode
*
parent
,
const
video
::
SColor
&
color
,
bool
center
)
{
using
namespace
core
;
core
::
array
<
scene
::
ISceneNode
*>
container
;
using
namespace
video
;
using
namespace
scene
;
array
<
scene
::
ISceneNode
*>
container
;
if
(
!
Driver
||
!
smgr
)
return
container
;
if
(
!
Driver
||
!
smgr
)
return
container
;
if
(
!
parent
)
if
(
!
parent
)
...
@@ -897,8 +890,8 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
...
@@ -897,8 +890,8 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
if
(
!
shared_plane_ptr_
)
//this points to a static mesh that contains the plane
if
(
!
shared_plane_ptr_
)
//this points to a static mesh that contains the plane
createSharedPlane
();
//if it's not initialized, we create one.
createSharedPlane
();
//if it's not initialized, we create one.
dimension2d
<
s32
>
text_size
(
getDimension
(
text
));
//convert from unsigned to signed.
core
::
dimension2d
<
s32
>
text_size
(
getDimension
(
text
));
//convert from unsigned to signed.
vector3df
start_point
(
0
,
0
,
0
),
offset
;
core
::
vector3df
start_point
(
0
,
0
,
0
),
offset
;
/** NOTICE:
/** NOTICE:
Because we are considering adding texts into 3D world, all Y axis vectors are inverted.
Because we are considering adding texts into 3D world, all Y axis vectors are inverted.
...
@@ -912,7 +905,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
...
@@ -912,7 +905,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
}
}
// the default font material
// the default font material
SMaterial
mat
;
video
::
SMaterial
mat
;
mat
.
setFlag
(
video
::
EMF_LIGHTING
,
true
);
mat
.
setFlag
(
video
::
EMF_LIGHTING
,
true
);
mat
.
setFlag
(
video
::
EMF_ZWRITE_ENABLE
,
false
);
mat
.
setFlag
(
video
::
EMF_ZWRITE_ENABLE
,
false
);
mat
.
setFlag
(
video
::
EMF_NORMALIZE_NORMALS
,
true
);
mat
.
setFlag
(
video
::
EMF_NORMALIZE_NORMALS
,
true
);
...
@@ -924,7 +917,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
...
@@ -924,7 +917,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
wchar_t
current_char
=
0
,
previous_char
=
0
;
wchar_t
current_char
=
0
,
previous_char
=
0
;
u32
n
=
0
;
u32
n
=
0
;
array
<
u32
>
glyph_indices
;
core
::
array
<
u32
>
glyph_indices
;
while
(
*
text
)
{
while
(
*
text
)
{
current_char
=
*
text
;
current_char
=
*
text
;
...
@@ -957,23 +950,23 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
...
@@ -957,23 +950,23 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
s32
offy
=
(
font_metrics
.
ascender
/
64
)
-
glyph
.
offset
.
Y
;
s32
offy
=
(
font_metrics
.
ascender
/
64
)
-
glyph
.
offset
.
Y
;
// Apply kerning.
// Apply kerning.
vector2di
k
=
getKerning
(
current_char
,
previous_char
);
core
::
vector2di
k
=
getKerning
(
current_char
,
previous_char
);
offset
.
X
+=
k
.
X
;
offset
.
X
+=
k
.
X
;
offset
.
Y
+=
k
.
Y
;
offset
.
Y
+=
k
.
Y
;
vector3df
current_pos
(
offset
.
X
+
offx
,
offset
.
Y
-
offy
,
0
);
core
::
vector3df
current_pos
(
offset
.
X
+
offx
,
offset
.
Y
-
offy
,
0
);
dimension2d
<
u32
>
letter_size
=
dimension2d
<
u32
>
(
texw
,
texh
);
core
::
dimension2d
<
u32
>
letter_size
=
core
::
dimension2d
<
u32
>
(
texw
,
texh
);
// Now we copy planes corresponding to the letter size.
// Now we copy planes corresponding to the letter size.
IMeshManipulator
*
mani
=
smgr
->
getMeshManipulator
();
scene
::
IMeshManipulator
*
mani
=
smgr
->
getMeshManipulator
();
IMesh
*
meshcopy
=
mani
->
createMeshCopy
(
shared_plane_ptr_
);
scene
::
IMesh
*
meshcopy
=
mani
->
createMeshCopy
(
shared_plane_ptr_
);
mani
->
scale
(
meshcopy
,
vector3df
((
f32
)
letter_size
.
Width
,
(
f32
)
letter_size
.
Height
,
1
));
mani
->
scale
(
meshcopy
,
core
::
vector3df
((
f32
)
letter_size
.
Width
,
(
f32
)
letter_size
.
Height
,
1
));
ISceneNode
*
current_node
=
smgr
->
addMeshSceneNode
(
meshcopy
,
parent
,
-
1
,
current_pos
);
scene
::
ISceneNode
*
current_node
=
smgr
->
addMeshSceneNode
(
meshcopy
,
parent
,
-
1
,
current_pos
);
meshcopy
->
drop
();
meshcopy
->
drop
();
current_node
->
getMaterial
(
0
)
=
mat
;
current_node
->
getMaterial
(
0
)
=
mat
;
current_node
->
setAutomaticCulling
(
EAC_OFF
);
current_node
->
setAutomaticCulling
(
scene
::
EAC_OFF
);
current_node
->
setIsDebugObject
(
true
);
//so the picking won't have any effect on individual letter
current_node
->
setIsDebugObject
(
true
);
//so the picking won't have any effect on individual letter
//current_node->setDebugDataVisible(EDS_BBOX); //de-comment this when debugging
//current_node->setDebugDataVisible(EDS_BBOX); //de-comment this when debugging
...
@@ -991,7 +984,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
...
@@ -991,7 +984,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
for
(
u32
i
=
0
;
i
<
glyph_indices
.
size
();
++
i
)
{
for
(
u32
i
=
0
;
i
<
glyph_indices
.
size
();
++
i
)
{
u32
n
=
glyph_indices
[
i
];
u32
n
=
glyph_indices
[
i
];
SGUITTGlyph
const
&
glyph
=
Glyphs
[
n
-
1
];
SGUITTGlyph
const
&
glyph
=
Glyphs
[
n
-
1
];
ITexture
*
current_tex
=
Glyph_Pages
[
glyph
.
glyph_page
]
->
texture
;
video
::
ITexture
*
current_tex
=
Glyph_Pages
[
glyph
.
glyph_page
]
->
texture
;
f32
page_texture_size
=
(
f32
)
current_tex
->
getSize
().
Width
;
f32
page_texture_size
=
(
f32
)
current_tex
->
getSize
().
Width
;
//Now we calculate the UV position according to the texture size and the source rect.
//Now we calculate the UV position according to the texture size and the source rect.
//
//
...
@@ -1007,15 +1000,15 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
...
@@ -1007,15 +1000,15 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
f32
v2
=
v1
+
(
glyph
.
source_rect
.
getHeight
()
/
page_texture_size
);
f32
v2
=
v1
+
(
glyph
.
source_rect
.
getHeight
()
/
page_texture_size
);
//we can be quite sure that this is IMeshSceneNode, because we just added them in the above loop.
//we can be quite sure that this is IMeshSceneNode, because we just added them in the above loop.
IMeshSceneNode
*
node
=
static_cast
<
IMeshSceneNode
*>
(
container
[
i
]);
scene
::
IMeshSceneNode
*
node
=
static_cast
<
scene
::
IMeshSceneNode
*>
(
container
[
i
]);
S3DVertex
*
pv
=
static_cast
<
S3DVertex
*>
(
node
->
getMesh
()
->
getMeshBuffer
(
0
)
->
getVertices
());
video
::
S3DVertex
*
pv
=
static_cast
<
video
::
S3DVertex
*>
(
node
->
getMesh
()
->
getMeshBuffer
(
0
)
->
getVertices
());
//pv[0].TCoords.Y = pv[1].TCoords.Y = (letter_size.Height - 1) / static_cast<f32>(letter_size.Height);
//pv[0].TCoords.Y = pv[1].TCoords.Y = (letter_size.Height - 1) / static_cast<f32>(letter_size.Height);
//pv[1].TCoords.X = pv[3].TCoords.X = (letter_size.Width - 1) / static_cast<f32>(letter_size.Width);
//pv[1].TCoords.X = pv[3].TCoords.X = (letter_size.Width - 1) / static_cast<f32>(letter_size.Width);
pv
[
0
].
TCoords
=
vector2df
(
u1
,
v2
);
pv
[
0
].
TCoords
=
core
::
vector2df
(
u1
,
v2
);
pv
[
1
].
TCoords
=
vector2df
(
u2
,
v2
);
pv
[
1
].
TCoords
=
core
::
vector2df
(
u2
,
v2
);
pv
[
2
].
TCoords
=
vector2df
(
u1
,
v1
);
pv
[
2
].
TCoords
=
core
::
vector2df
(
u1
,
v1
);
pv
[
3
].
TCoords
=
vector2df
(
u2
,
v1
);
pv
[
3
].
TCoords
=
core
::
vector2df
(
u2
,
v1
);
container
[
i
]
->
getMaterial
(
0
).
setTexture
(
0
,
current_tex
);
container
[
i
]
->
getMaterial
(
0
).
setTexture
(
0
,
current_tex
);
}
}
...
...
Classes/gframe/client_card.cpp
View file @
26a52ce9
...
@@ -56,7 +56,7 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
...
@@ -56,7 +56,7 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
}
}
if
(
flag
&
QUERY_POSITION
)
{
if
(
flag
&
QUERY_POSITION
)
{
int
pdata
=
(
BufferIO
::
ReadInt32
(
buf
)
>>
24
)
&
0xff
;
int
pdata
=
(
BufferIO
::
ReadInt32
(
buf
)
>>
24
)
&
0xff
;
if
((
location
&
(
LOCATION_EXTRA
|
LOCATION_REMOVED
))
&&
(
u8
)
pdata
!=
position
)
{
if
((
location
&
(
LOCATION_EXTRA
|
LOCATION_REMOVED
))
&&
pdata
!=
position
)
{
position
=
pdata
;
position
=
pdata
;
mainGame
->
dField
.
MoveCard
(
this
,
1
);
mainGame
->
dField
.
MoveCard
(
this
,
1
);
}
else
}
else
...
...
Classes/gframe/client_card.h
View file @
26a52ce9
...
@@ -15,9 +15,9 @@ public:
...
@@ -15,9 +15,9 @@ public:
irr
::
core
::
vector3df
curRot
;
irr
::
core
::
vector3df
curRot
;
irr
::
core
::
vector3df
dPos
;
irr
::
core
::
vector3df
dPos
;
irr
::
core
::
vector3df
dRot
;
irr
::
core
::
vector3df
dRot
;
u32
curAlpha
{
255
};
irr
::
u32
curAlpha
{
255
};
u32
dAlpha
{
0
};
irr
::
u32
dAlpha
{
0
};
u32
aniFrame
{
0
};
irr
::
u32
aniFrame
{
0
};
bool
is_moving
{
false
};
bool
is_moving
{
false
};
bool
is_fading
{
false
};
bool
is_fading
{
false
};
bool
is_hovered
{
false
};
bool
is_hovered
{
false
};
...
...
Classes/gframe/client_field.cpp
View file @
26a52ce9
...
@@ -669,14 +669,14 @@ void ClientField::ShowSelectOption(int select_hint) {
...
@@ -669,14 +669,14 @@ void ClientField::ShowSelectOption(int select_hint) {
mainGame
->
btnOptionOK
->
setVisible
(
false
);
mainGame
->
btnOptionOK
->
setVisible
(
false
);
for
(
int
i
=
0
;
i
<
5
;
i
++
)
for
(
int
i
=
0
;
i
<
5
;
i
++
)
mainGame
->
btnOption
[
i
]
->
setVisible
(
i
<
count
);
mainGame
->
btnOption
[
i
]
->
setVisible
(
i
<
count
);
recti
pos
=
mainGame
->
wOptions
->
getRelativePosition
();
irr
::
core
::
recti
pos
=
mainGame
->
wOptions
->
getRelativePosition
();
int
newheight
=
50
+
60
*
(
scrollbar
?
5
:
count
)
*
mainGame
->
yScale
;
int
newheight
=
50
+
60
*
(
scrollbar
?
5
:
count
)
*
mainGame
->
yScale
;
int
oldheight
=
pos
.
LowerRightCorner
.
Y
-
pos
.
UpperLeftCorner
.
Y
;
int
oldheight
=
pos
.
LowerRightCorner
.
Y
-
pos
.
UpperLeftCorner
.
Y
;
pos
.
UpperLeftCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
(
oldheight
-
newheight
)
/
2
;
pos
.
UpperLeftCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
(
oldheight
-
newheight
)
/
2
;
pos
.
LowerRightCorner
.
X
=
pos
.
UpperLeftCorner
.
X
+
(
scrollbar
?
425
:
390
)
*
mainGame
->
xScale
;
pos
.
LowerRightCorner
.
X
=
pos
.
UpperLeftCorner
.
X
+
(
scrollbar
?
425
:
390
)
*
mainGame
->
xScale
;
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
newheight
;
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
newheight
;
mainGame
->
wOptions
->
setRelativePosition
(
pos
);
mainGame
->
wOptions
->
setRelativePosition
(
pos
);
mainGame
->
bgOptions
->
setRelativePosition
(
rect
<
s32
>
(
0
,
0
,
(
scrollbar
?
425
:
390
)
*
mainGame
->
xScale
,
pos
.
LowerRightCorner
.
Y
-
pos
.
UpperLeftCorner
.
Y
));
mainGame
->
bgOptions
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
0
,
0
,
(
scrollbar
?
425
:
390
)
*
mainGame
->
xScale
,
pos
.
LowerRightCorner
.
Y
-
pos
.
UpperLeftCorner
.
Y
));
}
else
{
}
else
{
mainGame
->
SetStaticText
(
mainGame
->
stOptions
,
350
*
mainGame
->
xScale
,
mainGame
->
guiFont
,
dataManager
.
GetDesc
(
select_options
[
0
]));
mainGame
->
SetStaticText
(
mainGame
->
stOptions
,
350
*
mainGame
->
xScale
,
mainGame
->
guiFont
,
dataManager
.
GetDesc
(
select_options
[
0
]));
mainGame
->
stOptions
->
setVisible
(
true
);
mainGame
->
stOptions
->
setVisible
(
true
);
...
@@ -685,10 +685,10 @@ void ClientField::ShowSelectOption(int select_hint) {
...
@@ -685,10 +685,10 @@ void ClientField::ShowSelectOption(int select_hint) {
mainGame
->
btnOptionOK
->
setVisible
(
true
);
mainGame
->
btnOptionOK
->
setVisible
(
true
);
for
(
int
i
=
0
;
i
<
5
;
i
++
)
for
(
int
i
=
0
;
i
<
5
;
i
++
)
mainGame
->
btnOption
[
i
]
->
setVisible
(
false
);
mainGame
->
btnOption
[
i
]
->
setVisible
(
false
);
recti
pos
=
mainGame
->
wOptions
->
getRelativePosition
();
irr
::
core
::
recti
pos
=
mainGame
->
wOptions
->
getRelativePosition
();
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
180
*
mainGame
->
yScale
;
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
180
*
mainGame
->
yScale
;
mainGame
->
wOptions
->
setRelativePosition
(
pos
);
mainGame
->
wOptions
->
setRelativePosition
(
pos
);
mainGame
->
bgOptions
->
setRelativePosition
(
pos
);
mainGame
->
bgOptions
->
setRelativePosition
(
mainGame
->
wOptions
->
getRelativePosition
()
);
}
}
if
(
select_hint
)
if
(
select_hint
)
myswprintf
(
textBuffer
,
L"%ls"
,
dataManager
.
GetDesc
(
select_hint
));
myswprintf
(
textBuffer
,
L"%ls"
,
dataManager
.
GetDesc
(
select_hint
));
...
...
Classes/gframe/config.h
View file @
26a52ce9
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
#define mystrncasecmp strncasecmp
#define mystrncasecmp strncasecmp
#include <cstdio>
#include <cstdio>
#include <
stdlib.h
>
#include <
cstdlib
>
#include <iostream>
#include <iostream>
#include <algorithm>
#include <algorithm>
#include <string>
#include <string>
...
@@ -70,13 +70,8 @@ inline FILE* mywfopen(const wchar_t* filename, const char* mode) {
...
@@ -70,13 +70,8 @@ inline FILE* mywfopen(const wchar_t* filename, const char* mode) {
}
}
#include <irrlicht.h>
#include <irrlicht.h>
using
namespace
irr
;
using
namespace
irr
::
io
;
using
namespace
core
;
using
namespace
irr
::
os
;
using
namespace
scene
;
using
namespace
video
;
using
namespace
io
;
using
namespace
gui
;
using
namespace
os
;
extern
const
unsigned
short
PRO_VERSION
;
extern
const
unsigned
short
PRO_VERSION
;
extern
unsigned
int
enable_log
;
extern
unsigned
int
enable_log
;
...
...
Classes/gframe/data_manager.cpp
View file @
26a52ce9
...
@@ -87,10 +87,10 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
...
@@ -87,10 +87,10 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
if
(
reader
==
nullptr
)
if
(
reader
==
nullptr
)
return
false
;
return
false
;
spmemvfs_db_t
db
;
spmemvfs_db_t
db
;
spmembuffer_t
*
mem
=
(
spmembuffer_t
*
)
calloc
(
sizeof
(
spmembuffer_t
),
1
);
spmembuffer_t
*
mem
=
(
spmembuffer_t
*
)
std
::
calloc
(
sizeof
(
spmembuffer_t
),
1
);
spmemvfs_env_init
();
spmemvfs_env_init
();
mem
->
total
=
mem
->
used
=
reader
->
getSize
();
mem
->
total
=
mem
->
used
=
reader
->
getSize
();
mem
->
data
=
(
char
*
)
malloc
(
mem
->
total
+
1
);
mem
->
data
=
(
char
*
)
std
::
malloc
(
mem
->
total
+
1
);
reader
->
read
(
mem
->
data
,
mem
->
total
);
reader
->
read
(
mem
->
data
,
mem
->
total
);
reader
->
drop
();
reader
->
drop
();
(
mem
->
data
)[
mem
->
total
]
=
'\0'
;
(
mem
->
data
)[
mem
->
total
]
=
'\0'
;
...
@@ -411,7 +411,7 @@ unsigned char* DataManager::ScriptReaderEx(const char* script_path, int* slen) {
...
@@ -411,7 +411,7 @@ unsigned char* DataManager::ScriptReaderEx(const char* script_path, int* slen) {
return
nullptr
;
return
nullptr
;
}
}
unsigned
char
*
DataManager
::
ReadScriptFromIrrFS
(
const
char
*
script_name
,
int
*
slen
)
{
unsigned
char
*
DataManager
::
ReadScriptFromIrrFS
(
const
char
*
script_name
,
int
*
slen
)
{
IReadFile
*
reader
=
FileSystem
->
createAndOpenFile
(
script_name
);
auto
reader
=
FileSystem
->
createAndOpenFile
(
script_name
);
if
(
!
reader
)
if
(
!
reader
)
return
nullptr
;
return
nullptr
;
int
size
=
reader
->
read
(
scriptBuffer
,
sizeof
scriptBuffer
);
int
size
=
reader
->
read
(
scriptBuffer
,
sizeof
scriptBuffer
);
...
...
Classes/gframe/deck_con.cpp
View file @
26a52ce9
...
@@ -150,13 +150,13 @@ void DeckBuilder::Terminate() {
...
@@ -150,13 +150,13 @@ void DeckBuilder::Terminate() {
if
(
catesel
>=
0
)
if
(
catesel
>=
0
)
BufferIO
::
CopyWideString
(
mainGame
->
cbDBCategory
->
getItem
(
catesel
),
mainGame
->
gameConf
.
lastcategory
);
BufferIO
::
CopyWideString
(
mainGame
->
cbDBCategory
->
getItem
(
catesel
),
mainGame
->
gameConf
.
lastcategory
);
BufferIO
::
EncodeUTF8
(
mainGame
->
gameConf
.
lastcategory
,
linebuf
);
BufferIO
::
EncodeUTF8
(
mainGame
->
gameConf
.
lastcategory
,
linebuf
);
android
::
setLastCategory
(
mainGame
->
appMain
,
linebuf
);
irr
::
android
::
setLastCategory
(
mainGame
->
appMain
,
linebuf
);
//irr:os::Printer::log("setLastCategory", linebuf);
//irr:os::Printer::log("setLastCategory", linebuf);
int
decksel
=
mainGame
->
cbDBDecks
->
getSelected
();
int
decksel
=
mainGame
->
cbDBDecks
->
getSelected
();
if
(
decksel
>=
0
)
if
(
decksel
>=
0
)
BufferIO
::
CopyWideString
(
mainGame
->
cbDBDecks
->
getItem
(
decksel
),
mainGame
->
gameConf
.
lastdeck
);
BufferIO
::
CopyWideString
(
mainGame
->
cbDBDecks
->
getItem
(
decksel
),
mainGame
->
gameConf
.
lastdeck
);
BufferIO
::
EncodeUTF8
(
mainGame
->
gameConf
.
lastdeck
,
linebuf
);
BufferIO
::
EncodeUTF8
(
mainGame
->
gameConf
.
lastdeck
,
linebuf
);
android
::
setLastDeck
(
mainGame
->
appMain
,
linebuf
);
irr
::
android
::
setLastDeck
(
mainGame
->
appMain
,
linebuf
);
//os::Printer::log("setLastDeck", linebuf);
//os::Printer::log("setLastDeck", linebuf);
mainGame
->
SaveConfig
();
mainGame
->
SaveConfig
();
if
(
exit_on_return
)
if
(
exit_on_return
)
...
@@ -173,7 +173,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -173,7 +173,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
return
false
;
return
false
;
switch
(
event
.
EventType
)
{
switch
(
event
.
EventType
)
{
case
irr
:
:
EET_GUI_EVENT
:
{
case
irr
:
:
EET_GUI_EVENT
:
{
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
irr
::
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
if
(((
mainGame
->
wCategories
->
isVisible
()
&&
id
!=
BUTTON_CATEGORY_OK
)
||
if
(((
mainGame
->
wCategories
->
isVisible
()
&&
id
!=
BUTTON_CATEGORY_OK
)
||
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
||
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
||
(
mainGame
->
wLinkMarks
->
isVisible
()
&&
id
!=
BUTTON_MARKERS_OK
)
||
(
mainGame
->
wLinkMarks
->
isVisible
()
&&
id
!=
BUTTON_MARKERS_OK
)
||
...
...
Classes/gframe/deck_manager.cpp
View file @
26a52ce9
...
@@ -42,8 +42,8 @@ void DeckManager::LoadLFListSingle(const char* path) {
...
@@ -42,8 +42,8 @@ void DeckManager::LoadLFListSingle(const char* path) {
std
::
fclose
(
fp
);
std
::
fclose
(
fp
);
}
}
}
}
void
DeckManager
::
LoadLFList
(
android
::
InitOptions
*
options
)
{
void
DeckManager
::
LoadLFList
(
irr
::
android
::
InitOptions
*
options
)
{
io
::
path
workingDir
=
options
->
getWorkDir
();
irr
::
io
::
path
workingDir
=
options
->
getWorkDir
();
LoadLFListSingle
((
workingDir
+
path
(
"/expansions/lflist.conf"
)).
c_str
());
LoadLFListSingle
((
workingDir
+
path
(
"/expansions/lflist.conf"
)).
c_str
());
LoadLFListSingle
((
workingDir
+
path
(
"/lflist.conf"
)).
c_str
());
LoadLFListSingle
((
workingDir
+
path
(
"/lflist.conf"
)).
c_str
());
LFList
nolimit
;
LFList
nolimit
;
...
@@ -197,7 +197,7 @@ int DeckManager::LoadDeck(Deck& deck, std::istringstream& deckStream, bool is_pa
...
@@ -197,7 +197,7 @@ int DeckManager::LoadDeck(Deck& deck, std::istringstream& deckStream, bool is_pa
if
(
linebuf
[
0
]
<
'0'
||
linebuf
[
0
]
>
'9'
)
if
(
linebuf
[
0
]
<
'0'
||
linebuf
[
0
]
>
'9'
)
continue
;
continue
;
errno
=
0
;
errno
=
0
;
code
=
strtol
(
linebuf
.
c_str
(),
nullptr
,
10
);
code
=
st
d
::
st
rtol
(
linebuf
.
c_str
(),
nullptr
,
10
);
if
(
errno
==
ERANGE
)
if
(
errno
==
ERANGE
)
continue
;
continue
;
cardlist
[
ct
++
]
=
code
;
cardlist
[
ct
++
]
=
code
;
...
@@ -289,7 +289,7 @@ irr::io::IReadFile* DeckManager::OpenDeckReader(const wchar_t* file) {
...
@@ -289,7 +289,7 @@ irr::io::IReadFile* DeckManager::OpenDeckReader(const wchar_t* file) {
}
}
bool
DeckManager
::
LoadCurrentDeck
(
const
wchar_t
*
file
,
bool
is_packlist
)
{
bool
DeckManager
::
LoadCurrentDeck
(
const
wchar_t
*
file
,
bool
is_packlist
)
{
current_deck
.
clear
();
current_deck
.
clear
();
IReadFile
*
reader
=
OpenDeckReader
(
file
);
auto
reader
=
OpenDeckReader
(
file
);
if
(
!
reader
)
{
if
(
!
reader
)
{
wchar_t
localfile
[
256
];
wchar_t
localfile
[
256
];
myswprintf
(
localfile
,
L"./deck/%ls.ydk"
,
file
);
myswprintf
(
localfile
,
L"./deck/%ls.ydk"
,
file
);
...
@@ -315,7 +315,7 @@ bool DeckManager::LoadCurrentDeck(const wchar_t* file, bool is_packlist) {
...
@@ -315,7 +315,7 @@ bool DeckManager::LoadCurrentDeck(const wchar_t* file, bool is_packlist) {
bool
DeckManager
::
LoadCurrentDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
bool
DeckManager
::
LoadCurrentDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
wchar_t
filepath
[
256
];
wchar_t
filepath
[
256
];
GetDeckFile
(
filepath
,
cbCategory
,
cbDeck
);
GetDeckFile
(
filepath
,
cbCategory
,
cbDeck
);
bool
is_packlist
=
cbCategory
->
getSelected
()
==
0
;
bool
is_packlist
=
(
cbCategory
->
getSelected
()
==
0
)
;
bool
res
=
LoadCurrentDeck
(
filepath
,
is_packlist
);
bool
res
=
LoadCurrentDeck
(
filepath
,
is_packlist
);
if
(
res
&&
mainGame
->
is_building
)
if
(
res
&&
mainGame
->
is_building
)
mainGame
->
deckBuilder
.
RefreshPackListScroll
();
mainGame
->
deckBuilder
.
RefreshPackListScroll
();
...
...
Classes/gframe/deck_manager.h
View file @
26a52ce9
...
@@ -44,7 +44,7 @@ public:
...
@@ -44,7 +44,7 @@ public:
static
char
deckBuffer
[
0x10000
];
static
char
deckBuffer
[
0x10000
];
void
LoadLFListSingle
(
const
char
*
path
);
void
LoadLFListSingle
(
const
char
*
path
);
void
LoadLFList
(
android
::
InitOptions
*
options
);
void
LoadLFList
(
irr
::
android
::
InitOptions
*
options
);
const
wchar_t
*
GetLFListName
(
unsigned
int
lfhash
);
const
wchar_t
*
GetLFListName
(
unsigned
int
lfhash
);
const
LFList
*
GetLFList
(
unsigned
int
lfhash
);
const
LFList
*
GetLFList
(
unsigned
int
lfhash
);
unsigned
int
CheckDeck
(
Deck
&
deck
,
int
lfhash
,
int
rule
);
unsigned
int
CheckDeck
(
Deck
&
deck
,
int
lfhash
,
int
rule
);
...
...
Classes/gframe/drawing.cpp
View file @
26a52ce9
This diff is collapsed.
Click to expand it.
Classes/gframe/duelclient.cpp
View file @
26a52ce9
...
@@ -1948,14 +1948,14 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
...
@@ -1948,14 +1948,14 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
mainGame
->
btnPSDD
->
setVisible
(
true
);
mainGame
->
btnPSDD
->
setVisible
(
true
);
startpos
+=
178
;
startpos
+=
178
;
}
else
mainGame
->
btnPSDD
->
setVisible
(
false
);
}
else
mainGame
->
btnPSDD
->
setVisible
(
false
);
recti
pos
=
mainGame
->
wPosSelect
->
getRelativePosition
();
irr
::
core
::
recti
pos
=
mainGame
->
wPosSelect
->
getRelativePosition
();
s32
oldcenter
=
pos
.
getCenter
().
X
;
irr
::
s32
oldcenter
=
pos
.
getCenter
().
X
;
pos
.
LowerRightCorner
.
X
=
pos
.
UpperLeftCorner
.
X
+
(
count
*
178
+
50
)
*
mainGame
->
yScale
;
pos
.
LowerRightCorner
.
X
=
pos
.
UpperLeftCorner
.
X
+
(
count
*
178
+
50
)
*
mainGame
->
yScale
;
s32
newwidth
=
pos
.
getWidth
();
irr
::
s32
newwidth
=
pos
.
getWidth
();
pos
.
UpperLeftCorner
.
X
=
oldcenter
-
newwidth
/
2
;
pos
.
UpperLeftCorner
.
X
=
oldcenter
-
newwidth
/
2
;
pos
.
LowerRightCorner
.
X
=
oldcenter
+
newwidth
/
2
;
pos
.
LowerRightCorner
.
X
=
oldcenter
+
newwidth
/
2
;
mainGame
->
wPosSelect
->
setRelativePosition
(
pos
);
mainGame
->
wPosSelect
->
setRelativePosition
(
pos
);
mainGame
->
bgPosSelect
->
setRelativePosition
(
rect
<
s32
>
(
0
,
0
,
pos
.
getWidth
(),
pos
.
getHeight
()));
mainGame
->
bgPosSelect
->
setRelativePosition
(
irr
::
core
::
rect
<
irr
::
s32
>
(
0
,
0
,
pos
.
getWidth
(),
pos
.
getHeight
()));
mainGame
->
gMutex
.
lock
();
mainGame
->
gMutex
.
lock
();
mainGame
->
PopupElement
(
mainGame
->
wPosSelect
);
mainGame
->
PopupElement
(
mainGame
->
wPosSelect
);
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
...
@@ -3480,11 +3480,11 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
...
@@ -3480,11 +3480,11 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
float
xd
=
mainGame
->
dField
.
attack_target
->
curPos
.
X
;
float
xd
=
mainGame
->
dField
.
attack_target
->
curPos
.
X
;
float
yd
=
mainGame
->
dField
.
attack_target
->
curPos
.
Y
;
float
yd
=
mainGame
->
dField
.
attack_target
->
curPos
.
Y
;
sy
=
(
float
)
sqrt
((
xa
-
xd
)
*
(
xa
-
xd
)
+
(
ya
-
yd
)
*
(
ya
-
yd
))
/
2
;
sy
=
(
float
)
sqrt
((
xa
-
xd
)
*
(
xa
-
xd
)
+
(
ya
-
yd
)
*
(
ya
-
yd
))
/
2
;
mainGame
->
atk_t
=
vector3df
((
xa
+
xd
)
/
2
,
(
ya
+
yd
)
/
2
,
0
);
mainGame
->
atk_t
=
irr
::
core
::
vector3df
((
xa
+
xd
)
/
2
,
(
ya
+
yd
)
/
2
,
0
);
if
(
ca
==
0
)
if
(
ca
==
0
)
mainGame
->
atk_r
=
vector3df
(
0
,
0
,
-
atan
((
xd
-
xa
)
/
(
yd
-
ya
)));
mainGame
->
atk_r
=
irr
::
core
::
vector3df
(
0
,
0
,
-
atan
((
xd
-
xa
)
/
(
yd
-
ya
)));
else
else
mainGame
->
atk_r
=
vector3df
(
0
,
0
,
3.1415926
-
atan
((
xd
-
xa
)
/
(
yd
-
ya
)));
mainGame
->
atk_r
=
irr
::
core
::
vector3df
(
0
,
0
,
3.1415926
-
atan
((
xd
-
xa
)
/
(
yd
-
ya
)));
}
else
{
}
else
{
mainGame
->
soundManager
->
PlaySoundEffect
(
SoundManager
::
SFX
::
DIRECT_ATTACK
);
mainGame
->
soundManager
->
PlaySoundEffect
(
SoundManager
::
SFX
::
DIRECT_ATTACK
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1620
),
dataManager
.
GetName
(
mainGame
->
dField
.
attacker
->
code
));
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1620
),
dataManager
.
GetName
(
mainGame
->
dField
.
attacker
->
code
));
...
@@ -3495,11 +3495,11 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
...
@@ -3495,11 +3495,11 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
if
(
ca
==
0
)
if
(
ca
==
0
)
yd
=
-
3.5
f
;
yd
=
-
3.5
f
;
sy
=
(
float
)
sqrt
((
xa
-
xd
)
*
(
xa
-
xd
)
+
(
ya
-
yd
)
*
(
ya
-
yd
))
/
2
;
sy
=
(
float
)
sqrt
((
xa
-
xd
)
*
(
xa
-
xd
)
+
(
ya
-
yd
)
*
(
ya
-
yd
))
/
2
;
mainGame
->
atk_t
=
vector3df
((
xa
+
xd
)
/
2
,
(
ya
+
yd
)
/
2
,
0
);
mainGame
->
atk_t
=
irr
::
core
::
vector3df
((
xa
+
xd
)
/
2
,
(
ya
+
yd
)
/
2
,
0
);
if
(
ca
==
0
)
if
(
ca
==
0
)
mainGame
->
atk_r
=
vector3df
(
0
,
0
,
-
atan
((
xd
-
xa
)
/
(
yd
-
ya
)));
mainGame
->
atk_r
=
irr
::
core
::
vector3df
(
0
,
0
,
-
atan
((
xd
-
xa
)
/
(
yd
-
ya
)));
else
else
mainGame
->
atk_r
=
vector3df
(
0
,
0
,
3.1415926
-
atan
((
xd
-
xa
)
/
(
yd
-
ya
)));
mainGame
->
atk_r
=
irr
::
core
::
vector3df
(
0
,
0
,
3.1415926
-
atan
((
xd
-
xa
)
/
(
yd
-
ya
)));
}
}
matManager
.
GenArrow
(
sy
);
matManager
.
GenArrow
(
sy
);
mainGame
->
attack_sv
=
0
;
mainGame
->
attack_sv
=
0
;
...
@@ -4089,7 +4089,7 @@ void DuelClient::BeginRefreshHost() {
...
@@ -4089,7 +4089,7 @@ void DuelClient::BeginRefreshHost() {
event_base
*
broadev
=
event_base_new
();
event_base
*
broadev
=
event_base_new
();
#ifdef _IRR_ANDROID_PLATFORM_
#ifdef _IRR_ANDROID_PLATFORM_
//get local ip address in android style
//get local ip address in android style
int
ipaddr
=
android
::
getLocalAddr
(
mainGame
->
appMain
);
int
ipaddr
=
irr
::
android
::
getLocalAddr
(
mainGame
->
appMain
);
if
(
ipaddr
==
-
1
)
{
if
(
ipaddr
==
-
1
)
{
return
;
return
;
}
}
...
...
Classes/gframe/event_handler.cpp
View file @
26a52ce9
This diff is collapsed.
Click to expand it.
Classes/gframe/game.cpp
View file @
26a52ce9
This diff is collapsed.
Click to expand it.
Classes/gframe/game.h
View file @
26a52ce9
...
@@ -123,11 +123,11 @@ struct DuelInfo {
...
@@ -123,11 +123,11 @@ struct DuelInfo {
int
card_count
[
2
];
int
card_count
[
2
];
int
total_attack
[
2
];
int
total_attack
[
2
];
wchar_t
str_time_left
[
2
][
16
];
wchar_t
str_time_left
[
2
][
16
];
video
::
SColor
time_color
[
2
];
irr
::
video
::
SColor
time_color
[
2
];
wchar_t
str_card_count
[
2
][
16
];
wchar_t
str_card_count
[
2
][
16
];
wchar_t
str_total_attack
[
2
][
16
];
wchar_t
str_total_attack
[
2
][
16
];
video
::
SColor
card_count_color
[
2
];
irr
::
video
::
SColor
card_count_color
[
2
];
video
::
SColor
total_attack_color
[
2
];
irr
::
video
::
SColor
total_attack_color
[
2
];
};
};
struct
BotInfo
{
struct
BotInfo
{
...
@@ -152,19 +152,19 @@ struct FadingUnit {
...
@@ -152,19 +152,19 @@ struct FadingUnit {
irr
::
core
::
vector2di
fadingDiff
;
irr
::
core
::
vector2di
fadingDiff
;
};
};
class
Game
:
IProcessEventReceiver
{
class
Game
:
irr
::
IProcessEventReceiver
{
public:
public:
#ifdef _IRR_ANDROID_PLATFORM_
#ifdef _IRR_ANDROID_PLATFORM_
void
stopBGM
();
void
stopBGM
();
void
playBGM
();
void
playBGM
();
bool
Initialize
(
ANDROID_APP
app
,
android
::
InitOptions
*
options
);
bool
Initialize
(
ANDROID_APP
app
,
irr
::
android
::
InitOptions
*
options
);
#endif
#endif
void
MainLoop
();
void
MainLoop
();
void
RefreshTimeDisplay
();
void
RefreshTimeDisplay
();
void
BuildProjectionMatrix
(
irr
::
core
::
matrix4
&
mProjection
,
f32
left
,
f32
right
,
f32
bottom
,
f32
top
,
f32
znear
,
f32
zfar
);
void
BuildProjectionMatrix
(
irr
::
core
::
matrix4
&
mProjection
,
irr
::
f32
left
,
irr
::
f32
right
,
irr
::
f32
bottom
,
irr
::
f32
top
,
irr
::
f32
znear
,
irr
::
f32
zfar
);
void
InitStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
u32
cHeight
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
);
void
InitStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
irr
::
u32
cWidth
,
irr
::
u32
cHeight
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
);
std
::
wstring
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
=
0
);
std
::
wstring
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
irr
::
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
irr
::
u32
pos
=
0
);
void
LoadExpansions
();
void
LoadExpansions
();
void
RefreshCategoryDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
,
bool
selectlastused
=
true
);
void
RefreshCategoryDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
,
bool
selectlastused
=
true
);
void
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
...
@@ -216,7 +216,7 @@ public:
...
@@ -216,7 +216,7 @@ public:
int
ChatLocalPlayer
(
int
player
);
int
ChatLocalPlayer
(
int
player
);
const
wchar_t
*
LocalName
(
int
local_player
);
const
wchar_t
*
LocalName
(
int
local_player
);
bool
HasFocus
(
EGUI_ELEMENT_TYPE
type
)
const
{
bool
HasFocus
(
irr
::
gui
::
EGUI_ELEMENT_TYPE
type
)
const
{
irr
::
gui
::
IGUIElement
*
focus
=
env
->
getFocus
();
irr
::
gui
::
IGUIElement
*
focus
=
env
->
getFocus
();
return
focus
&&
focus
->
hasType
(
type
);
return
focus
&&
focus
->
hasType
(
type
);
}
}
...
@@ -228,19 +228,19 @@ public:
...
@@ -228,19 +228,19 @@ public:
}
}
void
ResizeChatInputWindow
();
void
ResizeChatInputWindow
();
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
irr
::
core
::
recti
Resize
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
);
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
s32
dx
,
s32
dy
,
s32
dx2
,
s32
dy2
);
irr
::
core
::
recti
Resize
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
,
irr
::
s32
dx
,
irr
::
s32
dy
,
irr
::
s32
dx2
,
irr
::
s32
dy2
);
irr
::
core
::
vector2di
Resize
(
s32
x
,
s32
y
);
irr
::
core
::
vector2di
Resize
(
irr
::
s32
x
,
irr
::
s32
y
);
irr
::
core
::
vector2di
ResizeReverse
(
s32
x
,
s32
y
);
irr
::
core
::
vector2di
ResizeReverse
(
irr
::
s32
x
,
irr
::
s32
y
);
recti
ResizePhaseHint
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
s32
width
);
irr
::
core
::
recti
ResizePhaseHint
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
,
irr
::
s32
width
);
recti
ResizeWin
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
irr
::
core
::
recti
ResizeWin
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
);
recti
Resize_Y
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
irr
::
core
::
recti
Resize_Y
(
irr
::
s32
x
,
irr
::
s32
y
,
irr
::
s32
x2
,
irr
::
s32
y2
);
irr
::
core
::
vector2di
Resize_Y
(
s32
x
,
s32
y
);
irr
::
core
::
vector2di
Resize_Y
(
irr
::
s32
x
,
irr
::
s32
y
);
template
<
typename
T
>
template
<
typename
T
>
static
std
::
vector
<
T
>
TokenizeString
(
T
input
,
const
T
&
token
);
static
std
::
vector
<
T
>
TokenizeString
(
T
input
,
const
T
&
token
);
template
<
typename
T
>
template
<
typename
T
>
static
void
DrawShadowText
(
irr
::
gui
::
CGUITTFont
*
font
,
const
T
&
text
,
const
core
::
rect
<
s32
>&
position
,
const
core
::
rect
<
s32
>&
padding
,
static
void
DrawShadowText
(
irr
::
gui
::
CGUITTFont
*
font
,
const
T
&
text
,
const
irr
::
core
::
rect
<
irr
::
s32
>&
position
,
const
irr
::
core
::
rect
<
irr
::
s32
>&
padding
,
video
::
SColor
color
=
0xffffffff
,
video
::
SColor
shadowcolor
=
0xff000000
,
bool
hcenter
=
false
,
bool
vcenter
=
false
,
const
core
::
rect
<
s32
>*
clip
=
nullptr
);
irr
::
video
::
SColor
color
=
0xffffffff
,
irr
::
video
::
SColor
shadowcolor
=
0xff000000
,
bool
hcenter
=
false
,
bool
vcenter
=
false
,
const
irr
::
core
::
rect
<
irr
::
s32
>*
clip
=
nullptr
);
std
::
unique_ptr
<
SoundManager
>
soundManager
;
std
::
unique_ptr
<
SoundManager
>
soundManager
;
std
::
mutex
gMutex
;
std
::
mutex
gMutex
;
...
@@ -258,38 +258,40 @@ public:
...
@@ -258,38 +258,40 @@ public:
std
::
wstring
chatMsg
[
8
];
std
::
wstring
chatMsg
[
8
];
std
::
vector
<
BotInfo
>
botInfo
;
std
::
vector
<
BotInfo
>
botInfo
;
int
hideChatTimer
;
int
hideChatTimer
{}
;
bool
hideChat
;
bool
hideChat
{}
;
int
chatTiming
[
8
]{};
int
chatTiming
[
8
]{};
int
chatType
[
8
]{};
int
chatType
[
8
]{};
unsigned
short
linePatternD3D
;
unsigned
short
linePatternD3D
{}
;
unsigned
short
linePatternGL
;
unsigned
short
linePatternGL
{
0x0f0f
}
;
int
waitFrame
;
int
waitFrame
{}
;
int
signalFrame
;
int
signalFrame
{}
;
int
actionParam
;
int
actionParam
{}
;
const
wchar_t
*
showingtext
;
const
wchar_t
*
showingtext
{}
;
int
showcard
;
int
showcard
{}
;
int
showcardcode
;
int
showcardcode
{}
;
int
showcarddif
;
int
showcarddif
{}
;
int
showcardp
;
int
showcardp
{}
;
int
is_attacking
;
int
is_attacking
{}
;
int
attack_sv
;
int
attack_sv
{}
;
irr
::
core
::
vector3df
atk_r
;
irr
::
core
::
vector3df
atk_r
;
irr
::
core
::
vector3df
atk_t
;
irr
::
core
::
vector3df
atk_t
;
float
atkdy
;
float
atkdy
{}
;
int
lpframe
;
int
lpframe
{}
;
int
lpd
;
int
lpd
{}
;
int
lpplayer
;
int
lpplayer
{}
;
int
lpccolor
;
int
lpccolor
{}
;
std
::
wstring
lpcstring
;
std
::
wstring
lpcstring
;
bool
always_chain
;
bool
always_chain
{}
;
bool
ignore_chain
;
bool
ignore_chain
{}
;
bool
chain_when_avail
;
bool
chain_when_avail
{}
;
bool
is_building
;
bool
is_building
{}
;
bool
is_siding
;
bool
is_siding
{}
;
irr
::
core
::
dimension2d
<
irr
::
u32
>
window_size
;
irr
::
core
::
dimension2d
<
irr
::
u32
>
window_size
;
float
xScale
{
1.0
f
};
float
yScale
{
1.0
f
};
ClientField
dField
;
ClientField
dField
;
DeckBuilder
deckBuilder
;
DeckBuilder
deckBuilder
;
...
@@ -524,8 +526,8 @@ public:
...
@@ -524,8 +526,8 @@ public:
irr
::
gui
::
IGUIImage
*
bgCardDisplay
;
irr
::
gui
::
IGUIImage
*
bgCardDisplay
;
irr
::
gui
::
IGUIStaticText
*
stCardDisplay
;
irr
::
gui
::
IGUIStaticText
*
stCardDisplay
;
irr
::
gui
::
CGUIImageButton
*
btnCardDisplay
[
5
];
irr
::
gui
::
CGUIImageButton
*
btnCardDisplay
[
5
];
irr
::
gui
::
IGUIStaticText
*
stDisplayPos
[
5
];
irr
::
gui
::
IGUIStaticText
*
stDisplayPos
[
5
];
irr
::
gui
::
IGUIScrollBar
*
scrDisplayList
;
irr
::
gui
::
IGUIScrollBar
*
scrDisplayList
;
irr
::
gui
::
IGUIButton
*
btnDisplayOK
;
irr
::
gui
::
IGUIButton
*
btnDisplayOK
;
//announce number
//announce number
irr
::
gui
::
IGUIWindow
*
wANNumber
;
irr
::
gui
::
IGUIWindow
*
wANNumber
;
...
@@ -687,22 +689,19 @@ public:
...
@@ -687,22 +689,19 @@ public:
irr
::
gui
::
IGUIButton
*
btnBigCardZoomIn
;
irr
::
gui
::
IGUIButton
*
btnBigCardZoomIn
;
irr
::
gui
::
IGUIButton
*
btnBigCardZoomOut
;
irr
::
gui
::
IGUIButton
*
btnBigCardZoomOut
;
irr
::
gui
::
IGUIButton
*
btnBigCardClose
;
irr
::
gui
::
IGUIButton
*
btnBigCardClose
;
float
xScale
;
float
yScale
;
#ifdef _IRR_ANDROID_PLATFORM_
#ifdef _IRR_ANDROID_PLATFORM_
ANDROID_APP
appMain
;
ANDROID_APP
appMain
;
int
glversion
;
int
glversion
;
bool
isPSEnabled
;
bool
isPSEnabled
;
bool
isNPOTSupported
;
bool
isNPOTSupported
;
s32
ogles2Solid
;
irr
::
s32
ogles2Solid
;
s32
ogles2TrasparentAlpha
;
irr
::
s32
ogles2TrasparentAlpha
;
s32
ogles2BlendTexture
;
irr
::
s32
ogles2BlendTexture
;
irr
::
android
::
CustomShaderConstantSetCallBack
customShadersCallback
;
irr
::
android
::
CustomShaderConstantSetCallBack
customShadersCallback
;
Signal
externalSignal
;
Signal
externalSignal
;
static
void
onHandleAndroidCommand
(
ANDROID_APP
app
,
int32_t
cmd
);
static
void
onHandleAndroidCommand
(
ANDROID_APP
app
,
int32_t
cmd
);
#endif
#endif
void
setPositionFix
(
core
::
position2di
fix
){
void
setPositionFix
(
irr
::
core
::
position2di
fix
){
InputFix
=
fix
;
InputFix
=
fix
;
}
}
float
optX
(
float
x
)
{
float
optX
(
float
x
)
{
...
@@ -722,7 +721,7 @@ public:
...
@@ -722,7 +721,7 @@ public:
}
}
void
process
(
irr
::
SEvent
&
event
);
void
process
(
irr
::
SEvent
&
event
);
private:
private:
core
::
position2di
InputFix
;
irr
::
core
::
position2di
InputFix
;
};
};
extern
Game
*
mainGame
;
extern
Game
*
mainGame
;
...
...
Classes/gframe/gframe.cpp
View file @
26a52ce9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#include "game.h"
#include "game.h"
#include "data_manager.h"
#include "data_manager.h"
#include <event2/thread.h>
#include <event2/thread.h>
#include <
locale.h
>
#include <
clocale
>
#include <memory>
#include <memory>
unsigned
int
enable_log
=
0x3
;
unsigned
int
enable_log
=
0x3
;
...
@@ -30,7 +30,7 @@ char* sub_string(const char* str, int start, int count = -1){
...
@@ -30,7 +30,7 @@ char* sub_string(const char* str, int start, int count = -1){
return
tmp
;
return
tmp
;
}
}
#ifdef _IRR_ANDROID_PLATFORM_
#ifdef _IRR_ANDROID_PLATFORM_
int
GetListBoxIndex
(
IGUIListBox
*
listbox
,
const
wchar_t
*
target
){
int
GetListBoxIndex
(
irr
::
gui
::
IGUIListBox
*
listbox
,
const
wchar_t
*
target
){
int
count
=
listbox
->
getItemCount
();
int
count
=
listbox
->
getItemCount
();
for
(
int
i
=
0
;
i
<
count
;
i
++
){
for
(
int
i
=
0
;
i
<
count
;
i
++
){
auto
item
=
listbox
->
getListItem
(
i
);
auto
item
=
listbox
->
getListItem
(
i
);
...
@@ -41,7 +41,7 @@ int GetListBoxIndex(IGUIListBox* listbox, const wchar_t * target){
...
@@ -41,7 +41,7 @@ int GetListBoxIndex(IGUIListBox* listbox, const wchar_t * target){
return
-
1
;
return
-
1
;
}
}
void
android_main
(
ANDROID_APP
app
)
{
void
android_main
(
ANDROID_APP
app
)
{
app
->
inputPollSource
.
process
=
android
::
process_input
;
app
->
inputPollSource
.
process
=
irr
::
android
::
process_input
;
#else
#else
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
#endif
#endif
...
@@ -49,7 +49,7 @@ int main(int argc, char* argv[]) {
...
@@ -49,7 +49,7 @@ int main(int argc, char* argv[]) {
ygo
::
Game
_game
;
ygo
::
Game
_game
;
ygo
::
mainGame
=
&
_game
;
ygo
::
mainGame
=
&
_game
;
#ifdef _IRR_ANDROID_PLATFORM_
#ifdef _IRR_ANDROID_PLATFORM_
android
::
InitOptions
*
options
=
android
::
getInitOptions
(
app
);
irr
::
android
::
InitOptions
*
options
=
irr
::
android
::
getInitOptions
(
app
);
if
(
!
ygo
::
mainGame
->
Initialize
(
app
,
options
)){
if
(
!
ygo
::
mainGame
->
Initialize
(
app
,
options
)){
delete
options
;
delete
options
;
return
;
return
;
...
...
Classes/gframe/image_manager.cpp
View file @
26a52ce9
...
@@ -204,7 +204,7 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
...
@@ -204,7 +204,7 @@ irr::video::ITexture* ImageManager::GetBigPicture(int code, float zoom) {
texture
=
driver
->
addTexture
(
file
,
srcimg
);
texture
=
driver
->
addTexture
(
file
,
srcimg
);
}
else
{
}
else
{
auto
origsize
=
srcimg
->
getDimension
();
auto
origsize
=
srcimg
->
getDimension
();
video
::
IImage
*
destimg
=
driver
->
createImage
(
srcimg
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
u32
>
(
origsize
.
Width
*
zoom
,
origsize
.
Height
*
zoom
));
irr
::
video
::
IImage
*
destimg
=
driver
->
createImage
(
srcimg
->
getColorFormat
(),
irr
::
core
::
dimension2d
<
irr
::
u32
>
(
origsize
.
Width
*
zoom
,
origsize
.
Height
*
zoom
));
//imageScaleNNAA(srcimg, destimg);
//imageScaleNNAA(srcimg, destimg);
texture
=
driver
->
addTexture
(
file
,
destimg
);
texture
=
driver
->
addTexture
(
file
,
destimg
);
destimg
->
drop
();
destimg
->
drop
();
...
...
Classes/gframe/image_manager.h
View file @
26a52ce9
...
@@ -29,7 +29,7 @@ public:
...
@@ -29,7 +29,7 @@ public:
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tFields
;
std
::
unordered_map
<
int
,
irr
::
video
::
ITexture
*>
tFields
;
irr
::
IrrlichtDevice
*
device
;
irr
::
IrrlichtDevice
*
device
;
irr
::
video
::
IVideoDriver
*
driver
;
irr
::
video
::
IVideoDriver
*
driver
;
irr
::
video
::
ITexture
*
tCover
[
2
];
irr
::
video
::
ITexture
*
tCover
[
4
];
irr
::
video
::
ITexture
*
tBigPicture
;
irr
::
video
::
ITexture
*
tBigPicture
;
irr
::
video
::
ITexture
*
tUnknown
;
irr
::
video
::
ITexture
*
tUnknown
;
irr
::
video
::
ITexture
*
tAct
;
irr
::
video
::
ITexture
*
tAct
;
...
...
Classes/gframe/menu_handler.cpp
View file @
26a52ce9
...
@@ -16,11 +16,11 @@ void UpdateDeck() {
...
@@ -16,11 +16,11 @@ void UpdateDeck() {
char
linebuf
[
256
];
char
linebuf
[
256
];
BufferIO
::
CopyWStr
(
mainGame
->
cbCategorySelect
->
getItem
(
mainGame
->
cbCategorySelect
->
getSelected
()),
mainGame
->
gameConf
.
lastcategory
,
64
);
BufferIO
::
CopyWStr
(
mainGame
->
cbCategorySelect
->
getItem
(
mainGame
->
cbCategorySelect
->
getSelected
()),
mainGame
->
gameConf
.
lastcategory
,
64
);
BufferIO
::
EncodeUTF8
(
mainGame
->
gameConf
.
lastcategory
,
linebuf
);
BufferIO
::
EncodeUTF8
(
mainGame
->
gameConf
.
lastcategory
,
linebuf
);
android
::
setLastCategory
(
mainGame
->
appMain
,
linebuf
);
irr
::
android
::
setLastCategory
(
mainGame
->
appMain
,
linebuf
);
BufferIO
::
CopyWStr
(
mainGame
->
cbDeckSelect
->
getItem
(
mainGame
->
cbDeckSelect
->
getSelected
()),
mainGame
->
gameConf
.
lastdeck
,
64
);
BufferIO
::
CopyWStr
(
mainGame
->
cbDeckSelect
->
getItem
(
mainGame
->
cbDeckSelect
->
getSelected
()),
mainGame
->
gameConf
.
lastdeck
,
64
);
BufferIO
::
EncodeUTF8
(
mainGame
->
gameConf
.
lastdeck
,
linebuf
);
BufferIO
::
EncodeUTF8
(
mainGame
->
gameConf
.
lastdeck
,
linebuf
);
android
::
setLastDeck
(
mainGame
->
appMain
,
linebuf
);
irr
::
android
::
setLastDeck
(
mainGame
->
appMain
,
linebuf
);
unsigned
char
deckbuf
[
1024
]{};
unsigned
char
deckbuf
[
1024
]{};
auto
pdeck
=
deckbuf
;
auto
pdeck
=
deckbuf
;
...
@@ -103,7 +103,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -103,7 +103,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
switch
(
event
.
EventType
)
{
switch
(
event
.
EventType
)
{
case
irr
:
:
EET_GUI_EVENT
:
{
case
irr
:
:
EET_GUI_EVENT
:
{
irr
::
gui
::
IGUIElement
*
caller
=
event
.
GUIEvent
.
Caller
;
irr
::
gui
::
IGUIElement
*
caller
=
event
.
GUIEvent
.
Caller
;
s32
id
=
caller
->
getID
();
irr
::
s32
id
=
caller
->
getID
();
if
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
{
if
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
{
mainGame
->
wQuery
->
getParent
()
->
bringToFront
(
mainGame
->
wQuery
);
mainGame
->
wQuery
->
getParent
()
->
bringToFront
(
mainGame
->
wQuery
);
break
;
break
;
...
@@ -381,7 +381,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -381,7 +381,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
prev_sel
=
sel
;
prev_sel
=
sel
;
#ifdef _IRR_ANDROID_PLATFORM_
#ifdef _IRR_ANDROID_PLATFORM_
ALOGD
(
"cc menu_handler: 1share replay file=%s"
,
name
);
ALOGD
(
"cc menu_handler: 1share replay file=%s"
,
name
);
android
::
OnShareFile
(
mainGame
->
appMain
,
"yrp"
,
name
);
irr
::
android
::
OnShareFile
(
mainGame
->
appMain
,
"yrp"
,
name
);
ALOGD
(
"cc menu_handler: 2after share replay file:index=%d"
,
sel
);
ALOGD
(
"cc menu_handler: 2after share replay file:index=%d"
,
sel
);
#endif
#endif
break
;
break
;
...
@@ -478,7 +478,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -478,7 +478,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
char
arg3
[
32
];
char
arg3
[
32
];
snprintf
(
arg3
,
sizeof
arg3
,
" Port=%d"
,
mainGame
->
gameConf
.
serverport
);
snprintf
(
arg3
,
sizeof
arg3
,
" Port=%d"
,
mainGame
->
gameConf
.
serverport
);
snprintf
(
args
,
sizeof
args
,
"%s%s%s"
,
arg1
,
arg2
,
arg3
);
snprintf
(
args
,
sizeof
args
,
"%s%s%s"
,
arg1
,
arg2
,
arg3
);
android
::
runWindbot
(
mainGame
->
appMain
,
args
);
irr
::
android
::
runWindbot
(
mainGame
->
appMain
,
args
);
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
{
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
{
mainGame
->
soundManager
->
PlaySoundEffect
(
SoundManager
::
SFX
::
INFO
);
mainGame
->
soundManager
->
PlaySoundEffect
(
SoundManager
::
SFX
::
INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
...
...
Classes/gframe/replay_mode.h
View file @
26a52ce9
#ifndef REPLAY_MODE_H
#ifndef REPLAY_MODE_H
#define REPLAY_MODE_H
#define REPLAY_MODE_H
#include <
stdint.h
>
#include <
cstdint
>
#include <vector>
#include <vector>
#include "replay.h"
#include "replay.h"
...
...
Classes/gframe/single_mode.h
View file @
26a52ce9
#ifndef SINGLE_MODE_H
#ifndef SINGLE_MODE_H
#define SINGLE_MODE_H
#define SINGLE_MODE_H
#include <
stdint.h
>
#include <
cstdint
>
#include <vector>
#include <vector>
#include "replay.h"
#include "replay.h"
...
...
Classes/gframe/utils.cpp
View file @
26a52ce9
...
@@ -384,7 +384,7 @@ namespace ygo {
...
@@ -384,7 +384,7 @@ namespace ygo {
auto
list
=
archive
->
getFileList
();
auto
list
=
archive
->
getFileList
();
std
::
vector
<
path_string
>
list_full
;
std
::
vector
<
path_string
>
list_full
;
folderindexes
[
TEXT
(
"."
)]
=
{
{
-
1
,
-
1
},
{
-
1
,
-
1
}
};
folderindexes
[
TEXT
(
"."
)]
=
{
{
-
1
,
-
1
},
{
-
1
,
-
1
}
};
for
(
u32
i
=
0
;
i
<
list
->
getFileCount
();
++
i
)
{
for
(
irr
::
u32
i
=
0
;
i
<
list
->
getFileCount
();
++
i
)
{
list_full
.
push_back
(
list
->
getFullFileName
(
i
).
c_str
());
list_full
.
push_back
(
list
->
getFullFileName
(
i
).
c_str
());
if
(
list
->
isDirectory
(
i
))
{
if
(
list
->
isDirectory
(
i
))
{
folderindexes
[
list
->
getFullFileName
(
i
).
c_str
()]
=
{
{
-
1
,
-
1
},
{
-
1
,
-
1
}
};
folderindexes
[
list
->
getFullFileName
(
i
).
c_str
()]
=
{
{
-
1
,
-
1
},
{
-
1
,
-
1
}
};
...
...
libcore/android/TouchEventTransferAndroid.cpp
View file @
26a52ce9
...
@@ -44,7 +44,7 @@ bool TouchEventTransferAndroid::OnTransferDeckEdit(const SEvent& event) {
...
@@ -44,7 +44,7 @@ bool TouchEventTransferAndroid::OnTransferDeckEdit(const SEvent& event) {
if
(
event
.
TouchInput
.
Event
==
ETIE_PRESSED_DOWN
)
{
if
(
event
.
TouchInput
.
Event
==
ETIE_PRESSED_DOWN
)
{
if
(
!
(
ygo
::
mainGame
->
scrFilter
->
isVisible
()
if
(
!
(
ygo
::
mainGame
->
scrFilter
->
isVisible
()
&&
ygo
::
mainGame
->
scrFilter
->
isPointInside
(
position2d
<
s32
>
(
s_current_x
,
s_current_y
))))
{
&&
ygo
::
mainGame
->
scrFilter
->
isPointInside
(
irr
::
core
::
position2d
<
irr
::
s32
>
(
s_current_x
,
s_current_y
))))
{
SEvent
hoverEvent
;
SEvent
hoverEvent
;
hoverEvent
.
EventType
=
EET_MOUSE_INPUT_EVENT
;
hoverEvent
.
EventType
=
EET_MOUSE_INPUT_EVENT
;
hoverEvent
.
MouseInput
.
Event
=
EMIE_MOUSE_MOVED
;
hoverEvent
.
MouseInput
.
Event
=
EMIE_MOUSE_MOVED
;
...
...
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