moon example returns: structure has no member named 'w'

SGDK only sub forum

Moderator: Stef

Post Reply
d3javu
Newbie
Posts: 2
Joined: Fri Jun 27, 2014 8:48 am

moon example returns: structure has no member named 'w'

Post by d3javu » Fri Jun 27, 2014 10:18 am

Hi folks,

below is the code and moon header i'm trying but for some reason moon.h, moon.w and moon.image giving error:
Field 'w' could not be resolved and structure has no member named 'w'"

any idea? did i missed something? :?

Code: Select all

#include <genesis.h>
#include "moon.h"

int main()
{

	{
	        // get the image width (in pixel) ==> should be 8pix aligned
	        u16 w = moon.w;
	        // get the image height (in pixel)  ==> should be 8px aligned
	        u16 h = moon.h;

	        // get the palette data of moon
	        VDP_setPalette(PAL1, moon.palette->data);


	        // load bitmap data of moon in VRAM
	        // w/8 = width in tiles we want to load
	        // h/8 = height in tile we want to load
	        // w/8 = width in tiles of the bitamp
	        // the 3rd arg is needed because you could load only a part of the bitmap if you want but SGDK needs the width as reference
	        VDP_loadBMPTileData(moon.image, 1, w / 8, h / 8, w/8 );

        while(1)
        {
        	VDP_waitVSync();
        }
        return (0);
}


Code: Select all

#ifndef _MOON_H_
#define _MOON_H_

extern const Image moon;

#endif // _MOON_H_

    d3javu
    Newbie
    Posts: 2
    Joined: Fri Jun 27, 2014 8:48 am

    Solved

    Post by d3javu » Fri Jun 27, 2014 10:35 am

    Sorry, found my mistake. Used IMAGE instead of BITMAP in .res.

    Post Reply