// Merge in a file by name boolean W_MergeFile(char *filename) { int old_numlumps; old_numlumps = numlumps; // Load PWAD if (W_AddFile(filename) == NULL) return false; // IWAD is at the start, PWAD was appended to the end iwad.lumps = lumpinfo; iwad.numlumps = old_numlumps; pwad.lumps = lumpinfo + old_numlumps; pwad.numlumps = numlumps - old_numlumps; // Setup sprite/flat lists SetupLists(); // Generate list of sprites to be replaced by the PWAD GenerateSpriteList(); // Perform the merge DoMerge(); return true; }
void cAppli_MPI2Mnt::DoAll() { if (mDoMnt ) DoMTD(); mParamTarget = StdGetFromSI(mTargetGeom,XML_ParamNuage3DMaille); if (mDoMnt ) DoBascule(); if (mDoMnt ) DoMerge(); //============== Generation d'un Ori cXML_ParamNuage3DMaille aN = StdGetFromSI(mDirApp+mDirBasc +mNameMerge,XML_ParamNuage3DMaille); cFileOriMnt aFOM = ToFOM(aN,true); MakeFileXML(aFOM,mDirApp+mDirBasc +mNameOriMasq); double aSR = aN.SsResolRef().Val(); int aISR = round_ni(aSR); ELISE_ASSERT(ElAbs(aSR-aISR)<1e-7,"cAppli_MPI2Mnt::DoAll => ToFOM"); aFOM.NombrePixels() = aFOM.NombrePixels()* aISR; aFOM.ResolutionPlani() = aFOM.ResolutionPlani() / aISR; aFOM.ResolutionAlti() = aFOM.ResolutionAlti() / aISR; MakeFileXML(aFOM,mDirApp+mDirBasc +mNameOriMerge); //============== Generation d'un Ori if (mDoOrtho) DoOrtho(); }
void GSDevice::Merge(GSTexture* sTex[2], GSVector4* sRect, GSVector4* dRect, const GSVector2i& fs, bool slbg, bool mmod, const GSVector4& c) { if(m_merge == NULL || m_merge->GetSize() != fs) { Recycle(m_merge); m_merge = CreateRenderTarget(fs.x, fs.y, false); } // TODO: m_1x1 // KH:COM crashes at startup when booting *through the bios* due to m_merge being NULL. // (texture appears to be non-null, and is being re-created at a size around like 1700x340, // dunno if that's relevant) -- air if(m_merge) { GSTexture* tex[2] = {NULL, NULL}; for(size_t i = 0; i < countof(tex); i++) { if(sTex[i] != NULL) { tex[i] = sTex[i]->IsMSAA() ? Resolve(sTex[i]) : sTex[i]; } } DoMerge(tex, sRect, m_merge, dRect, slbg, mmod, c); for(size_t i = 0; i < countof(tex); i++) { if(tex[i] != sTex[i]) { Recycle(tex[i]); } } } else { printf("GSdx: m_merge is NULL!\n"); } m_current = m_merge; }
void MergeSort( int *pIn, int idxBegin, int idxEnd ) { if( ( idxEnd - idxBegin ) < 2 ) { if( pIn[idxEnd] < pIn[idxBegin] ) { swap( pIn[idxEnd], pIn[idxBegin] ); } } else { MergeSort( pIn, idxBegin, (idxBegin + idxEnd)/2); MergeSort( pIn, (idxBegin + idxEnd)/2 + 1, idxEnd); //Merge the sorted arrays DoMerge( pIn, idxBegin, (idxBegin + idxEnd)/2, idxEnd ); } }