lesson 20 problem

The Partridge Family were neither partridges nor a family. Discuss.
rimvislt
Posts: 1
Joined: June 1st, 2012, 7:10 pm

lesson 20 problem

Post by rimvislt » June 1st, 2012, 7:14 pm

everything working perfect but in this function i get error

void Game::UpdateAnimation(AnimatedSpriteInstance* instance )
{
instance->currentFrame++;
if( instance->currentFrameExposure >= instance->templat->frameDuration)
{
instance->currentFrame++;
instance->currentFrame %= instance->templat->nFrames;
instance->currentFrameExposure = 0;
}

}

instance->currentFrame++; before if sentense if i comment it is working if not
err assertion failed expresion x<800

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: lesson 20 problem

Post by chili » June 2nd, 2012, 12:44 am

Shouldn't your first instance->currentFrame be instance->currentFrameExposure? ;)
Chili

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: lesson 20 problem

Post by Asimov » June 2nd, 2012, 3:30 pm

Hi,

I loved lession 20. Chilli made loading a bmp so simple while watching the video, but once the video is stopped could I do it on my own, no way man LOL.

I will be re-watching this. Would love to work out how to load pngs just for the transparency later.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: lesson 20 problem

Post by chili » June 3rd, 2012, 12:24 am

PNGs include compression that would make them a LOT more difficult to load than a raw bitmap. I recommend using library functions for stuff like this. The only reason we coded it from scratch was for the practice in file access (which we just learned in the previous lesson).
Chili

ghilllie
Posts: 72
Joined: May 2nd, 2012, 3:25 am

Re: lesson 20 problem

Post by ghilllie » June 3rd, 2012, 4:58 am

Asimov wrote:Hi,

I loved lession 20. Chilli made loading a bmp so simple while watching the video, but once the video is stopped could I do it on my own, no way man LOL.

I will be re-watching this. Would love to work out how to load pngs just for the transparency later.

Asimov
check out my topic here for loading png files you can also use .tga , .dds, .bmp, .jpg and some more...

However I somehow fuck up the file and put it to .iwd file extension you can just change the .iwd to .rar or use "open with" winrar to extract the file... I will be changing the download link to .rar when I'm home since the shitty internet connection of mine here in the office can not handle downloading files into mediafire...
Chili++ for President :)

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: lesson 20 problem

Post by Asimov » June 3rd, 2012, 10:11 am

Hi ghillie,

I did download your file, and quickly deleted it when I saw iwd LOL. Thought it was some Mac format or something.

Will have a look it later.
I think I will leave pngs until I understand the basics, and then come back to them later to make my program pretty.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

ghilllie
Posts: 72
Joined: May 2nd, 2012, 3:25 am

Re: lesson 20 problem

Post by ghilllie » June 3rd, 2012, 10:21 am

yup it's iwd but that's because i am a modder of modern warfare 2 and i always think that i am modifying a game file and compressing using .iwd but that's actually compressed by winrar - so things are just the same except the file extension.

You are right that the basic building block of knowing programming is to understand or even master the basics first before going to complicated ones. But in some ways it's also helpful to become ahead a little bit some times... :-)
Chili++ for President :)

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: lesson 20 problem

Post by Asimov » June 3rd, 2012, 10:27 am

Hi ghillie,

My brother plays Modern Warfare three also. You will like my handgrenade in my Avatar then LOL, which I built in 3ds Max and only 700 polys.

I tend to build even my 2D graphics in 3ds max because I am better at 3D than I am at 2D. I made a 2D game called Thomthello and all the pieces were built in max. I made that with Codeblock, mingw compiler, C++ and the SDL framework though.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

ghilllie
Posts: 72
Joined: May 2nd, 2012, 3:25 am

Re: lesson 20 problem

Post by ghilllie » June 3rd, 2012, 1:35 pm

Good for you Asimov I myself can make 3d's using 3d's Max like organic modelling... it's a good tool when you are interested in games if you know modelling this is a Plus.

by the way I hate modern warfare 3, There's a bunch of cheaters around there. I love to play mw2 from 4D1 formerly alterIW since they enhanced the game and prevent cheaters...
Chili++ for President :)

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: lesson 20 problem

Post by LuX » June 3rd, 2012, 2:18 pm

I throw frisbee with MW discs... Only thing they are good for imo
ʕ •ᴥ•ʔ

Post Reply