Jump to content

  • Log In with Google      Sign In   
  • Create Account

Nypyren

Member Since 19 Aug 2002
Online Last Active Today, 10:44 AM

Posts I've Made

In Topic: Virtual functions are not called from a static library

Today, 12:04 AM

Sometimes, if the debugger is confused enough, it won't be able to find the memory address that it needs to place a breakpoint on. Sometimes it'll tell you this, sometimes you can miss it.

If a breakpoint suspiciously fails, try logging something - your code might indeed be executing.

In Topic: Do you usually prefix your classes with the letter 'C' or something e...

25 May 2016 - 11:51 PM

My keyboard doesn't have a '' key. So I an't prefix my lasses. :(

It's pretty hard to ode in /++ or #.

In Topic: Issue with convertion C++ code to C# for TGA loading

25 May 2016 - 03:33 PM

Why do you store the TGA file's data in an Image at all? It's not an image, it's a file.

Why do you have pTGA in an IntPtr? Why is it not a (File)Stream, BinaryReader, or at very least a byte[]?

Can you show the code where that IntPtr is coming from? Generally you never have to use IntPtrs in C# unless you're doing interop, and I don't see why you need any interop when reading from a file.

In Topic: Issue with convertion C++ code to C# for TGA loading

25 May 2016 - 10:58 AM

byte* sPtr = (byte*) pixelBuffer.DataPointer;
uint* dstPtr = (uint*) (((byte*) pixelBuffer.DataPointer) +

OK, I think I see the major problem; It looks like you're reading and writing the same buffer simultaneously. That'll definitely not work with TGA files. You'll start getting corruption the moment the write pointer writes to data that the read pointer is about to read.

You definitely need to have the writes not interfere with reads.

Personally I would use a BinaryReader like Stainless' TGA reader does, since it's clean and looks more like usual C# code.

In Topic: how much PC do you need to build a given game?

23 May 2016 - 09:41 AM

(For some reason quoting your last post pulls in a ton of font formatting info, so I'm avoiding that.)

RE: Windows background processing:

Right now, monitoring process use on Windows 10: I have about 70 processes running, and about two dozen of them are using "0.01%" of my CPU at any given time. The rest are using 0%. It's insignificant, at least for me.

The only time I ever notice a "background process" sucking down CPU time is at work where our mandated Kaspersky antivirus software does its periodic scans that bring my work laptop to its knees. But that was true in Windows 7 through Windows 10, and isn't the OS's fault.

Back when CPUs were just getting two cores, I noticed a big improvement when I got my first 2-core PC, but I haven't noticed any difference in background task handling since then.

PARTNERS