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
8efe15a2
Commit
8efe15a2
authored
Jun 26, 2009
by
Max-Wilhelm Bruker
Browse files
card back svg
parent
fb03c5cd
Changes
5
Show whitespace changes
Inline
Side-by-side
cockatrice/cockatrice.pro
View file @
8efe15a2
...
@@ -8,9 +8,10 @@ DEPENDPATH += . src
...
@@ -8,9 +8,10 @@ DEPENDPATH += . src
INCLUDEPATH
+=
.
src
INCLUDEPATH
+=
.
src
MOC_DIR
=
build
MOC_DIR
=
build
OBJECTS_DIR
=
build
OBJECTS_DIR
=
build
RESOURCES
=
cockatrice
.
qrc
#
CONFIG
+=
qt
debug
#
CONFIG
+=
qt
debug
QT
+=
network
QT
+=
network
svg
#
QT
+=
opengl
#
QT
+=
opengl
#
QTPLUGIN
+=
qjpeg
#
QTPLUGIN
+=
qjpeg
...
...
cockatrice/cockatrice.qrc
0 → 100644
View file @
8efe15a2
<!DOCTYPE RCC>
<RCC
version=
"1.0"
>
<qresource>
<file
alias=
"back.svg"
>
resources/back.svg
</file>
</qresource>
</RCC>
cockatrice/resources/back.svg
0 → 100644
View file @
8efe15a2
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
xmlns:cc=
"http://creativecommons.org/ns#"
xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xmlns:sodipodi=
"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape=
"http://www.inkscape.org/namespaces/inkscape"
width=
"240"
height=
"340"
id=
"svg2"
sodipodi:version=
"0.32"
inkscape:version=
"0.46"
sodipodi:docname=
"hintergrund.svg"
inkscape:output_extension=
"org.inkscape.output.svg.inkscape"
version=
"1.0"
>
<defs
id=
"defs4"
>
<linearGradient
id=
"linearGradient4766"
>
<stop
style=
"stop-color:#784421;stop-opacity:1;"
offset=
"0"
id=
"stop4768"
/>
<stop
style=
"stop-color:#3d2210;stop-opacity:0;"
offset=
"1"
id=
"stop4770"
/>
</linearGradient>
<linearGradient
id=
"linearGradient4758"
>
<stop
style=
"stop-color:#a05a2c;stop-opacity:1;"
offset=
"0"
id=
"stop4760"
/>
<stop
style=
"stop-color:#3d2210;stop-opacity:1;"
offset=
"1"
id=
"stop4762"
/>
</linearGradient>
<inkscape:perspective
sodipodi:type=
"inkscape:persp3d"
inkscape:vp_x=
"0 : 526.18109 : 1"
inkscape:vp_y=
"0 : 1000 : 0"
inkscape:vp_z=
"744.09448 : 526.18109 : 1"
inkscape:persp3d-origin=
"372.04724 : 350.78739 : 1"
id=
"perspective10"
/>
<inkscape:perspective
id=
"perspective2484"
inkscape:persp3d-origin=
"372.04724 : 350.78739 : 1"
inkscape:vp_z=
"744.09448 : 526.18109 : 1"
inkscape:vp_y=
"0 : 1000 : 0"
inkscape:vp_x=
"0 : 526.18109 : 1"
sodipodi:type=
"inkscape:persp3d"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758"
id=
"linearGradient4764"
x1=
"466.09601"
y1=
"485.96021"
x2=
"715.14801"
y2=
"485.96021"
gradientUnits=
"userSpaceOnUse"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766"
id=
"linearGradient4772"
x1=
"496.548"
y1=
"485.26816"
x2=
"683.31201"
y2=
"485.26816"
gradientUnits=
"userSpaceOnUse"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758"
id=
"linearGradient5374"
gradientUnits=
"userSpaceOnUse"
x1=
"590.62201"
y1=
"434.7522"
x2=
"698.54004"
y2=
"517.79218"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766"
id=
"linearGradient5376"
gradientUnits=
"userSpaceOnUse"
x1=
"661.24402"
y1=
"602.90814"
x2=
"431.5"
y2=
"201.5482"
/>
</defs>
<sodipodi:namedview
id=
"base"
pagecolor=
"#ffffff"
bordercolor=
"#666666"
borderopacity=
"1.0"
inkscape:pageopacity=
"0.0"
inkscape:pageshadow=
"2"
inkscape:zoom=
"1.0399859"
inkscape:cx=
"266.11903"
inkscape:cy=
"191.87768"
inkscape:document-units=
"px"
inkscape:current-layer=
"layer1"
showgrid=
"false"
inkscape:window-width=
"1280"
inkscape:window-height=
"725"
inkscape:window-x=
"0"
inkscape:window-y=
"25"
/>
<metadata
id=
"metadata7"
>
<rdf:RDF>
<cc:Work
rdf:about=
""
>
<dc:format>
image/svg+xml
</dc:format>
<dc:type
rdf:resource=
"http://purl.org/dc/dcmitype/StillImage"
/>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label=
"Ebene 1"
inkscape:groupmode=
"layer"
id=
"layer1"
>
<g
id=
"g5369"
transform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
>
<rect
y=
"324.3782"
x=
"476.09601"
height=
"323.164"
width=
"229.052"
id=
"rect2490"
style=
"fill:url(#linearGradient5374);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:20;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
/>
<rect
y=
"345.83017"
x=
"497.548"
height=
"278.87601"
width=
"184.76401"
id=
"rect3302"
style=
"fill:url(#linearGradient5376);fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
/>
<path
transform=
"matrix(1.1813093,0,0,1.0234202,-106.20504,-16.66044)"
d=
"M 661.55199,489.76617 A 71.968002,128.71201 0 1 1 517.61598,489.76617 A 71.968002,128.71201 0 1 1 661.55199,489.76617 z"
sodipodi:ry=
"128.71201"
sodipodi:rx=
"71.968002"
sodipodi:cy=
"489.76617"
sodipodi:cx=
"589.58398"
id=
"path3304"
style=
"fill:#a05a2c;stroke:#000000;stroke-width:2;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
sodipodi:type=
"arc"
/>
</g>
</g>
</svg>
cockatrice/src/carddatabase.cpp
View file @
8efe15a2
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
#include
<QFile>
#include
<QFile>
#include
<QTextStream>
#include
<QTextStream>
#include
<QSettings>
#include
<QSettings>
#include
<QSvgRenderer>
#include
<QPainter>
CardSet
::
CardSet
(
const
QString
&
_shortName
,
const
QString
&
_longName
)
CardSet
::
CardSet
(
const
QString
&
_shortName
,
const
QString
&
_longName
)
:
shortName
(
_shortName
),
longName
(
_longName
)
:
shortName
(
_shortName
),
longName
(
_longName
)
...
@@ -142,9 +144,18 @@ QPixmap *CardInfo::getPixmap(QSize size)
...
@@ -142,9 +144,18 @@ QPixmap *CardInfo::getPixmap(QSize size)
if
(
cachedPixmap
)
if
(
cachedPixmap
)
return
cachedPixmap
;
return
cachedPixmap
;
QPixmap
*
bigPixmap
=
loadPixmap
();
QPixmap
*
bigPixmap
=
loadPixmap
();
if
(
bigPixmap
->
isNull
())
QPixmap
*
result
;
if
(
bigPixmap
->
isNull
())
{
if
(
!
getName
().
isEmpty
())
return
0
;
return
0
;
QPixmap
*
result
=
new
QPixmap
(
bigPixmap
->
scaled
(
size
,
Qt
::
IgnoreAspectRatio
,
Qt
::
SmoothTransformation
));
else
{
result
=
new
QPixmap
(
size
);
QSvgRenderer
svg
(
QString
(
":/back.svg"
));
QPainter
painter
(
result
);
svg
.
render
(
&
painter
,
QRectF
(
0
,
0
,
size
.
width
(),
size
.
height
()));
}
}
else
result
=
new
QPixmap
(
bigPixmap
->
scaled
(
size
,
Qt
::
IgnoreAspectRatio
,
Qt
::
SmoothTransformation
));
scaledPixmapCache
.
insert
(
size
.
width
(),
result
);
scaledPixmapCache
.
insert
(
size
.
width
(),
result
);
return
result
;
return
result
;
}
}
...
...
cockatrice/src/cardinfowidget.cpp
View file @
8efe15a2
#include
"cardinfowidget.h"
#include
"cardinfowidget.h"
#include
"carditem.h"
#include
<QGridLayout>
#include
<QGridLayout>
#include
<QLabel>
#include
<QLabel>
#include
<QTextEdit>
#include
<QTextEdit>
...
@@ -54,7 +55,7 @@ CardInfoWidget::CardInfoWidget(CardDatabase *_db, QWidget *parent)
...
@@ -54,7 +55,7 @@ CardInfoWidget::CardInfoWidget(CardDatabase *_db, QWidget *parent)
CardInfo
*
cardBack
=
db
->
getCard
();
CardInfo
*
cardBack
=
db
->
getCard
();
QPixmap
*
bigPixmap
=
cardBack
->
loadPixmap
();
QPixmap
*
bigPixmap
=
cardBack
->
loadPixmap
();
if
(
bigPixmap
->
isNull
())
if
(
bigPixmap
->
isNull
())
QMessageBox
::
critical
(
this
,
tr
(
"Error"
),
tr
(
"Unable to load pixmap for card back."
))
;
pixmapHeight
=
pixmapWidth
*
CARD_HEIGHT
/
CARD_WIDTH
;
else
else
pixmapHeight
=
pixmapWidth
*
bigPixmap
->
height
()
/
bigPixmap
->
width
();
pixmapHeight
=
pixmapWidth
*
bigPixmap
->
height
()
/
bigPixmap
->
width
();
setCard
(
cardBack
);
setCard
(
cardBack
);
...
...
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