473,396 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Having trouble with this source code

OK this is the complete source code and when i compile it gets errors
i am stumped as to why. not sure if the headers are there or not
can some one please help me fix these errors please

Expand|Select|Wrap|Line Numbers
  1. #define charbody m==char Stridenum[44];
  2. unsigned int m_Stride;
  3. unsigned int NumVertices;
  4. unsigned int primCount;
  5. int Stridelogger = false;
  6. int stri = 0;
  7. int numvert = 0;
  8. int primcnt = 0;
  9. CD3DFont *pD3DFont;
  10. LPDIRECT3DTEXTURE9 texRed;
  11. LPDIRECT3DTEXTURE9 texBlue;
  12. LPDIRECT3DTEXTURE9 texYellow;
  13. LPDIRECT3DTEXTURE9 texGreen;
  14. LPDIRECT3DTEXTURE9 texWhite;
  15. LPDIRECT3DTEXTURE9 texAqua;
  16. //LPDIRECT3DTEXTURE9 texDarkBlue;
  17. //LPDIRECT3DTEXTURE9 texPink;
  18. //LPDIRECT3DTEXTURE9 texOrange;
  19. LPDIRECT3DTEXTURE9 texPurple;
  20. const BYTE bRed[60] =
  21. {
  22. 0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  23. 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
  24. 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  25. 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  26. 0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
  27. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  28. 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00
  29. };
  30. const BYTE bBlue[60] =
  31. 0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  32. 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
  33. 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  34. 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  35. 0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
  36. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  37. 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00
  38. };
  39.  
  40. const BYTE bGreen[60] =
  41. {
  42. 0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  43. 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
  44. 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  45. 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
  46. 0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
  47. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  48. 0x00, 0x9E, 0x00, 0x00, 0x00, 0x00
  49. };
  50. const BYTE bYellow[60] =
  51. {
  52. 0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  53. 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
  54. 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  55. 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
  56. 0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
  57. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  58. 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00
  59. }; 
  60. const BYTE bAqua[58] =
  61. {
  62. 0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  63. 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
  64. 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  65. 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
  66. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  67. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  68. 0xFF, 0xFF, 0x00, 0x00
  69. };
  70. const BYTE bPurple[58] =
  71. {
  72. 0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  73. 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
  74. 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  75. 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
  76. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  77. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  78. 0xFF, 0x00, 0xFF, 0x00
  79. };
  80. .r{}
  81. const BYTE bWhite[58] =
  82. {
  83. 0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  84. 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
  85. 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  86. 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
  87. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  88. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  89. 0xFF, 0xFF, 0xFF, 0x00
  90. };
  91. #define D3DHOOK_TEXTURES
  92. HRESULT CD3DManager::Initialize()
  93. {
  94. D3DXCreateTextureFromFileInMemory(m_pD3Ddev, (LPCVOID)&bRed, 60, &texRed);
  95. D3DXCreateTextureFromFileInMemory(m_pD3Ddev, (LPCVOID)&bBlue, 60, &texBlue);
  96. D3DXCreateTextureFromFileInMemory(m_pD3Ddev, (LPCVOID)&bGreen, 60, &texGreen);
  97. D3DXCreateTextureFromFileInMemory(m_pD3Ddev, (LPCVOID)&bYellow, 60, &texYellow);
  98. D3DXCreateTextureFromFileInMemory(m_pD3Ddev, (LPCVOID)&bWhite, 60, &texWhite);
  99. D3DXCreateTextureFromFileInMemory(m_pD3Ddev, (LPCVOID)&bAqua, 60, &texAqua);
  100. D3DXCreateTextureFromFileInMemory(m_pD3Ddev, (LPCVOID)&bPurple, 60, &texPurple);
  101.  
  102. pD3DFont = new CD3DFont("Comic Sans MS", 12);
  103. pD3DFont->InitDeviceObjects(m_pD3Ddev);
  104. pD3DFont->RestoreDeviceObjects();
  105. return S_OK;
  106. }
  107. HRESULT CD3DManager::PreReset()
  108. {
  109. return S_OK;
  110. }
  111. HRESULT CD3DManager::PostReset()
  112. {
  113. return S_OK;
  114. }
  115. HRESULT CD3DManager::Release()
  116. {
  117. delete pD3DFont;
  118. texRed->Release();
  119. texBlue->Release();
  120. texGreen->Release();
  121. texWhite->Release();
  122. texAqua->Release();
  123. texYellow->Release();
  124. texPurple->Release();
  125. return S_OK;
  126. }
  127. in DIP
  128. -------
  129. if(GetAsyncKeyState(VK_F1)&1)
  130. {
  131. Stridelogger=!Stridelogger;
  132. }
  133. if(Stridelogger)
  134. {
  135. if(GetAsyncKeyState(VK_NUMPAD7)&1)stri ;
  136. if(GetAsyncKeyState(VK_NUMPAD1)&1)stri--;
  137. if(GetAsyncKeyState(VK_NUMPAD8)&1)numvert ;
  138. if(GetAsyncKeyState(VK_NUMPAD2)&1)numvert--;
  139. if(GetAsyncKeyState(VK_NUMPAD9)&1)primcnt ;
  140. if(GetAsyncKeyState(VK_NUMPAD3)&1)primcnt--;
  141. }
  142. if(m_Stride == stri)
  143. {
  144. m_pD3Ddev->SetTexture(0,texRed);
  145. return m_pD3Ddev->DrawIndexedPrimitive(Type,BaseVertexIndex,
  146. MinVertexIndex, NumVertices, startIndex, primCount);
  147. }
  148. if(NumVertices == numvert)
  149. {
  150. m_pD3Ddev->SetTexture(0,texBlue);
  151. return m_pD3Ddev->DrawIndexedPrimitive
  152. (Type,BaseVertexIndex,MinVertexIndex, NumVertices, startIndex, primCount);
  153. }
  154. if(primCount == primcnt)
  155. {
  156. m_pD3Ddev->SetTexture(0,texGreen);
  157. return m_pD3Ddev->DrawIndexedPrimitive (Type,BaseVertexIndex,MinVertexIndex, NumVertices, startIndex, primCount);
  158. }
  159. if(GetAsyncKeyState(VK_NUMPAD0)&1)
  160. {
  161. stri=0;
  162. numvert=0;
  163. primcnt=0;
  164. }
  165. if(GetAsyncKeyState(VK_NUMPAD4)&1)
  166. {
  167. add_log("Player Stride:%i",stri);
  168. }
  169. if(GetAsyncKeyState(VK_NUMPAD5)&1)
  170. {
  171. add_log("Stride:%i",stri);
  172. add_log("NumVertices:%i",numvert);
  173. add_log("primCount:%i",primcnt);
  174. }
  175.  
Oct 4 '09 #1
4 3070
Banfa
9,065 Expert Mod 8TB
There is little point saying that you have got compiler diagnostics (errors or warnings) and asking for help to fix them without actually posting those errors!
Oct 4 '09 #2
Hi i was going to do this but i dident know if it was needed or not. so i'll post it now.
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Documents and Settings\Ab\My Documents\Untitled1.cpp" -o "C:\Documents and Settings\Ab\My Documents\Untitled1.exe" -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:9: error: expected constructor, destructor, or type conversion before '*' token
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:9: error: expected `,' or `;' before '*' token

C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:10: error: expected unqualified-id before string constant
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:10: error: expected `)' before string constant
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:10: error: expected `,' or `;' before string constant
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:11: error: `LPDIRECT3DTEXTURE9' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:12: error: `LPDIRECT3DTEXTURE9' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:13: error: `LPDIRECT3DTEXTURE9' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:14: error: `LPDIRECT3DTEXTURE9' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:15: error: `LPDIRECT3DTEXTURE9' does not name a type

C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:19: error: `LPDIRECT3DTEXTURE9' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:20: error: `BYTE' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:30: error: `BYTE' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:41: error: `BYTE' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:51: error: `BYTE' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:61: error: `BYTE' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:71: error: `BYTE' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:81: error: expected unqualified-id before '.' token
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:81: error: expected `,' or `;' before '.' token
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:82: error: `BYTE' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:93: error: `HRESULT' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:108: error: `HRESULT' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:112: error: `HRESULT' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:116: error: `HRESULT' does not name a type
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:128: error: `in' does not name a type

C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:134: error: expected unqualified-id before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:134: error: expected `,' or `;' before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:143: error: expected unqualified-id before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:143: error: expected `,' or `;' before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:149: error: expected unqualified-id before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:149: error: expected `,' or `;' before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:155: error: expected unqualified-id before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:155: error: expected `,' or `;' before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:160: error: expected unqualified-id before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:160: error: expected `,' or `;' before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:166: error: expected unqualified-id before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:166: error: expected `,' or `;' before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:170: error: expected unqualified-id before "if"
C:\Documents and Settings\Ab\My Documents\Untitled1.cpp:170: error: expected `,' or `;' before "if"

Execution terminated

hope this help :)
Oct 4 '09 #3
newb16
687 512MB
CD3DFont is never defined. It must be defined somewhere in the headers you had to include. Where did you get this code?
Oct 4 '09 #4
it's a code i had laying around from a website. i visit often, but as it is the headers are missing so i'll fix that and see how i get on
Oct 4 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Anand | last post by:
Hi i am having trouble adding a recordset into the access database, the code seems to be working fine it passs and parses through all variables just fine without showing any errors and also when i...
1
by: George | last post by:
Hi, I am trying to write a query in Oracle which I have not done before, and are having some difficulty getting my result. Please check my query and my results. select max(note.datetime),...
9
by: KublaiKhan | last post by:
The main window spawns a daughter window that has no toolbars or buttons. I right click & choose "view source", yet nothing happens. What gives? Thanks. KK
5
by: Krumble Bunk | last post by:
Hello! First things first (but not necessarily in that order), this is a really great group, and has helped me understand more and more C everytime I read the postings, so thanks for a great...
0
by: khawar | last post by:
here is my code that i am using to send the post to verisign: using System.Drawing; using System.Data; using System.Data.SqlClient; using System.Data.OleDb; using System; using System.Web.UI;...
5
by: I am Sam | last post by:
The codebehind is as follows: I have instenced the DataSet dsclub2a protected System.Data.DataSet dsclub2a; and I have instanced the DropdownList as follows: protected...
9
by: Christian Blackburn | last post by:
Hi Gang, I don't know what to make of all of this, but I'm having nothing, but trouble copying data to the clipboard which should be the easiest thing in the world. The only systems I can get...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
1
by: MLH | last post by:
Am having trouble with the filter property setting below. Would like to filter the listing to car makes beginning with "D". I'm blowing it on the filter spec somehow??? Sub OpenRecordsetX() ...
5
by: tkondal | last post by:
Hi all. I just started looking at Python's ctypes lib and I am having trouble using it for a function. For starters, here's my Python code: from ctypes import*; myStringDLL=...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.