Jump to content
  • Advertisement

MTclip

Member
  • Content Count

    357
  • Joined

  • Last visited

Everything posted by MTclip

  1. Im curious if peolpe would / do use SQL for there games, or are there better suited DBs for games?
  2. Im am trying to figure out the number of possible cominations of balls for a 24 number bingo game... here is what i have so far.. there are.. B = 3003 combinations I = 3003 combinations N = 1365 combinations G = 3003 combinations O = 3003 combinations how do i find out the possible combinations for all letters combined is it.. n = B*I*N*G*0 r = 5
  3. MTclip

    a joint combinations problem

    well order is un important so i chose combination... I am trying to figure out the number of different ball combinations.. B has balls# 1 - 15 and 5 are in a combination I 16 - 30 & 5 in combo N 31 - 45 & 4 in combo G 46 - 60 & 5 in combo 0 60 - 75 & 5 in combo
  4. Is there any way c# to create 1 #define that can be seen by all files? .. for instatnce I have an application that runs on XP and CE but uses different code paths for each... but I have to put the #define at the top of each file... surely there is a way to set it up like in c++.. thanks
  5. Im looking for a way to count the number of bits in an int that are set to "1"... ie "11000111" should return 5; the only way i can think of is to have a mask for each slot and keep a count of the ones that AND together.. thanks
  6. I am developing a graphical application at work for an unknown windows CE 5.0 device... I just assumed that I would have to use the new direct3d mobile.. but I was searching the mircosoft site and found this click which caused me to think that direct3D was avalible outside of the mobile edition... anyone know if that is the case..? also any good links for windows CE .net compact framework 2.0 would be great.. thanks
  7. hey guys, Im tring to a struct of mine so i can stream in data from a binary file... heres what i got BinaryReader fin = new BinaryReader( File.OpenRead( file )); fin.Read((byte[])fileHeader, 0, Marshal.SizeOf(fileHeader)); // were fileHeader is an instance of the struct the error is that it cannot convert the struct to a byte[].. any help here would be great thanks
  8. That was certainly interesting, but its not really what im looking for... at least I dont want to do that to solve this issue ;p thanks anyhow
  9. MTclip

    Tiny C++ Template Question

    You are taking a ref of a std::string so you can not assign a value to a ref that not there... this should solve it template <class T> T Foo(const string & string("12345") ){
  10. The issue is shown in the simple console program posted below.. The problem: some static objects not being destroyed in time for memory leak detection #include <crtdbg.h> #include <map> class TestClass { static int i; static std::map<int, int> tMap; }; std::map<int, int> TestClass::i; int TestClass::tMap = 4; void main() { _CrtDumpMemoryLeaks(); } var "i" reports 0bytes leak var "tMap" reports 24bytes same holds true for namespaces and static vars I am assumeing the tMap destroys after main terminates... is this true? also is ther any other way to force it to terminate aside from allocating it on the heap?
  11. it does return size_t perhaps a better solution would be int size = (uint)vec.size(); for(int i = 0; i < size; i++) avoids cast & function call assumeing of course you are not changing the size of the vector in the loop
  12. Yeah that pretty much what I thought... Thanks
  13. MTclip

    Advice on my school..

    You can never judge a book by a cover... same goes for a degree program ;P ...also dont leave it upto someone else to tell/teach you what you need to know)...( by that i mean dont leave it up to any school/teachers to get you all the knowledge and info needed ). Take some initiative and find out( like you are ) -good luck
  14. MTclip

    D3DX Meshes

    lets not forget that ID3DXMesh is a COM object so you would not be able to call a constructor for your derived class... <hope im not wrong here> ;P I would just use CMesh as an adaptor type class.. make functions to reference the the parts of the ID3DXMesh you may need... as for the getting the vertex data.. have a vector or vector3 to hold your position vertices, or what ever else you need good luck
  15. hey Im just wondering if anyone knows how to export the bones and weights affecting a vertex in maxscript.. I can get the mesh exported but cant seem to find the functions to get at the bones... thanks
  16. MTclip

    What does this mean? class stuff

    Critter( int hunger = 0 ) that assigns a default value to the parameter... that way you can send a value in or just leave it blank and the value will be 0 Critter( 5 ) Critter() Critter::Critter( int hunger ): m_Hunger( hunger ) google initaliztion list It calls the members constructor basically its more efficient than Critter(int hunger ) { m_Hunger = hunger; } hope that helps
  17. MTclip

    D3D x mesh problem

    There are couple things that could be going on. First of all the D3DX mesh loading functions dont require you to supply an FVF so this makes me think that (a). you are loading the mesh yourself, or (b). you are trying to convert a loaded mesh to a specific FVF. Im not really sure what you are doing.. if you want to post your loading code I can better help you.
  18. MTclip

    D3D x mesh problem

    try turning of lighting pD3dDevice->SetRenderState( D3DRS_LIGHTING, FALSE ); but also if you do not supply diffuse colors they will be black
  19. MTclip

    ID3DXSprite trouble

    Quote: error LNK2001: unresolved external symbol "void __cdecl render(void)" (?render@@YAXXZ) that means it cant find "your" render function... make sure your function declaration and implementation have the same name.. your function was called render.. but I posted it as Render..
  20. MTclip

    ID3DXSprite trouble

    ... a couple things here... you are calling render once per frame. so your code also creates a texture & creates a sprite object every frame.. thats not good.. you should have a load function that gets called once at the begining of the program.. in the load function you load a texture and create the sprite. then rearage your render function like this void Render(void) { if( !pd3dDevice ) return; if( FAILED (pd3dDevice->BeginScene() )) return; // start sprite rendering pFront->Begin( D3DXSPRITE_ALPHABLEND ); pFront->Draw(pFrontTex, NULL, NULL, NULL, 0xFFFFFFFF); // end sprite rendering pFront->End(); pd3dDevice->EndScene(); pd3dDevice->Present( NULL, NULL, NULL, NULL ) }
  21. LPD3DXSPRITE::Begin() & ::End() must be in between IDirect3DDevice9::BecginScene() & EndScene()... // set the render target g_pD3DDevice->SetRenderTarget(0, g_pTextureSurface); // clear the target to a particular colour g_pD3DDevice->Clear(0, 0, D3DCLEAR_TARGET, STARTNODECOLOUR, 1.0f, 0 ); // render the text out to the object g_pD3DDevice->BeginScene(); renderTextureText(nodeToUpdate); // renderTextureText section -- g_pD3DXTextureSprite->Begin(D3DXSPRITE_ALPHABLEND); // render my text using a few of these calls g_pD3DXTextureFont->DrawTextA(g_pD3DXTextureSprite, pTextTotal, -1, &rect, DT_LEFT, D3DCOLOR_XRGB(200, 200, 200)); g_pD3DXTextureSprite->End(); // move this down here g_pD3DDevice->EndScene();
  22. You really want to avoid the sqrt.. but you seem to know that.. lookup SIMD .. //here is a faster absolute value _inline static float FastAbs(float f) { int i=((*(int*)&f)&0x7fffffff); return (*(float*)&i); } divides are a little slower so your normalize should get the inverse of length and multiply float iLenght = 1.0f / length; x *= iLenght; y *= iLenght; z *= iLenght; other functions you could add.. Length // return the magnitude of a vector LenghtSquared // return mag squared Min // returns the minimun xyz of two vectors Max // same but maximum Reflect // reflect the vector from a givin normal Project // project the vector from a given axis .. those are some of the things I find helpful
  23. MTclip

    OBB transformation

    I am trying to figure out how to transform an OBB by a 4x4 transformation matrx that can include scale rotation and translation.. my OBB has these Vector3 center Vector3 extents Vector3[3] orientation any help would be great.. thanks
  24. Frustum Culling ... basically you find the area that it viewable through the camera and test to see if a vertex, or better yet some sort of bounds ( sphere, box... ) for a bunch of vertices is in side the view frustum.... if it is you render it...
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!