Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - I need a resource editor! | | | |
Pages: 1 2 3 4 | Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
Dish Spiny Level: 38 Posts: 342/596 EXP: 355646 For next: 14801 Since: 03-15-04 From: Disch Since last post: 18 days Last activity: 18 days |
| ||
I, too, have Enterprise Architect. Though I only use the C/C++ portion of it. | |||
sloat Level: 16 Posts: 43/85 EXP: 18044 For next: 2212 Since: 05-21-04 From: South Central Delaware Since last post: 19 days Last activity: 5 hours |
| ||
I'll have a Samuel Adams too. I mean, I have Enterprise Architect too. I just love buzzwords. |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 2913/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
load times are influenced by CPU load, HD speed, how clusted needed files are, memory structure, and CPU cache usage... | |||
Lenophis Super Koopa Level: 44 Posts: 439/830 EXP: 584360 For next: 26925 Since: 03-15-04 From: Duluth, MN Since last post: 4 hours Last activity: 3 hours |
| ||
Originally posted by Parasyte 15 seconds for me. 550MHz, 64 megs of ram. Windows 2k, SP4. VS.NET 2003, 7200 RPM HD speed, and that's all I can think of. Doubles up as a nice hex editor too (behold! The only one I've ever gotten to work with my setup!) Cause DOS is suck! |
|||
HyperLamer <||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people Sesshomaru Tamaranian Level: 118 Posts: 4282/8210 EXP: 18171887 For next: 211027 Since: 03-15-04 From: Canada, w00t! LOL FAD Since last post: 2 hours Last activity: 2 hours |
| ||
For me it takes... Oh right, it doesn't, because it's 2GB and only contains one component I'd ever want to use. Seriously, getting a bit off topic? |
|||
Dekker Avesque Goomba Level: 10 Posts: 32/32 EXP: 3754 For next: 660 Since: 08-29-04 Since last post: 190 days Last activity: 13 days |
| ||
I used to use ResourceHacker for resource editing, but of course it can only edit pre-existing resources within executables. When I heard the project was becoming inactive, I decided to move onto another editor, and I found PE Resource Explorer. It can edit exes, dlls, res files, etc... But it can also create new resources, dialogs included. Check it out, I like it a lot. I'm sure you can find it on google if you search "PE Resource Explorer". |
|||
HyperLamer <||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people Sesshomaru Tamaranian Level: 118 Posts: 4286/8210 EXP: 18171887 For next: 211027 Since: 03-15-04 From: Canada, w00t! LOL FAD Since last post: 2 hours Last activity: 2 hours |
| ||
Thanks, I'll try that next time I get work on a project that needs a GUI. As long as we're discussing C, is this possible? const char x[] = "Text: "; What I want is to NOT have a null terminator at the end of x, so that it flows right into y, and the above would print "Text: Hey, it's text". Any way to do that? Also, how can I make a function with a variable number of arguments like printf()? (Actually, I'm just making something like printf() but with one extra argument, in case that helps. ) |
|||
sloat Level: 16 Posts: 44/85 EXP: 18044 For next: 2212 Since: 05-21-04 From: South Central Delaware Since last post: 19 days Last activity: 5 hours |
| ||
to get a string to run in to the next variable -- which probably isn't a great idea -- specify a length of the string without giving space for a null char, or allocate it by characters. i didn't test this, but it should work:
for variable arguments, there is a macro called va_start in stdarg.h. i can't ever remember how to use it or any of the related macros, so i can't really help any further. |
|||
HyperLamer <||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people Sesshomaru Tamaranian Level: 118 Posts: 4287/8210 EXP: 18171887 For next: 211027 Since: 03-15-04 From: Canada, w00t! LOL FAD Since last post: 2 hours Last activity: 2 hours |
| ||
[edit] Ok... The problem just kinda disappeared when I fixed a missing bracket in another function in a completely different file. [/edit] Ooh, here's another, very interesting one: BYTE ReadMemory(int Addr, int AccessType) The first if statement is fine, but when it gets to the second one, suddenly Addr is undeclared and the function returns void (warns me about returning a value in a function that doesn't). As for the null-less string thing, it looks like it worked (no errors) but I can't very well tell with this problem. (edited by R2H2 on 04-25-05 04:29 PM) |
|||
Parasyte Bullet Bill Level: 35 Posts: 470/514 EXP: 267348 For next: 12588 Since: 05-25-04 Since last post: 104 days Last activity: 32 days |
| ||
"ROMBank" appears to be undeclared (unless it's global? Odd...) As for running a string over into another array, what the hell? That has to be one of the worst ideas I've ever heard from you. Just use a pointer to point into the array. Like so: char x[64] = "Text: "; //be sure to allocate enough memory Then you can strcpy(y, ...) or whatever all you want! OH! Forgot to reply to the stdarg question. To use stdarg, first include the header. (obviously) Then not so obviously, use the va_ macros to define where the variable arg list begins, and how to use them. Since you plan to 'extend' the capability of printf(), you can just use vprintf() along with the va_ macros: void myprintf(int myextension, char *fmt, ...) { Something to that effect. To break this function down: a va_list is declared, named 'list'. The va_start macro is issued, passing the list, along with the very last argument to the function. This will set up the variable arg list to point to whatever arguments are referenced after that last arg. Therefore, it is critical to always use the LAST arg to the function when using the va_start macro. Then vprintf() is called, which works like printf() with the exception that the variable args are passed as a va_list, rather than actual args. Then the list is cleaned with the issue of the va_end macro. And finally, whatever extended args you want included in the function can be added right to the beginning. In this example, I made an integer named myextention, which is simply printed before the "fmt" (formatted) text. There's no real purpose for that, it's just an example. (edited by Parasyte on 04-26-05 10:33 AM) (edited by Parasyte on 04-26-05 10:36 AM) |
|||
HyperLamer <||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people Sesshomaru Tamaranian Level: 118 Posts: 4291/8210 EXP: 18171887 For next: 211027 Since: 03-15-04 From: Canada, w00t! LOL FAD Since last post: 2 hours Last activity: 2 hours |
| ||
Hah, I should have thought of that. And yes, it is global. Any idea why DIB sections might draw wrong? Say I write 0xFFFFFF into the bitmap; rather than drawing one white pixel it draws one red, one green and one blue! I'll post more info later; I need to go and can't get into my FTP anyway. |
|||
Dish Spiny Level: 38 Posts: 368/596 EXP: 355646 For next: 14801 Since: 03-15-04 From: Disch Since last post: 18 days Last activity: 18 days |
| ||
You must just be doing your pointer handling wrong. I can't think of how writing 0xFFFFFF would draw a red green and blue pixel though, that's pretty strange. What depth bitmaps are you using? 32/16/8-bit? You can do 24 bit too but it's harder to work with (to the point of not being practical). | |||
HyperLamer <||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people Sesshomaru Tamaranian Level: 118 Posts: 4292/8210 EXP: 18171887 For next: 211027 Since: 03-15-04 From: Canada, w00t! LOL FAD Since last post: 2 hours Last activity: 2 hours |
| ||
It's 24. Here's what I was doing, it's a bit messy at the moment though:BYTE GFX0[2][0x1800]; //8000 - 97FF Tiles |
|||
Dish Spiny Level: 38 Posts: 369/596 EXP: 355646 For next: 14801 Since: 03-15-04 From: Disch Since last post: 18 days Last activity: 18 days |
| ||
int* MainBMPData = 0; MainBMPData[(Addr + (3*i))] = (Colour[p] & 0xFF); MainBMPData[(Addr + (3*i)) + 1] = ((Colour[p] & 0xFF00) >> 8); MainBMPData[(Addr + (3*i)) + 2] = ((Colour[p] & 0xFF0000) >> 16); There's your problem. MainBMPData is an int pointer -- you're treating it as though it was a BYTE pointer. The index you're using (Addr + (3*i and all that jazz ) is really being multiplied by 4 (or really sizeof(int)) by the index -- instead of being multiplied by 1 (sizeof(BYTE)) which it looks like you want. Furthermore each one of your writse is actually writing 4 bytes to the buffer! Not 1 byte like you seemed to want. And furthermore -- this code is exactly why 24-bit bitmaps are stupid to work with. Save yourself a headache and make it a 32-bit bitmap with following code:
as you can see -- much simpler -- much less errorprone -- much faster. Slightly more mem -- but if that's a huge problem go with 16-bit bitmaps (just be sure to change the pointer to a short then). The quality loss is almost never noticable. |
|||
Parasyte Bullet Bill Level: 35 Posts: 475/514 EXP: 267348 For next: 12588 Since: 05-25-04 Since last post: 104 days Last activity: 32 days |
| ||
Disch seems to have covered all of your problems, there. One thing I'd like to point out: Though drawing 32-bit bitmaps using 32-bit writes is much faster than drawing 24-bit bitmaps using 8-bit writes, it is still very important to note that the actual rendering speed is completely left up to GDI. GDI will have to do color-depth convertions if the bitmap's color depth does not match the desktop. Whatever the case, 32-bit and 8-bit bitmaps tend to be the fastest for GDI to render. And if you will not use more than 256 colors, I highly recommend using 8-bit, instead. (edited by Parasyte on 04-27-05 09:07 PM) |
|||
HyperLamer <||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people Sesshomaru Tamaranian Level: 118 Posts: 4293/8210 EXP: 18171887 For next: 211027 Since: 03-15-04 From: Canada, w00t! LOL FAD Since last post: 2 hours Last activity: 2 hours |
| ||
I'm not sure about 8-bit; as you can maybe tell it's a Gameboy emulator, and GBC uses 15-bit colours. I figure I'll need at least 16 (though I could get away with 8 in non-colour mode). Will I need to define a palette for those though, or do they have a default one? Good point about the desktop colour matching too; I'll probably end up writing something to match the current colour settings. And thanks for pointing out the pointer (no pun intended). I keep forgetting that int pointers increment by the size of an int. [edit] Er, what exactly does the 4th byte do in 32-bit colour? Depending what I set it to in each colour, different colours will show up or not, and no matter what combination I use everything shows up blue. (edited by R2H2 on 04-28-05 06:12 AM) |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 2944/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
The 4th byte in 32-bit coloring is the alpha bit for alpha transparency. If you set those 8 bits to be all 1, you have 100% transparency i believe. As for having all blue, why don't you print out the hex you are sending to the painter... |
|||
Dish Spiny Level: 38 Posts: 372/596 EXP: 355646 For next: 14801 Since: 03-15-04 From: Disch Since last post: 18 days Last activity: 18 days |
| ||
Sometimes. I'm pretty sure that 32bit DIBs don't use the 4th byte at all (at least BitBlt doesn't when blitting -- maybe AlphaBlt or some other function does). In the case where Alpha blending is used... 0 would be fully transparent, FF would be opaque, with values inbetween being the degree of transluscensy (sp) -- but like I said I really don't think this applies to windows DIBs -- not unless you load them to D3D textures or something. As for your blue problem -- you're not still writing byte-at-a-time are you? if you have a 32-bit bitmap, you can write each pixel in full with a single write to a long buffer (each 32-bit long would represent 1 pixel -- you can treat the array of longs as a direct array to the pixels). Byte order might also be a problem -- Low byte is blue, 2nd low byte is green, 2nd high byte is red, and high byte is unused (or A). so 0x00FF0000 is full red, 0x000000FF is full blue. But keep in mind that it uses little endian, so the blue value is stored first: FF 00 00 00 = 0x000000FF = full blue |
|||
HyperLamer <||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people Sesshomaru Tamaranian Level: 118 Posts: 4294/8210 EXP: 18171887 For next: 211027 Since: 03-15-04 From: Canada, w00t! LOL FAD Since last post: 2 hours Last activity: 2 hours |
| ||
Ah, found it... Another pointer problem. I had changed MainBMPData to a byte pointer for the 24-bit colour and forgot to change it back. | |||
Parasyte Bullet Bill Level: 35 Posts: 477/514 EXP: 267348 For next: 12588 Since: 05-25-04 Since last post: 104 days Last activity: 32 days |
| ||
8-bit bitmaps use a colour table. The color table is an array of RGBQUADs, so you can still use your 15-bit colors with it. I believe GBC can only display 56 colors at once (without funky scanline effects). However, now that you mention this is an emualtor, I recommend using something like SDL, rather than GDI. GDI will be far too slow. |
Pages: 1 2 3 4 | Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - I need a resource editor! | | | |