void RouteMapOverlay::RenderIsoRoute(IsoRoute *r, wxColour &grib_color, wxColour &climatology_color, wrDC &dc, PlugIn_ViewPort &vp) { SkipPosition *s = r->skippoints; if(!s) return; wxColour grib_deficient_color = TransparentColor(grib_color); wxColour climatology_deficient_color = TransparentColor(climatology_color); Position *p = s->point; wxColour *pcolor = &PositionColor(p, grib_color, climatology_color, grib_deficient_color, climatology_deficient_color); if(!dc.GetDC()) glBegin(GL_LINES); do { wxColour &ncolor = PositionColor(p->next, grib_color, climatology_color, grib_deficient_color, climatology_deficient_color); if(!p->copied || !p->next->copied) DrawLine(p, *pcolor, p->next, ncolor, dc, vp); pcolor = &ncolor; p = p->next; } while(p != s->point); if(!dc.GetDC()) glEnd(); /* now render any children */ wxColour cyan(0, 255, 255), magenta(255, 0, 255); for(IsoRouteList::iterator it = r->children.begin(); it != r->children.end(); ++it) RenderIsoRoute(*it, cyan, magenta, dc, vp); }
void RouteMapOverlay::RenderAlternateRoute(IsoRoute *r, bool each_parent, wrDC &dc, PlugIn_ViewPort &vp) { Position *pos = r->skippoints->point; wxColor black = wxColour(0, 0, 0, 192), tblack = TransparentColor(black); do { wxColour *color = pos->data_mask & Position::DATA_DEFICIENT_WIND ? &tblack : &black; for(Position *p = pos; p && !p->drawn && p->parent; p = p->parent) { // wxColour &color = p->data_mask & Position::DATA_DEFICIENT_WIND ? tblack : black; wxColour &pcolor = p->parent->data_mask & Position::DATA_DEFICIENT_WIND ? tblack : black; if(!p->copied || each_parent) DrawLine(p, *color, p->parent, pcolor, dc, vp); p->drawn = true; if(!each_parent) break; color = &pcolor; } pos = pos->next; } while(pos != r->skippoints->point); wxColour blue(0, 0, 255); SetColor(dc, blue); for(IsoRouteList::iterator cit = r->children.begin(); cit != r->children.end(); cit++) RenderAlternateRoute(*cit, each_parent, dc, vp); }
void Image::replace(const std::string & path) { Image * other = get_image_cache(path, 0, 0, 0, 0, TransparentColor()); other->upload_texture(); if (other->width != width || other->height != height) { std::cout << "Dimensions do not match: " << path << std::endl; width = other->width; height = other->height; } unload(); tex = other->tex; #ifndef CHOWDREN_IS_WIIU alpha = other->alpha; #endif }
void Chowdren::LoadTexture( Gwen::Texture* pTexture ) { pTexture->failed = true; return; if (pTexture->data) FreeTexture(pTexture); pTexture->data = (void*)new FileImage(pTexture->name.c_str(), 0, 0, 0, 0, TransparentColor()); if (((FileImage*)pTexture->data)->tex == 0) { pTexture->failed = true; FreeTexture(pTexture); } }
void CharacterImageObject::load(int alias, const std::string & c, const std::string & path, int x_hotspot, int y_hotspot) { Image * new_image = get_image_cache(convert_path(path), 0, 0, 0, 0, TransparentColor()); if (new_image == NULL) { std::cout << "Could not load image " << path << std::endl; return; } new_image->hotspot_x = get_load_point(x_hotspot, new_image->width); new_image->hotspot_y = get_load_point(y_hotspot, new_image->height); CharacterImageAlias & a = aliases[alias]; unsigned char cc = (unsigned char)c[0]; a.charmap[cc].image = new_image; }