Added 'position hint' to packages, used to specify the order of the packages in a package list;

Added 'pack type', intended for playtesting (random boosters/starters);
Added 'default(_image)' property to ImageStyle, and added the frame fillers for magic;
Added blurring and bold printing (rather hacky) to the text rendering functions (used for "double click to add image" text);
Added 'symmetric overlay' combine mode, which will look really nice for hybrids;
Moved the watermark choices from the game to an include file in magic-watermarks;
Working on a replacement for the image scripting system that plays nicer with the rest of the code. In particular, it will be possible to compare generated images quickly, so they can be updated continuously. This is a work in progress, currently there are two versions of everything.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@327 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-05-09 21:41:15 +00:00
parent 6f7db851a7
commit 3c4729aaa2
63 changed files with 964 additions and 134 deletions
+2
View File
@@ -37,6 +37,8 @@ class Age {
/// Compare two ages, smaller means earlier
inline bool operator < (Age a) const { return age < a.age; }
/// Compare two ages
inline bool operator == (Age a) const { return age == a.age; }
/// A number corresponding to the age
inline AtomicIntEquiv get() const { return age; }
+3 -1
View File
@@ -412,12 +412,14 @@ IMPLEMENT_REFLECTION(Packaged) {
REFLECT(short_name);
REFLECT(full_name);
REFLECT_N("icon", icon_filename);
REFLECT(position_hint);
REFLECT(version);
REFLECT_N("depends ons", dependencies); // hack for singular_form
}
Packaged::Packaged()
: fully_loaded(true)
: position_hint(100000)
, fully_loaded(true)
{}
InputStreamP Packaged::openIconFile() {
+1
View File
@@ -198,6 +198,7 @@ class Packaged : public Package {
String full_name; ///< Name of this package, for menus etc.
String icon_filename; ///< Filename of icon to use in package lists
vector<PackageDependencyP> dependencies; ///< Dependencies of this package
int position_hint; ///< A hint for the package list
/// Get an input stream for the package icon, if there is any
InputStreamP openIconFile();
+1 -1
View File
@@ -122,7 +122,7 @@ void Reader::readLine(bool in_string) {
return;
}
key = line.substr(indent, pos - indent);
if (!in_string && starts_with(key, _(" "))) {
if (!ignore_invalid && !in_string && starts_with(key, _(" "))) {
warning(_("key: '") + key + _("' starts with a space; only use TABs for indentation!"));
// try to fix up: 8 spaces is a tab
while (starts_with(key, _(" "))) {
+2 -2
View File
@@ -124,12 +124,12 @@ RotatedDC::RotatedDC(DC& dc, const Rotation& rotation, RenderQuality quality)
// ----------------------------------------------------------------------------- : RotatedDC : Drawing
void RotatedDC::DrawText (const String& text, const RealPoint& pos) {
void RotatedDC::DrawText (const String& text, const RealPoint& pos, int blur_radius, int boldness) {
if (text.empty()) return;
if (quality == QUALITY_AA) {
RealRect r(pos, GetTextExtent(text));
RealRect r_ext = trNoNeg(r);
draw_resampled_text(dc, r_ext, revX(), revY(), angle, text);
draw_resampled_text(dc, r_ext, revX(), revY(), angle, text, blur_radius, boldness);
} else if (quality == QUALITY_SUB_PIXEL) {
RealPoint p_ext = tr(pos)*text_scaling;
double usx,usy;
+1 -1
View File
@@ -138,7 +138,7 @@ class RotatedDC : public Rotation {
// --------------------------------------------------- : Drawing
void DrawText (const String& text, const RealPoint& pos);
void DrawText (const String& text, const RealPoint& pos, int blur_radius = 0, int boldness = 1);
/// Draw abitmap, it must already be zoomed!
void DrawBitmap(const Bitmap& bitmap, const RealPoint& pos);
/// Draw an image using the given combining mode, the image must already be zoomed!
+41
View File
@@ -111,6 +111,41 @@ inline shared_ptr<T> new_shared9(const A0& a0, const A1& a1, const A2& a2, const
inline intrusive_ptr<T> new_intrusive2(const A0& a0, const A1& a1) {
return intrusive_ptr<T>(new T(a0, a1));
}
/// Allocate a new intrusive-pointed object, given three arguments to pass to the ctor of T
template <typename T, typename A0, typename A1, typename A2>
inline intrusive_ptr<T> new_intrusive3(const A0& a0, const A1& a1, const A2& a2) {
return intrusive_ptr<T>(new T(a0, a1, a2));
}
/// Allocate a new intrusive-pointed object, given four arguments to pass to the ctor of T
template <typename T, typename A0, typename A1, typename A2, typename A3>
inline intrusive_ptr<T> new_intrusive4(const A0& a0, const A1& a1, const A2& a2, const A3& a3) {
return intrusive_ptr<T>(new T(a0, a1, a2, a3));
}
/// Allocate a new intrusive-pointed object, given five arguments to pass to the ctor of T
template <typename T, typename A0, typename A1, typename A2, typename A3, typename A4>
inline intrusive_ptr<T> new_intrusive5(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4) {
return intrusive_ptr<T>(new T(a0, a1, a2, a3, a4));
}
/// Allocate a new intrusive-pointed object, given six arguments to pass to the ctor of T
template <typename T, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5>
inline intrusive_ptr<T> new_intrusive6(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) {
return intrusive_ptr<T>(new T(a0, a1, a2, a3, a4, a5));
}
/// Allocate a new intrusive-pointed object, given seven arguments to pass to the ctor of T
template <typename T, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
inline intrusive_ptr<T> new_intrusive7(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) {
return intrusive_ptr<T>(new T(a0, a1, a2, a3, a4, a5, a6));
}
/// Allocate a new intrusive-pointed object, given eight arguments to pass to the ctor of T
template <typename T, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
inline intrusive_ptr<T> new_intrusive8(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) {
return intrusive_ptr<T>(new T(a0, a1, a2, a3, a4, a5, a6, a7));
}
/// Allocate a new intrusive-pointed object, given nine arguments to pass to the ctor of T
template <typename T, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
inline intrusive_ptr<T> new_intrusive9(const A0& a0, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) {
return intrusive_ptr<T>(new T(a0, a1, a2, a3, a4, a5, a6, a7, a8));
}
/// Base class for objects wishing to use intrusive_ptrs
class IntrusivePtrBase {
@@ -144,6 +179,12 @@ inline shared_ptr<T> new_shared9(const A0& a0, const A1& a1, const A2& a2, const
#define new_intrusive1 new_shared1
#define new_intrusive2 new_shared2
#define new_intrusive3 new_shared3
#define new_intrusive4 new_shared4
#define new_intrusive5 new_shared5
#define new_intrusive6 new_shared6
#define new_intrusive7 new_shared7
#define new_intrusive8 new_shared8
#define new_intrusive9 new_shared9
class IntrusivePtrBase {
public: