Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-tutorial-porting
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Tvete
qt-tutorial-porting
Commits
2cbda78a
Commit
2cbda78a
authored
6 years ago
by
Paul Tvete
Browse files
Options
Downloads
Patches
Plain Diff
Change TRUE/FALSE to true/false
parent
8f451083
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
t14/cannon.cpp
+13
-13
13 additions, 13 deletions
t14/cannon.cpp
with
13 additions
and
13 deletions
t14/cannon.cpp
+
13
−
13
View file @
2cbda78a
...
...
@@ -21,12 +21,12 @@ CannonField::CannonField( QWidget *parent, const char *name )
{
ang
=
45
;
f
=
0
;
shooting
=
FALSE
;
shooting
=
false
;
timerCount
=
0
;
shoot_ang
=
0
;
shoot_f
=
0
;
gameEnded
=
FALSE
;
barrelPressed
=
FALSE
;
gameEnded
=
false
;
barrelPressed
=
false
;
newTarget
();
}
...
...
@@ -39,7 +39,7 @@ void CannonField::setAngle( int degrees )
if
(
ang
==
degrees
)
return
;
ang
=
degrees
;
repaint
(
cannonRect
(),
FALSE
);
repaint
(
cannonRect
(),
false
);
emit
angleChanged
(
ang
);
}
...
...
@@ -60,15 +60,15 @@ void CannonField::shoot()
timerCount
=
0
;
shoot_ang
=
ang
;
shoot_f
=
f
;
shooting
=
TRUE
;
shooting
=
true
;
startTimer
(
50
);
}
void
CannonField
::
newTarget
()
{
static
bool
first_time
=
TRUE
;
static
bool
first_time
=
true
;
if
(
first_time
)
{
first_time
=
FALSE
;
first_time
=
false
;
QTime
midnight
(
0
,
0
,
0
);
srand
(
midnight
.
secsTo
(
QTime
::
currentTime
())
);
}
...
...
@@ -84,7 +84,7 @@ void CannonField::setGameOver()
return
;
if
(
shooting
)
stopShooting
();
gameEnded
=
TRUE
;
gameEnded
=
true
;
repaint
();
}
...
...
@@ -92,7 +92,7 @@ void CannonField::restartGame()
{
if
(
shooting
)
stopShooting
();
gameEnded
=
FALSE
;
gameEnded
=
false
;
repaint
();
}
...
...
@@ -114,7 +114,7 @@ void CannonField::timerEvent( QTimerEvent * )
emit
missed
();
return
;
}
repaint
(
shotR
,
FALSE
);
repaint
(
shotR
,
false
);
}
void
CannonField
::
paintEvent
(
QPaintEvent
*
e
)
...
...
@@ -145,7 +145,7 @@ void CannonField::mousePressEvent( QMouseEvent *e )
if
(
e
->
button
()
!=
LeftButton
)
return
;
if
(
barrelHit
(
e
->
pos
()
)
)
barrelPressed
=
TRUE
;
barrelPressed
=
true
;
}
void
CannonField
::
mouseMoveEvent
(
QMouseEvent
*
e
)
...
...
@@ -164,12 +164,12 @@ void CannonField::mouseMoveEvent( QMouseEvent *e )
void
CannonField
::
mouseReleaseEvent
(
QMouseEvent
*
e
)
{
if
(
e
->
button
()
==
LeftButton
)
barrelPressed
=
FALSE
;
barrelPressed
=
false
;
}
void
CannonField
::
stopShooting
()
{
shooting
=
FALSE
;
shooting
=
false
;
killTimers
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment