Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-2pick
Commits
dfb9d45b
Commit
dfb9d45b
authored
Apr 02, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add DrawSelectionLine for element
parent
5a55adf1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
16 deletions
+37
-16
gframe/drawing.cpp
gframe/drawing.cpp
+30
-10
gframe/game.cpp
gframe/game.cpp
+4
-5
gframe/game.h
gframe/game.h
+3
-1
No files found.
gframe/drawing.cpp
View file @
dfb9d45b
...
@@ -12,7 +12,7 @@ void Game::DrawSelectionLine(irr::video::S3DVertex* vec, bool strip, int width,
...
@@ -12,7 +12,7 @@ void Game::DrawSelectionLine(irr::video::S3DVertex* vec, bool strip, int width,
if
(
!
gameConf
.
use_d3d
)
{
if
(
!
gameConf
.
use_d3d
)
{
float
origin
[
4
]
=
{
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
};
float
origin
[
4
]
=
{
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
};
glLineWidth
(
width
);
glLineWidth
(
width
);
glLineStipple
(
1
,
linePattern
);
glLineStipple
(
1
,
linePattern
GL
);
if
(
strip
)
if
(
strip
)
glEnable
(
GL_LINE_STIPPLE
);
glEnable
(
GL_LINE_STIPPLE
);
glDisable
(
GL_TEXTURE_2D
);
glDisable
(
GL_TEXTURE_2D
);
...
@@ -29,16 +29,16 @@ void Game::DrawSelectionLine(irr::video::S3DVertex* vec, bool strip, int width,
...
@@ -29,16 +29,16 @@ void Game::DrawSelectionLine(irr::video::S3DVertex* vec, bool strip, int width,
}
else
{
}
else
{
driver
->
setMaterial
(
matManager
.
mOutLine
);
driver
->
setMaterial
(
matManager
.
mOutLine
);
if
(
strip
)
{
if
(
strip
)
{
if
(
linePattern
<
15
)
{
if
(
linePattern
D3D
<
15
)
{
driver
->
draw3DLine
(
vec
[
0
].
Pos
,
vec
[
0
].
Pos
+
(
vec
[
1
].
Pos
-
vec
[
0
].
Pos
)
*
(
linePattern
+
1
)
/
15.0
);
driver
->
draw3DLine
(
vec
[
0
].
Pos
,
vec
[
0
].
Pos
+
(
vec
[
1
].
Pos
-
vec
[
0
].
Pos
)
*
(
linePattern
D3D
+
1
)
/
15.0
);
driver
->
draw3DLine
(
vec
[
1
].
Pos
,
vec
[
1
].
Pos
+
(
vec
[
3
].
Pos
-
vec
[
1
].
Pos
)
*
(
linePattern
+
1
)
/
15.0
);
driver
->
draw3DLine
(
vec
[
1
].
Pos
,
vec
[
1
].
Pos
+
(
vec
[
3
].
Pos
-
vec
[
1
].
Pos
)
*
(
linePattern
D3D
+
1
)
/
15.0
);
driver
->
draw3DLine
(
vec
[
3
].
Pos
,
vec
[
3
].
Pos
+
(
vec
[
2
].
Pos
-
vec
[
3
].
Pos
)
*
(
linePattern
+
1
)
/
15.0
);
driver
->
draw3DLine
(
vec
[
3
].
Pos
,
vec
[
3
].
Pos
+
(
vec
[
2
].
Pos
-
vec
[
3
].
Pos
)
*
(
linePattern
D3D
+
1
)
/
15.0
);
driver
->
draw3DLine
(
vec
[
2
].
Pos
,
vec
[
2
].
Pos
+
(
vec
[
0
].
Pos
-
vec
[
2
].
Pos
)
*
(
linePattern
+
1
)
/
15.0
);
driver
->
draw3DLine
(
vec
[
2
].
Pos
,
vec
[
2
].
Pos
+
(
vec
[
0
].
Pos
-
vec
[
2
].
Pos
)
*
(
linePattern
D3D
+
1
)
/
15.0
);
}
else
{
}
else
{
driver
->
draw3DLine
(
vec
[
0
].
Pos
+
(
vec
[
1
].
Pos
-
vec
[
0
].
Pos
)
*
(
linePattern
-
14
)
/
15.0
,
vec
[
1
].
Pos
);
driver
->
draw3DLine
(
vec
[
0
].
Pos
+
(
vec
[
1
].
Pos
-
vec
[
0
].
Pos
)
*
(
linePattern
D3D
-
14
)
/
15.0
,
vec
[
1
].
Pos
);
driver
->
draw3DLine
(
vec
[
1
].
Pos
+
(
vec
[
3
].
Pos
-
vec
[
1
].
Pos
)
*
(
linePattern
-
14
)
/
15.0
,
vec
[
3
].
Pos
);
driver
->
draw3DLine
(
vec
[
1
].
Pos
+
(
vec
[
3
].
Pos
-
vec
[
1
].
Pos
)
*
(
linePattern
D3D
-
14
)
/
15.0
,
vec
[
3
].
Pos
);
driver
->
draw3DLine
(
vec
[
3
].
Pos
+
(
vec
[
2
].
Pos
-
vec
[
3
].
Pos
)
*
(
linePattern
-
14
)
/
15.0
,
vec
[
2
].
Pos
);
driver
->
draw3DLine
(
vec
[
3
].
Pos
+
(
vec
[
2
].
Pos
-
vec
[
3
].
Pos
)
*
(
linePattern
D3D
-
14
)
/
15.0
,
vec
[
2
].
Pos
);
driver
->
draw3DLine
(
vec
[
2
].
Pos
+
(
vec
[
0
].
Pos
-
vec
[
2
].
Pos
)
*
(
linePattern
-
14
)
/
15.0
,
vec
[
0
].
Pos
);
driver
->
draw3DLine
(
vec
[
2
].
Pos
+
(
vec
[
0
].
Pos
-
vec
[
2
].
Pos
)
*
(
linePattern
D3D
-
14
)
/
15.0
,
vec
[
0
].
Pos
);
}
}
}
else
{
}
else
{
driver
->
draw3DLine
(
vec
[
0
].
Pos
,
vec
[
1
].
Pos
);
driver
->
draw3DLine
(
vec
[
0
].
Pos
,
vec
[
1
].
Pos
);
...
@@ -48,6 +48,26 @@ void Game::DrawSelectionLine(irr::video::S3DVertex* vec, bool strip, int width,
...
@@ -48,6 +48,26 @@ void Game::DrawSelectionLine(irr::video::S3DVertex* vec, bool strip, int width,
}
}
}
}
}
}
void
Game
::
DrawSelectionLine
(
irr
::
gui
::
IGUIElement
*
element
,
int
width
,
irr
::
video
::
SColor
color
)
{
recti
pos
=
element
->
getAbsolutePosition
();
float
x1
=
pos
.
UpperLeftCorner
.
X
;
float
x2
=
pos
.
LowerRightCorner
.
X
;
float
y1
=
pos
.
UpperLeftCorner
.
Y
;
float
y2
=
pos
.
LowerRightCorner
.
Y
;
float
w
=
pos
.
getWidth
();
float
h
=
pos
.
getHeight
();
if
(
linePatternD3D
<
15
)
{
driver
->
draw2DRectangle
(
recti
(
x1
-
1
-
width
,
y1
-
1
-
width
,
x1
+
(
w
*
(
linePatternD3D
+
1
)
/
15.0
)
+
1
+
width
,
y1
-
1
),
color
,
color
,
color
,
color
);
driver
->
draw2DRectangle
(
recti
(
x2
-
(
w
*
(
linePatternD3D
+
1
)
/
15.0
)
-
1
-
width
,
y2
+
1
,
x2
+
1
+
width
,
y2
+
1
+
width
),
color
,
color
,
color
,
color
);
driver
->
draw2DRectangle
(
recti
(
x1
-
1
-
width
,
y1
-
1
-
width
,
x1
-
1
,
y2
-
(
h
*
(
linePatternD3D
+
1
)
/
15.0
)
+
1
+
width
),
color
,
color
,
color
,
color
);
driver
->
draw2DRectangle
(
recti
(
x2
+
1
,
y1
+
(
h
*
(
linePatternD3D
+
1
)
/
15.0
)
-
1
-
width
,
x2
+
1
+
width
,
y2
+
1
+
width
),
color
,
color
,
color
,
color
);
}
else
{
driver
->
draw2DRectangle
(
recti
(
x1
-
1
-
width
+
(
w
*
(
linePatternD3D
-
14
)
/
15.0
),
y1
-
1
-
width
,
x2
+
1
+
width
,
y1
-
1
),
color
,
color
,
color
,
color
);
driver
->
draw2DRectangle
(
recti
(
x1
-
1
-
width
,
y2
+
1
,
x2
-
(
w
*
(
linePatternD3D
-
14
)
/
15.0
)
+
1
+
width
,
y2
+
1
+
width
),
color
,
color
,
color
,
color
);
driver
->
draw2DRectangle
(
recti
(
x1
-
1
-
width
,
y2
-
(
h
*
(
linePatternD3D
-
14
)
/
15.0
)
-
1
-
width
,
x1
-
1
,
y2
+
1
+
width
),
color
,
color
,
color
,
color
);
driver
->
draw2DRectangle
(
recti
(
x2
+
1
,
y1
-
1
-
width
,
x2
+
1
+
width
,
y1
+
(
h
*
(
linePatternD3D
-
14
)
/
15.0
)
+
1
+
width
),
color
,
color
,
color
,
color
);
}
}
void
Game
::
DrawBackGround
()
{
void
Game
::
DrawBackGround
()
{
static
int
selFieldAlpha
=
255
;
static
int
selFieldAlpha
=
255
;
static
int
selFieldDAlpha
=
-
10
;
static
int
selFieldDAlpha
=
-
10
;
...
...
gframe/game.cpp
View file @
dfb9d45b
...
@@ -34,7 +34,8 @@ bool Game::Initialize() {
...
@@ -34,7 +34,8 @@ bool Game::Initialize() {
device
=
irr
::
createDeviceEx
(
params
);
device
=
irr
::
createDeviceEx
(
params
);
if
(
!
device
)
if
(
!
device
)
return
false
;
return
false
;
linePattern
=
0x0f0f
;
linePatternD3D
=
0
;
linePatternGL
=
0x0f0f
;
waitFrame
=
0
;
waitFrame
=
0
;
signalFrame
=
0
;
signalFrame
=
0
;
showcard
=
0
;
showcard
=
0
;
...
@@ -700,10 +701,8 @@ void Game::MainLoop() {
...
@@ -700,10 +701,8 @@ void Game::MainLoop() {
int
fps
=
0
;
int
fps
=
0
;
int
cur_time
=
0
;
int
cur_time
=
0
;
while
(
device
->
run
())
{
while
(
device
->
run
())
{
if
(
gameConf
.
use_d3d
)
linePatternD3D
=
(
linePatternD3D
+
1
)
%
30
;
linePattern
=
(
linePattern
+
1
)
%
30
;
linePatternGL
=
(
linePatternGL
<<
1
)
|
(
linePatternGL
>>
15
);
else
linePattern
=
(
linePattern
<<
1
)
|
(
linePattern
>>
15
);
atkframe
+=
0.1
f
;
atkframe
+=
0.1
f
;
atkdy
=
(
float
)
sin
(
atkframe
);
atkdy
=
(
float
)
sin
(
atkframe
);
driver
->
beginScene
(
true
,
true
,
SColor
(
0
,
0
,
0
,
0
));
driver
->
beginScene
(
true
,
true
,
SColor
(
0
,
0
,
0
,
0
));
...
...
gframe/game.h
View file @
dfb9d45b
...
@@ -110,6 +110,7 @@ public:
...
@@ -110,6 +110,7 @@ public:
void
RefreshSingleplay
();
void
RefreshSingleplay
();
void
RefreshBot
();
void
RefreshBot
();
void
DrawSelectionLine
(
irr
::
video
::
S3DVertex
*
vec
,
bool
strip
,
int
width
,
float
*
cv
);
void
DrawSelectionLine
(
irr
::
video
::
S3DVertex
*
vec
,
bool
strip
,
int
width
,
float
*
cv
);
void
DrawSelectionLine
(
irr
::
gui
::
IGUIElement
*
element
,
int
width
,
irr
::
video
::
SColor
color
);
void
DrawBackGround
();
void
DrawBackGround
();
void
DrawLinkedZones
(
ClientCard
*
pcard
);
void
DrawLinkedZones
(
ClientCard
*
pcard
);
void
CheckMutual
(
ClientCard
*
pcard
,
int
mark
);
void
CheckMutual
(
ClientCard
*
pcard
,
int
mark
);
...
@@ -166,7 +167,8 @@ public:
...
@@ -166,7 +167,8 @@ public:
bool
hideChat
;
bool
hideChat
;
int
chatTiming
[
8
];
int
chatTiming
[
8
];
int
chatType
[
8
];
int
chatType
[
8
];
unsigned
short
linePattern
;
unsigned
short
linePatternD3D
;
unsigned
short
linePatternGL
;
int
waitFrame
;
int
waitFrame
;
int
signalFrame
;
int
signalFrame
;
int
actionParam
;
int
actionParam
;
...
...
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