Skip to main content
gamedev.net
🔒 Locked

yet another memory read error

Started by shalrath Jan 16, 2004 at 12:56 AM 2 replies 300+ views
Original Post
shalrath
shalrath
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;
overflowed
overflowed
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.
emilk
emilk
<= -> <
MGB
MGB
lol - I thought that was a strange smiley until I worked out the problem myself

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.