Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
e92840c8
Commit
e92840c8
authored
Sep 23, 2010
by
Max-Wilhelm Bruker
Browse files
moved call to rng constructor to main()
parent
a5d73a9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/main.cpp
View file @
e92840c8
...
...
@@ -35,12 +35,14 @@
#include
"carddatabase.h"
#include
"settingscache.h"
#include
"pixmapgenerator.h"
#include
"rng_sfmt.h"
//Q_IMPORT_PLUGIN(qjpeg)
CardDatabase
*
db
;
QTranslator
*
translator
,
*
qtTranslator
;
SettingsCache
*
settingsCache
;
RNG_Abstract
*
rng
;
void
myMessageOutput
(
QtMsgType
/*type*/
,
const
char
*
msg
)
{
...
...
@@ -84,6 +86,7 @@ int main(int argc, char *argv[])
QCoreApplication
::
setOrganizationDomain
(
"cockatrice.de"
);
QCoreApplication
::
setApplicationName
(
"Cockatrice"
);
rng
=
new
RNG_SFMT
;
settingsCache
=
new
SettingsCache
;
db
=
new
CardDatabase
;
...
...
@@ -125,6 +128,7 @@ int main(int argc, char *argv[])
delete
db
;
delete
settingsCache
;
delete
rng
;
PingPixmapGenerator
::
clear
();
CountryPixmapGenerator
::
clear
();
UserLevelPixmapGenerator
::
clear
();
...
...
common/rng_abstract.cpp
View file @
e92840c8
#include
"rng_abstract.h"
#include
"rng_qt.h"
#include
"rng_sfmt.h"
#include
<QDebug>
RNG_Abstract
*
rng
=
new
RNG_SFMT
;
QVector
<
int
>
RNG_Abstract
::
makeNumbersVector
(
int
n
,
int
min
,
int
max
)
{
...
...
servatrice/src/main.cpp
View file @
e92840c8
...
...
@@ -22,7 +22,9 @@
#include
<QTextCodec>
#include
<iostream>
#include
"servatrice.h"
#include
"rng_abstract.h"
#include
"rng_sfmt.h"
RNG_Abstract
*
rng
;
void
myMessageOutput
(
QtMsgType
/*type*/
,
const
char
*
msg
)
{
...
...
@@ -76,6 +78,8 @@ int main(int argc, char *argv[])
app
.
setApplicationName
(
"Servatrice"
);
QTextCodec
::
setCodecForCStrings
(
QTextCodec
::
codecForName
(
"UTF-8"
));
rng
=
new
RNG_SFMT
;
std
::
cerr
<<
"Servatrice "
<<
Servatrice
::
versionString
.
toStdString
()
<<
" starting."
<<
std
::
endl
;
std
::
cerr
<<
"-------------------------"
<<
std
::
endl
;
...
...
@@ -87,5 +91,9 @@ int main(int argc, char *argv[])
std
::
cerr
<<
"-------------------------"
<<
std
::
endl
;
std
::
cerr
<<
"Server initialized."
<<
std
::
endl
;
return
app
.
exec
();
int
retval
=
app
.
exec
();
delete
rng
;
return
retval
;
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment