Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Quellcode |
|
1 2 3 4 5 6 7 8 |
void Terrain::CalculateNormal(Terrain::Vertex* pvVertex) { Game().Log("Calculate vertex normals"); // Make Indices unsigned long* pulFace = new unsigned long[(m_uiWidth-1) * (m_uiDepth-1) * 6]; Game().Log("Test"); unsigned int index = 0; |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
void Terrain::MakeTerrain(const unsigned char* pbyHeightmap) { Game().Log("Make terrain vertice"); TB_PARAM(pbyHeightmap); if(D3DDevice()->CreateVertexBuffer(sizeof(Terrain::Vertex)*m_uiWidth*m_uiDepth, D3DUSAGE_DYNAMIC, Terrain::Vertex::FVF, D3DPOOL_DEFAULT, &m_pVertice, 0) != D3D_OK) TB_EXCEPT(E_INTERFACE, "Cannot create vertex buffer"); Terrain::Vertex* pvData; m_pVertice->Lock(0, 0, (void**)&pvData, D3DLOCK_DISCARD); float fDetailX = m_uiWidth * m_fDetailMapCount; float fDetailZ = m_uiDepth * m_fDetailMapCount; ... } |
Administrator
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, char* szCmdLine, int iShow) { try { Game().Initialise(); Game().Run(); Game().Release(); } catch(Exception& exp) { gtl::string out("Founding a "); out << CodeToString(exp.GetCode()) << " Exception!\n"; out << exp.GetMessage() << "\n"; out << "File: " << exp.GetFile() << "\nLine: " << exp.GetLine() << "\nFunction: " << exp.GetFunction(); ShowCursor(true); MessageBox(NULL, out.c_str(), "Tower Bombing - Error", MB_OK | MB_ICONEXCLAMATION); Game().Release(); } catch(std::bad_alloc& exp) { gtl::string out; out << "Founding bad memory allocation!\nInformation: " << exp.what(); ShowCursor(true); MessageBox(NULL, out.c_str(), "Tower Bombing - Error", MB_OK | MB_ICONEXCLAMATION); Game().Release(); } catch(exception& exp) { gtl::string out; out << "Founding exception!\nInformation: " << exp.what(); ShowCursor(true); MessageBox(NULL, out.c_str(), "Tower Bombing - Error", MB_OK | MB_ICONEXCLAMATION); Game().Release(); } catch(...) { ShowCursor(true); MessageBox(NULL, "Find an unkown exception.\nNo information available!", "Tower Bombing - Error", MB_OK | MB_ICONEXCLAMATION); Game().Release(); } return 0; } |
Werbeanzeige