Ejemplo n.º 1
0
// seg001:0004
int __pascal far proc_cutscene_frame(int wait_frames) {
	cutscene_wait_frames = wait_frames;
	reset_timer(timer_0);
	do {
		set_timer_length(timer_0, cutscene_frame_time);
		play_both_seq();
		draw_proom_drects(); // changed order of drects and flash
		if (flash_time) {
			do_flash(flash_color);
		}
		if (flash_time) {
			--flash_time;
			remove_flash();
		}
		if (!check_sound_playing()) {
			play_next_sound();
		}
		do {
			if (!disable_keys && do_paused()) {
				stop_sounds();
				draw_rect(&screen_rect, 0);
#ifdef USE_FADE
				if (is_global_fading) {
					fade_palette_buffer->proc_restore_free(fade_palette_buffer);
					is_global_fading = 0;
				}
#endif
				return 1;
			}
#ifdef USE_FADE
			if (is_global_fading) {
				if (fade_palette_buffer->proc_fade_frame(fade_palette_buffer)) {
					fade_palette_buffer->proc_restore_free(fade_palette_buffer);
					is_global_fading = 0;
					return 2;
				}
			} else {
				idle();
				delay_ticks(1);
			}
#else
			idle();
#endif
		} while(!has_timer_stopped(timer_0)); // busy waiting?
	} while(--cutscene_wait_frames);
	return 0;
}
Ejemplo n.º 2
0
// seg000:09B6
void __pascal far draw_game_frame() {
	short var_2;
	if (need_full_redraw) {
		redraw_screen(0);
		need_full_redraw = 0;
	} else {
		if (different_room) {
			drawn_room = next_room;
			if (tbl_level_type[current_level]) {
				gen_palace_wall_colors();
			}
			redraw_screen(1);
		} else {
			if (need_redraw_because_flipped) {
				need_redraw_because_flipped = 0;
				redraw_screen(0);
			} else {
				memset_near(&table_counts, 0, sizeof(table_counts));
				draw_moving();
				draw_tables();
				if (is_blind_mode) {
					draw_rect(&rect_top, 0);
				}
				if (upside_down) {
					flip_screen(offscreen_surface);
				}
				while (drects_count--) {
					copy_screen_rect(&drects[drects_count]);
				}
				if (upside_down) {
					flip_screen(offscreen_surface);
				}
				drects_count = 0;
			}
		}
	}

	play_next_sound();
	// Note: texts are identified by their total time!
	if (text_time_remaining == 1) {
		// If the text's is about to expire:
		if (text_time_total == 36 || text_time_total == 288) {
			// 36: died on demo/potions level
			// 288: press button to continue
			// In this case, restart the game.
			start_level = 0;
			need_quotes = 1;
			start_game();
		} else {
			// Otherwise, just clear it.
			erase_bottom_text(1);
		}
	} else {
		if (text_time_remaining != 0 && text_time_total != 1188) {
			// 1188: potions level (page/line/word) -- this one does not disappear
			--text_time_remaining;
			if (text_time_total == 288 && text_time_remaining < 72) {
				// 288: press button to continue
				// Blink the message:
				var_2 = text_time_remaining % 12;
				if (var_2 > 3) {
					erase_bottom_text(0);
				} else {
					if (var_2 == 3) {
						display_text_bottom("Press Button to Continue");
						play_sound_from_buffer(sound_pointers[sound_38_blink]); // press button blink
					}
				}
			}
		}
	}
}