Jump to content
  • Advertisement

Ioachim Berselius

  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Ioachim Berselius

  • Rank
  1. Ioachim Berselius

    3d take item question (first person)

    An idea would be to check collisions between the objects and a "invisible hand" shape (it could be a box, cone, or anyting really) located as if it was in front of the camera.
  2. Ioachim Berselius

    PNG with Translucent Pixels

    Maybe it has to do with how you are loading the image into the texture?
  3. Ioachim Berselius

    Directory and files which don't exist... but exist.

    Quote:Original post by frob Sure it can. Just enclose it with quotes or it will assume the space is a separator. "Flying Saucer Tour, Vol. 1 " I don't think that works, at least for me. Windows (or at least Explorer, cmd.exe, Python and PowerShell) just trim any leading and trailing whitespace in folder names, even when part of a path.
  4. Ioachim Berselius

    Directory and files which don't exist... but exist.

    Quote:Original post by luca-deltodesco No that's not the issue, an example is: D:\Music\Bill Hicks\Flying Saucer Tour, Vol. 1 \xxxxxxxx.mp3 where for every mp3 in that folder (which doesn't exist) there is another folder: D:\Music\Bill Hicks\Flying Saucer Tour, Vol. 1 which contains the non false mp3s. I ran chkdsk on the drive, and it found no errors or anything... Is there a space at the end of the "fake folder" name? I have never seen something like that, and if that's the case, I don't know if Windows can access paths ending in whitespace
  5. Ioachim Berselius

    Accessing offset in void* array

    The first question is: why do you need to use void* instead of a specific (type-container) type? Because void* can refer to anything, you can't know the size of each data record, so doing pointer arithmetic makes no sense (p + 1 means "take p and advance 1*sizeof(p) bytes).
  6. Ioachim Berselius

    OpenGL Alpha Ignored

    What you want to to is alpha blending, not alpha testing. Alpha testing compares the alpha value using the AlphaFunc and makes the non passing pixels transparent (i.e. invisible, not translucent) You need to use glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
  7. Ioachim Berselius

    Procedurally drawing a tube.

    I did something like this a couple of years ago for a university project. I went for the "rotate one vector approach", I had my curve defined as line segments, just a list of vectors, each giving the movement to the next point of the curve, so point_i = sum vector_i from 0 to i For each pair of vectors, I calculated the tangent (just the average of both vectors), and the cross product, and created the "ring" by rotating the cross product using the tangent as rotation direction.
  8. Ioachim Berselius

    Good free program for creating 2d sprites?

    If you want to do pixel art, I second ddn3 opinion of using Paint.Net. There's also GraphicsGale, a freeware (there's also a shareware edition, lets you save GIFs) pixel sprite editor with features for animating easier.
  9. Ioachim Berselius

    [C#] do-while loop not functioning correctly.

    Check you condition, if you want to continue when mood isn't "GOOD" nor "BAD" you should use AND, not OR. Your current condition will be always true, it becames false only if mood is "GOOD" and "BAD", that, of course, can never happen. do { //... }while((mood != "GOOD") && (mood != "BAD")) EDIT: The lang attribute is "csharp" or "c#"
  10. Ioachim Berselius

    [.net] Directories problem...

    When not using WinForms, you can use AppDomain.CurrentDomain.BaseDirectory to get the executable directory
  11. Ioachim Berselius

    Blitting 32bit to 16bit

    Generally the data for each surface line is aligned to a 32 bit boundary. With 32bit images this is not a problem, but for other depths it can be In that case, if the 16 bit color surface width is odd, you will have an extra unused short after each line. Generally surfaces have a field called stride that contains the scanline width measured in bytes, which you should use instead of the image width. Which graphics library are you using?
  12. Ioachim Berselius

    Blitting 32bit to 16bit

    You are trying to convert a paletted 8bpp with a 24bpp color depth to a non-paletted 16bpp surface, right? You can't just copy the color components and expect them to work, you need to convert them. Each component is 0..255 in rgb24, but 0..31 (or 0..63 in the case of the green channel) in rgb16 , so you need to scale accordingly, by dividing, or better, doing a right shift ( (a >> 1) is the same as (a / 2)) //... do { BlitColour32* colour = &src->palette[*srcPixels]; dstPixels->red = colour->red >> 3; // 8bpp - 5bpp dstPixels->green = colour->green >> 2; // 8bpp - 6bpp dstPixels->blue = colour->blue >> 3; // 8bpp - 5bpp ++dstPixels; ++srcPixels; } while(--width); //... The other problem (from what can be seen from your picture) is a pixel alignment problem. What is the original image you try to transform? And are you sure they are in the correct format? To me it looks like you might be confusing 32bit and paletted 8bit modes.
  13. I think that you aren't really getting the concept behind the ArrayList, or .Net data structures in general, your problem is a non-issue, as these classes are designed to handle insertion, removal, etc. ArrayLists don't work as as object[], and they don't hace "empty indexes" as you call them, they don't contain null values unless you explicitly add or insert them. When you call ArrayList.Remove(), the element is removed and the gap is automatically closed. A little problem with your solution is that you add SocketManagers to the ArrayList, but check if the elements are Sockets, so GetSocketListIndex always returns -1. As benryves mentioned, you should really use a LinkedList for what you want. The code should look something like this (of course, if you want to save SocketManagers instead of Sockets, you should make some changes // ConnectionManager.cs class file using System; using System.Collections.Generic; using System.Text; using System.Net.Sockets; using System.Net; namespace Software_Configuration_Server { class ConnectionManager { private LinkedList<Socket> m_SocketList = new LinkedList<Socket>(); // array list to hold our sockets private Socket m_MainListeningSocket; // main socket that listens for new connections private IPHostEntry m_HostInfo; // iphost info to use for listener private IPAddress m_IPAddress; // ip address private IPEndPoint m_IPEndPoint; // end point for the main listening socket // properties and accessor methods public LinkedList<Socket> SocketList { get { return m_SocketList; } set { m_SocketList = value; } } // callback for client connection public void OnClientConnect(IAsyncResult asyn) { //Add the socket to the client to the lost of sockets Socket activeSocket = m_MainListeningSocket.EndAccept(asyn); m_SocketList.Add(activeSocket); // finally, start waiting for connection again m_MainListeningSocket.BeginAccept(OnClientConnect, null); } // constructor public ConnectionManager() { m_HostInfo = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); // iphost info to use for listener m_IPAddress = m_HostInfo.AddressList[0]; // get the ip address from the iphost info m_IPEndPoint = new System.Net.IPEndPoint(m_IPAddress, 10000); // end point for the main listening socket m_MainListeningSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); // init the socket // now bind the listening socket to the local endpoint so that we can listen m_MainListeningSocket.Bind(m_IPEndPoint); // now start to listen m_MainListeningSocket.Listen(512); // accept connections m_MainListeningSocket.BeginAccept(OnClientConnect, null); } // end constructor // destructor ~ConnectionManager() { } // end destructor } // end ConnectionManager class }
  14. Ioachim Berselius

    Caligari TrueSpace 7.6 is free.

    I remember using TrueSpace 3 a long time ago. It's the only modeling tool I've really gotten into, and it was quite nice. If you are searching free tools, you could check XSI Mod Tool out I got around the registration problems by using https://cart1.caligari.com/web/trueSpaceREg.aspx.
  15. Ioachim Berselius

    OpenGL 2D Camera

    Is your scene set using orthographic projection, or prespective? If it's the latter, that could be the problem
  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!