Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

shalrath

yet another memory read error

This topic is 5422 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The final line of the code i''ve posted is where my program crashes, on it''s first iteration. Can anyone see anything wrong with the code itself, or is there likely to be a problem with the data I''m sending it?
void CalcWorldLight(vertex_t **ob, light_t *lights, int wverts, int hverts, int numlights)
{
	int vwcnt, vhcnt, lcnt;

	for (vwcnt = 0; vwcnt <= wverts; vwcnt++)
	{
		for (vhcnt = 0; vhcnt <= hverts; vhcnt++)
		{
			ob[vwcnt][vhcnt].final_colour = ob[vwcnt][vhcnt].colour.emissive;

Share this post


Link to post
Share on other sites
Advertisement
Try doing it with a single dimension array first. Also be sure to check if you''re actually getting a valid pointer and not a null/random value.

Check to see if it''s the ob[][].colour.emissive or the ob[][].final_color that''s actually throwing the error.

As I detest multi-dimensional arrays (personal preference) I can''t vouch for the validity of your syntax (I don''t know if you wrote it properally). Looks fine from what I see.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!