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
a26cc3ae
Commit
a26cc3ae
authored
Jun 20, 2017
by
edo9300
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'refs/remotes/Fluorohydride/master'
parents
72b9b75c
94f7e54b
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
168 additions
and
181 deletions
+168
-181
gframe/client_card.cpp
gframe/client_card.cpp
+1
-0
gframe/client_card.h
gframe/client_card.h
+1
-1
gframe/client_field.cpp
gframe/client_field.cpp
+20
-54
gframe/client_field.h
gframe/client_field.h
+6
-3
gframe/config.h
gframe/config.h
+1
-1
gframe/data_manager.cpp
gframe/data_manager.cpp
+20
-23
gframe/data_manager.h
gframe/data_manager.h
+5
-5
gframe/drawing.cpp
gframe/drawing.cpp
+68
-57
gframe/duelclient.cpp
gframe/duelclient.cpp
+13
-11
gframe/event_handler.cpp
gframe/event_handler.cpp
+20
-20
gframe/game.cpp
gframe/game.cpp
+9
-6
gframe/image_manager.cpp
gframe/image_manager.cpp
+3
-0
gframe/image_manager.h
gframe/image_manager.h
+1
-0
textures/chaintarget.png
textures/chaintarget.png
+0
-0
No files found.
gframe/client_card.cpp
View file @
a26cc3ae
...
...
@@ -16,6 +16,7 @@ ClientCard::ClientCard() {
is_selected
=
false
;
is_showequip
=
false
;
is_showtarget
=
false
;
is_showchaintarget
=
false
;
is_highlighting
=
false
;
is_disabled
=
false
;
is_reversed
=
false
;
...
...
gframe/client_card.h
View file @
a26cc3ae
...
...
@@ -47,7 +47,6 @@ typedef std::unordered_map<unsigned int, CardDataC>::const_iterator code_pointer
class
ClientCard
{
public:
irr
::
video
::
ITexture
*
curTexture
;
irr
::
core
::
matrix4
mTransform
;
irr
::
core
::
vector3df
curPos
;
irr
::
core
::
vector3df
curRot
;
...
...
@@ -63,6 +62,7 @@ public:
bool
is_selected
;
bool
is_showequip
;
bool
is_showtarget
;
bool
is_showchaintarget
;
bool
is_highlighting
;
bool
is_reversed
;
u32
code
;
...
...
gframe/client_field.cpp
View file @
a26cc3ae
...
...
@@ -65,6 +65,8 @@ void ClientField::Clear() {
overlay_cards
.
clear
();
extra_p_count
[
0
]
=
0
;
extra_p_count
[
1
]
=
0
;
player_desc_hints
[
0
].
clear
();
player_desc_hints
[
1
].
clear
();
chains
.
clear
();
activatable_cards
.
clear
();
summonable_cards
.
clear
();
...
...
@@ -93,9 +95,7 @@ void ClientField::Initial(int player, int deckc, int extrac) {
pcard
->
location
=
0x1
;
pcard
->
sequence
=
i
;
pcard
->
position
=
POS_FACEDOWN_DEFENSE
;
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
pcard
->
mTransform
.
setTranslation
(
pcard
->
curPos
);
pcard
->
mTransform
.
setRotationRadians
(
pcard
->
curRot
);
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
,
true
);
}
for
(
int
i
=
0
;
i
<
extrac
;
++
i
)
{
pcard
=
new
ClientCard
;
...
...
@@ -105,9 +105,7 @@ void ClientField::Initial(int player, int deckc, int extrac) {
pcard
->
location
=
0x40
;
pcard
->
sequence
=
i
;
pcard
->
position
=
POS_FACEDOWN_DEFENSE
;
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
pcard
->
mTransform
.
setTranslation
(
pcard
->
curPos
);
pcard
->
mTransform
.
setRotationRadians
(
pcard
->
curRot
);
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
,
true
);
}
}
ClientCard
*
ClientField
::
GetCard
(
int
controler
,
int
location
,
int
sequence
,
int
sub_seq
)
{
...
...
@@ -586,63 +584,47 @@ void ClientField::ReplaySwap() {
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
for
(
auto
cit
=
deck
[
p
].
begin
();
cit
!=
deck
[
p
].
end
();
++
cit
)
{
(
*
cit
)
->
controler
=
1
-
(
*
cit
)
->
controler
;
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
for
(
auto
cit
=
hand
[
p
].
begin
();
cit
!=
hand
[
p
].
end
();
++
cit
)
{
(
*
cit
)
->
controler
=
1
-
(
*
cit
)
->
controler
;
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
for
(
auto
cit
=
mzone
[
p
].
begin
();
cit
!=
mzone
[
p
].
end
();
++
cit
)
{
if
(
*
cit
)
{
(
*
cit
)
->
controler
=
1
-
(
*
cit
)
->
controler
;
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
}
for
(
auto
cit
=
szone
[
p
].
begin
();
cit
!=
szone
[
p
].
end
();
++
cit
)
{
if
(
*
cit
)
{
(
*
cit
)
->
controler
=
1
-
(
*
cit
)
->
controler
;
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
}
for
(
auto
cit
=
grave
[
p
].
begin
();
cit
!=
grave
[
p
].
end
();
++
cit
)
{
(
*
cit
)
->
controler
=
1
-
(
*
cit
)
->
controler
;
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
for
(
auto
cit
=
remove
[
p
].
begin
();
cit
!=
remove
[
p
].
end
();
++
cit
)
{
(
*
cit
)
->
controler
=
1
-
(
*
cit
)
->
controler
;
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
for
(
auto
cit
=
extra
[
p
].
begin
();
cit
!=
extra
[
p
].
end
();
++
cit
)
{
(
*
cit
)
->
controler
=
1
-
(
*
cit
)
->
controler
;
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
}
for
(
auto
cit
=
overlay_cards
.
begin
();
cit
!=
overlay_cards
.
end
();
++
cit
)
{
(
*
cit
)
->
controler
=
1
-
(
*
cit
)
->
controler
;
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
mainGame
->
dInfo
.
isFirst
=
!
mainGame
->
dInfo
.
isFirst
;
...
...
@@ -660,56 +642,40 @@ void ClientField::ReplaySwap() {
void
ClientField
::
RefreshAllCards
()
{
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
for
(
auto
cit
=
deck
[
p
].
begin
();
cit
!=
deck
[
p
].
end
();
++
cit
)
{
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
for
(
auto
cit
=
hand
[
p
].
begin
();
cit
!=
hand
[
p
].
end
();
++
cit
)
{
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
for
(
auto
cit
=
mzone
[
p
].
begin
();
cit
!=
mzone
[
p
].
end
();
++
cit
)
{
if
(
*
cit
)
{
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
}
for
(
auto
cit
=
szone
[
p
].
begin
();
cit
!=
szone
[
p
].
end
();
++
cit
)
{
if
(
*
cit
)
{
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
}
for
(
auto
cit
=
grave
[
p
].
begin
();
cit
!=
grave
[
p
].
end
();
++
cit
)
{
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
for
(
auto
cit
=
remove
[
p
].
begin
();
cit
!=
remove
[
p
].
end
();
++
cit
)
{
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
for
(
auto
cit
=
extra
[
p
].
begin
();
cit
!=
extra
[
p
].
end
();
++
cit
)
{
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
}
for
(
auto
cit
=
overlay_cards
.
begin
();
cit
!=
overlay_cards
.
end
();
++
cit
)
{
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
);
(
*
cit
)
->
mTransform
.
setTranslation
((
*
cit
)
->
curPos
);
(
*
cit
)
->
mTransform
.
setRotationRadians
((
*
cit
)
->
curRot
);
GetCardLocation
(
*
cit
,
&
(
*
cit
)
->
curPos
,
&
(
*
cit
)
->
curRot
,
true
);
(
*
cit
)
->
is_moving
=
false
;
}
}
...
...
gframe/client_field.h
View file @
a26cc3ae
...
...
@@ -3,12 +3,13 @@
#include "config.h"
#include <vector>
#include <set>
namespace
ygo
{
class
ClientCard
;
struct
ChainInfo
{
struct
ChainInfo
{
irr
::
core
::
vector3df
chain_pos
;
ClientCard
*
chain_card
;
int
code
;
...
...
@@ -17,6 +18,7 @@ struct ChainInfo{
int
location
;
int
sequence
;
bool
solved
;
std
::
set
<
ClientCard
*>
target
;
};
class
ClientField
:
public
irr
::
IEventReceiver
{
...
...
@@ -79,7 +81,7 @@ public:
bool
last_chain
;
bool
deck_reversed
;
bool
conti_selecting
;
ClientField
();
void
Clear
();
void
Initial
(
int
player
,
int
deckc
,
int
extrac
);
...
...
@@ -96,7 +98,7 @@ public:
void
ShowLocationCard
();
void
ReplaySwap
();
void
RefreshAllCards
();
void
GetChainLocation
(
int
controler
,
int
location
,
int
sequence
,
irr
::
core
::
vector3df
*
t
);
void
GetCardLocation
(
ClientCard
*
pcard
,
irr
::
core
::
vector3df
*
t
,
irr
::
core
::
vector3df
*
r
,
bool
setTrans
=
false
);
void
MoveCard
(
ClientCard
*
pcard
,
int
frame
);
...
...
@@ -132,6 +134,7 @@ public:
void
ShowMenu
(
int
flag
,
int
x
,
int
y
);
void
UpdateChainButtons
();
void
ShowCancelOrFinishButton
(
int
buttonOp
);
void
SetShowMark
(
ClientCard
*
pcard
,
bool
enable
);
void
SetResponseSelectedCards
()
const
;
};
...
...
gframe/config.h
View file @
a26cc3ae
...
...
@@ -4,7 +4,7 @@
#pragma once
#define _IRR_STATIC_LIB_
#define
_
IRR_COMPILE_WITH_DX9_DEV_PACK
#define IRR_COMPILE_WITH_DX9_DEV_PACK
#ifdef _WIN32
#include <WinSock2.h>
...
...
gframe/data_manager.cpp
View file @
a26cc3ae
...
...
@@ -94,28 +94,20 @@ bool DataManager::LoadStrings(const char* file) {
sscanf
(
linebuf
,
"!%s"
,
strbuf
);
if
(
!
strcmp
(
strbuf
,
"system"
))
{
sscanf
(
&
linebuf
[
7
],
"%d %240[^
\n
]"
,
&
value
,
strbuf
);
int
len
=
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
wchar_t
*
pbuf
=
new
wchar_t
[
len
+
1
];
wcscpy
(
pbuf
,
strBuffer
);
_sysStrings
[
value
]
=
pbuf
;
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
_sysStrings
[
value
]
=
strBuffer
;
}
else
if
(
!
strcmp
(
strbuf
,
"victory"
))
{
sscanf
(
&
linebuf
[
8
],
"%x %240[^
\n
]"
,
&
value
,
strbuf
);
int
len
=
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
wchar_t
*
pbuf
=
new
wchar_t
[
len
+
1
];
wcscpy
(
pbuf
,
strBuffer
);
_victoryStrings
[
value
]
=
pbuf
;
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
_victoryStrings
[
value
]
=
strBuffer
;
}
else
if
(
!
strcmp
(
strbuf
,
"counter"
))
{
sscanf
(
&
linebuf
[
8
],
"%x %240[^
\n
]"
,
&
value
,
strbuf
);
int
len
=
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
wchar_t
*
pbuf
=
new
wchar_t
[
len
+
1
];
wcscpy
(
pbuf
,
strBuffer
);
_counterStrings
[
value
]
=
pbuf
;
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
_counterStrings
[
value
]
=
strBuffer
;
}
else
if
(
!
strcmp
(
strbuf
,
"setname"
))
{
sscanf
(
&
linebuf
[
8
],
"%x %240[^
\t\n
]"
,
&
value
,
strbuf
);
//using tab for comment
int
len
=
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
wchar_t
*
pbuf
=
new
wchar_t
[
len
+
1
];
wcscpy
(
pbuf
,
strBuffer
);
_setnameStrings
[
value
]
=
pbuf
;
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
_setnameStrings
[
value
]
=
strBuffer
;
}
}
fclose
(
fp
);
...
...
@@ -180,32 +172,37 @@ const wchar_t* DataManager::GetDesc(int strCode) {
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
{
if
(
code
<
0
||
code
>=
2048
||
_sysStrings
[
code
]
==
0
)
if
(
code
<
0
||
code
>=
2048
)
return
unknown_string
;
return
_sysStrings
[
code
];
auto
csit
=
_sysStrings
.
find
(
code
);
if
(
csit
==
_sysStrings
.
end
())
return
unknown_string
;
return
csit
->
second
.
c_str
();
}
const
wchar_t
*
DataManager
::
GetVictoryString
(
int
code
)
{
auto
csit
=
_victoryStrings
.
find
(
code
);
if
(
csit
==
_victoryStrings
.
end
())
return
unknown_string
;
return
csit
->
second
;
return
csit
->
second
.
c_str
()
;
}
const
wchar_t
*
DataManager
::
GetCounterName
(
int
code
)
{
auto
csit
=
_counterStrings
.
find
(
code
);
if
(
csit
==
_counterStrings
.
end
())
return
unknown_string
;
return
csit
->
second
;
return
csit
->
second
.
c_str
()
;
}
const
wchar_t
*
DataManager
::
GetSetName
(
int
code
)
{
auto
csit
=
_setnameStrings
.
find
(
code
);
if
(
csit
==
_setnameStrings
.
end
())
return
NULL
;
return
csit
->
second
;
return
csit
->
second
.
c_str
()
;
}
unsigned
int
DataManager
::
GetSetCode
(
const
wchar_t
*
setname
)
{
for
(
auto
csit
=
_setnameStrings
.
begin
();
csit
!=
_setnameStrings
.
end
();
++
csit
)
if
(
wcscmp
(
csit
->
second
,
setname
)
==
0
)
for
(
auto
csit
=
_setnameStrings
.
begin
();
csit
!=
_setnameStrings
.
end
();
++
csit
)
{
auto
xpos
=
csit
->
second
.
find_first_of
(
L'|'
);
//setname|extra info
if
(
csit
->
second
.
compare
(
0
,
xpos
,
setname
)
==
0
)
return
csit
->
first
;
}
return
0
;
}
const
wchar_t
*
DataManager
::
GetNumString
(
int
num
,
bool
bracket
)
{
...
...
gframe/data_manager.h
View file @
a26cc3ae
...
...
@@ -35,11 +35,11 @@ public:
std
::
unordered_map
<
unsigned
int
,
CardDataC
>
_datas
;
std
::
unordered_map
<
unsigned
int
,
CardString
>
_strings
;
std
::
unordered_map
<
unsigned
int
,
wchar_t
*>
_counterStrings
;
std
::
unordered_map
<
unsigned
int
,
wchar_t
*>
_victoryStrings
;
std
::
unordered_map
<
unsigned
int
,
wchar_t
*>
_setnameStrings
;
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_counterStrings
;
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_victoryStrings
;
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_setnameStrings
;
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_sysStrings
;
wchar_t
*
_sysStrings
[
2048
];
wchar_t
numStrings
[
256
][
4
];
wchar_t
numBuffer
[
6
];
wchar_t
attBuffer
[
128
];
...
...
@@ -51,7 +51,7 @@ public:
static
wchar_t
strBuffer
[
4096
];
static
const
wchar_t
*
unknown_string
;
static
int
CardReader
(
int
,
void
*
);
};
extern
DataManager
dataManager
;
...
...
gframe/drawing.cpp
View file @
a26cc3ae
...
...
@@ -24,6 +24,7 @@ void Game::DrawSelectionLine(irr::video::S3DVertex* vec, bool strip, int width,
glEnd
();
glMaterialfv
(
GL_FRONT
,
GL_AMBIENT
,
origin
);
glDisable
(
GL_LINE_STIPPLE
);
glEnable
(
GL_TEXTURE_2D
);
}
else
{
driver
->
setMaterial
(
matManager
.
mOutLine
);
if
(
strip
)
{
...
...
@@ -49,9 +50,9 @@ void Game::DrawSelectionLine(irr::video::S3DVertex* vec, bool strip, int width,
void
Game
::
DrawBackGround
()
{
static
int
selFieldAlpha
=
255
;
static
int
selFieldDAlpha
=
-
10
;
matrix4
im
=
irr
::
core
::
IdentityMatrix
;
im
.
setTranslation
(
vector3df
(
0
,
0
,
-
0.01
f
));
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
im
);
//
matrix4 im = irr::core::IdentityMatrix;
//
im.setTranslation(vector3df(0, 0, -0.01f));
//
driver->setTransform(irr::video::ETS_WORLD, im);
//dark shade
// matManager.mSelField.AmbientColor = 0xff000000;
// matManager.mSelField.DiffuseColor = 0xa0000000;
...
...
@@ -64,39 +65,39 @@ void Game::DrawBackGround() {
//draw field
//draw field spell card
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
irr
::
core
::
IdentityMatrix
);
int
fieldcode1
=
-
1
;
int
fieldcode2
=
-
1
;
bool
drawField
=
false
;
int
rule
=
(
dInfo
.
duel_rule
>=
4
)
?
1
:
0
;
if
(
mainGame
->
gameConf
.
draw_field_spell
&&
mainGame
->
dField
.
szone
[
0
][
5
]
&&
mainGame
->
dField
.
szone
[
0
][
5
]
->
position
&
POS_FACEUP
)
fieldcode1
=
mainGame
->
dField
.
szone
[
0
][
5
]
->
code
;
if
(
mainGame
->
gameConf
.
draw_field_spell
&&
mainGame
->
dField
.
szone
[
1
][
5
]
&&
mainGame
->
dField
.
szone
[
1
][
5
]
->
position
&
POS_FACEUP
)
fieldcode2
=
mainGame
->
dField
.
szone
[
1
][
5
]
->
code
;
int
fieldcode
=
(
fieldcode1
>
0
)
?
fieldcode1
:
fieldcode2
;
if
(
fieldcode1
>
0
&&
fieldcode2
>
0
&&
fieldcode1
!=
fieldcode2
)
{
ITexture
*
texture
=
imageManager
.
GetTextureField
(
fieldcode1
);
if
(
texture
)
{
drawField
=
true
;
matManager
.
mTexture
.
setTexture
(
0
,
texture
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vFieldSpell1
,
4
,
matManager
.
iRectangle
,
2
);
}
texture
=
imageManager
.
GetTextureField
(
fieldcode2
);
if
(
texture
)
{
drawField
=
true
;
matManager
.
mTexture
.
setTexture
(
0
,
texture
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vFieldSpell2
,
4
,
matManager
.
iRectangle
,
2
);
}
}
else
if
(
fieldcode
>
0
)
{
ITexture
*
texture
=
imageManager
.
GetTextureField
(
fieldcode
);
if
(
texture
)
{
drawField
=
true
;
matManager
.
mTexture
.
setTexture
(
0
,
texture
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vFieldSpell
,
4
,
matManager
.
iRectangle
,
2
);
if
(
mainGame
->
gameConf
.
draw_field_spell
)
{
int
fieldcode1
=
-
1
;
int
fieldcode2
=
-
1
;
if
(
mainGame
->
dField
.
szone
[
0
][
5
]
&&
mainGame
->
dField
.
szone
[
0
][
5
]
->
position
&
POS_FACEUP
)
fieldcode1
=
mainGame
->
dField
.
szone
[
0
][
5
]
->
code
;
if
(
mainGame
->
dField
.
szone
[
1
][
5
]
&&
mainGame
->
dField
.
szone
[
1
][
5
]
->
position
&
POS_FACEUP
)
fieldcode2
=
mainGame
->
dField
.
szone
[
1
][
5
]
->
code
;
int
fieldcode
=
(
fieldcode1
>
0
)
?
fieldcode1
:
fieldcode2
;
if
(
fieldcode1
>
0
&&
fieldcode2
>
0
&&
fieldcode1
!=
fieldcode2
)
{
ITexture
*
texture
=
imageManager
.
GetTextureField
(
fieldcode1
);
if
(
texture
)
{
drawField
=
true
;
matManager
.
mTexture
.
setTexture
(
0
,
texture
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vFieldSpell1
,
4
,
matManager
.
iRectangle
,
2
);
}
texture
=
imageManager
.
GetTextureField
(
fieldcode2
);
if
(
texture
)
{
drawField
=
true
;
matManager
.
mTexture
.
setTexture
(
0
,
texture
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vFieldSpell2
,
4
,
matManager
.
iRectangle
,
2
);
}
}
else
if
(
fieldcode
>
0
)
{
ITexture
*
texture
=
imageManager
.
GetTextureField
(
fieldcode
);
if
(
texture
)
{
drawField
=
true
;
matManager
.
mTexture
.
setTexture
(
0
,
texture
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vFieldSpell
,
4
,
matManager
.
iRectangle
,
2
);
}
}
}
matManager
.
mTexture
.
setTexture
(
0
,
drawField
?
imageManager
.
tFieldTransparent
[
rule
]
:
imageManager
.
tField
[
rule
]);
...
...
@@ -249,7 +250,6 @@ void Game::DrawCards() {
DrawCard
(
*
cit
);
}
void
Game
::
DrawCard
(
ClientCard
*
pcard
)
{
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
pcard
->
mTransform
);
if
(
pcard
->
aniFrame
)
{
if
(
pcard
->
is_moving
)
{
pcard
->
curPos
+=
pcard
->
dPos
;
...
...
@@ -267,29 +267,20 @@ void Game::DrawCard(ClientCard* pcard) {
}
matManager
.
mCard
.
AmbientColor
=
0xffffffff
;
matManager
.
mCard
.
DiffuseColor
=
(
pcard
->
curAlpha
<<
24
)
|
0xffffff
;
matManager
.
mCard
.
setTexture
(
0
,
imageManager
.
GetTexture
(
pcard
->
code
));
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
pcard
->
mTransform
);
driver
->
setMaterial
(
matManager
.
mCard
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vCardFront
,
4
,
matManager
.
iRectangle
,
2
);
if
(
pcard
->
controler
==
0
||
!
imageManager
.
tCover
[
1
])
matManager
.
mCard
.
setTexture
(
0
,
imageManager
.
tCover
[
0
]);
else
matManager
.
mCard
.
setTexture
(
0
,
imageManager
.
tCover
[
1
]);
driver
->
setMaterial
(
matManager
.
mCard
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vCardBack
,
4
,
matManager
.
iRectangle
,
2
);
if
(
pcard
->
is_showequip
)
{
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tEquip
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vSymbol
,
4
,
matManager
.
iRectangle
,
2
);
}
else
if
(
pcard
->
is_showtarget
)
{
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tTarget
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vSymbol
,
4
,
matManager
.
iRectangle
,
2
);
}
else
if
(
pcard
->
is_disabled
&&
(
pcard
->
location
&
LOCATION_ONFIELD
)
&&
(
pcard
->
position
&
POS_FACEUP
))
{
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tNegated
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vNegate
,
4
,
matManager
.
iRectangle
,
2
);
auto
m22
=
pcard
->
mTransform
(
2
,
2
);
if
(
m22
>
-
0.99
||
pcard
->
is_moving
)
{
matManager
.
mCard
.
setTexture
(
0
,
imageManager
.
GetTexture
(
pcard
->
code
));
driver
->
setMaterial
(
matManager
.
mCard
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vCardFront
,
4
,
matManager
.
iRectangle
,
2
);
}
if
(
m22
<
0.99
||
pcard
->
is_moving
)
{
matManager
.
mCard
.
setTexture
(
0
,
imageManager
.
tCover
[
pcard
->
controler
]);
driver
->
setMaterial
(
matManager
.
mCard
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vCardBack
,
4
,
matManager
.
iRectangle
,
2
);
}
if
(
pcard
->
is_moving
)
return
;
if
(
pcard
->
is_selectable
&&
(
pcard
->
location
&
0xe
))
{
float
cv
[
4
]
=
{
1.0
f
,
1.0
f
,
0.0
f
,
1.0
f
};
if
((
pcard
->
location
==
LOCATION_HAND
&&
pcard
->
code
)
||
((
pcard
->
location
&
0xc
)
&&
(
pcard
->
position
&
POS_FACEUP
)))
...
...
@@ -304,6 +295,26 @@ void Game::DrawCard(ClientCard* pcard) {
else
DrawSelectionLine
(
matManager
.
vCardOutliner
,
true
,
2
,
cv
);
}
irr
::
core
::
matrix4
im
;
im
.
setTranslation
(
pcard
->
curPos
);
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
im
);
if
(
pcard
->
is_showequip
)
{
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tEquip
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vSymbol
,
4
,
matManager
.
iRectangle
,
2
);
}
else
if
(
pcard
->
is_showtarget
)
{
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tTarget
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vSymbol
,
4
,
matManager
.
iRectangle
,
2
);
}
else
if
(
pcard
->
is_showchaintarget
)
{
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tChainTarget
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vSymbol
,
4
,
matManager
.
iRectangle
,
2
);
}
else
if
(
pcard
->
is_disabled
&&
(
pcard
->
location
&
LOCATION_ONFIELD
)
&&
(
pcard
->
position
&
POS_FACEUP
))
{
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tNegated
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vNegate
,
4
,
matManager
.
iRectangle
,
2
);
}
if
(
pcard
->
cmdFlag
&
COMMAND_ATTACK
)
{
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tAttack
);
driver
->
setMaterial
(
matManager
.
mTexture
);
...
...
@@ -872,7 +883,7 @@ void Game::DrawSpec() {
matk
.
setRotationRadians
(
atk_r
);
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
matk
);
driver
->
setMaterial
(
matManager
.
mATK
);
driver
->
drawVertexPrimitiveList
(
&
matManager
.
vArrow
[
attack_sv
],
40
,
matManager
.
iArrow
,
10
,
EVT_STANDARD
,
EPT_TRIANGLE_STRIP
);
driver
->
drawVertexPrimitiveList
(
&
matManager
.
vArrow
[
attack_sv
],
12
,
matManager
.
iArrow
,
10
,
EVT_STANDARD
,
EPT_TRIANGLE_STRIP
);
attack_sv
+=
4
;
if
(
attack_sv
>
28
)
attack_sv
=
0
;
...
...
gframe/duelclient.cpp
View file @
a26cc3ae
...
...
@@ -2206,9 +2206,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
gMutex
.
Lock
();
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
mainGame
->
gMutex
.
Unlock
();
mainGame
->
dField
.
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
);
pcard
->
mTransform
.
setTranslation
(
pcard
->
curPos
);
pcard
->
mTransform
.
setRotationRadians
(
pcard
->
curRot
);
mainGame
->
dField
.
GetCardLocation
(
pcard
,
&
pcard
->
curPos
,
&
pcard
->
curRot
,
true
);
pcard
->
curAlpha
=
5
;
mainGame
->
dField
.
FadeCard
(
pcard
,
255
,
20
);
mainGame
->
WaitFrameSignal
(
20
);
...
...
@@ -2249,8 +2247,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
equipTarget
=
0
;
}
}
pcard
->
is_hovered
=
false
;
pcard
->
is_showequip
=
false
;
pcard
->
is_showtarget
=
false
;
pcard
->
is_showchaintarget
=
false
;
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
pcard
->
position
=
cp
;
...
...
@@ -2301,6 +2301,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
counters
.
clear
();
pcard
->
ClearTarget
();
pcard
->
is_showtarget
=
false
;
pcard
->
is_showchaintarget
=
false
;
ClientCard
*
olcard
=
mainGame
->
dField
.
GetCard
(
cc
,
cl
&
0x7f
,
cs
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
...
...
@@ -2570,13 +2571,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
current_chain
.
sequence
=
cs
;
mainGame
->
dField
.
GetChainLocation
(
cc
,
cl
,
cs
,
&
mainGame
->
dField
.
current_chain
.
chain_pos
);
mainGame
->
dField
.
current_chain
.
solved
=
false
;
mainGame
->
dField
.
current_chain
.
target
.
clear
();
int
chc
=
0
;
for
(
size_t
i
=
0
;
i
<
mainGame
->
dField
.
chains
.
size
();
++
i
)
{
for
(
auto
chit
=
mainGame
->
dField
.
chains
.
begin
();
chit
!=
mainGame
->
dField
.
chains
.
end
();
++
chit
)
{
if
(
cl
==
0x10
||
cl
==
0x20
)
{
if
(
mainGame
->
dField
.
chains
[
i
].
controler
==
cc
&&
mainGame
->
dField
.
chains
[
i
].
location
==
cl
)
if
(
chit
->
controler
==
cc
&&
chit
->
location
==
cl
)
chc
++
;
}
else
{
if
(
mainGame
->
dField
.
chains
[
i
].
controler
==
cc
&&
mainGame
->
dField
.
chains
[
i
].
location
==
cl
&&
mainGame
->
dField
.
chains
[
i
].
sequence
==
cs
)
if
(
chit
->
controler
==
cc
&&
chit
->
location
==
cl
&&
chit
->
sequence
==
cs
)
chc
++
;
}
}
...
...
@@ -2669,14 +2671,14 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pbuf
+=
count
*
4
;
return
true
;
}
ClientCard
*
pcard
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l
=
BufferIO
::
ReadInt8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int ss = */
BufferIO
::
ReadInt8
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
pcard
->
is_highlighting
=
true
;
mainGame
->
dField
.
current_chain
.
target
.
insert
(
pcard
);
if
(
pcard
->
location
&
LOCATION_ONFIELD
)
{
for
(
int
j
=
0
;
j
<
3
;
++
j
)
{
mainGame
->
dField
.
FadeCard
(
pcard
,
5
,
5
);
...
...
@@ -3531,12 +3533,12 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
GetChainLocation
(
cc
,
cl
,
cs
,
&
mainGame
->
dField
.
current_chain
.
chain_pos
);
mainGame
->
dField
.
current_chain
.
solved
=
false
;
int
chc
=
0
;
for
(
size_t
i
=
0
;
i
<
mainGame
->
dField
.
chains
.
size
();
++
i
)
{
for
(
auto
chit
=
mainGame
->
dField
.
chains
.
begin
();
chit
!=
mainGame
->
dField
.
chains
.
end
();
++
chit
)
{
if
(
cl
==
0x10
||
cl
==
0x20
)
{
if
(
mainGame
->
dField
.
chains
[
i
].
controler
==
cc
&&
mainGame
->
dField
.
chains
[
i
].
location
==
cl
)
if
(
chit
->
controler
==
cc
&&
chit
->
location
==
cl
)
chc
++
;
}
else
{
if
(
mainGame
->
dField
.
chains
[
i
].
controler
==
cc
&&
mainGame
->
dField
.
chains
[
i
].
location
==
cl
&&
mainGame
->
dField
.
chains
[
i
].
sequence
==
cs
)
if
(
chit
->
controler
==
cc
&&
chit
->
location
==
cl
&&
chit
->
sequence
==
cs
)
chc
++
;
}
}
...
...
gframe/event_handler.cpp
View file @
a26cc3ae
...
...
@@ -1759,7 +1759,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mplayer
=
1
;
}
}
if
(
hovered_location
==
LOCATION_HAND
&&
(
mainGame
->
dInfo
.
is_shuffling
||
mainGame
->
dInfo
.
curMsg
==
MSG_SHUFFLE_HAND
))
mcard
=
0
;
if
(
mcard
==
0
&&
mplayer
<
0
)
...
...
@@ -1779,17 +1778,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
hovered_controler
==
0
)
mainGame
->
hideChat
=
false
;
}
if
(
hovered_card
->
equipTarget
)
hovered_card
->
equipTarget
->
is_showequip
=
false
;
if
(
hovered_card
->
equipped
.
size
())
for
(
auto
cit
=
hovered_card
->
equipped
.
begin
();
cit
!=
hovered_card
->
equipped
.
end
();
++
cit
)
(
*
cit
)
->
is_showequip
=
false
;
if
(
hovered_card
->
cardTarget
.
size
())
for
(
auto
cit
=
hovered_card
->
cardTarget
.
begin
();
cit
!=
hovered_card
->
cardTarget
.
end
();
++
cit
)
(
*
cit
)
->
is_showtarget
=
false
;
if
(
hovered_card
->
ownerTarget
.
size
())
for
(
auto
cit
=
hovered_card
->
ownerTarget
.
begin
();
cit
!=
hovered_card
->
ownerTarget
.
end
();
++
cit
)
(
*
cit
)
->
is_showtarget
=
false
;
SetShowMark
(
hovered_card
,
false
);
}
if
(
mcard
)
{
if
(
mcard
!=
clicked_card
)
...
...
@@ -1800,14 +1789,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
hovered_controler
==
0
)
mainGame
->
hideChat
=
true
;
}
if
(
mcard
->
equipTarget
)
mcard
->
equipTarget
->
is_showequip
=
true
;
for
(
auto
cit
=
mcard
->
equipped
.
begin
();
cit
!=
mcard
->
equipped
.
end
();
++
cit
)
(
*
cit
)
->
is_showequip
=
true
;
for
(
auto
cit
=
mcard
->
cardTarget
.
begin
();
cit
!=
mcard
->
cardTarget
.
end
();
++
cit
)
(
*
cit
)
->
is_showtarget
=
true
;
for
(
auto
cit
=
mcard
->
ownerTarget
.
begin
();
cit
!=
mcard
->
ownerTarget
.
end
();
++
cit
)
(
*
cit
)
->
is_showtarget
=
true
;
SetShowMark
(
mcard
,
true
);
if
(
mcard
->
code
)
{
mainGame
->
ShowCardInfo
(
mcard
->
code
);
if
(
mcard
->
location
&
0xe
)
{
...
...
@@ -2366,6 +2348,24 @@ void ClientField::ShowCancelOrFinishButton(int buttonOp) {
mainGame
->
btnCancelOrFinish
->
setVisible
(
false
);
}
}
void
ClientField
::
SetShowMark
(
ClientCard
*
pcard
,
bool
enable
)
{
if
(
pcard
->
equipTarget
)
pcard
->
equipTarget
->
is_showequip
=
enable
;
for
(
auto
cit
=
pcard
->
equipped
.
begin
();
cit
!=
pcard
->
equipped
.
end
();
++
cit
)
(
*
cit
)
->
is_showequip
=
enable
;
for
(
auto
cit
=
pcard
->
cardTarget
.
begin
();
cit
!=
pcard
->
cardTarget
.
end
();
++
cit
)
(
*
cit
)
->
is_showtarget
=
enable
;
for
(
auto
cit
=
pcard
->
ownerTarget
.
begin
();
cit
!=
pcard
->
ownerTarget
.
end
();
++
cit
)
(
*
cit
)
->
is_showtarget
=
enable
;
for
(
auto
chit
=
chains
.
begin
();
chit
!=
chains
.
end
();
++
chit
)
{
if
(
pcard
==
chit
->
chain_card
)
{
for
(
auto
tgit
=
chit
->
target
.
begin
();
tgit
!=
chit
->
target
.
end
();
++
tgit
)
(
*
tgit
)
->
is_showchaintarget
=
enable
;
}
if
(
chit
->
target
.
find
(
pcard
)
!=
chit
->
target
.
end
())
chit
->
chain_card
->
is_showchaintarget
=
enable
;
}
}
void
ClientField
::
SetResponseSelectedCards
()
const
{
unsigned
char
respbuf
[
64
];
respbuf
[
0
]
=
selected_cards
.
size
();
...
...
gframe/game.cpp
View file @
a26cc3ae
...
...
@@ -60,8 +60,6 @@ bool Game::Initialize() {
is_building
=
false
;
memset
(
&
dInfo
,
0
,
sizeof
(
DuelInfo
));
memset
(
chatTiming
,
0
,
sizeof
(
chatTiming
));
for
(
int
i
=
0
;
i
<
2048
;
++
i
)
dataManager
.
_sysStrings
[
i
]
=
0
;
deckManager
.
LoadLFList
();
driver
=
device
->
getVideoDriver
();
driver
->
setTextureCreationFlag
(
irr
::
video
::
ETCF_CREATE_MIP_MAPS
,
false
);
...
...
@@ -784,8 +782,12 @@ void Game::InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cH
void
Game
::
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
)
{
int
pbuffer
=
0
,
lsnz
=
0
;
u32
_width
=
0
,
_height
=
0
,
s
=
font
->
getCharDimension
(
L' '
).
Width
;
wchar_t
prev
=
0
;
for
(
size_t
i
=
0
;
text
[
i
]
!=
0
&&
i
<
wcslen
(
text
);
++
i
)
{
if
(
text
[
i
]
==
L' '
)
{
wchar_t
c
=
text
[
i
];
u32
w
=
font
->
getCharDimension
(
c
).
Width
+
font
->
getKerningWidth
(
c
,
prev
);
prev
=
c
;
if
(
c
==
L' '
)
{
lsnz
=
i
;
if
(
_width
+
s
>
cWidth
)
{
dataManager
.
strBuffer
[
pbuffer
++
]
=
L'\n'
;
...
...
@@ -799,7 +801,7 @@ void Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gu
_width
+=
s
;
}
}
else
if
(
text
[
i
]
==
L'\n'
)
{
else
if
(
c
==
L'\n'
)
{
dataManager
.
strBuffer
[
pbuffer
++
]
=
L'\n'
;
_width
=
0
;
_height
++
;
...
...
@@ -807,14 +809,14 @@ void Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gu
pbuffer
=
0
;
}
else
{
if
((
_width
+=
font
->
getCharDimension
(
text
[
i
]).
Width
)
>
cWidth
)
{
if
((
_width
+=
w
)
>
cWidth
)
{
dataManager
.
strBuffer
[
lsnz
]
=
L'\n'
;
_width
=
0
;
for
(
int
j
=
lsnz
+
1
;
j
<
i
;
j
++
)
{
_width
+=
font
->
getCharDimension
(
text
[
j
]).
Width
;
}
}
dataManager
.
strBuffer
[
pbuffer
++
]
=
text
[
i
]
;
dataManager
.
strBuffer
[
pbuffer
++
]
=
c
;
}
}
dataManager
.
strBuffer
[
pbuffer
]
=
0
;
...
...
@@ -1360,6 +1362,7 @@ void Game::CloseDuelWindow() {
btnChainAlways
->
setVisible
(
false
);
btnChainWhenAvail
->
setVisible
(
false
);
btnCancelOrFinish
->
setVisible
(
false
);
btnShuffle
->
setVisible
(
false
);
wChat
->
setVisible
(
false
);
lstLog
->
clear
();
logParam
.
clear
();
...
...
gframe/image_manager.cpp
View file @
a26cc3ae
...
...
@@ -7,6 +7,8 @@ ImageManager imageManager;
bool
ImageManager
::
Initial
()
{
tCover
[
0
]
=
driver
->
getTexture
(
"textures/cover.jpg"
);
tCover
[
1
]
=
driver
->
getTexture
(
"textures/cover2.jpg"
);
if
(
!
tCover
[
1
])
tCover
[
1
]
=
tCover
[
0
];
tUnknown
=
driver
->
getTexture
(
"textures/unknown.jpg"
);
tAct
=
driver
->
getTexture
(
"textures/act.png"
);
tAttack
=
driver
->
getTexture
(
"textures/attack.png"
);
...
...
@@ -18,6 +20,7 @@ bool ImageManager::Initial() {
tMask
=
driver
->
getTexture
(
"textures/mask.png"
);
tEquip
=
driver
->
getTexture
(
"textures/equip.png"
);
tTarget
=
driver
->
getTexture
(
"textures/target.png"
);
tChainTarget
=
driver
->
getTexture
(
"textures/chaintarget.png"
);
tLim
=
driver
->
getTexture
(
"textures/lim.png"
);
tHand
[
0
]
=
driver
->
getTexture
(
"textures/f1.jpg"
);
tHand
[
1
]
=
driver
->
getTexture
(
"textures/f2.jpg"
);
...
...
gframe/image_manager.h
View file @
a26cc3ae
...
...
@@ -34,6 +34,7 @@ public:
irr
::
video
::
ITexture
*
tMask
;
irr
::
video
::
ITexture
*
tEquip
;
irr
::
video
::
ITexture
*
tTarget
;
irr
::
video
::
ITexture
*
tChainTarget
;
irr
::
video
::
ITexture
*
tLim
;
irr
::
video
::
ITexture
*
tHand
[
3
];
irr
::
video
::
ITexture
*
tBackGround
;
...
...
textures/chaintarget.png
0 → 100644
View file @
a26cc3ae
2.3 KB
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