File: simloadingscreen.h

package info (click to toggle)
simutrans 120.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 19,024 kB
  • sloc: cpp: 144,315; ansic: 2,782; makefile: 903; sh: 622
file content (53 lines) | stat: -rw-r--r-- 1,317 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * Copyright (c) 1997 - 2001 Hansjrg Malthaner
 *
 * This file is part of the Simutrans project under the artistic license.
 * (see license.txt)
 */

#ifndef SIMLOADINGSCREEN_H
#define SIMLOADINGSCREEN_H

#include "simtypes.h"
#include "tpl/slist_tpl.h"

struct event_t;

/**
 * Implements the loading screen related routines, in the aim of  centralize
 * all its code and make it more modular, as it was scattered across all code
 * before.
 * @author prissi converted the namespace code from Markohs
 * @note The functions are safe on non-initialized displays, it won't try to write
 * on a not existent buffer.
 */
class loadingscreen_t
{
private:
	const char *what, *info;
	uint32 progress, max_progress;
	int last_bar_len;
	bool show_logo;
	slist_tpl<event_t *> queued_events;

	// show the logo if requested and there
	void display_logo();

	// show everything but the logo
	void display();

public:
	loadingscreen_t( const char *what, uint32 max_progress, bool show_logo = false, bool continueflag = false );

	~loadingscreen_t();

	void set_progress( uint32 progress );

	void set_max( uint32 max ) { max_progress = max; }

	void set_info( const char *info ) { this->info = info; }

	void set_what( const char *what ) { this->what = what; }
};

#endif