|
|
|
@ -153,7 +153,7 @@ void drawVertexColorBox (float x0, float y0, float x1, float y1, CRGBA color, fl
|
|
|
|
|
{
|
|
|
|
|
// Draw a white frame behind
|
|
|
|
|
CDRU::drawQuad (x0, y0, x1, y1, driver, CRGBA (0x40, 0x40, 0x40), CViewport());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Compute the colors with alpha to show the hardness
|
|
|
|
|
CRGBA fullFull=color;
|
|
|
|
|
CRGBA full=color;
|
|
|
|
@ -222,9 +222,9 @@ void drawInterface (TModeMouse select, TModePaint mode, PaintPatchMod *pobj, IDr
|
|
|
|
|
CDRU::drawBitmap ( (float)(t%MOD_WIDTH)/(float)MOD_WIDTH, (float)(t/MOD_WIDTH)/(float)MOD_HEIGHT, 1.f/(float)MOD_WIDTH,
|
|
|
|
|
1.f/(float)MOD_HEIGHT, *texture, driver, CViewport(), false);
|
|
|
|
|
else
|
|
|
|
|
CDRU::drawQuad ( (float)(t%MOD_WIDTH)/(float)MOD_WIDTH, (float)(t/MOD_WIDTH)/(float)MOD_HEIGHT,
|
|
|
|
|
CDRU::drawQuad ( (float)(t%MOD_WIDTH)/(float)MOD_WIDTH, (float)(t/MOD_WIDTH)/(float)MOD_HEIGHT,
|
|
|
|
|
(float)(t%MOD_WIDTH)/(float)MOD_WIDTH+1.f/(float)MOD_WIDTH,
|
|
|
|
|
(float)(t/MOD_WIDTH)/(float)MOD_HEIGHT+1.f/(float)MOD_HEIGHT, driver,
|
|
|
|
|
(float)(t/MOD_WIDTH)/(float)MOD_HEIGHT+1.f/(float)MOD_HEIGHT, driver,
|
|
|
|
|
CRGBA (128, 128, 128), CViewport());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -394,7 +394,7 @@ void drawInterface (TModeMouse select, TModePaint mode, PaintPatchMod *pobj, IDr
|
|
|
|
|
if ((pobj->CurrentTileSet!=-1)&&(mode==ModeTile))
|
|
|
|
|
{
|
|
|
|
|
// *** Draw the current group
|
|
|
|
|
ITexture* group[NL3D_CTILE_NUM_GROUP+1]={bankCont->allBitmap, bankCont->_0Bitmap, bankCont->_1Bitmap, bankCont->_2Bitmap, bankCont->_3Bitmap,
|
|
|
|
|
ITexture* group[NL3D_CTILE_NUM_GROUP+1]={bankCont->allBitmap, bankCont->_0Bitmap, bankCont->_1Bitmap, bankCont->_2Bitmap, bankCont->_3Bitmap,
|
|
|
|
|
bankCont->_4Bitmap, bankCont->_5Bitmap, bankCont->_6Bitmap, bankCont->_7Bitmap, bankCont->_8Bitmap, bankCont->_9Bitmap,
|
|
|
|
|
bankCont->_10Bitmap, bankCont->_11Bitmap};
|
|
|
|
|
|
|
|
|
@ -450,7 +450,7 @@ void makeVectMesh (std::vector<EPM_Mesh>& vectMesh, INodeTab& nodes, ModContextL
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < mcList.Count (); i++)
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
PaintPatchData *patchData = (PaintPatchData*)mcList[i]->localData;
|
|
|
|
|
if (!patchData)
|
|
|
|
|
continue;
|
|
|
|
@ -496,7 +496,7 @@ void transformDesc (tileDesc &desc, bool symmetry, uint rotate, uint mesh, uint
|
|
|
|
|
CTileBank::TTileType type;
|
|
|
|
|
bank.getTileXRef (tile, tileSet, number, type);
|
|
|
|
|
|
|
|
|
|
// Transform the transfo
|
|
|
|
|
// Transform the transfo
|
|
|
|
|
CPatchInfo::getTileSymmetryRotate (bank, desc.getLayer(0).Tile, tileSymmetry, tileRotate);
|
|
|
|
|
|
|
|
|
|
// Get the state of the layer 0
|
|
|
|
@ -579,7 +579,7 @@ void transformInvDesc (tileDesc &desc, bool symmetry, uint rotate, uint mesh, ui
|
|
|
|
|
transformDesc (desc, symmetry, 0, mesh, tile, vectMesh);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EPM_PaintMouseProc::SetTile (int mesh, int tile, const tileDesc& desc, std::vector<EPM_Mesh>& vectMesh, CLandscape* land,
|
|
|
|
|
void EPM_PaintMouseProc::SetTile (int mesh, int tile, const tileDesc& desc, std::vector<EPM_Mesh>& vectMesh, CLandscape* land,
|
|
|
|
|
CNelPatchChanger& nelPatchChg, std::vector<CBackupValue>* backupStack, bool undo, bool updateDisplace)
|
|
|
|
|
{
|
|
|
|
|
// Undo: get old value
|
|
|
|
@ -600,7 +600,7 @@ void EPM_PaintMouseProc::SetTile (int mesh, int tile, const tileDesc& desc, std:
|
|
|
|
|
maxDesc.setDisplace (oldDesc.getDisplace());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Transform tile
|
|
|
|
|
// Transform tile
|
|
|
|
|
tileDesc copyDesc=maxDesc;
|
|
|
|
|
transformInvDesc (maxDesc, vectMesh[mesh].Symmetry, 4-vectMesh[mesh].Rotate, mesh, tile, vectMesh);
|
|
|
|
|
transformInvDesc (copyDesc, vectMesh[mesh].Symmetry, 0, mesh, tile, vectMesh);
|
|
|
|
@ -805,7 +805,7 @@ bool EPM_PaintMouseProc::isLocked256 (PaintPatchMod *pobj, EPM_PaintTile* pTile)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool EPM_PaintMouseProc::ClearATile ( EPM_PaintTile* pTile, std::vector<EPM_Mesh>& vectMesh,
|
|
|
|
|
bool EPM_PaintMouseProc::ClearATile ( EPM_PaintTile* pTile, std::vector<EPM_Mesh>& vectMesh,
|
|
|
|
|
CLandscape* land, CNelPatchChanger& nelPatchChg, bool _256, bool _force128)
|
|
|
|
|
{
|
|
|
|
|
// ** 1) Backup of the tile
|
|
|
|
@ -864,7 +864,7 @@ bool EPM_PaintMouseProc::ClearATile ( EPM_PaintTile* pTile, std::vector<EPM_Mesh
|
|
|
|
|
// Check locked
|
|
|
|
|
if (isLocked (pobj, pTile))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Cleared descriptor
|
|
|
|
|
tileDesc desc;
|
|
|
|
|
desc.setTile (0, 0, 0, tileIndex (0,0), tileIndex (0,0), tileIndex (0,0));
|
|
|
|
@ -882,8 +882,8 @@ bool EPM_PaintMouseProc::ClearATile ( EPM_PaintTile* pTile, std::vector<EPM_Mesh
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRotation, const CTileBank& bank,
|
|
|
|
|
bool selectCycle, std::set<EPM_PaintTile*>& visited, std::vector<EPM_Mesh>& vectMesh,
|
|
|
|
|
bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRotation, const CTileBank& bank,
|
|
|
|
|
bool selectCycle, std::set<EPM_PaintTile*>& visited, std::vector<EPM_Mesh>& vectMesh,
|
|
|
|
|
CLandscape* land, CNelPatchChanger& nelPatchChg, bool _256)
|
|
|
|
|
{
|
|
|
|
|
// If tile 256, must have delta pos aligned on 2x2
|
|
|
|
@ -912,7 +912,7 @@ bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRo
|
|
|
|
|
int patch=pTile->tile/NUM_TILE_SEL;
|
|
|
|
|
|
|
|
|
|
// Check if we are in patch subobject and if this patch is selected
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((vectMesh[pTile->Mesh].PMesh->selLevel==EP_PATCH)&&(!vectMesh[pTile->Mesh].PMesh->patchSel[patch]))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
@ -986,7 +986,7 @@ bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRo
|
|
|
|
|
desc.setTile (1, 1+((-curRotation-1)&3), 0, tileIndex (nTile, (curRotation-nRot)&3), tileIndex (0,0), tileIndex (0,0));
|
|
|
|
|
nlassert (other);
|
|
|
|
|
SetTile (other->Mesh, other->tile, desc, vectMesh, land, nelPatchChg, &backupStack);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add to visited tile set
|
|
|
|
|
visited.insert (other);
|
|
|
|
|
|
|
|
|
@ -995,7 +995,7 @@ bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRo
|
|
|
|
|
desc.setTile (1, 1+((-curRotation+1)&3), 0, tileIndex (nTile, (curRotation-nRot)&3), tileIndex (0,0), tileIndex (0,0));
|
|
|
|
|
nlassert (other);
|
|
|
|
|
SetTile (other->Mesh, other->tile, desc, vectMesh, land, nelPatchChg, &backupStack);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add to visited tile set
|
|
|
|
|
visited.insert (other);
|
|
|
|
|
|
|
|
|
@ -1005,7 +1005,7 @@ bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRo
|
|
|
|
|
nlassert (other);
|
|
|
|
|
nlassert (other==pTile->getBottomRight256 (0, nRot));
|
|
|
|
|
SetTile (other->Mesh, other->tile, desc, vectMesh, land, nelPatchChg, &backupStack);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add to visited tile set
|
|
|
|
|
visited.insert (other);
|
|
|
|
|
}
|
|
|
|
@ -1037,14 +1037,14 @@ bool EPM_PaintMouseProc::PutATile ( EPM_PaintTile* pTile, int tileSet, int curRo
|
|
|
|
|
case 0:
|
|
|
|
|
// Main
|
|
|
|
|
if (pTile->voisins[3])
|
|
|
|
|
if (!PropagateBorder (pTile->voisins[3], (pTile->rotate[3]+curRotation)&3, tileSet, visited, bank,
|
|
|
|
|
if (!PropagateBorder (pTile->voisins[3], (pTile->rotate[3]+curRotation)&3, tileSet, visited, bank,
|
|
|
|
|
vectMesh, land, nelPatchChg, backupStack))
|
|
|
|
|
{
|
|
|
|
|
bContinue=false;
|
|
|
|
|
goto zap;
|
|
|
|
|
}
|
|
|
|
|
if (pTile->voisins[0])
|
|
|
|
|
if (!PropagateBorder (pTile->voisins[0], (pTile->rotate[0]+curRotation)&3, tileSet, visited, bank,
|
|
|
|
|
if (!PropagateBorder (pTile->voisins[0], (pTile->rotate[0]+curRotation)&3, tileSet, visited, bank,
|
|
|
|
|
vectMesh, land, nelPatchChg, backupStack))
|
|
|
|
|
{
|
|
|
|
|
bContinue=false;
|
|
|
|
@ -1212,13 +1212,13 @@ zap:;
|
|
|
|
|
for (uint corner=0; corner<4; corner++)
|
|
|
|
|
{
|
|
|
|
|
finalCorner[corner].TileSet = -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// All the same or empty ?
|
|
|
|
|
for (uint layer=0; layer<4; layer++)
|
|
|
|
|
{
|
|
|
|
|
// Compatible ?
|
|
|
|
|
if ( ( finalCorner[corner].TileSet == -1 )
|
|
|
|
|
|| ( tileSetCases[layer][corner].TileSet == -1 )
|
|
|
|
|
if ( ( finalCorner[corner].TileSet == -1 )
|
|
|
|
|
|| ( tileSetCases[layer][corner].TileSet == -1 )
|
|
|
|
|
|| ( tileSetCases[layer][corner] == finalCorner[corner] ) )
|
|
|
|
|
{
|
|
|
|
|
// Copy the tile
|
|
|
|
@ -1265,7 +1265,7 @@ zap:;
|
|
|
|
|
bFind=true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// no, ok push it back.
|
|
|
|
|
if (!bFind)
|
|
|
|
|
setIndex.push_back (finalCorner[v]);
|
|
|
|
@ -1369,7 +1369,7 @@ zap:;
|
|
|
|
|
finalIndex[l].Tile=tileTrans->getTile();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set the border desc
|
|
|
|
|
tileDesc desc;
|
|
|
|
|
GetTile (pTile->Mesh, pTile->tile, desc, vectMesh, land);
|
|
|
|
@ -1403,8 +1403,8 @@ zap:;
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
void EPM_PaintMouseProc::PutADisplacetile ( EPM_PaintTile* pTile, const CTileBank& bank,
|
|
|
|
|
std::vector<EPM_Mesh>& vectMesh,
|
|
|
|
|
void EPM_PaintMouseProc::PutADisplacetile ( EPM_PaintTile* pTile, const CTileBank& bank,
|
|
|
|
|
std::vector<EPM_Mesh>& vectMesh,
|
|
|
|
|
CLandscape* land, CNelPatchChanger& nelPatchChg)
|
|
|
|
|
{
|
|
|
|
|
// Get tile description
|
|
|
|
@ -1431,8 +1431,8 @@ void EPM_PaintMouseProc::PutADisplacetile ( EPM_PaintTile* pTile, const CTileBan
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
bool EPM_PaintMouseProc::GetBorderDesc (EPM_PaintTile* tile, tileSetIndex *pVoisinCorner, CTileSet::TFlagBorder pBorder[4][3],
|
|
|
|
|
tileDesc *pVoisinIndex, const CTileBank& bank, std::vector<EPM_Mesh>& vectMesh,
|
|
|
|
|
bool EPM_PaintMouseProc::GetBorderDesc (EPM_PaintTile* tile, tileSetIndex *pVoisinCorner, CTileSet::TFlagBorder pBorder[4][3],
|
|
|
|
|
tileDesc *pVoisinIndex, const CTileBank& bank, std::vector<EPM_Mesh>& vectMesh,
|
|
|
|
|
CNelPatchChanger& nelPatchChg, CLandscape *land)
|
|
|
|
|
{
|
|
|
|
|
// Tile info
|
|
|
|
@ -1445,7 +1445,7 @@ bool EPM_PaintMouseProc::GetBorderDesc (EPM_PaintTile* tile, tileSetIndex *pVois
|
|
|
|
|
tileIndex pIndexx[3];
|
|
|
|
|
for (int nL=0; nL<nLayer; nL++)
|
|
|
|
|
{
|
|
|
|
|
// GetTileIndex
|
|
|
|
|
// GetTileIndex
|
|
|
|
|
tileIndex index=backup.getLayer (nL);
|
|
|
|
|
pIndexx[nL]=index;
|
|
|
|
|
|
|
|
|
@ -1515,7 +1515,7 @@ const CTileSetTransition* EPM_PaintMouseProc::FindTransition (int nTileSet, int
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Look for good tile..
|
|
|
|
|
CTileSet::TTransition nTransition=CTileSet::getTransitionTile
|
|
|
|
|
CTileSet::TTransition nTransition=CTileSet::getTransitionTile
|
|
|
|
|
(pBorderConverted[3], pBorderConverted[1], pBorderConverted[0], pBorderConverted[2]);
|
|
|
|
|
//nlassert (nTransition!=CTileSet::notfound);
|
|
|
|
|
if (nTransition==CTileSet::notfound)
|
|
|
|
@ -1537,7 +1537,7 @@ int EPM_PaintMouseProc::getLayer (EPM_PaintTile* tile, int border, int tileSet,
|
|
|
|
|
tileIndex index=desc.getLayer(o);
|
|
|
|
|
index.Rotate-=tile->rotate[border];
|
|
|
|
|
index.Rotate&=3;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CTileBank::TTileType type;
|
|
|
|
|
int TileSet, number;
|
|
|
|
|
|
|
|
|
@ -1554,8 +1554,8 @@ int EPM_PaintMouseProc::getLayer (EPM_PaintTile* tile, int border, int tileSet,
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, int curTileSet, std::set<EPM_PaintTile*>& visited,
|
|
|
|
|
const CTileBank& bank, std::vector<EPM_Mesh>& vectMesh,
|
|
|
|
|
bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation, int curTileSet, std::set<EPM_PaintTile*>& visited,
|
|
|
|
|
const CTileBank& bank, std::vector<EPM_Mesh>& vectMesh,
|
|
|
|
|
CLandscape* land, CNelPatchChanger& nelPatchChg, std::vector<CBackupValue>& backupStack, bool recurseNoDiff)
|
|
|
|
|
{
|
|
|
|
|
// 1) Already visited
|
|
|
|
@ -1698,7 +1698,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
}
|
|
|
|
|
extraOrdinary[v]++;
|
|
|
|
|
bDiff=true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -1799,7 +1799,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
(desc1.isEmpty())||
|
|
|
|
|
(desc1.getCase()!=(1+((nCase+3)&3)))||
|
|
|
|
|
(desc1.getLayer(0).Tile!=backup.getLayer(0).Tile)||
|
|
|
|
|
(desc1.getLayer(0).Rotate!=((backup.getLayer(0).Rotate-rot)&3))
|
|
|
|
|
(desc1.getLayer(0).Rotate!=((backup.getLayer(0).Rotate-rot)&3))
|
|
|
|
|
)
|
|
|
|
|
bDiff=true;
|
|
|
|
|
}
|
|
|
|
@ -1868,7 +1868,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
bFind=true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// no, ok push it back.
|
|
|
|
|
if (!bFind)
|
|
|
|
|
setIndex.push_back (nCorner[v]);
|
|
|
|
@ -1877,7 +1877,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
std::sort (setIndex.begin(), setIndex.end());
|
|
|
|
|
|
|
|
|
|
// Check validity
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// A) Check for more than 3 materials
|
|
|
|
|
if (setIndex.size()>3)
|
|
|
|
|
return false;
|
|
|
|
@ -1981,18 +1981,18 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
// Last on the stack ?
|
|
|
|
|
if (*ite<nCorner[c])
|
|
|
|
|
{
|
|
|
|
|
// no,
|
|
|
|
|
// no,
|
|
|
|
|
wanted=CTileSet::_1000;
|
|
|
|
|
invWanted=CTileSet::_1110;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// yes,
|
|
|
|
|
// yes,
|
|
|
|
|
wanted=CTileSet::_1110;
|
|
|
|
|
invWanted=CTileSet::_1000;
|
|
|
|
|
}
|
|
|
|
|
border[c]=wanted;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If voisin already visited, force his transition to 3/4
|
|
|
|
|
if (tile->voisins[c])
|
|
|
|
|
{
|
|
|
|
@ -2034,7 +2034,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
// Set the tile..
|
|
|
|
|
SetTile (tile->voisins[c]->Mesh, tile->voisins[c]->tile, pVoisinIndex, vectMesh,
|
|
|
|
|
SetTile (tile->voisins[c]->Mesh, tile->voisins[c]->tile, pVoisinIndex, vectMesh,
|
|
|
|
|
land, nelPatchChg, &backupStack);
|
|
|
|
|
}
|
|
|
|
|
/*if (pBorder[edge][nLayer]==CTileSet::_0001)
|
|
|
|
@ -2045,11 +2045,11 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Normal,
|
|
|
|
|
// Normal,
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Voisin visited or frozen ?
|
|
|
|
|
if (tile->voisins[c]&&((visited.find (tile->voisins[c])!=visited.end()) /*||
|
|
|
|
|
if (tile->voisins[c]&&((visited.find (tile->voisins[c])!=visited.end()) /*||
|
|
|
|
|
(vectMesh[tile->voisins[c]->Mesh].Node->IsFrozen())*/ ))
|
|
|
|
|
{
|
|
|
|
|
// Yes, visited. Copy the border
|
|
|
|
@ -2057,7 +2057,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
CTileSet::TFlagBorder pBorder[4][3];
|
|
|
|
|
tileDesc pVoisinIndex;
|
|
|
|
|
bool bOk=GetBorderDesc (tile->voisins[c], pVoisinCorner, pBorder, &pVoisinIndex, bank, vectMesh, nelPatchChg, land);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Should not be empty
|
|
|
|
|
nlassert (bOk);
|
|
|
|
|
int edge=(2+c+tile->rotate[c])&3;
|
|
|
|
@ -2075,7 +2075,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// No, not yet visited
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Choose transition by random
|
|
|
|
|
bool bComputed=false;
|
|
|
|
|
if ((bVisited[c]||!recurseNoDiff)&&bSameEdge[c])
|
|
|
|
@ -2086,7 +2086,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
CTileSet::TFlagBorder pBorder[4][3];
|
|
|
|
|
tileDesc pVoisinIndex;
|
|
|
|
|
bool bOk=GetBorderDesc (tile->voisins[c], pVoisinCorner, pBorder, &pVoisinIndex, bank, vectMesh, nelPatchChg, land);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ok voisin is here ?
|
|
|
|
|
if (bOk)
|
|
|
|
|
{
|
|
|
|
@ -2140,18 +2140,18 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
// Last on the stack ?
|
|
|
|
|
if (*ite<nCorner[c])
|
|
|
|
|
{
|
|
|
|
|
// no,
|
|
|
|
|
// no,
|
|
|
|
|
wanted=CTileSet::_0001;
|
|
|
|
|
invWanted=CTileSet::_0111;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// yes,
|
|
|
|
|
// yes,
|
|
|
|
|
wanted=CTileSet::_0111;
|
|
|
|
|
invWanted=CTileSet::_0001;
|
|
|
|
|
}
|
|
|
|
|
border[c]=wanted;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If voisin already visited, force his transition to 3/4
|
|
|
|
|
if (tile->voisins[c])//&&visited.find (tile->voisins[c])!=visited.end())
|
|
|
|
|
{
|
|
|
|
@ -2193,7 +2193,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
// Set the tile..
|
|
|
|
|
SetTile (tile->voisins[c]->Mesh, tile->voisins[c]->tile, pVoisinIndex, vectMesh,
|
|
|
|
|
SetTile (tile->voisins[c]->Mesh, tile->voisins[c]->tile, pVoisinIndex, vectMesh,
|
|
|
|
|
land, nelPatchChg, &backupStack);
|
|
|
|
|
}
|
|
|
|
|
/*if (pBorder[edge][nLayer]==CTileSet::_1000)
|
|
|
|
@ -2205,7 +2205,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// Normal,
|
|
|
|
|
// Normal,
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Voisin visited ?
|
|
|
|
@ -2216,7 +2216,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
CTileSet::TFlagBorder pBorder[4][3];
|
|
|
|
|
tileDesc pVoisinIndex;
|
|
|
|
|
bool bOk=GetBorderDesc (tile->voisins[c], pVoisinCorner, pBorder, &pVoisinIndex, bank, vectMesh, nelPatchChg, land);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Should not be empty
|
|
|
|
|
nlassert (bOk);
|
|
|
|
|
int edge=(2+c+tile->rotate[c])&3;
|
|
|
|
@ -2235,7 +2235,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// No, not yet visited
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Choose transition by random
|
|
|
|
|
bool bComputed=false;
|
|
|
|
|
if ((bVisited[c]||!recurseNoDiff)&&bSameEdge[c])
|
|
|
|
@ -2246,7 +2246,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
CTileSet::TFlagBorder pBorder[4][3];
|
|
|
|
|
tileDesc pVoisinIndex;
|
|
|
|
|
bool bOk=GetBorderDesc (tile->voisins[c], pVoisinCorner, pBorder, &pVoisinIndex, bank, vectMesh, nelPatchChg, land);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ok voisin is here ?
|
|
|
|
|
if (bOk)
|
|
|
|
|
{
|
|
|
|
@ -2293,7 +2293,7 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
}
|
|
|
|
|
ite++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set the border desc
|
|
|
|
|
tileDesc desc;
|
|
|
|
|
GetTile (tile->Mesh, tile->tile, desc, vectMesh, land);
|
|
|
|
@ -2341,22 +2341,22 @@ bool EPM_PaintMouseProc::PropagateBorder (EPM_PaintTile* tile, int curRotation,
|
|
|
|
|
{
|
|
|
|
|
// Voisin not already visited and not frozen ?
|
|
|
|
|
if ((tile->voisins[v]) && (visited.find (tile->voisins[v])==visited.end()) /* && (vectMesh[tile->voisins[v]->Mesh].Node->IsFrozen()==0)*/)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
// ok.. not visited, border with modified corner ?
|
|
|
|
|
if (bModified[v]||bModified[(v+1)&3]||(!bSameEdge[v]))
|
|
|
|
|
if (!PropagateBorder (tile->voisins[v], (tile->rotate[v]+curRotation)&3, curTileSet, visited, bank, vectMesh, land, nelPatchChg,
|
|
|
|
|
if (!PropagateBorder (tile->voisins[v], (tile->rotate[v]+curRotation)&3, curTileSet, visited, bank, vectMesh, land, nelPatchChg,
|
|
|
|
|
backupStack, false))
|
|
|
|
|
{
|
|
|
|
|
bContinue=false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!bContinue)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2413,8 +2413,8 @@ uint8 EPM_PaintMouseProc::CalcRotPath (EPM_PaintTile* from, EPM_PaintTile* to, i
|
|
|
|
|
static TModePaint nModeTexture=ModeTile;
|
|
|
|
|
static TModeMouse modeSelect=ModePaint;
|
|
|
|
|
|
|
|
|
|
void EPM_PaintMouseProc::RecursTile (EPM_PaintTile* pTile, const CTileBank& bank, int tileSet, std::vector<EPM_Mesh>& vectMesh, CLandscape* land,
|
|
|
|
|
int recurs, std::set<EPM_PaintTile*>& alreadyRecursed, bool first, int rotation,
|
|
|
|
|
void EPM_PaintMouseProc::RecursTile (EPM_PaintTile* pTile, const CTileBank& bank, int tileSet, std::vector<EPM_Mesh>& vectMesh, CLandscape* land,
|
|
|
|
|
int recurs, std::set<EPM_PaintTile*>& alreadyRecursed, bool first, int rotation,
|
|
|
|
|
CNelPatchChanger& nelPatchChg, bool _256)
|
|
|
|
|
{
|
|
|
|
|
if (alreadyRecursed.find (pTile)==alreadyRecursed.end())
|
|
|
|
@ -2437,20 +2437,20 @@ void EPM_PaintMouseProc::RecursTile (EPM_PaintTile* pTile, const CTileBank& bank
|
|
|
|
|
if (_256)
|
|
|
|
|
{
|
|
|
|
|
if (pTile->get2Voisin(i))
|
|
|
|
|
RecursTile (pTile->get2Voisin(i), bank, tileSet, vectMesh, land, recurs-2, alreadyRecursed, false,
|
|
|
|
|
RecursTile (pTile->get2Voisin(i), bank, tileSet, vectMesh, land, recurs-2, alreadyRecursed, false,
|
|
|
|
|
(rotation+pTile->get2VoisinRotate(i))&3, nelPatchChg, true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (pTile->voisins[i])
|
|
|
|
|
RecursTile (pTile->voisins[i], bank, tileSet, vectMesh, land, recurs-1, alreadyRecursed, false, (rotation+pTile->rotate[i])&3,
|
|
|
|
|
RecursTile (pTile->voisins[i], bank, tileSet, vectMesh, land, recurs-1, alreadyRecursed, false, (rotation+pTile->rotate[i])&3,
|
|
|
|
|
nelPatchChg, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL EPM_PaintMouseProc::PutDisplace (int tile, int mesh, const CTileBank& bank, std::vector<EPM_Mesh>& vectMesh, CLandscape* land,
|
|
|
|
|
BOOL EPM_PaintMouseProc::PutDisplace (int tile, int mesh, const CTileBank& bank, std::vector<EPM_Mesh>& vectMesh, CLandscape* land,
|
|
|
|
|
int recurs, std::set<EPM_PaintTile*>& alreadyRecursed, CNelPatchChanger& nelPatchChg)
|
|
|
|
|
{
|
|
|
|
|
static sint32 MeshOld=-1;
|
|
|
|
@ -2460,7 +2460,7 @@ BOOL EPM_PaintMouseProc::PutDisplace (int tile, int mesh, const CTileBank& bank,
|
|
|
|
|
EPM_PaintTile* pTile=&metaTile[mesh][tile];
|
|
|
|
|
|
|
|
|
|
// Ok recurse tiles
|
|
|
|
|
RecursTile (pTile, bank, 0, vectMesh, land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, true,
|
|
|
|
|
RecursTile (pTile, bank, 0, vectMesh, land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, true,
|
|
|
|
|
EPM_PaintMouseProc::Rotation, nelPatchChg, false);
|
|
|
|
|
|
|
|
|
|
MeshOld=mesh;
|
|
|
|
@ -2469,7 +2469,7 @@ BOOL EPM_PaintMouseProc::PutDisplace (int tile, int mesh, const CTileBank& bank,
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL EPM_PaintMouseProc::PutTile (int tile, int mesh, bool first, const CTileBank& bank, int tileSet, std::vector<EPM_Mesh>& vectMesh, CLandscape* land,
|
|
|
|
|
BOOL EPM_PaintMouseProc::PutTile (int tile, int mesh, bool first, const CTileBank& bank, int tileSet, std::vector<EPM_Mesh>& vectMesh, CLandscape* land,
|
|
|
|
|
int recurs, std::set<EPM_PaintTile*>& alreadyRecursed, CNelPatchChanger& nelPatchChg, bool _256)
|
|
|
|
|
{
|
|
|
|
|
static sint32 MeshOld=-1;
|
|
|
|
@ -2523,7 +2523,7 @@ BOOL EPM_PaintMouseProc::PutTile (int tile, int mesh, bool first, const CTileBan
|
|
|
|
|
std::set<EPM_PaintTile*> alreadyRecursed;
|
|
|
|
|
|
|
|
|
|
// Ok recurse tiles
|
|
|
|
|
RecursTile (pTile, bank, tileSet, vectMesh, land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, first,
|
|
|
|
|
RecursTile (pTile, bank, tileSet, vectMesh, land, brushValue[PaintPatchMod::brushSize], alreadyRecursed, first,
|
|
|
|
|
EPM_PaintMouseProc::Rotation, nelPatchChg, _256);
|
|
|
|
|
}
|
|
|
|
|
MeshOld=mesh;
|
|
|
|
@ -2815,7 +2815,7 @@ void mainproc(CScene& scene, CEventListenerAsync& AsyncListener, CEvent3dMouseLi
|
|
|
|
|
if (AsyncListener.isKeyPushed ((TKey)PainterKeys[SelectColorBrush]))
|
|
|
|
|
{
|
|
|
|
|
// Create a dialog filter
|
|
|
|
|
static TCHAR szFilter[] =
|
|
|
|
|
static TCHAR szFilter[] =
|
|
|
|
|
_T("Targa Files (*.tga)\0*.tga\0")
|
|
|
|
|
_T("All Files (*.*)\0*.*\0\0");
|
|
|
|
|
|
|
|
|
@ -2837,7 +2837,7 @@ void mainproc(CScene& scene, CEventListenerAsync& AsyncListener, CEvent3dMouseLi
|
|
|
|
|
|
|
|
|
|
// Open the dialog
|
|
|
|
|
if (GetOpenFileName(&openFile))
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
// Load the file
|
|
|
|
|
paintColor.loadBrush (tStrToUtf8(buffer));
|
|
|
|
|
paintColor.setBrushMode (true);
|
|
|
|
@ -2991,7 +2991,7 @@ void mainproc(CScene& scene, CEventListenerAsync& AsyncListener, CEvent3dMouseLi
|
|
|
|
|
|
|
|
|
|
t0= t1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Draw interface
|
|
|
|
|
drawInterface (modeSelect, nModeTexture, pData->pobj, driver, landscape, paintColor);
|
|
|
|
|
|
|
|
|
@ -3016,7 +3016,7 @@ public:
|
|
|
|
|
bool WindowActive;
|
|
|
|
|
CPaintColor PaintColor;
|
|
|
|
|
public:
|
|
|
|
|
MouseListener (IObjParam *ip, CCamera *camera, CViewport *viewport, PaintPatchMod *pobj, EPM_PaintMouseProc *eproc, CLandscape* land,
|
|
|
|
|
MouseListener (IObjParam *ip, CCamera *camera, CViewport *viewport, PaintPatchMod *pobj, EPM_PaintMouseProc *eproc, CLandscape* land,
|
|
|
|
|
CEventListenerAsync* async, CEvent3dMouseListener* mouseList, std::vector<EPM_Mesh>& vectMesh, TimeValue t)
|
|
|
|
|
: PaintColor (pobj, land, &bankCont->Undo, eproc), _FillTile (pobj, land, &bankCont->Undo, eproc), _VectMesh(vectMesh)
|
|
|
|
|
{
|
|
|
|
@ -3063,7 +3063,7 @@ private:
|
|
|
|
|
if (pressed&&((mouse->Button&rightButton)&&((mouse->Button&(ctrlButton|shiftButton|altButton))==0)))
|
|
|
|
|
{
|
|
|
|
|
pressed=false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Undo step
|
|
|
|
|
bankCont->Undo.pushUndo ();
|
|
|
|
|
|
|
|
|
@ -3099,13 +3099,13 @@ private:
|
|
|
|
|
if (nModeTexture==ModeTile)
|
|
|
|
|
{
|
|
|
|
|
// Put the tile
|
|
|
|
|
_Eproc->PutTile (tile1, mesh1, true, bank, _Pobj->CurrentTileSet, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize],
|
|
|
|
|
_Eproc->PutTile (tile1, mesh1, true, bank, _Pobj->CurrentTileSet, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize],
|
|
|
|
|
alreadyRecursed, nelPatchChg, _Pobj->tileSize!=0);
|
|
|
|
|
}
|
|
|
|
|
else // (nModeTexture==ModeDisplace)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
// Put the tile
|
|
|
|
|
_Eproc->PutDisplace (tile1, mesh1, bank, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize],
|
|
|
|
|
_Eproc->PutDisplace (tile1, mesh1, bank, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize],
|
|
|
|
|
alreadyRecursed, nelPatchChg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3141,7 +3141,7 @@ private:
|
|
|
|
|
// Paint mode
|
|
|
|
|
if (nModeTexture==ModeTile)
|
|
|
|
|
// Fill this patch with the current tile
|
|
|
|
|
_FillTile.fillTile (mesh1, patch, _VectMesh, _Pobj->CurrentTileSet, _Pobj->TileFillRotation, _Pobj->TileGroup, _Pobj->tileSize!=0,
|
|
|
|
|
_FillTile.fillTile (mesh1, patch, _VectMesh, _Pobj->CurrentTileSet, _Pobj->TileFillRotation, _Pobj->TileGroup, _Pobj->tileSize!=0,
|
|
|
|
|
bank);
|
|
|
|
|
else if (nModeTexture==ModeColor)
|
|
|
|
|
// Fill this patch with the current color
|
|
|
|
@ -3188,7 +3188,7 @@ private:
|
|
|
|
|
{
|
|
|
|
|
pressed = false;
|
|
|
|
|
_Pobj->ShowCurrentState = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Undo step
|
|
|
|
|
bankCont->Undo.pushUndo ();
|
|
|
|
|
}
|
|
|
|
@ -3222,13 +3222,13 @@ private:
|
|
|
|
|
if (nModeTexture==ModeTile)
|
|
|
|
|
{
|
|
|
|
|
// Put the tile
|
|
|
|
|
_Eproc->PutTile (tile2, mesh2, false, bank, _Pobj->CurrentTileSet, _VectMesh, _Land,
|
|
|
|
|
_Eproc->PutTile (tile2, mesh2, false, bank, _Pobj->CurrentTileSet, _VectMesh, _Land,
|
|
|
|
|
brushValue[PaintPatchMod::brushSize], alreadyRecursed, nelPatchChg, _Pobj->tileSize!=0);
|
|
|
|
|
}
|
|
|
|
|
else // (nModeTexture==ModeDisplace)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
// Put the tile
|
|
|
|
|
_Eproc->PutDisplace (tile2, mesh2, bank, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize],
|
|
|
|
|
_Eproc->PutDisplace (tile2, mesh2, bank, _VectMesh, _Land, brushValue[PaintPatchMod::brushSize],
|
|
|
|
|
alreadyRecursed, nelPatchChg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3299,7 +3299,7 @@ private:
|
|
|
|
|
_Pobj->CurrentTileSet=tileSetSelector.getTileSet (tile-1);
|
|
|
|
|
_Pobj->DisplaceTileSet=_Pobj->CurrentTileSet;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Mode displace ?
|
|
|
|
@ -3308,7 +3308,7 @@ private:
|
|
|
|
|
if ((tile>=0)&&(tile<CTileSet::CountDisplace))
|
|
|
|
|
{
|
|
|
|
|
_Pobj->DisplaceTile=tile;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -3345,7 +3345,7 @@ void MouseListener::pick (int mesh, int tile, const CVector& hit, TModePaint mod
|
|
|
|
|
// Pickup a displace ?
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Get the displace tile index
|
|
|
|
|
// Get the displace tile index
|
|
|
|
|
_Pobj->DisplaceTile=desc.getDisplace ();
|
|
|
|
|
_Pobj->DisplaceTileSet=tileSet;
|
|
|
|
|
}
|
|
|
|
@ -3577,7 +3577,7 @@ void EPM_PaintCMode::DoPaint ()
|
|
|
|
|
int nV=1<<rpatch->getUIPatch (p).NbTilesV;
|
|
|
|
|
for (int u=0; u<=nU; u++)
|
|
|
|
|
for (int v=0; v<=nV; v++)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
Point3 pos=patch->patches[p].interp (patch, (float)u/(float)(nU), (float)v/(float)(nV));
|
|
|
|
|
pos=pos*(vectMesh[i].Node->GetObjectTM (t));
|
|
|
|
|
if (fMaxX<pos.x)
|
|
|
|
@ -3643,7 +3643,7 @@ void EPM_PaintCMode::DoPaint ()
|
|
|
|
|
pTile->rotate[2]=0;
|
|
|
|
|
pTile->u=u;
|
|
|
|
|
pTile->v=v;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Compute bouding box of the tile
|
|
|
|
|
fMinX=FLT_MAX;
|
|
|
|
|
fMinY=FLT_MAX;
|
|
|
|
@ -3665,7 +3665,7 @@ void EPM_PaintCMode::DoPaint ()
|
|
|
|
|
pTile->Center=(maxToNel (pos[0])+maxToNel (pos[1])+maxToNel (pos[2])+maxToNel (pos[3]))/4.f;
|
|
|
|
|
|
|
|
|
|
// Store its radius
|
|
|
|
|
pTile->Radius=std::max
|
|
|
|
|
pTile->Radius=std::max
|
|
|
|
|
(
|
|
|
|
|
std::max ( (maxToNel (pos[0])-pTile->Center).norm(), (maxToNel (pos[1])-pTile->Center).norm() ),
|
|
|
|
|
std::max ( (maxToNel (pos[2])-pTile->Center).norm(), (maxToNel (pos[3])-pTile->Center).norm() )
|
|
|
|
@ -3958,7 +3958,7 @@ void EPM_PaintCMode::DoPaint ()
|
|
|
|
|
pTile->locked = 0;
|
|
|
|
|
|
|
|
|
|
// Check that neighbor tiles are not frozen
|
|
|
|
|
uint neighbor;
|
|
|
|
|
uint neighbor;
|
|
|
|
|
for (neighbor=0; neighbor<4; neighbor++)
|
|
|
|
|
{
|
|
|
|
|
// Neighbor exist ?
|
|
|
|
@ -4009,7 +4009,7 @@ void EPM_PaintCMode::DoPaint ()
|
|
|
|
|
pData->pobj=pobj;
|
|
|
|
|
pData->center=center;
|
|
|
|
|
pData->T=t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
myThread (pData); // Do it without thread
|
|
|
|
|
|
|
|
|
|
// Invalidate all objects
|
|
|
|
@ -4082,9 +4082,9 @@ bool loadLigoConfigFile (CLigoConfig& config, Interface& it)
|
|
|
|
|
// Can't found the module
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DWORD WINAPI myThread (LPVOID vData)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
// Mega try
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -4109,7 +4109,7 @@ DWORD WINAPI myThread (LPVOID vData)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// The scene
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Loaf cfg files
|
|
|
|
|
LoadKeyCfg ();
|
|
|
|
|
LoadVarCfg ();
|
|
|
|
@ -4155,7 +4155,7 @@ DWORD WINAPI myThread (LPVOID vData)
|
|
|
|
|
{
|
|
|
|
|
// Build skined ?
|
|
|
|
|
bool skined=false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Export the shape
|
|
|
|
|
IShape *pShape;
|
|
|
|
|
pShape=export_.buildShape (*pNode, pData->T, NULL, true);
|
|
|
|
@ -4193,7 +4193,7 @@ DWORD WINAPI myThread (LPVOID vData)
|
|
|
|
|
CMatrix mat;
|
|
|
|
|
mat.identity();
|
|
|
|
|
CVector I,J,K,P;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Matrix3 matInvert;
|
|
|
|
|
matInvert.SetRow (0, Point3(1.f, 0.f, 0.f));
|
|
|
|
|
matInvert.SetRow (1, Point3(0.f, 0.f, 1.f));
|
|
|
|
@ -4275,7 +4275,7 @@ DWORD WINAPI myThread (LPVOID vData)
|
|
|
|
|
// Go.
|
|
|
|
|
//========
|
|
|
|
|
CEvent3dMouseListener mouseListener;
|
|
|
|
|
MouseListener listener (pData->eproc->ip, CNELU::Camera, &viewport, pData->pobj, pData->eproc, &TheLand->Landscape,
|
|
|
|
|
MouseListener listener (pData->eproc->ip, CNELU::Camera, &viewport, pData->pobj, pData->eproc, &TheLand->Landscape,
|
|
|
|
|
&CNELU::AsyncListener, &mouseListener, pData->VectMesh, pData->T);
|
|
|
|
|
|
|
|
|
|
// Mouse listener
|
|
|
|
@ -4303,7 +4303,7 @@ DWORD WINAPI myThread (LPVOID vData)
|
|
|
|
|
{
|
|
|
|
|
// For all the tileset selected
|
|
|
|
|
for (sint tss=0; tss<(sint)tileSetSelector.getTileCount (); tss++)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
// Get the tileset index
|
|
|
|
|
sint ts=tileSetSelector.getTileSet (tss);
|
|
|
|
|
|
|
|
|
@ -4434,7 +4434,7 @@ BOOL EPM_PaintMouseProc::HitATile(ViewExp *vpt, IPoint2 *p, int *tile, int *mesh
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL EPM_PaintMouseProc::HitATile(const CViewport& viewport, const CCamera& camera, float x, float y, int *tile, int *mesh, TimeValue t,
|
|
|
|
|
BOOL EPM_PaintMouseProc::HitATile(const CViewport& viewport, const CCamera& camera, float x, float y, int *tile, int *mesh, TimeValue t,
|
|
|
|
|
std::vector<EPM_Mesh>& vectMesh, NLMISC::CVector& hit, NLMISC::CVector &topVector)
|
|
|
|
|
{
|
|
|
|
|
// Get a world ray with the mouse 2d point
|
|
|
|
@ -4581,10 +4581,10 @@ bool EPM_PaintTile::intersect (const Ray& ray, std::vector<EPM_Mesh>& vectMesh,
|
|
|
|
|
/*-------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
int EPM_PaintMouseProc::proc(
|
|
|
|
|
HWND hwnd,
|
|
|
|
|
int msg,
|
|
|
|
|
int point,
|
|
|
|
|
int flags,
|
|
|
|
|
HWND hwnd,
|
|
|
|
|
int msg,
|
|
|
|
|
int point,
|
|
|
|
|
int flags,
|
|
|
|
|
IPoint2 m)
|
|
|
|
|
{
|
|
|
|
|
#if MAX_VERSION_MAJOR >= 19
|
|
|
|
@ -4611,10 +4611,10 @@ int EPM_PaintMouseProc::proc(
|
|
|
|
|
|
|
|
|
|
case MOUSE_MOVE:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case MOUSE_FREEMOVE:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case MOUSE_ABORT:
|
|
|
|
|
ip->SetStdCommandMode(CID_OBJMOVE);
|
|
|
|
|
break;
|
|
|
|
|