Exemplo n.º 1
0
// seg000:0D20
void __pascal far load_lev_spr(int level) {
	dat_type* dathandle;
	short guardtype;
	char filename[20];
	dathandle = NULL;
	current_level = next_level = level;
	draw_rect(&screen_rect, 0);
	free_optsnd_chtab();
	snprintf(filename, sizeof(filename), "%s%s.DAT",
		tbl_envir_gr[graphics_mode],
		tbl_envir_ki[tbl_level_type[current_level]]
	);
	load_chtab_from_file(id_chtab_6_environment, 200, filename, 1<<5);
	load_more_opt_graf(filename);
	guardtype = tbl_guard_type[current_level];
	if (guardtype != -1) {
		if (guardtype == 0) {
			dathandle = open_dat(tbl_level_type[current_level] ? "GUARD1.DAT" : "GUARD2.DAT", 0);
		}
		load_chtab_from_file(id_chtab_5_guard, 750, tbl_guard_dat[guardtype], 1<<8);
		if (dathandle) {
			close_dat(dathandle);
		}
	}
	curr_guard_color = 0;
	load_chtab_from_file(id_chtab_7_environmentwall, 360, filename, 1<<6);

	// Level colors (1.3)
	if (graphics_mode == gmMcgaVga && level_var_palettes != NULL) {
		int level_color = tbl_level_color[current_level];
		if (level_color != 0) {
			byte* env_pal = level_var_palettes + 0x30*(level_color-1);
			byte* wall_pal = env_pal + 0x30 * tbl_level_type[current_level];
			set_pal_arr(0x50, 0x10, (rgb_type*)env_pal, 1);
			set_pal_arr(0x60, 0x10, (rgb_type*)wall_pal, 1);
			set_chtab_palette(chtab_addrs[id_chtab_6_environment], env_pal, 0x10);
			set_chtab_palette(chtab_addrs[id_chtab_7_environmentwall], wall_pal, 0x10);
		}
	}

	/*if (comp_skeleton[current_level])*/ {
		load_opt_sounds(44, 44); // skel alive
	}
	/*if (comp_mirror[current_level])*/ {
		load_opt_sounds(45, 45); // mirror
	}
	/*if (comp_chomper[current_level])*/ {
		load_opt_sounds(46, 47); // something chopped, chomper
	}
	/*if (comp_spike[current_level])*/ {
		load_opt_sounds(48, 49); // something spiked, spikes
	}
}
Exemplo n.º 2
0
// seg001:0CCD
void __pascal far load_intro(int which_imgs,cutscene_ptr_type func,int free_sounds) {
	short current_star;
	draw_rect(&screen_rect, 0);
	if (free_sounds) {
		free_optional_sounds();
	}
	free_all_chtabs_from(id_chtab_3_princessinstory);
	load_chtab_from_file(id_chtab_8_princessroom, 950, "PV.DAT", 1<<13);
	load_chtab_from_file(id_chtab_9_princessbed, 980, "PV.DAT", 1<<14);
	current_target_surface = offscreen_surface;
	method_6_blit_img_to_scr(get_image(id_chtab_8_princessroom, 0), 0, 0, 0);
	method_6_blit_img_to_scr(get_image(id_chtab_9_princessbed, 0), 0, 142, blitters_2_or);

	// Free the images that are not needed anymore.
	free_all_chtabs_from(id_chtab_9_princessbed);
	SDL_FreeSurface(get_image(id_chtab_8_princessroom, 0));
	if (NULL != chtab_addrs[id_chtab_8_princessroom]) chtab_addrs[id_chtab_8_princessroom]->images[0] = NULL;

	load_chtab_from_file(id_chtab_3_princessinstory, 800, "PV.DAT", 1<<9);
	load_chtab_from_file(id_chtab_4_jaffarinstory_princessincutscenes,
	                     50*which_imgs + 850, "PV.DAT", 1<<10);
	for (current_star = 0; current_star < N_STARS; ++current_star) {
		draw_star(current_star, 0);
	}
	current_target_surface = onscreen_surface_;
	while (check_sound_playing()) {
		idle();
		do_paused();
		delay_ticks(1);
	}
	need_drects = 1;
	reset_cutscene();
	is_cutscene = 1;
	func();
	is_cutscene = 0;
	free_all_chtabs_from(3);
	draw_rect(&screen_rect, 0);
}
Exemplo n.º 3
0
// seg000:1D2C
void __pascal far load_kid_sprite() {
	load_chtab_from_file(id_chtab_2_kid, 400, "KID.DAT", 1<<7);
}