File: SplashWidget.h

package info (click to toggle)
arkrpg 0.1.4b-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,104 kB
  • ctags: 5,445
  • sloc: cpp: 28,145; sh: 9,006; ansic: 3,259; makefile: 344
file content (42 lines) | stat: -rw-r--r-- 951 bytes parent folder | download | duplicates (3)
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
#ifndef SPLASH_WIDGET_H
#define SPLASH_WIDGET_H

#include <Client/Widget.h>

namespace Client
{
   // Draw the splashscreen.
   class SplashWidget : public Widget
   {
      public:
	 virtual ~SplashWidget() {}

	 virtual void Render(UIRenderer *ui)
	 {
	    // FIXME : splash shouldnt be of the same size than the normal game
	    // window, and DrawTexturedRectangle coordinates shouldnt be
	    // hardcoded that would fix the problem with the splashscreen if
	    // the x/y factors dont match
	    Ark::TexturePtr tex;
	    int width = Ark::Sys()->Cfg()->GetInt ("renderer::Width", 800);
            int height = Ark::Sys()->Cfg()->GetInt ("renderer::Height", 600);
	    
	    ui->Rdr()->GetCache().Get (Ark::V_TEXTURE,
				       "{game}/data/misc/splashscreen.jpg",
				       tex);

	    if (tex)
	    {
		tex->Configure();

		ui->SetTexture (tex);
		ui->DrawTexturedRectangle(0, 0, width, height);
		ui->Flush();
	    }

	 }

   };
}

#endif