void CSVPrinter::PrintHeading(ColumnDescriptors const & descriptors) { for (size_t i = 0; i < descriptors.size(); ++i) { auto const & desc = descriptors[i]; m_stream << desc.name << "(" << GetTypeStr(desc.type) << ")"; if (i + 1 != descriptors.size()) m_stream << ","; } m_stream << std::endl; }
BOOL CReturnParameter::StoreToXMLFile(CXXMLFile* pFile, CXXMLFile::CElement* pParentElement) { CXXMLFile::CElement* pElement; if(pFile && pParentElement) { //ReturnParameter Elements pElement = (CXXMLFile::CElement*)pFile->AddElement(pParentElement); pFile->SetText(pElement, "ReturnParameter"); pElement->SetAt("Id", GetIndexStr()); pElement->SetAt("Name", GetName()); pElement->SetAt("Type", GetTypeStr()); pElement->SetAt("Value", GetValueStr(OVF_HEX)); if(!m_oVisible) pElement->SetAt("Visible", GetVisibleStr()); return TRUE; } return FALSE; }
//HRESULT VertexObject::ChangeIndexingMode(IndexingType TindexingMode) //{ // indexing_type = TindexingMode; // short Indeces[6]; // HRESULT hr = DDevice->CreateIndexBuffer(sizeof(short)*6,0,D3DFMT_INDEX16, D3DPOOL_DEFAULT, &index_bufer, NULL ); // if(FAILED(hr)) // { // if(loger) // { // wstring number; // wstringstream wstrstrm; // wstrstrm << hr; // wstrstrm >> number; // loger->SendToLog(GetTypeStr()+GetName()+TEXT("CreateIndexBuffer: Line 147 in VertexObject.cpp ")+number); // } // return hr; // } // if(indexing_type == IndexingType::Square) // { // Indeces[0]=0; // Indeces[1]=1; // Indeces[2]=2; // Indeces[3]=3; // Indeces[4]=0; // Indeces[5]=1; // } // else if(indexing_type == IndexingType::Triangle) // { // Indeces[0]=0; // Indeces[1]=2; // Indeces[2]=1; // Indeces[3]=0; // Indeces[4]=3; // Indeces[5]=2; // /*Indeces[0]=0; // Indeces[1]=2; // Indeces[2]=1; // Indeces[3]=0; // Indeces[4]=2; // Indeces[5]=3;*/ // } // VOID* IndexData = NULL; // hr = index_bufer->Lock(0, 0, &IndexData, 0); // return S_OK; //} HRESULT VertexObject::LoadTexture(wstring fileName) { if(texture1) { texture1->Release(); texture1 = NULL; } HRESULT hr = D3DXCreateTextureFromFile( DDevice, fileName.c_str(), &texture1 ); if( FAILED( hr ) ) { if(loger) { wstring number; wstringstream wstrstrm; wstrstrm << hr; wstrstrm >> number; loger->SendToLog(GetTypeStr()+GetName()+TEXT("ErroreTextureLoad: Line 172 in VertexObject.cpp ")+number); } return hr; } return S_OK; }
LPCTSTR XBaseLayer::GetTypeString( xSpr::xtLayer type /*= xSpr::xLT_NONE*/ ) const { if( type == xSpr::xLT_NONE ) type = GetbitType(); return GetTypeStr( type ); }
void DebugPrint(char * report, char * file, int line, int type) { printf("%s %s %d %s %s\n", FormatDate(0), file, line, GetTypeStr(type), report); }
HRESULT VertexObject::CreatePlane(D3DXVECTOR3 Tmin, D3DXVECTOR3 Tmax, IndexingType Ttype) { indexing_type = Ttype; short Indeces[6]; GAMVERTEX vertices[] = { { D3DXVECTOR3(Tmin.x, (Tmin.y+Tmax.y)/2, Tmax.z ), D3DXVECTOR3(1, 1, 1), 0.0, 0.0 }, { D3DXVECTOR3(Tmax.x, (Tmin.y+Tmax.y)/2, Tmax.z ), D3DXVECTOR3(1, 1, 1), 1.0, 0.0 }, { D3DXVECTOR3(Tmax.x, (Tmin.y+Tmax.y)/2, Tmin.z ), D3DXVECTOR3(1, 1, 1), 1.0, 1.0 }, { D3DXVECTOR3(Tmin.x, (Tmin.y+Tmax.y)/2, Tmin.z ), D3DXVECTOR3(1, 1, 1), 0.0, 1.0 } }; if(vertex_bufer) { vertex_bufer->Release(); } if(index_bufer) { index_bufer->Release(); } HRESULT hr = DDevice->CreateVertexBuffer( 4*sizeof(GAMVERTEX), 0, D3DFVF_MESHVERTEX, D3DPOOL_DEFAULT, &vertex_bufer, NULL ); if(FAILED(hr)) { if(loger) { wstring number; wstringstream wstrstrm; wstrstrm << hr; wstrstrm >> number; loger->SendToLog(GetTypeStr()+GetName()+TEXT("CreateVertexBuffer: Line 117 in VertexObject.cpp ")+number); } return hr; } VOID* pVertix; hr = vertex_bufer->Lock( 0, sizeof(vertices), (void**)&pVertix, 0 ); if(FAILED(hr)) { if(loger) { wstring number; wstringstream wstrstrm; wstrstrm << hr; wstrstrm >> number; loger->SendToLog(GetTypeStr()+GetName()+TEXT("LockVertexBuffer: Line 131 in VertexObject.cpp ")+number); } return hr; } memcpy( pVertix, vertices, sizeof(vertices) ); vertex_bufer->Unlock(); hr = DDevice->CreateIndexBuffer(sizeof(short)*6,0,D3DFMT_INDEX16, D3DPOOL_DEFAULT, &index_bufer, NULL ); if(FAILED(hr)) { if(loger) { wstring number; wstringstream wstrstrm; wstrstrm << hr; wstrstrm >> number; loger->SendToLog(GetTypeStr()+GetName()+TEXT("CreateIndexBuffer: Line 147 in VertexObject.cpp ")+number); } return hr; } if(indexing_type == IndexingType::Square) { Indeces[0]=0; Indeces[1]=1; Indeces[2]=2; Indeces[3]=3; Indeces[4]=0; Indeces[5]=1; } else if(indexing_type == IndexingType::Triangle) { Indeces[0]=0; Indeces[1]=2; Indeces[2]=1; Indeces[3]=0; Indeces[4]=3; Indeces[5]=2; /*Indeces[0]=0; Indeces[1]=2; Indeces[2]=1; Indeces[3]=0; Indeces[4]=2; Indeces[5]=3;*/ } VOID* IndexData = NULL; hr = index_bufer->Lock(0, 0, &IndexData, 0); if(FAILED(hr)) { if(loger) { wstring number; wstringstream wstrstrm; wstrstrm << hr; wstrstrm >> number; loger->SendToLog(GetTypeStr()+GetName()+TEXT("LockIndexBuffer: Line 185 in VertexObject.cpp ")+number); } return hr; } memcpy(IndexData, (void*)&Indeces, sizeof(Indeces)); index_bufer->Unlock(); //D3DXCreateTextureFromFile(pDevice,TEXT("white.jpg"),&g_texture); return S_OK; }