Choice rendering now uses "style.image()" instead of "style.choice_images[value]";

Added script functions for working with multiple choice values;
Added in_context support for filter_rule;
Optimized toUpper/toLower because they are slow on windows (they use thread local storage and mutexes)

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@427 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-06-17 13:13:56 +00:00
parent 59d0aee4e7
commit 97e0e8d6d6
16 changed files with 325 additions and 49 deletions
+9 -3
View File
@@ -19,9 +19,15 @@ void ChoiceValueViewer::draw(RotatedDC& dc) {
double margin = 0;
if (style().render_style & RENDER_IMAGE) {
// draw image
map<String,ScriptableImage>::iterator it = style().choice_images.find(cannocial_name_form(value().value()));
if (it != style().choice_images.end() && it->second.isReady()) {
ScriptableImage& img = it->second;
// map<String,ScriptableImage>::iterator it = style().choice_images.find(cannocial_name_form(value().value()));
// if (it != style().choice_images.end() && it->second.isReady()) {
// ScriptableImage& img = it->second;
style().initImage();
ScriptableImage& img = style().image;
Context& ctx = viewer.getContext();
ctx.setVariable(_("input"), to_script(value().value()));
img.update(ctx);
if (img.isReady()) {
GeneratedImage::Options img_options(0,0, viewer.stylesheet.get(), &getSet());
if (nativeLook()) {
img_options.width = img_options.height = 16;