void dosman::Entry::run() { std::string dosbox("dosbox "); std::string conf(" -conf "); std::string cpath(getConfPath()); std::string rpath(getRunConfPath()); std::string line = dosbox + conf + cpath + conf + rpath; system(line.c_str()); }
void* cnoload(const char* x) { string s = cpath(x); #ifdef _WIN32 void *r = GetModuleHandleA((mU_Home() + "/bin/" + s).c_str()); return r ? r : GetModuleHandleA(s.c_str()); #else void *r = dlopen((mU_Home() + "/lib/" + s).c_str(), RTLD_LAZY | RTLD_NOLOAD); return r ? r : dlopen(s.c_str(), RTLD_LAZY | RTLD_NOLOAD); #endif }
void* cload(const char* x) { string s = cpath(x); #ifdef _WIN32 void *r = LoadLibraryA((mU_Home() + "/bin/" + s).c_str()); return r ? r : LoadLibraryA(s.c_str()); #else void * r = dlopen((mU_Home() + "/lib/" + s).c_str(), RTLD_LAZY); return r ? r : dlopen(s.c_str(), RTLD_LAZY); #endif }
Imath::Box2f scene_renderer_t::calc_bbox( const shape_t& s, int subsample) { Imath::Box2f box; agg::path_storage path; convert_to_path( s, path, Imath::V2i( 0, 0), subsample); agg::conv_curve<agg::path_storage> cpath( path); agg::bounding_rect_single( cpath, 0, &(box.min.x), &(box.min.y), &(box.max.x), &(box.max.y)); return box; }
cupdatenetlib::cupdatenetlib(void) : m_hD3DX9Dll(NULL) { resetCounter(); CString path; GetModuleFileName(NULL, path.GetBuffer(MAX_PATH), MAX_PATH); path.ReleaseBuffer(); CPath cpath(path); cpath.RemoveFileSpec(); cpath.AddBackslash(); szBasePath = CString(cpath); cpath.Append(_T("UPD")); cpath.AddBackslash(); szUpdfilesPath = CString(cpath); _wmkdir(szUpdfilesPath); }
void DecodeDlg::DecodePreviewDone(int rc) { bool clmode = ((CUud32App *) AfxGetApp())->GetCLMode(); if (SHOW_DEBUG) { deBox.Ready(); // OK to interact with debug box decoder->UD.SetLastMessage(""); // Messages already retrieved } if (rc == CUud32acxCtrl::uudRetCancel) // Cancel. { HourGlass(false); m_DecodeGo.SetLabel(IDS_PREVIEW); Info1(IDS_CANCEL); return; } else if (rc != CUud32acxCtrl::uudRetOK) { CString emsg(decoder->UD.GetLastMessage()); CString lfn; int row = m_DecodeList.GetFirstSel(); if (row >= 0) m_DecodeList.GetText(row, lfn); else lfn = "(Unknown?)"; if (ArgMessageBox("Load Encoded Files", MB_OKCANCEL | MB_ICONQUESTION, "Error loading file:\r\n%s\r\nCode: %d [%s]\r\nContinue?", (const char *) lfn, rc, (const char *) emsg) == IDOK) decoder->PostThreadMessage(ENG_LOAD, 0, 0); // Restart the engine with next file else { HourGlass(false); Info1(IDS_CANCEL); m_DecodeGo.SetLabel(IDS_PREVIEW); } return; } Info1("Done loading."); CString lfn(decoder->UD.GetLastMessage()); Info2(lfn); // Messages already routed m_DecodeList.SetSel(-1, FALSE); // Clear all selections m_DecodeList.SetCaretIndex(0, FALSE); // Scroll list back to top int row, rmax = decoder->UD.GetDFCount(); // Read maximum file count CString cpath(CurrentOutput()); if (rmax == 0) { Info1(IDS_NOTHING_DECODE); if (!clmode) { CString msg; msg.LoadString(IDS_NOFIND_DECODE); MessageBox(msg, "Decode", MB_ICONEXCLAMATION | MB_OK); } m_DecodeGo.SetLabel(IDS_PREVIEW); HourGlass(false); SetState(MS_PREVIEW); return; } m_DecodeOut.SetRedraw(FALSE); m_DecodeOut.SetItemCount(rmax + 1); // Maximum items to add... for (row=0; row < rmax; row++) if (!(decoder->UD.GetDFileFlags(row) & CUud32acxCtrl::uudFileNoData)) { lfn = decoder->UD.GetDFile(row); lfn = decoder->UD.FileFilter(lfn); if (!options[OPT_PCASE]) // Preserve case on output lfn.MakeLower(); m_DecodeOut.InsertItem(LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM, 0, lfn, 0, 0, DecIcon(row, cpath + lfn), row); } m_DecodeOut.SetRedraw(TRUE); HourGlass(false); if (m_DecodeOut.GetItemCount() == 0) { Info1(IDS_NOTHING_DECODE); CString msg; msg.LoadString(IDS_NOTHING_DECODE); m_DecodeGo.SetLabel(IDS_PREVIEW); if (!clmode) MessageBox(msg, "Decode", MB_ICONEXCLAMATION | MB_OK); SetState(MS_PREVIEW); return; } DupCheck(); SetState(MS_GO); if (options[OPT_DNOPROMPT]) // Decode without prompting { CWnd *go = GetDlgItem(IDC_DECODEGO); ASSERT(go != NULL); if (!clmode && go != NULL) // Not command line mode PostMessage(WM_COMMAND, IDC_DECODEGO, (LPARAM) go->m_hWnd); } }
void scene_renderer_t::render_and_filter_shape( const shape_t& s, int bbox_index) { RAMEN_ASSERT( bbox_index >= 0 && bbox_index <= filtered_bboxes_.size()); boost::gil::fill_pixels( boost::gil::view( buf_), image::gray_pixel_t( 0)); boost::gil::fill_pixels( boost::gil::view( tmp_), image::gray_pixel_t( 0)); ren_base_type ren_base; agg::scanline_u8 sl; agg::rasterizer_scanline_aa<> ras; renderer_type ren; ren_base.set_view( boost::gil::view( buf_)); ren.attach( ren_base); ras.gamma( agg::gamma_none()); convert_to_path( s, path_, filtered_bboxes_[bbox_index].min, subsample_); agg::conv_curve<agg::path_storage> cpath( path_); ras.add_path( cpath); ras.filling_rule( agg::fill_non_zero); ren.color( color_type( 1.0f, 1.0f)); agg::render_scanlines( ras, sl, ren); image::gray_image_view_t buf_view( boost::gil::view( buf_)); float g = s.grow(); if( g != 0.0f) { /* image::gray_image_view_t subbuf_view( boost::gil::subimage_view( buf_view, bboxes_[bbox_index].min.x - filtered_bboxes_[bbox_index].min.x, bboxes_[bbox_index].min.y - filtered_bboxes_[bbox_index].min.y, bboxes_[bbox_index].size().x + 1, bboxes_[bbox_index].size().y + 1)); image::dilate( subbuf_view, boost::gil::view( tmp_), subbuf_view, g / aspect_ / subsample_, g / subsample_); */ boost::gil::fill_pixels( boost::gil::view( tmp_), image::gray_pixel_t( 0)); image::dilate( buf_view, boost::gil::view( tmp_), buf_view, g / aspect_ / subsample_, g / subsample_); } Imath::V2f blur = s.blur(); if( blur.x != 0.0f || blur.y != 0.0f) { boost::gil::fill_pixels( boost::gil::view( tmp_), image::gray_pixel_t( 0)); image::box_blur_gray( buf_view, boost::gil::view( tmp_), buf_view, blur.x / aspect_ / subsample_, blur.y / subsample_, 1); } Imath::Box2i common_area = ImathExt::intersect( area_, filtered_bboxes_[bbox_index]); if( !common_area.isEmpty()) { image::gray_image_view_t bg_view( boost::gil::subimage_view( boost::gil::view( pixels_), common_area.min.x - area_.min.x, common_area.min.y - area_.min.y, common_area.size().x, common_area.size().y)); boost::gil::tbb_transform2_pixels( boost::gil::subimage_view( buf_view, common_area.min.x - filtered_bboxes_[bbox_index].min.x, common_area.min.y - filtered_bboxes_[bbox_index].min.y, common_area.size().x, common_area.size().y), bg_view, bg_view, composite_layer( s.color(), s.opacity())); } }