Files
itgmania212121/stepmania/src/ScreenTest.cpp
T

76 lines
1.8 KiB
C++
Raw Normal View History

2003-02-16 04:01:45 +00:00
#include "global.h"
/*
-----------------------------------------------------------------------------
File: ScreenTest.h
Desc: Area for testing.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
Glenn Maynard (OpenGL Code)
Lance Gilbert (OpenGL/Usability Modifications)
-----------------------------------------------------------------------------
*/
2003-02-16 04:01:45 +00:00
#include "global.h"
#include "ScreenTest.h"
#include "ScreenSandbox.h"
#include "ScreenTestSound.h"
#include "ScreenTestFonts.h"
#include "ScreenManager.h"
2003-07-26 23:05:16 +00:00
#include "RageSounds.h"
ScreenTest::~ScreenTest()
{
delete current;
}
void ScreenTest::SetScreen(int num)
{
cur_screen = num;
delete current;
if(num > 2) num = 0;
if(num == 0)
2003-09-27 22:30:51 +00:00
current=new ScreenSandbox("ScreenSandbox");
else if(num == 1)
2003-09-27 22:30:51 +00:00
current=new ScreenTestSound("ScreenTestSound");
else if(num == 2)
2003-09-27 22:30:51 +00:00
current=new ScreenTestFonts("ScreenTestFonts");
}
2003-09-27 22:30:51 +00:00
ScreenTest::ScreenTest( CString sClassName ) : Screen( sClassName )
{
current = NULL;
cur_screen = -1;
2003-07-26 23:05:16 +00:00
SOUND->StopMusic();
SetScreen(0);
}
2003-01-25 03:40:58 +00:00
void ScreenTest::Update(float f) { current->Update(f); Screen::Update(f); }
void ScreenTest::HandleScreenMessage( const ScreenMessage SM ) { current->HandleScreenMessage(SM); }
void ScreenTest::Draw() { current->Draw(); }
void ScreenTest::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
if(DeviceI.device == DEVICE_KEYBOARD)
{
if(DeviceI.button >= SDLK_F9 && DeviceI.button <= SDLK_F12)
{
if( type != IET_FIRST_PRESS ) return;
SetScreen(DeviceI.button - SDLK_F9);
return;
}
if(DeviceI.button == SDLK_ESCAPE)
{
if( type != IET_FIRST_PRESS ) return;
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
return;
}
}
current->Input( DeviceI, type, GameI, MenuI, StyleI );
}