merge from some old revision (forgot to commit)

This commit is contained in:
Thai Pangsakulyanont
2011-09-09 08:58:01 +07:00
52 changed files with 429 additions and 173 deletions
+2 -2
View File
@@ -1589,7 +1589,7 @@ static const Style g_Style_Beat_Versus5 =
false, // m_bUsedForEdit
true, // m_bUsedForDemonstration
false, // m_bUsedForHowToPlay
"versus", // m_szName
"versus5", // m_szName
StepsType_beat_versus5, // m_StepsType
StyleType_TwoPlayersTwoSides, // m_StyleType
6, // m_iColsPerPlayer
@@ -1725,7 +1725,7 @@ static const Style g_Style_Beat_Versus7 =
true, // m_bUsedForEdit
false, // m_bUsedForDemonstration
false, // m_bUsedForHowToPlay
"single7", // m_szName
"versus7", // m_szName
StepsType_beat_versus7, // m_StepsType
StyleType_TwoPlayersTwoSides, // m_StyleType
8, // m_iColsPerPlayer
+6 -2
View File
@@ -198,19 +198,23 @@ void MenuTimer::SetText( float fSeconds )
class LunaMenuTimer: public Luna<MenuTimer>
{
public:
static int setseconds( T* p, lua_State *L ) { p->SetSeconds(FArg(1)); return 0; }
static int SetSeconds( T* p, lua_State *L ) { p->SetSeconds(FArg(1)); return 0; }
static int GetSeconds( T* p, lua_State *L ) { lua_pushnumber( L, p->GetSeconds() ); return 1; }
static int start( T* p, lua_State *L ) { p->Start(); return 0; }
static int pause( T* p, lua_State *L ) { p->Pause(); return 0; }
static int stop( T* p, lua_State *L ) { p->Stop(); return 0; }
static int disable( T* p, lua_State *L ) { p->Disable(); return 0; }
static int silent( T* p, lua_State *L ) { p->EnableSilent(BArg(1)); return 0; }
static int stealth( T* p, lua_State *L ) { p->EnableStealth(BArg(1)); return 0; }
LunaMenuTimer()
{
ADD_METHOD( setseconds );
ADD_METHOD( SetSeconds );
ADD_METHOD( GetSeconds );
ADD_METHOD( start );
ADD_METHOD( pause );
ADD_METHOD( stop );
ADD_METHOD( disable );
ADD_METHOD( silent );
ADD_METHOD( stealth );
}
+2
View File
@@ -54,9 +54,11 @@ bool NotesLoader::LoadFromDir( const RString &sPath, Song &out, set<RString> &Bl
BMSLoader::GetApplicableFiles( sPath, list );
if( !list.empty() )
return BMSLoader::LoadFromDir( sPath, out );
/*
PMSLoader::GetApplicableFiles( sPath, list );
if( !list.empty() )
return PMSLoader::LoadFromDir( sPath, out );
*/
KSFLoader::GetApplicableFiles( sPath, list );
if( !list.empty() )
return KSFLoader::LoadFromDir( sPath, out );
+2 -1
View File
@@ -272,7 +272,8 @@ RString GetInfoLog( GLhandleARB h )
{
GLint iLength;
glGetObjectParameterivARB( h, GL_OBJECT_INFO_LOG_LENGTH_ARB, &iLength );
if (!iLength)
if( iLength <= 0 )
return RString();
GLcharARB *pInfoLog = new GLcharARB[iLength];
+5
View File
@@ -21,8 +21,13 @@
#pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */
#else
extern "C" {
#if defined(MACOSX)
#include <../extern/libjpeg/jpeglib.h>
#include <../extern/libjpeg/jerror.h>
#else
#include "jpeglib.h"
#include "jerror.h"
#endif
}
#endif
+4
View File
@@ -12,7 +12,11 @@ namespace jpeg
{
extern "C"
{
#if defined(MACOSX)
#include <../extern/libjpeg/jpeglib.h>
#else
#include "jpeglib.h"
#endif
}
}
-1
View File
@@ -2173,7 +2173,6 @@ void ScreenGameplay::Input( const InputEventPlus &input )
{
//LOG->Trace( "ScreenGameplay::Input()" );
// codes motherfucker, do you speak it
Message msg("");
if( m_Codes.InputMessage(input, msg) )
this->HandleMessage( msg );
+13 -2
View File
@@ -1327,8 +1327,19 @@ public:
return 1;
}
//FSX's WIP code, don't touch
//static int SetOptio
/*FSX's WIP code, touch if it's wrong (which it probably is)
static int SetOptionRowFromName( T* p, lua_State *L )
{
FOREACH_PlayerNumber( pn )
{
for( unsigned i=0; i<m_pRows.size(); i++ )
{
if( m_pRows[i]->GetRowTitle() == SArg(1) && m_pRows[i]->GetRowDef().IsEnabledForPlayer(p) )
p->MoveRowAbsolute(pn,i)
}
}
}
*/
LunaScreenOptions()
{
+1 -1
View File
@@ -14,7 +14,7 @@ public:
LightsDriver() {};
virtual ~LightsDriver() {};
virtual void Set( const LightsState *ls ) = 0;
};
+1 -1
View File
@@ -12,7 +12,7 @@ public:
LightsDriver_Export();
virtual void Set( const LightsState *ls );
/* Get the current lights state. This can be called from a thread. */
// Get the current lights state. This can be called from a thread.
static LightsState GetState();
private:
@@ -1,9 +1,6 @@
//
// LightsDriver_LinuxParallel - Parallel Port Based Lights Driver for Linux
//
// This requires root permissions to work! (run as root or suid)
// This code was written using SystemMessage Driver as template.
//
/* LightsDriver_LinuxParallel - Parallel Port Based Lights Driver for Linux
* This requires root permissions to work! (run as root or suid)
* This code was written using SystemMessage Driver as template. */
#include "global.h"
#include <sys/io.h>
@@ -12,6 +9,7 @@
#include "InputMapper.h"
#include "Game.h"
// xxx: don't hardcode the port address. -aj
static const int PORT_ADDRESS = 0x378;
static const bool SCREEN_DEBUG = false;
@@ -19,7 +17,7 @@ REGISTER_SOUND_DRIVER_CLASS(LinuxParallel);
LightsDriver_LinuxParallel::LightsDriver_LinuxParallel()
{
// Give port's permissions and reset all bits to zero
// Give ports permissions and reset all bits to zero
ioperm( PORT_ADDRESS, 1, 1 );
outb( 0, PORT_ADDRESS );
}
@@ -36,7 +34,7 @@ void LightsDriver_LinuxParallel::Set( const LightsState *ls )
// Set LightState to port
RString s;
// Prepare Screen Output too for debugging
// Prepare screen output too for debugging
s += "LinuxParallel Lights Driver Debug\n";
s += "Lights Mode: " + LightsModeToString(LIGHTSMAN->GetLightsMode()) + "\n";
@@ -75,7 +73,6 @@ void LightsDriver_LinuxParallel::Set( const LightsState *ls )
/*
* (c) 2004 Hugo Hromic M. <[email protected]>
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
+42 -25
View File
@@ -11,7 +11,7 @@
REGISTER_SOUND_DRIVER_CLASS(LinuxWeedTech);
// Begin serial driver //
// Begin serial driver
static int fd = -1;
static LightsState CurLights;
@@ -45,7 +45,7 @@ static inline void SerialOpen()
{
// Make sure we've not already opened the port
SerialClose();
// Open a fresh instance..
fd = open( "/dev/ttyS0", O_WRONLY | O_NOCTTY | O_NDELAY );
if( fd < 0 )
@@ -58,16 +58,14 @@ static inline void SerialOpen()
tcgetattr( fd, &my_termios );
tcflush( fd, TCIFLUSH );
my_termios.c_cflag = B9600 | CS8 | CLOCAL | HUPCL;
cfsetospeed( &my_termios, B9600 );
tcsetattr( fd, TCSANOW, &my_termios );
}
}
// End serial driver //
/* Module maps
/* Module maps (Dance mode)
MODULE #A
Channel A: Marquee (Up-Left)
Channel B: Marquee (Up-Right)
@@ -101,7 +99,6 @@ static inline void SerialOpen()
Channel N: <not used>
*/
LightsDriver_LinuxWeedTech::LightsDriver_LinuxWeedTech()
{
// Open port
@@ -131,7 +128,7 @@ void LightsDriver_LinuxWeedTech::Set( const LightsState *ls )
// Re-used var's
char str[6] = { 0x00, 0x00, 0x00, '1', 0x0d, 0x00 };
bool bOn = false;
{
LightsMode lm = LIGHTSMAN->GetLightsMode();
if( lm == LIGHTSMODE_GAMEPLAY )
@@ -144,10 +141,10 @@ void LightsDriver_LinuxWeedTech::Set( const LightsState *ls )
bOn |= ls->m_bCabinetLights[cl];
CurLights.m_bCabinetLights[cl] = ls->m_bCabinetLights[cl];
}
str[0]='A';
str[1]='W';
if( bOn )
{
str[2]='C';
@@ -158,13 +155,13 @@ void LightsDriver_LinuxWeedTech::Set( const LightsState *ls )
str[2]='0';
str[3]='0';
}
// Send command
puts( str );
SerialOut( str, 6 );
return;
}
FOREACH_CabinetLight( cl )
{
// Only send the command if the light has changed states (on/off)
@@ -177,13 +174,12 @@ void LightsDriver_LinuxWeedTech::Set( const LightsState *ls )
else if(cl == LIGHT_MARQUEE_LR_RIGHT) {str[0] = 'A'; str[2] = 'D';}
else if(cl == LIGHT_BASS_LEFT) {str[0] = 'A'; str[2] = 'G';}
else if(cl == LIGHT_BASS_RIGHT) {str[0] = 'A'; str[2] = 'H';}
if( bOn )
str[1]='L';
else
str[1]='H';
if( str[0] != 0x00 )
{
SerialOut( str, 6 );
@@ -193,7 +189,7 @@ void LightsDriver_LinuxWeedTech::Set( const LightsState *ls )
}
}
}
FOREACH_ENUM( GameController, gc )
{
FOREACH_ENUM( GameButton, gb )
@@ -204,23 +200,20 @@ void LightsDriver_LinuxWeedTech::Set( const LightsState *ls )
if(gc == GameController_1) {
if(gb == DANCE_BUTTON_LEFT) {str[0] = 'A'; str[2] = 'I';}
if(gb == DANCE_BUTTON_RIGHT) {str[0] = 'A'; str[2] = 'J';}
if(gb == DANCE_BUTTON_UP) {str[0] = 'A'; str[2] = 'K';}
if(gb == DANCE_BUTTON_UP) {str[0] = 'A'; str[2] = 'K';}
if(gb == DANCE_BUTTON_DOWN) {str[0] = 'A'; str[2] = 'L';}
if(gb == GAME_BUTTON_START) {str[0] = 'A'; str[2] = 'E';}
}
else if(gc == GameController_2) {
if(gb == DANCE_BUTTON_LEFT) {str[0] = 'A'; str[2] = 'M';}
if(gb == DANCE_BUTTON_RIGHT) {str[0] = 'A'; str[2] = 'N';}
if(gb == DANCE_BUTTON_UP) {str[0] = 'B'; str[2] = 'A';}
if(gb == DANCE_BUTTON_UP) {str[0] = 'B'; str[2] = 'A';}
if(gb == DANCE_BUTTON_DOWN) {str[0] = 'B'; str[2] = 'B';}
if(gb == GAME_BUTTON_START) {str[0] = 'A'; str[2] = 'F';}
}
if( bOn )
str[1]='L';
else
str[1]='H';
str[1] = bOn ? 'L' : 'H';
if( str[0] != 0x00 )
{
//SerialOut(str, 6);
@@ -230,5 +223,29 @@ void LightsDriver_LinuxWeedTech::Set( const LightsState *ls )
}
}
}
}
/*
* (c) 2003-2004 Kevin Slaughter
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+3 -5
View File
@@ -1,7 +1,5 @@
/*
* LightsDriver_LinuxWeedTech: Control lights with WTDIO-M from Weeder Technologies
* http://www.weedtech.com
*/
/* LightsDriver_LinuxWeedTech: Control lights with WTDIO-M from Weeder Technologies
* http://www.weedtech.com / http://www.weedtech.com/wtdio-m.html */
#ifndef LightsDriver_LinuxWeedTech_H
#define LightsDriver_LinuxWeedTech_H
@@ -13,7 +11,7 @@ class LightsDriver_LinuxWeedTech : public LightsDriver
public:
LightsDriver_LinuxWeedTech();
virtual ~LightsDriver_LinuxWeedTech();
virtual void Set( const LightsState *ls );
};
@@ -20,7 +20,7 @@ void LightsDriver_SystemMessage::Set( const LightsState *ls )
return;
RString s;
s += LightsModeToString(LIGHTSMAN->GetLightsMode()) + "\n";
s += "Cabinet: ";
+2 -1
View File
@@ -1,3 +1,4 @@
/* LightsDriver_SystemMessage: Outputs light state as a system message. */
#ifndef LightsDriver_SystemMessage_H
#define LightsDriver_SystemMessage_H
@@ -8,7 +9,7 @@ class LightsDriver_SystemMessage : public LightsDriver
public:
LightsDriver_SystemMessage();
virtual ~LightsDriver_SystemMessage();
virtual void Set( const LightsState *ls );
};
@@ -13,6 +13,7 @@ typedef short int (WINAPI ISDRIVERINSTALLED)();
ISDRIVERINSTALLED* IsDriverInstalled = NULL;
const int LIGHTS_PER_PARALLEL_PORT = 8;
// xxx: don't hardcode the port addresses. -aj
const int MAX_PARALLEL_PORTS = 3;
short LPT_ADDRESS[MAX_PARALLEL_PORTS] =
{
@@ -48,7 +49,7 @@ LightsDriver_Win32Parallel::LightsDriver_Win32Parallel()
MessageBox(NULL, "Could not LoadLibrary( parallel_lights_io.dll ).", "ERROR", MB_OK );
return;
}
//Get the function pointers
PortOut = (PORTOUT*) GetProcAddress(hDLL, "PortOut");
IsDriverInstalled = (ISDRIVERINSTALLED*) GetProcAddress(hDLL, "IsDriverInstalled");
@@ -83,7 +84,7 @@ void LightsDriver_Win32Parallel::Set( const LightsState *ls )
data[lpt] &= ~mask;
}
}
FOREACH_ENUM( GameController, gc )
{
FOREACH_ENUM( GameButton, gb )
+3 -5
View File
@@ -1,7 +1,5 @@
/*
* LightsDriver_Win32Parallel - Control lights with Kit 74:
* http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=kit+74+relay
*/
/* LightsDriver_Win32Parallel - Control lights with Kit 74:
* http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=kit+74+relay */
#ifndef LightsDriver_Win32Parallel_H
#define LightsDriver_Win32Parallel_H
@@ -13,7 +11,7 @@ class LightsDriver_Win32Parallel : public LightsDriver
public:
LightsDriver_Win32Parallel();
virtual ~LightsDriver_Win32Parallel();
virtual void Set( const LightsState *ls );
};