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
1
Merge Requests
1
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
nanahira
ygopro
Commits
937046a6
Commit
937046a6
authored
Jan 11, 2018
by
edo9300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More constants replacement
parent
5a9b97b1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
52 deletions
+72
-52
gframe/client_field.cpp
gframe/client_field.cpp
+43
-43
gframe/drawing.cpp
gframe/drawing.cpp
+4
-4
gframe/duelclient.cpp
gframe/duelclient.cpp
+1
-1
gframe/event_handler.cpp
gframe/event_handler.cpp
+3
-3
gframe/game.cpp
gframe/game.cpp
+7
-1
gframe/game.h
gframe/game.h
+14
-0
No files found.
gframe/client_field.cpp
View file @
937046a6
...
@@ -780,7 +780,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -780,7 +780,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
if
(
controler
==
0
)
{
if
(
controler
==
0
)
{
if
(
deck_reversed
==
pcard
->
is_reversed
)
{
if
(
deck_reversed
==
pcard
->
is_reversed
)
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Y
=
3.1415926
f
;
r
->
Y
=
PI
;
r
->
Z
=
0.0
f
;
r
->
Z
=
0.0
f
;
}
else
{
}
else
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
...
@@ -790,12 +790,12 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -790,12 +790,12 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
}
else
{
}
else
{
if
(
deck_reversed
==
pcard
->
is_reversed
)
{
if
(
deck_reversed
==
pcard
->
is_reversed
)
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Y
=
3.1415926
f
;
r
->
Y
=
PI
;
r
->
Z
=
3.1415926
f
;
r
->
Z
=
PI
;
}
else
{
}
else
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Y
=
0.0
f
;
r
->
Y
=
0.0
f
;
r
->
Z
=
3.1415926
f
;
r
->
Z
=
PI
;
}
}
}
}
break
;
break
;
...
@@ -819,12 +819,12 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -819,12 +819,12 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
t
->
Z
=
0.5
f
+
0.001
f
*
sequence
;
t
->
Z
=
0.5
f
+
0.001
f
*
sequence
;
}
}
if
(
pcard
->
code
)
{
if
(
pcard
->
code
)
{
r
->
X
=
-
0.798056
f
;
r
->
X
=
-
mainGame
->
board
.
atan
;
r
->
Y
=
0.0
f
;
r
->
Y
=
0.0
f
;
r
->
Z
=
0.0
f
;
r
->
Z
=
0.0
f
;
}
else
{
}
else
{
r
->
X
=
0.798056
f
;
r
->
X
=
mainGame
->
board
.
atan
;
r
->
Y
=
3.1415926
f
;
r
->
Y
=
PI
;
r
->
Z
=
0
;
r
->
Z
=
0
;
}
}
}
else
{
}
else
{
...
@@ -843,11 +843,11 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -843,11 +843,11 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
t
->
Z
=
0.5
f
-
0.001
f
*
sequence
;
t
->
Z
=
0.5
f
-
0.001
f
*
sequence
;
}
}
if
(
pcard
->
code
==
0
)
{
if
(
pcard
->
code
==
0
)
{
r
->
X
=
0.798056
f
;
r
->
X
=
mainGame
->
board
.
atan
;
r
->
Y
=
3.1415926
f
;
r
->
Y
=
PI
;
r
->
Z
=
0
;
r
->
Z
=
0
;
}
else
{
}
else
{
r
->
X
=
-
0.798056
f
;
r
->
X
=
-
mainGame
->
board
.
atan
;
r
->
Y
=
0
;
r
->
Y
=
0
;
r
->
Z
=
0
;
r
->
Z
=
0
;
}
}
...
@@ -861,29 +861,29 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -861,29 +861,29 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
if
(
controler
==
0
)
{
if
(
controler
==
0
)
{
if
(
pcard
->
position
&
POS_DEFENSE
)
{
if
(
pcard
->
position
&
POS_DEFENSE
)
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Z
=
-
3.1415926
f
/
2.0
f
;
r
->
Z
=
-
HALF_PI
;
if
(
pcard
->
position
&
POS_FACEDOWN
)
if
(
pcard
->
position
&
POS_FACEDOWN
)
r
->
Y
=
3.1415926
f
+
0.001
f
;
r
->
Y
=
PI
+
0.001
f
;
else
r
->
Y
=
0.0
f
;
else
r
->
Y
=
0.0
f
;
}
else
{
}
else
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Z
=
0.0
f
;
r
->
Z
=
0.0
f
;
if
(
pcard
->
position
&
POS_FACEDOWN
)
if
(
pcard
->
position
&
POS_FACEDOWN
)
r
->
Y
=
3.1415926
f
;
r
->
Y
=
PI
;
else
r
->
Y
=
0.0
f
;
else
r
->
Y
=
0.0
f
;
}
}
}
else
{
}
else
{
if
(
pcard
->
position
&
POS_DEFENSE
)
{
if
(
pcard
->
position
&
POS_DEFENSE
)
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Z
=
3.1415926
f
/
2.0
f
;
r
->
Z
=
HALF_PI
;
if
(
pcard
->
position
&
POS_FACEDOWN
)
if
(
pcard
->
position
&
POS_FACEDOWN
)
r
->
Y
=
3.1415926
f
+
0.001
f
;
r
->
Y
=
PI
+
0.001
f
;
else
r
->
Y
=
0.0
f
;
else
r
->
Y
=
0.0
f
;
}
else
{
}
else
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Z
=
3.1415926
f
;
r
->
Z
=
PI
;
if
(
pcard
->
position
&
POS_FACEDOWN
)
if
(
pcard
->
position
&
POS_FACEDOWN
)
r
->
Y
=
3.1415926
f
;
r
->
Y
=
PI
;
else
r
->
Y
=
0.0
f
;
else
r
->
Y
=
0.0
f
;
}
}
}
}
...
@@ -897,13 +897,13 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -897,13 +897,13 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Z
=
0.0
f
;
r
->
Z
=
0.0
f
;
if
(
pcard
->
position
&
POS_FACEDOWN
)
if
(
pcard
->
position
&
POS_FACEDOWN
)
r
->
Y
=
3.1415926
f
;
r
->
Y
=
PI
;
else
r
->
Y
=
0.0
f
;
else
r
->
Y
=
0.0
f
;
}
else
{
}
else
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Z
=
3.1415926
f
;
r
->
Z
=
PI
;
if
(
pcard
->
position
&
POS_FACEDOWN
)
if
(
pcard
->
position
&
POS_FACEDOWN
)
r
->
Y
=
3.1415926
f
;
r
->
Y
=
PI
;
else
r
->
Y
=
0.0
f
;
else
r
->
Y
=
0.0
f
;
}
}
break
;
break
;
...
@@ -919,7 +919,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -919,7 +919,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
}
else
{
}
else
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Y
=
0.0
f
;
r
->
Y
=
0.0
f
;
r
->
Z
=
3.1415926
f
;
r
->
Z
=
PI
;
}
}
break
;
break
;
}
}
...
@@ -934,18 +934,18 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -934,18 +934,18 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
r
->
Z
=
0.0
f
;
r
->
Z
=
0.0
f
;
}
else
{
}
else
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Y
=
3.1415926
f
;
r
->
Y
=
PI
;
r
->
Z
=
0.0
f
;
r
->
Z
=
0.0
f
;
}
}
}
else
{
}
else
{
if
(
pcard
->
position
&
POS_FACEUP
)
{
if
(
pcard
->
position
&
POS_FACEUP
)
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Y
=
0.0
f
;
r
->
Y
=
0.0
f
;
r
->
Z
=
3.1415926
f
;
r
->
Z
=
PI
;
}
else
{
}
else
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Y
=
3.1415926
f
;
r
->
Y
=
PI
;
r
->
Z
=
3.1415926
f
;
r
->
Z
=
PI
;
}
}
}
}
break
;
break
;
...
@@ -958,14 +958,14 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -958,14 +958,14 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
if
(
pcard
->
position
&
POS_FACEUP
)
if
(
pcard
->
position
&
POS_FACEUP
)
r
->
Y
=
0.0
f
;
r
->
Y
=
0.0
f
;
else
r
->
Y
=
3.1415926
f
;
else
r
->
Y
=
PI
;
r
->
Z
=
0.0
f
;
r
->
Z
=
0.0
f
;
}
else
{
}
else
{
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
if
(
pcard
->
position
&
POS_FACEUP
)
if
(
pcard
->
position
&
POS_FACEUP
)
r
->
Y
=
0.0
f
;
r
->
Y
=
0.0
f
;
else
r
->
Y
=
3.1415926
f
;
else
r
->
Y
=
PI
;
r
->
Z
=
3.1415926
f
;
r
->
Z
=
PI
;
}
}
break
;
break
;
}
}
...
@@ -989,7 +989,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -989,7 +989,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
t
->
Z
=
0.005
f
+
pcard
->
sequence
*
0.0001
f
;
t
->
Z
=
0.005
f
+
pcard
->
sequence
*
0.0001
f
;
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Y
=
0.0
f
;
r
->
Y
=
0.0
f
;
r
->
Z
=
3.1415926
f
;
r
->
Z
=
PI
;
}
}
}
else
{
}
else
{
if
(
pcard
->
overlayTarget
->
controler
==
0
)
{
if
(
pcard
->
overlayTarget
->
controler
==
0
)
{
...
@@ -1006,7 +1006,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
...
@@ -1006,7 +1006,7 @@ void ClientField::GetCardLocation(ClientCard* pcard, irr::core::vector3df* t, ir
t
->
Z
=
0.005
f
+
pcard
->
sequence
*
0.0001
f
;
t
->
Z
=
0.005
f
+
pcard
->
sequence
*
0.0001
f
;
r
->
X
=
0.0
f
;
r
->
X
=
0.0
f
;
r
->
Y
=
0.0
f
;
r
->
Y
=
0.0
f
;
r
->
Z
=
3.1415926
f
;
r
->
Z
=
PI
;
}
}
}
}
break
;
break
;
...
@@ -1023,27 +1023,27 @@ void ClientField::MoveCard(ClientCard * pcard, int frame) {
...
@@ -1023,27 +1023,27 @@ void ClientField::MoveCard(ClientCard * pcard, int frame) {
GetCardLocation
(
pcard
,
&
trans
,
&
rot
);
GetCardLocation
(
pcard
,
&
trans
,
&
rot
);
pcard
->
dPos
=
(
trans
-
pcard
->
curPos
)
/
frame
;
pcard
->
dPos
=
(
trans
-
pcard
->
curPos
)
/
frame
;
float
diff
=
rot
.
X
-
pcard
->
curRot
.
X
;
float
diff
=
rot
.
X
-
pcard
->
curRot
.
X
;
while
(
diff
<
0
)
diff
+=
3.1415926
f
*
2
;
while
(
diff
<
0
)
diff
+=
PI
*
2
;
while
(
diff
>
3.1415926
f
*
2
)
while
(
diff
>
PI
*
2
)
diff
-=
3.1415926
f
*
2
;
diff
-=
PI
*
2
;
if
(
diff
<
3.1415926
f
)
if
(
diff
<
PI
)
pcard
->
dRot
.
X
=
diff
/
frame
;
pcard
->
dRot
.
X
=
diff
/
frame
;
else
else
pcard
->
dRot
.
X
=
-
(
3.1415926
f
*
2
-
diff
)
/
frame
;
pcard
->
dRot
.
X
=
-
(
PI
*
2
-
diff
)
/
frame
;
diff
=
rot
.
Y
-
pcard
->
curRot
.
Y
;
diff
=
rot
.
Y
-
pcard
->
curRot
.
Y
;
while
(
diff
<
0
)
diff
+=
3.1415926
f
*
2
;
while
(
diff
<
0
)
diff
+=
PI
*
2
;
while
(
diff
>
3.1415926
f
*
2
)
diff
-=
3.1415926
f
*
2
;
while
(
diff
>
PI
*
2
)
diff
-=
PI
*
2
;
if
(
diff
<
3.1415926
f
)
if
(
diff
<
PI
)
pcard
->
dRot
.
Y
=
diff
/
frame
;
pcard
->
dRot
.
Y
=
diff
/
frame
;
else
else
pcard
->
dRot
.
Y
=
-
(
3.1415926
f
*
2
-
diff
)
/
frame
;
pcard
->
dRot
.
Y
=
-
(
PI
*
2
-
diff
)
/
frame
;
diff
=
rot
.
Z
-
pcard
->
curRot
.
Z
;
diff
=
rot
.
Z
-
pcard
->
curRot
.
Z
;
while
(
diff
<
0
)
diff
+=
3.1415926
f
*
2
;
while
(
diff
<
0
)
diff
+=
PI
*
2
;
while
(
diff
>
3.1415926
f
*
2
)
diff
-=
3.1415926
f
*
2
;
while
(
diff
>
PI
*
2
)
diff
-=
PI
*
2
;
if
(
diff
<
3.1415926
f
)
if
(
diff
<
PI
)
pcard
->
dRot
.
Z
=
diff
/
frame
;
pcard
->
dRot
.
Z
=
diff
/
frame
;
else
else
pcard
->
dRot
.
Z
=
-
(
3.1415926
f
*
2
-
diff
)
/
frame
;
pcard
->
dRot
.
Z
=
-
(
PI
*
2
-
diff
)
/
frame
;
pcard
->
is_moving
=
true
;
pcard
->
is_moving
=
true
;
pcard
->
aniFrame
=
frame
;
pcard
->
aniFrame
=
frame
;
}
}
...
...
gframe/drawing.cpp
View file @
937046a6
...
@@ -643,10 +643,10 @@ void Game::DrawStackIndicator(const wchar_t* text, S3DVertex* v, bool opponent)
...
@@ -643,10 +643,10 @@ void Game::DrawStackIndicator(const wchar_t* text, S3DVertex* v, bool opponent)
/*Converts the coordinates from the 3d plane to the 2d plane (the window)
/*Converts the coordinates from the 3d plane to the 2d plane (the window)
*/
*/
void
Game
::
ConvertCoords
(
float
x
,
float
y
,
int
*
x1
,
int
*
y1
)
{
void
Game
::
ConvertCoords
(
float
x
,
float
y
,
int
*
x1
,
int
*
y1
)
{
double
angle
=
atan
((
y
-
8.0
)
/
-
7.8
);
double
angle
=
atan
((
y
-
mainGame
->
board
.
y
)
/
-
mainGame
->
board
.
z
);
double
screeny
=
tan
(
0.798056
-
angle
);
//0.798056 = arctan(8.0/7.8), to avoid calculating it every time
double
screeny
=
tan
(
mainGame
->
board
.
atan
-
angle
);
double
vlen
=
sqrt
(
1.0
+
screeny
*
screeny
);
double
vlen
=
sqrt
(
1.0
+
screeny
*
screeny
);
double
screenx
=
(
x
-
4.2
)
/
(
7.8
/
vlen
/
cos
(
angle
));
double
screenx
=
(
x
-
mainGame
->
board
.
x
)
/
(
mainGame
->
board
.
z
/
vlen
/
cos
(
angle
));
*
x1
=
(
screenx
+
0.90
)
*
1024.0
/
1.35
;
*
x1
=
(
screenx
+
0.90
)
*
1024.0
/
1.35
;
*
y1
=
(
screeny
+
0.42
)
*
640.0
/
0.84
;
*
y1
=
(
screeny
+
0.42
)
*
640.0
/
0.84
;
}
}
...
@@ -798,7 +798,7 @@ void Game::DrawSpec() {
...
@@ -798,7 +798,7 @@ void Game::DrawSpec() {
}
}
case
7
:
{
case
7
:
{
core
::
position2d
<
s32
>
corner
[
4
];
core
::
position2d
<
s32
>
corner
[
4
];
float
y
=
sin
(
showcarddif
*
3.1415926
f
/
180.0
f
)
*
CARD_IMG_HEIGHT
*
window_size
.
Height
/
640
;
float
y
=
sin
(
showcarddif
*
PI
/
180.0
f
)
*
CARD_IMG_HEIGHT
*
window_size
.
Height
/
640
;
corner
[
0
]
=
core
::
position2d
<
s32
>
(
574
*
window_size
.
Width
/
1024
-
(
CARD_IMG_HEIGHT
*
window_size
.
Height
/
640
-
y
)
*
0.3
f
,
404
*
window_size
.
Height
/
640
-
y
);
corner
[
0
]
=
core
::
position2d
<
s32
>
(
574
*
window_size
.
Width
/
1024
-
(
CARD_IMG_HEIGHT
*
window_size
.
Height
/
640
-
y
)
*
0.3
f
,
404
*
window_size
.
Height
/
640
-
y
);
corner
[
1
]
=
core
::
position2d
<
s32
>
(
751
*
window_size
.
Width
/
1024
+
(
CARD_IMG_HEIGHT
*
window_size
.
Height
/
640
-
y
)
*
0.3
f
,
404
*
window_size
.
Height
/
640
-
y
);
corner
[
1
]
=
core
::
position2d
<
s32
>
(
751
*
window_size
.
Width
/
1024
+
(
CARD_IMG_HEIGHT
*
window_size
.
Height
/
640
-
y
)
*
0.3
f
,
404
*
window_size
.
Height
/
640
-
y
);
corner
[
2
]
=
core
::
position2d
<
s32
>
(
574
*
window_size
.
Width
/
1024
,
404
*
window_size
.
Height
/
640
);
corner
[
2
]
=
core
::
position2d
<
s32
>
(
574
*
window_size
.
Width
/
1024
,
404
*
window_size
.
Height
/
640
);
...
...
gframe/duelclient.cpp
View file @
937046a6
...
@@ -2244,7 +2244,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2244,7 +2244,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
for
(
auto
cit
=
mainGame
->
dField
.
hand
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
hand
[
player
].
end
();
++
cit
)
if
((
*
cit
)
->
code
)
{
if
((
*
cit
)
->
code
)
{
(
*
cit
)
->
dPos
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
(
*
cit
)
->
dPos
=
irr
::
core
::
vector3df
(
0
,
0
,
0
);
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
1.322
f
/
5
,
3.1415926
f
/
5
,
0
);
(
*
cit
)
->
dRot
=
irr
::
core
::
vector3df
(
1.322
f
/
5
,
PI
/
5
,
0
);
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
is_moving
=
true
;
(
*
cit
)
->
is_hovered
=
false
;
(
*
cit
)
->
is_hovered
=
false
;
(
*
cit
)
->
aniFrame
=
5
;
(
*
cit
)
->
aniFrame
=
5
;
...
...
gframe/event_handler.cpp
View file @
937046a6
...
@@ -2198,10 +2198,10 @@ void ClientField::GetHoverField(int x, int y) {
...
@@ -2198,10 +2198,10 @@ void ClientField::GetHoverField(int x, int y) {
}
else
{
}
else
{
double
screenx
=
x
/
1024.0
*
1.35
-
0.90
;
double
screenx
=
x
/
1024.0
*
1.35
-
0.90
;
double
screeny
=
y
/
640.0
*
0.84
-
0.42
;
double
screeny
=
y
/
640.0
*
0.84
-
0.42
;
double
angle
=
0.798056
-
atan
(
screeny
);
//0.798056 = arctan(8.0/7.8)
double
angle
=
mainGame
->
board
.
atan
-
atan
(
screeny
);
double
vlen
=
sqrt
(
1.0
+
screeny
*
screeny
);
double
vlen
=
sqrt
(
1.0
+
screeny
*
screeny
);
double
boardx
=
4.2
+
7.8
*
screenx
/
vlen
/
cos
(
angle
);
double
boardx
=
mainGame
->
board
.
x
+
mainGame
->
board
.
z
*
screenx
/
vlen
/
cos
(
angle
);
double
boardy
=
8.0
-
7.8
*
tan
(
angle
);
double
boardy
=
mainGame
->
board
.
y
-
mainGame
->
board
.
z
*
tan
(
angle
);
hovered_location
=
0
;
hovered_location
=
0
;
if
(
boardx
>=
matManager
.
vFieldExtra
[
0
][
speed
][
0
].
Pos
.
X
&&
boardx
<=
matManager
.
vFieldExtra
[
0
][
speed
][
1
].
Pos
.
X
)
{
if
(
boardx
>=
matManager
.
vFieldExtra
[
0
][
speed
][
0
].
Pos
.
X
&&
boardx
<=
matManager
.
vFieldExtra
[
0
][
speed
][
1
].
Pos
.
X
)
{
if
(
boardy
>=
matManager
.
vFieldExtra
[
0
][
speed
][
0
].
Pos
.
Y
&&
boardy
<=
matManager
.
vFieldExtra
[
0
][
speed
][
2
].
Pos
.
Y
)
{
if
(
boardy
>=
matManager
.
vFieldExtra
[
0
][
speed
][
0
].
Pos
.
Y
&&
boardy
<=
matManager
.
vFieldExtra
[
0
][
speed
][
2
].
Pos
.
Y
)
{
...
...
gframe/game.cpp
View file @
937046a6
...
@@ -693,6 +693,12 @@ bool Game::Initialize() {
...
@@ -693,6 +693,12 @@ bool Game::Initialize() {
col
.
setAlpha
(
224
);
col
.
setAlpha
(
224
);
env
->
getSkin
()
->
setColor
((
EGUI_DEFAULT_COLOR
)
i
,
col
);
env
->
getSkin
()
->
setColor
((
EGUI_DEFAULT_COLOR
)
i
,
col
);
}
}
board
.
x
=
FIELD_X
;
board
.
y
=
FIELD_Y
;
board
.
z
=
FIELD_Z
;
board
.
atan
=
atan
(
FIELD_Y
/
FIELD_Z
);
engineSound
=
irrklang
::
createIrrKlangDevice
();
engineSound
=
irrklang
::
createIrrKlangDevice
();
engineMusic
=
irrklang
::
createIrrKlangDevice
();
engineMusic
=
irrklang
::
createIrrKlangDevice
();
hideChat
=
false
;
hideChat
=
false
;
...
@@ -709,7 +715,7 @@ void Game::MainLoop() {
...
@@ -709,7 +715,7 @@ void Game::MainLoop() {
BuildProjectionMatrix
(
mProjection
,
-
0.90
f
,
0.45
f
,
-
0.42
f
,
0.42
f
,
1.0
f
,
100.0
f
);
BuildProjectionMatrix
(
mProjection
,
-
0.90
f
,
0.45
f
,
-
0.42
f
,
0.42
f
,
1.0
f
,
100.0
f
);
camera
->
setProjectionMatrix
(
mProjection
);
camera
->
setProjectionMatrix
(
mProjection
);
mProjection
.
buildCameraLookAtMatrixLH
(
vector3df
(
4.2
f
,
8.0
f
,
7.8
f
),
vector3df
(
4.2
f
,
0
,
0
),
vector3df
(
0
,
0
,
1
));
mProjection
.
buildCameraLookAtMatrixLH
(
vector3df
(
board
.
x
,
board
.
y
,
board
.
z
),
vector3df
(
board
.
x
,
0
,
0
),
vector3df
(
0
,
0
,
1
));
camera
->
setViewMatrixAffector
(
mProjection
);
camera
->
setViewMatrixAffector
(
mProjection
);
smgr
->
setAmbientLight
(
SColorf
(
1.0
f
,
1.0
f
,
1.0
f
));
smgr
->
setAmbientLight
(
SColorf
(
1.0
f
,
1.0
f
,
1.0
f
));
float
atkframe
=
0.1
f
;
float
atkframe
=
0.1
f
;
...
...
gframe/game.h
View file @
937046a6
...
@@ -86,6 +86,10 @@ struct FadingUnit {
...
@@ -86,6 +86,10 @@ struct FadingUnit {
irr
::
core
::
vector2di
fadingDiff
;
irr
::
core
::
vector2di
fadingDiff
;
};
};
struct
Fieldmatrix
{
float
x
,
y
,
z
,
atan
;
};
class
Game
{
class
Game
{
public:
public:
...
@@ -119,6 +123,7 @@ public:
...
@@ -119,6 +123,7 @@ public:
void
WaitFrameSignal
(
int
frame
);
void
WaitFrameSignal
(
int
frame
);
void
DrawThumb
(
code_pointer
cp
,
position2di
pos
,
std
::
unordered_map
<
int
,
int
>*
lflist
,
bool
drag
=
false
);
void
DrawThumb
(
code_pointer
cp
,
position2di
pos
,
std
::
unordered_map
<
int
,
int
>*
lflist
,
bool
drag
=
false
);
void
DrawDeckBd
();
void
DrawDeckBd
();
bool
LoadGui
(
irr
::
SIrrlichtCreationParameters
params
,
bool
reload
=
false
);
void
LoadConfig
();
void
LoadConfig
();
void
SaveConfig
();
void
SaveConfig
();
void
ShowCardInfo
(
int
code
,
bool
resize
=
false
);
void
ShowCardInfo
(
int
code
,
bool
resize
=
false
);
...
@@ -148,6 +153,7 @@ public:
...
@@ -148,6 +153,7 @@ public:
position2di
Resize
(
s32
x
,
s32
y
,
bool
reverse
=
false
);
position2di
Resize
(
s32
x
,
s32
y
,
bool
reverse
=
false
);
recti
ResizeElem
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
ResizeElem
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
ResizeWin
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
bool
chat
=
false
);
recti
ResizeWin
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
bool
chat
=
false
);
void
ValidateName
(
irr
::
gui
::
IGUIEditBox
*
box
);
Mutex
gMutex
;
Mutex
gMutex
;
Mutex
gBuffer
;
Mutex
gBuffer
;
...
@@ -486,12 +492,18 @@ public:
...
@@ -486,12 +492,18 @@ public:
//cancel or finish
//cancel or finish
irr
::
gui
::
IGUIButton
*
btnCancelOrFinish
;
irr
::
gui
::
IGUIButton
*
btnCancelOrFinish
;
Fieldmatrix
board
;
};
};
extern
Game
*
mainGame
;
extern
Game
*
mainGame
;
}
}
#define FIELD_X 4.2f
#define FIELD_Y 8.0f
#define FIELD_Z 7.8f
#define CARD_IMG_WIDTH 177
#define CARD_IMG_WIDTH 177
#define CARD_IMG_HEIGHT 254
#define CARD_IMG_HEIGHT 254
#define CARD_THUMB_WIDTH 44
#define CARD_THUMB_WIDTH 44
...
@@ -599,6 +611,7 @@ extern Game* mainGame;
...
@@ -599,6 +611,7 @@ extern Game* mainGame;
#define BUTTON_DISPLAY_4 294
#define BUTTON_DISPLAY_4 294
#define SCROLL_CARD_DISPLAY 295
#define SCROLL_CARD_DISPLAY 295
#define BUTTON_CARD_DISP_OK 296
#define BUTTON_CARD_DISP_OK 296
#define EDITBOX_DECK_NAME 297
#define BUTTON_CATEGORY_OK 300
#define BUTTON_CATEGORY_OK 300
#define COMBOBOX_DBLFLIST 301
#define COMBOBOX_DBLFLIST 301
#define COMBOBOX_DBDECKS 302
#define COMBOBOX_DBDECKS 302
...
@@ -624,6 +637,7 @@ extern Game* mainGame;
...
@@ -624,6 +637,7 @@ extern Game* mainGame;
#define BUTTON_REPLAY_UNDO 323
#define BUTTON_REPLAY_UNDO 323
#define BUTTON_REPLAY_EXIT 324
#define BUTTON_REPLAY_EXIT 324
#define BUTTON_REPLAY_SWAP 325
#define BUTTON_REPLAY_SWAP 325
#define EDITBOX_REPLAY_NAME 326
#define BUTTON_REPLAY_SAVE 330
#define BUTTON_REPLAY_SAVE 330
#define BUTTON_REPLAY_CANCEL 331
#define BUTTON_REPLAY_CANCEL 331
#define LISTBOX_SINGLEPLAY_LIST 350
#define LISTBOX_SINGLEPLAY_LIST 350
...
...
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