Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
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
magicseteditor
Commits
0514e8dd
Commit
0514e8dd
authored
Dec 18, 2006
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added image export, tested mtgeditor import
parent
73d6577a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
2 deletions
+94
-2
src/data/format/clipboard.cpp
src/data/format/clipboard.cpp
+2
-1
src/data/format/image.cpp
src/data/format/image.cpp
+47
-0
src/data/format/mtg_editor.cpp
src/data/format/mtg_editor.cpp
+6
-1
src/mse.vcproj
src/mse.vcproj
+39
-0
No files found.
src/data/format/clipboard.cpp
View file @
0514e8dd
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
// ----------------------------------------------------------------------------- : Includes
// ----------------------------------------------------------------------------- : Includes
#include <data/format/clipboard.hpp>
#include <data/format/clipboard.hpp>
#include <data/format/formats.hpp>
#include <data/card.hpp>
#include <data/card.hpp>
#include <data/set.hpp>
#include <data/set.hpp>
#include <data/game.hpp>
#include <data/game.hpp>
...
@@ -77,7 +78,7 @@ CardOnClipboard::CardOnClipboard(const SetP& set, const CardP& card) {
...
@@ -77,7 +78,7 @@ CardOnClipboard::CardOnClipboard(const SetP& set, const CardP& card) {
// TODO
// TODO
//Add( new TextDataObject(_("card")))
//Add( new TextDataObject(_("card")))
// Conversion to bitmap format
// Conversion to bitmap format
// Add(new BitmapDataObject(exportImageBm
p(set, card)));
Add
(
new
wxBitmapDataObject
(
export_bitma
p
(
set
,
card
)));
// Conversion to serialized card format
// Conversion to serialized card format
Add
(
new
CardDataObject
(
set
,
card
),
true
);
Add
(
new
CardDataObject
(
set
,
card
),
true
);
}
}
src/data/format/image.cpp
0 → 100644
View file @
0514e8dd
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
// ----------------------------------------------------------------------------- : Includes
#include <data/format/formats.hpp>
#include <data/set.hpp>
#include <data/settings.hpp>
#include <render/card/viewer.hpp>
// ----------------------------------------------------------------------------- : Single card export
void
export_image
(
const
SetP
&
set
,
const
CardP
&
card
,
const
String
&
filename
)
{
Image
img
=
export_bitmap
(
set
,
card
).
ConvertToImage
();
img
.
SaveFile
(
filename
);
// can't use Bitmap::saveFile, it wants to know the file type
// but image.saveFile determines it automagicly
}
Bitmap
export_bitmap
(
const
SetP
&
set
,
const
CardP
&
card
)
{
// create viewer
DataViewer
viewer
;
viewer
.
setSet
(
set
);
viewer
.
setCard
(
card
);
// style to use
StyleSheetP
style
=
set
->
stylesheetFor
(
card
);
// size of cards
if
(
settings
.
stylesheetSettingsFor
(
*
style
).
card_normal_export
())
{
// TODO
// viewer.rotation.angle = 0;
// viewer.rotation.zoom = 1.0;
}
RealSize
size
=
viewer
.
getRotation
().
getExternalRect
().
size
();
// create bitmap & dc
Bitmap
bitmap
(
size
.
width
,
size
.
height
);
if
(
!
bitmap
.
Ok
())
throw
InternalError
(
_
(
"Unable to create bitmap"
));
wxMemoryDC
dc
;
dc
.
SelectObject
(
bitmap
);
// draw
viewer
.
draw
(
dc
);
dc
.
SelectObject
(
wxNullBitmap
);
return
bitmap
;
}
// ----------------------------------------------------------------------------- : Multiple card export
src/data/format/mtg_editor.cpp
View file @
0514e8dd
...
@@ -192,7 +192,12 @@ SetP MtgEditorFileFormat::importSet(const String& filename) {
...
@@ -192,7 +192,12 @@ SetP MtgEditorFileFormat::importSet(const String& filename) {
// Load stylesheet
// Load stylesheet
if
(
layout
!=
_
(
"8e"
))
{
if
(
layout
!=
_
(
"8e"
))
{
set
->
stylesheet
=
StyleSheet
::
byGameAndName
(
*
set
->
game
,
_
(
"old"
));
try
{
set
->
stylesheet
=
StyleSheet
::
byGameAndName
(
*
set
->
game
,
_
(
"old"
));
}
catch
(
const
Error
&
)
{
// If old style doesn't work try the new one
set
->
stylesheet
=
StyleSheet
::
byGameAndName
(
*
set
->
game
,
_
(
"new"
));
}
}
else
{
}
else
{
set
->
stylesheet
=
StyleSheet
::
byGameAndName
(
*
set
->
game
,
_
(
"new"
));
set
->
stylesheet
=
StyleSheet
::
byGameAndName
(
*
set
->
game
,
_
(
"new"
));
}
}
...
...
src/mse.vcproj
View file @
0514e8dd
...
@@ -1503,6 +1503,45 @@
...
@@ -1503,6 +1503,45 @@
<File
<File
RelativePath=
".\data\format\html.cpp"
>
RelativePath=
".\data\format\html.cpp"
>
</File>
</File>
<File
RelativePath=
".\data\format\image.cpp"
>
<FileConfiguration
Name=
"Debug|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
ObjectFile=
"$(IntDir)/$(InputName)4.obj"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Release|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
ObjectFile=
"$(IntDir)/$(InputName)4.obj"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Debug Unicode|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
ObjectFile=
"$(IntDir)/$(InputName)4.obj"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Release Unicode|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
ObjectFile=
"$(IntDir)/$(InputName)4.obj"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Release Profile Unicode|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
ObjectFile=
"$(IntDir)/$(InputName)4.obj"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Release Unicode fast build|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
ObjectFile=
"$(IntDir)/$(InputName)4.obj"
/>
</FileConfiguration>
</File>
<File
<File
RelativePath=
".\data\format\mse1.cpp"
>
RelativePath=
".\data\format\mse1.cpp"
>
</File>
</File>
...
...
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