![]() |
| Register | Login | |||||
|
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
|
| | |||
| Acmlm's Board - I3 Archive - - Posts by sloat |
| User | Post | ||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| don't you have to use "this" with everything...or am i stuck in php mode?
also, what exception is it giving you? |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
Originally posted by HyperHacker It looks like 0x7473654C is a string that's getting dereferenced too many times, or in this case, probably overwriting your file pointer. If you convert it to ascii you get "tseL". But remember that an x86 processor always reads addresses from low to high, so the actual string that it thinks is a pointer is "Lest". I dunno if that has any significance to you, but to me it would be a starting point. |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| I believe MisterJones means make a file mapping object, which would be much more efficient. It's also how Hex Workshop can open 700meg files with little or no lag.
Check out CreateFileMapping and MapViewOfFile. |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
Originally posted by MathOnNapkins With Windows, it's more like a copy gets loaded in to the process address space. You use the FlushViewOfFile to save changes. So you can modify to your heart's content and not have to save it. To close it, first you call UnmapViewOfFile, then CloseHandle on the file mapping object, then CloseHandle on the file. |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
You don't have to use RegisterWindowMessage unless you need to make sure that the number you use doesn't interfere with some other message. But that would probably only happen if you're subclassing a control.
#define WM_MYMESSAGE WM_USER+0x1337
You can use WM_APP instead if you're really paranoid about duplicate values. |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| InvalidateRect will cause flicker if you're not using double buffering. It can be slow with double buffering. You can try using ScrollWindowEx which has a param for flags for repainting, or if you're using double buffering, you can try ScrollDC. ScrollDC is more for if you don't want to redraw the entire window contents (which is a good thing), but the code to manage a backbuffer and scrolling it will be more complex. | |||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| I'd say keep the main program functions separate and make a plugin SDK -- an interface for the plugin to access the main program (if it really needs it). There might be a way to have the application export functions (like a dll) and use a header/library for the plugin to have access. Or if that doesn't work, you can have a message-only or otherwise hidden window in the application for the plugin to communicate with via messages.
The rest of the plugin would be a bunch of callbacks that it registers (in the init function or whatever) to specific application events. The main application would keep a linked-list of event-handlers so more than one plugin can handle the same event. When that event gets fired, the application simply walks down the chain until it reaches the end, or a plugin has asked the chain to stop. I wouldn't worry too much about 64-bit and 32-bit at the moment. Yeah, the plugin would probably have to be recompiled, but so would the application. |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| double buffering is something you have to do manually, with a memory DC and memory bitmap. you basically draw everything to this memory DC, then use BitBlt to set it to the screen. There are plenty of examples of it on MSDN (if you can find them) or google. | |||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| if you want a native look, you should also check out wxWidgets. It's almost as simple as Qt, and might be more lightweight (not really sure though).
The biggest gripe most people have with Qt is the license -- you can either pay for the toolkit or license your application under the GPL. But if that doesn't matter, then by all means use it. It's definitely more robust and proven. |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| MSDN says you can get a performance boost using a CachedBitmap class and the Graphics:: DrawCachedBitmap method. But you might not be able to use it depending on your situation.
There's no doubt that GDI+ is slower than regular GDI or DirectX, but it still shouldn't be that slow. Once you've got it loaded and ready to go, it should draw almost instantly. The only time I've ever had something go very slow was when I was fooling around with the automatic gamma correction and alpha-blending. Still, it was rendering a 550x320 bitmap with about 10 sprites at about 6 or 7 frames per second. (edited by sloat on 02-12-06 11:22 PM) |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| For typical use, it shouldn't be a problem. But remember, it's a pseudorandom number generator. It's not safe for cryptography (IOW, the algorithm can be derived from the output) and it will repeat sequences eventually. | |||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| I'll throw my possible solution in to the ring...
set the graphics object (whatever you're drawing to) .SmoothingMode property to System.Drawing.Drawing2D.SmoothingMode.None |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| Try adding a _stdcall or WINAPI directive to your function type definitions. They're the same thing, so it doesn't matter which you choose. I forget where to put it though, so good luck. | |||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| for SNES, it might be possible to multiply by the (reciprocal * 2^8)+1 if you're using a constant. I've never tried it on SNES, but with GBA and x86 asm, it works. The result would be in the high-byte of the multiplication result.
You could multiply the result by the divisor and subtract from the original number to get the remainder. I have no idea if all this would be slower than the regular divide function though. Here's an example: ;123 / 10 = 12 (1/10 * 2^8)+1 = 0x1A 123 * 0x1A = 0x0C7E As you can see, the high-byte of the result is 0x0C, which is 12. |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| C# as a language is really nice. Very similar to Java, just with better features, better syntax, less crummy-ness.
Java and C# both require large runtimes. Java is mostly cross-platform (any OS the runtime is supported on) and C# is getting better platform support thanks to the Mono Project, which I hear is getting pretty decent. However, for an editor, I wouldn't use either Java or C#. In my experience, the higher level the language, the harder it is to work with binary files. I honestly wouldn't even know where to begin with either C# or Java. I do remember when I was messing with stuff in VB4, binary files gave me many headaches. In contrast, with the zamn editor (written in C), I could make structs and arrays of structs and copy the data from the game almost directly in to them. And writing the data back was about as simple. So, I would (and did) stick with C/C++. Things like memory mapped file I/O are too useful to not have. And if you code it carefully, you can have it cross platform with little effort. |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| From what I can remember, they Keyboard Hook can't be used to modify input. The only way I was ever able to modify keyboard data or block the keystroke message was with a WH_GETMESSAGE hook. | |||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
Originally posted by HyperMackerel My mistake. I was just inspecting it and it seems bit 24 of the lParam will be set if you're using the regular insert key and cleared if you do shift+numpad0. But it still registers as an insert keystroke. |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| If it's that confusing, just don't use BitBlt at all then. Clear the background using ExtFloodFill or FillRect (whichever works better for you), and just use TransparentBlt to do all your drawing.
Chances are it won't show up properly anyway since, IIRC, the SNES uses the palette index to indicate transparency and not the color value. Probably the best solution would be to do masking for each tile, and draw each with BitBlt using a SRCAND-SRCPAINT double blit. Another solution would be to change the color value of palette index 0 to something that isn't in the game...then you can use TransparentBlt with no ill effects. Generating masks on the fly and changing pixel colors present their own problems -- the most noticable would be how slow the pixel manipulation functions are. Unless you're prepared to jump in to the fun fun world of DIBs, you should stick with broken rendering, or... Using a separate, static bitmap mask would work. But then, that's another file to add to your project. btw, TransparentBlt hates Windows 98. It will cause huge memory leaks, and may not even work at all. |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
| You have to define how to show the tag with your stylesheet. Basically, you define an xsl:template block and match "i" (or whatever tag you want to render). In that, you put your html and an 'xsl:value-of select="."' tag
Then, you use xsl:apply-templates instead of xsl:value-of to output, and you should be set. Hope this helps. |
|||
|
sloat Since: 11-18-05 From: Delaware, US Last post: 6011 days Last view: 6011 days |
| ||
Originally posted by HyperHacker I'm pretty sure this is the issue. You should get the DC of the current window (from the hWnd param) and use that to create both the memory DC and Bitmap. Originally posted by Buried in MSDN |
| Acmlm's Board - I3 Archive - - Posts by sloat |