Help loading mappy level!!
I'm trying to use mappy to load a level and display it. I don't know how many of you are familier with mappy and it's built in functions but i'm having a bitch of a time getting this to work so I would appreciate some help.
The program compiles fine but when I run it the level does not load. the program displays a black screen for a second and than throws me back to the desktop.
I have the "TEST.FMP" file in the same directory as my exe so that isn't the problem. If someone could please take a look and point out exactly where and how i'm screwing up I'd be grateful.
Anyways here are my gameinit() and gamemain() functions (yes it is lamothe influenced)
int Game_Main()
{
// this is the main loop of the game, do all your processing
// here
int start_map_x, start_map_y, end_map_x, end_map_y;
// for now test if user is hitting ESC and send WM_CLOSE
if (KEYDOWN(VK_ESCAPE))
SendMessage(main_window_handle,WM_CLOSE,0,0);
Start_Clock();
DDraw_Fill_Surface(lpddsback, 0);
start_map_x = world_x/64;
start_map_y = world_y/64;
end_map_x = start_map_x + 10 - 1;
end_map_y = start_map_y + 7 - 1;
MapDrawBG(lpddsback, end_map_x, end_map_y);
DDraw_Flip();
Wait_Clock(30);
// return success or failure or your own return code here
return(1);
} // end Game_Main
////////////////////////////////////////////////////////////
int Game_Init()
{
// this is called once after the initial window is created and
// before the main event loop is entered, do all your initialization
// here
int index;
char filename[80];
DDraw_Init(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP);
MapLoad ("TEST.FMP", lpdd);
lpdd->CreatePalette(DDPCAPS_8BIT, mappept, &lpddpal, NULL);
lpddsprimary->SetPalette(lpddpal);
lpddsback->SetPalette(lpddpal);
RECT screen_rect = {0,0,screen_width,screen_height-32};
lpddclipper = DDraw_Attach_Clipper(lpddsback,1,&screen_rect);
ShowCursor(FALSE);
// return success or failure or your own return code here
return(1);
} // end Game_Init
Edited by - Brad on 1/4/00 11:50:00 PM
Well, Hmm.. i''m useing Mappy for my Tile based enignr and it work fine..
one problem i see is that this should be
int start_map_x, start_map_y, end_map_x, end_map_y;
cuz if not once the function loses scope then the int are reinit.
static int start_map_x, start_map_y, end_map_x, end_map_y;
if you want i can send you somd code to get you rolling
one problem i see is that this should be
int start_map_x, start_map_y, end_map_x, end_map_y;
cuz if not once the function loses scope then the int are reinit.
static int start_map_x, start_map_y, end_map_x, end_map_y;
if you want i can send you somd code to get you rolling
thanks for the offer but I have resolved my problem. The problem occured because of the clipper. Apparantly the mappy load level fuction would not work when I attached a clipper to the DDraw surface. I don''t know why.
Mappy is a tiled level editor. It allows you take tiled graphics and build levels using them. It supports some really nice features plus such as built in collision detection, parallex scrolling, and animated tiles.
Also there is a library available - mappydx I believe it's called. This provides you with functions of code that do things like load the map and draw it to the screen and so forth.
I really like the editor. It seems to be very versatile and it's the best one I've come across. However I have not been very successful in finding others who use it.
If you want more information the mappy homepage is at: http://www.rbsite.freeserve.co.uk/robmpy.htm
or you can e-mail me at vsickle@mill.tds.net and I'll try to answer any more questions you might have
Edited by - Brad on 1/15/00 4:27:47 PM
Also there is a library available - mappydx I believe it's called. This provides you with functions of code that do things like load the map and draw it to the screen and so forth.
I really like the editor. It seems to be very versatile and it's the best one I've come across. However I have not been very successful in finding others who use it.
If you want more information the mappy homepage is at: http://www.rbsite.freeserve.co.uk/robmpy.htm
or you can e-mail me at vsickle@mill.tds.net and I'll try to answer any more questions you might have
Edited by - Brad on 1/15/00 4:27:47 PM
Mappy is pretty cool. However, I have tried to optimize it as much as possible and it seems that I am getting nowhere with it. All I managed to do is increase the framerate from 29 fps to 31 fps. On a Pentium 200 with 2 megs vidram. (old system, I know). I haven''t rewriten anything yet, just optimized what was already done.
Anyways, what I wanted to ask was... What systems do you guys have and what framerate is it displaying on the test level. Just so I have something to compare mine to.
Anyways, what I wanted to ask was... What systems do you guys have and what framerate is it displaying on the test level. Just so I have something to compare mine to.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement