Jump to content
  • Advertisement

ramy

Member
  • Content Count

    224
  • Joined

  • Last visited

Community Reputation

148 Neutral

About ramy

  • Rank
    Member
  1. To the best of my knowledge, there has never been a version of Windows that used 1 byte for newlines, and there has also never been a version of DOS that used 1 byte for newlines. If you want to know for sure what's in any given file, get yourself a hex editor and examine it properly. [/quote] Come to think about it, I never ever had to read a text file using fread until now, I always used std library and I didn't really consider doing what I am doing right now. mix in also some miss-conceptions from when I first started programming years and years ago. Im glad its all sorted now thanks for everybody!
  2. hmmm, i under under which versions of windows is that from? is it from XP and later? But ya, I guess I will have to deal with it
  3. thanks everyone for your replies! [/quote] my apologizes, i actually read the documentation but must have missed it! But since when did windows have newline as 2 bytes? it was always 1 byte if i remember correctly..
  4. Hiya community, i am trying to read contents of a file in text but im facing some pretty weird problems. to make things simple the file is text i created in notepad and only has two lines, one with H and other with E. so theoretically it should be 3 bytes right??? windows states that it is 4 bytes! why?? when i read the file one byte at a time (until i hit EOF) using fread i get 3 bytes. this is what i expect because the file should have only 3 byts, but windows says its 4 bytes. also i decided to remove the newline from the text file, and modified the file to be HE, then windows says its 2 bytes! and fread has no problem reading and returns 2 bytes as expected! this implies that fread somewhere does not like newlines right?? Going back to H newline E, if i change the fread open mode to binary, then fread DOES in fact read 4 bytes not 3. but this is a text file, i can not possible read it in binary. so can i understand from this that, under text-ascii mode, fread doesn't like newlines and reads them as 1 byte instead of 2? im saying 2 bytes because judging from windows file properties it states the file is 4 bytes.. whilst i know windows uses 1 byte for newline.. oh, and before i forget.. i tried to get the filesize in my code using the seek and tell and that also returns 4 bytes as oppose to 3 bytes (same as what windows says). also the good old stat also says its 4 bytes!! damn it, where is that 4th BYTE???? and why isnt fread getting it? it only reads 3 bytes and then says EOF! im using windows 7 btw 64 bit, if that at all helps..
  5. ramy

    Bluetooth controllers, joysticks, gamepads

    well i just got mine MBP acouple of weeks ago. I would suggest getting one of these usb adapters. they can come in handy alot. I never tried them on the MBP thou, but i'm guessing they would work out fine, don't know why they don't work. You can tell me if they work out nicely or not :D enjoy
  6. ramy

    lua in c++

    just copy the lua dll to place it with your application, and it should run.
  7. char op; Console.WriteLine("1 - Create user"); Console.WriteLine("2 - Load user"); Console.Write("> "); op = (char)Console.Read(); if (op.Equals('1')) { string name Console.WriteLine(); Console.WriteLine("Name -> "); while ( (name = Console.ReadLine()) != null) { Console.WriteLine(name); } } :D
  8. ramy

    lua in c++

    What version of compiler are you using? I haven't used lua for quite some time thou. note: you supplied the directories for lua right?
  9. I personally debug in windows mode before testing on full screen, I usually end up restarting my computer when it hits a breakpoint when its in fullscreen. Or u can dump data to files when its running in fullscreen. However I have heard that it can be done, but I'm not sure if anybody did it or not, I would like to know myself.
  10. ramy

    Meshes are solid black

    Quote:Original post by Armadon 1) Check your lights, put on some debug light such as directional, as it's the easiest to test with. 2) Check if your light is enabled by the device. 3) Lights needs materials to know how to interact with the object. Check if you have materials assigned. 4) If you are using Shaders, make sure that the shader is compiling fine and that the matrices passed are correct. I hope this helps. Take care. Also to add to your list Armadon is the normals. If you are using directional lights make sure the mesh has normal, and they are correctly loaded and calculated. Hope it helps Ramy Gowigati
  11. I never worked with unions myself as well. I googled for some help and came up with something that might help out, u might have tried this. did u try giving the union and struct a name? union { Matrix m_world; struct { Vector3 m_right; float m_w1; Vector3 m_up; float m_w2; Vector3 m_facing; float m_w3; Vector3 m_position; float m_w4; } vectors; } mydata;
  12. Hi Sc0rp, I'm not sure what exactly do u mean by a single animation mesh. But I have tried personally adding several "Animation Sets" to the file, and it works just fine. Adding and removing that is. But the Animation file had one mesh but several animations. Hope thats helps.
  13. yup, thanks a million. it worked out for me. plus my visuals were miss leading, so its all ok now =D thanks Chimaira [Edited by - ramy on October 2, 2007 4:18:31 PM]
  14. what is the focus length? actually im implementing as what i wrote in the post, and its not working, maybe its my custom rotation control i implemented :S not sure how to check [Edited by - ramy on October 2, 2007 4:24:51 PM]
  15. Hey guys, i was wondering how to calculate the look direction vector from a rotation x, y, z vales i have. i have looked to this thread http://www.gamedev.net/community/forums/topic.asp?topic_id=352932 and i am having problems. I understand that i should be using Spherical-to-Cartesian conversion as the member stated, but its not working with me. NVector3 vDiff = NVector3(view.x, view.y, view.z); float XRot = atan2(-vDiff.y, sqrt(vDiff.x*vDiff.x + vDiff.z*vDiff.z)); float YRot = atan2(vDiff.x, vDiff.z); float sx = sinf(XRot); float cx = cosf(XRot); float sy = sinf(YRot); float cy = cosf(YRot); float x = sy*cx; float y = -sx; float z = cy*cx; view.x = x; view.y = y; view.z = z; is there anything im doing wrong? But im wondering where does the rotation x y z values come in here? btw im using Direct3D. thanks [Edited by - ramy on October 2, 2007 4:26:24 PM]
  • 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!