Mirage Source

Free ORPG making software.
It is currently Sat Apr 27, 2024 10:21 pm

All times are UTC




Post new topic Reply to topic  [ 68 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Fri Mar 09, 2007 6:55 am 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
yep, definately correct, file extension is correct, i've registered and adding the dll to the references, the code is the exact code your pasted in the tutorial, i've set the variables, the files are in the right folders.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 6:57 am 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 10:07 pm
Posts: 327
Location: Washington
I didn't actually make this tutorial.. I believe it is Grim's tutorial, since I originally created the graphics system for him. ;)

But... I know that the height and width should not be 0.. See if setting both values to 128 (static, for testing purposes) will still error.. Then we shall know whether or not I am full of crap. :D


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 7:03 am 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
I used that 128 value. It lets me log on but the tiles are all screwed up. And I get an error when entering the map editor. I assume that 128 was just a test value and that'll be why these things are happening?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 7:07 am 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 10:07 pm
Posts: 327
Location: Washington
Yes.. Hmm... Try loading into DDSCAPS_SYSTEMMEMORY instead of DDSCAPS_VIDEOMEMORY. Let me know what the results are.. (Be sure to change those 128s back to what they were. :)

[Edit]
There I go, typing before I think again... Scratch the above, and I will see if I can figure it out.

[Edit]
Are you 100% certain that the file is encrypted? If you use the wrong password, or the file is not encrypted when you try to decrypt it, the bitmap utils byte data will become corrupt (until you load a new file..).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 7:17 am 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
I load up that encryption software you included, I type ogf into the extension box, and 47dn45 into the password box. I don't bother with compression, it's not important for now I don't think. Then I load the .bmp files until they are all encrypted into .ogf files in the gfx folder. I've changed the GFX_EXT to .ogf in the constants module, and used the code I pasted above.

If you want you can download Oasis Source from http://www.os.nevetsweb.com and try it in the source for yourself, you might find it easier to work out the problem that way, i dunno.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 7:18 am 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 10:07 pm
Posts: 327
Location: Washington
If you are not bothering to compress, then you shouldn't decompress either. ;)

Take out the BMUtil.DecompressByteData lines that don't apply, and then try it. :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 7:20 am 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
I want to use the compression, I just didn't think it was important while just testing. I've used the ZLib compression option before and still got the same error, i'll try the other one, see if it works.

[edit]
Ok I can log in with the NT Native compression, but I still get an invalid picture message on the map editor.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 7:27 am 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 10:07 pm
Posts: 327
Location: Washington
I got no errors when I used your code... How much RAM you got in your Vid Card?

[edit]
Bleh... Just realized why that was.. nevermind my above comment.. Looks like I got some coding to do. :P


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 7:33 am 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
I'll add this to a later version of Oasis Source then. It's not insanely important, but I guess it's a nice feature my users would like to have.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 7:56 am 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 10:07 pm
Posts: 327
Location: Washington
Okay...

Here's the thing.

1) I got that same error when I tried to unzip a zlib'd file with native decompression.. (DecompressByteData = Native NT decompression, DecompressByteData_ZLib = ZLib decompression)

2) The Invalid picture thing.. You are trying to load the picture from the now encrypted graphics file. What you need to do is change EditorInit() to look something like
Code:
Public Sub EditorInit()
    Dim DC As Long
   
    SaveMap = Map
    InEditor = True
    frmMapEditor.Visible = True
    frmMapEditor.picBackSelect.Cls
   
    DC = DD_TileSurf.GetDC
    With frmMapEditor.picBackSelect
        .Width = 7 * PIC_X
        .Height = 255 * PIC_Y
        Call BitBlt(.hdc, 0, 0, DDSD_Tile.lWidth, DDSD_Tile.lHeight, DC, 0, 0, SRCCOPY)
'        .Picture = LoadPicture(App.Path + GFX_PATH & "tiles" & GFX_EXT)
    End With
    Call DD_TileSurf.ReleaseDC(DC)
End Sub


You may need to look for other GFX_EXT calls in your code to make sure they aren't trying to load your encrypted graphics files into your picture boxes..

[Edit]
I apologize if this is unclear... It's late for me, and I need to go to bed... If you are still having difficulty with this, feel free to post, and I'll take another look at it tomorrow.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 9:38 am 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
I'll look here again after the weekend is over. I work late nights so don't get much time to do computer stuff over the weekend.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 09, 2007 2:57 pm 
Offline
Knowledgeable
User avatar

Joined: Sun May 28, 2006 10:07 pm
Posts: 327
Location: Washington
Okay... I'll try to explain some things about VWBitmapUtils..

Most errors that have to do with file format are eaten by the module for security purposes. If you put in the wrong password, you will not get an error, but your data will be corrupted. If you try to use Native NT DeCompression to decompress a file that was compressed with ZLib, you will not get an error. The same is true for using ZLib DeCompression to decompress a file that was compressed with Native NT Compression.

Here is what I think happened with your first problem:

1) You compressed and encrypted your graphics with the BMP Utils.exe program, using Encryption and ZLib compression.
2) You told the DirectX module to use the DecompressByteData() function when decompressing the data in the encrypted files, but DecompressByteData() is for Native NT Compression, so your data got corrupt.
3) When you tried to get the width/height of the bitmap in memory, it did a check to see if it was a valid bitmap file, and exited because it wasn't. (It may or may not have raised an error for you here.. Can't remember..)
4) Since the bitmap height and width were returned as 0, DirectX thought you were trying to create a surface with 0 size, and threw an error at you.

Once you switched to Native NT Compression, you got the invalid picture error.. This is because the DirectX module was using DecompressByteData(), and it got beyond the errors you were getting in the DirectX module before, and pushed you on to a new error where when you opened the map editor, it was trying to load the graphics from the bitmap file.. But since the bitmap file is now encrypted (Remember, we had to change the GFX_EXT... See the commented line in the code I provided in my prior post.) it couldn't find a valid image in the file.. The code I provided for you last night goes around that by grabbing the DC of the surface that already had that data stored in memory, and copying that data to the DC of the picture box (picbackselect) that you were trying to load the bitmap into. This process is actually faster than loading the bitmap into the map editor every time you open it, because the data is being copied from memory to memory, and you don't have to load it from disk. :)

I hope that explains things a little better.. If not, I'll check this thread later (after I get the kids off to school) and try (again) to explain it better. :P


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 12, 2007 12:50 am 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
Ok I got the map editor working, but I'll need you to help me fix the item editor and NPC editor (And anything else that loads the gfx into a picture/image box).

thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 12, 2007 1:56 am 
Offline
Pro

Joined: Mon May 29, 2006 2:58 pm
Posts: 370
common gameboy, you can figure it out based on the map editor

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 12, 2007 2:19 am 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
I tried using the source Verrigan posted in a similar manner but I still get an error. Unlike other people I actually attempt the problem at hand first before asking for code help.

I've stripped down the client to include no editors what-so-ever, so what I have now will work fine. I don't think the development kit needs this, as I would expect developers would need to look at the gfx files anyway.

So thanks for the help.


Top
 Profile  
 
PostPosted: Thu Jan 17, 2008 3:18 pm 
Offline
Regular
User avatar

Joined: Sun Jun 24, 2007 2:45 am
Posts: 62
Location: Texas, USA
Allright. Im attempting to add this... I have the same problem GameBoy was getting;

"Invalid Procedure Call or Arguement" On, Set DD_TileSurf = DD.CreateSurface(DDSD_Tile)

Ive set the GFX_EXT, and Im sure the password is correct. I used NT Native Compression. Although I hoverd over the imagehieght and imagewidth and there 0... I read were gameboy noted when he loaded the image as NT Native, it worked. Well, It's not for me... Any Help?

_________________
Image
Image


Top
 Profile  
 
PostPosted: Thu Jan 17, 2008 3:36 pm 
Offline
Pro
User avatar

Joined: Mon May 29, 2006 3:26 pm
Posts: 493
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com
Some times is a problem with dll/ocx registering.

_________________
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:
www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:
I love you and your computer.Marry me.


Top
 Profile  
 
PostPosted: Fri Jan 18, 2008 9:51 pm 
Offline
Regular
User avatar

Joined: Sun Jun 24, 2007 2:45 am
Posts: 62
Location: Texas, USA
Dragoons Master wrote:
Some times is a problem with dll/ocx registering.


Eh, Took it out and learned how to use resource files for images, Yet I don't understand DirectX Enough to blt from a resource file. So I added this again, and it worked. But It laggs extremley. Any reason why it would?

_________________
Image
Image


Top
 Profile  
 
PostPosted: Thu Mar 13, 2008 2:24 pm 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
wisefire wrote:
Dragoons Master wrote:
Some times is a problem with dll/ocx registering.


Eh, Took it out and learned how to use resource files for images, Yet I don't understand DirectX Enough to blt from a resource file. So I added this again, and it worked. But It laggs extremley. Any reason why it would?


Same here, I'm using seamless scrolling maps. Maybe that's an issue?


Top
 Profile  
 
PostPosted: Thu Mar 13, 2008 9:15 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
It shouldn't lag any more than it did before, so something must be wrong.

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
PostPosted: Fri Mar 14, 2008 6:58 pm 
Offline
Regular
User avatar

Joined: Sun Jun 24, 2007 2:45 am
Posts: 62
Location: Texas, USA
GameBoy wrote:
Same here, I'm using seamless scrolling maps. Maybe that's an issue?

Im using them too, That might be it?

_________________
Image
Image


Top
 Profile  
 
PostPosted: Tue Apr 08, 2008 2:54 am 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
bump?


Top
 Profile  
 
PostPosted: Tue Apr 08, 2008 3:16 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
William wrote:
It shouldn't lag any more than it did before, so something must be wrong.

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
PostPosted: Wed Apr 16, 2008 4:28 am 
Offline
Regular
User avatar

Joined: Sun Jun 24, 2007 2:45 am
Posts: 62
Location: Texas, USA
William wrote:
William wrote:
It shouldn't lag any more than it did before, so something must be wrong.


Like... What?

_________________
Image
Image


Top
 Profile  
 
PostPosted: Tue May 06, 2008 4:45 pm 
Offline
Regular
User avatar

Joined: Sun Jun 24, 2007 2:45 am
Posts: 62
Location: Texas, USA
How do you load a picture into a picbox that is incrypted?

Like, picSprites.Picture = LoadPicture(App.Path & "\Data\Graphics\sprites.dat")?

_________________
Image
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 68 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group