Thorough(!) remodeling of the arch/ directory and the contents therein; fixed link-time warnings on GCC and should make things a lot easier to manage. A pile of other random things too, mostly cleanups and getting things to work with the remodeled arch/ directory.

This commit is contained in:
Ben Anderson
2005-03-14 06:44:38 +00:00
parent eaaace1f30
commit 0db665d4d6
95 changed files with 765 additions and 493 deletions
@@ -0,0 +1,89 @@
#include "LoadingWindow.h"
#include "global.h"
#include "RageLog.h"
#include "PrefsManager.h"
#include "Selector_LoadingWindow.h"
LoadingWindow *MakeLoadingWindow()
{
if( !PREFSMAN->m_bShowLoadingWindow )
return new LoadingWindow_Null;
/* Don't load NULL by default. On most systems, if we can't load the SDL
* loading window, we won't be able to init OpenGL, either, so don't bother. */
CString drivers = "xbox,win32,cocoa,gtk,sdl";
CStringArray DriversToTry;
split(drivers, ",", DriversToTry, true);
ASSERT( DriversToTry.size() != 0 );
CString Driver;
LoadingWindow *ret = NULL;
for(unsigned i = 0; ret == NULL && i < DriversToTry.size(); ++i)
{
Driver = DriversToTry[i];
#ifdef USE_LOADING_WINDOW_COCOA
if(!DriversToTry[i].CompareNoCase("Cocoa") ) ret = new LoadingWindow_Cocoa;
#endif
#ifdef USE_LOADING_WINDOW_GTK
if(!DriversToTry[i].CompareNoCase("Gtk") ) ret = new LoadingWindow_Gtk;
#endif
#ifdef USE_LOADING_WINDOW_NULL
if(!DriversToTry[i].CompareNoCase("Null") ) ret = new LoadingWindow_Null;
#endif
#ifdef USE_LOADING_WINDOW_SDL
if(!DriversToTry[i].CompareNoCase("SDL") ) ret = new LoadingWindow_SDL;
#endif
#ifdef USE_LOADING_WINDOW_WIN32
if(!DriversToTry[i].CompareNoCase("Win32") ) ret = new LoadingWindow_Win32;
#endif
#ifdef USE_LOADING_WINDOW_XBOX
if(!DriversToTry[i].CompareNoCase("Xbox") ) ret = new LoadingWindow_Xbox;
#endif
if( ret == NULL )
continue;
CString sError = ret->Init();
if( sError != "" )
{
LOG->Info("Couldn't load driver %s: %s", DriversToTry[i].c_str(), sError.c_str());
SAFE_DELETE( ret );
}
}
if(ret)
LOG->Info("Loading window: %s", Driver.c_str());
return ret;
}
/*
* (c) 2002-2004 Glenn Maynard
* 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,6 +3,8 @@
#ifndef LOADING_WINDOW_H
#define LOADING_WINDOW_H
#include "global.h"
struct RageSurface;
class LoadingWindow
{
@@ -15,6 +17,8 @@ public:
virtual void SetIcon( const RageSurface *pIcon ) { }
};
LoadingWindow *MakeLoadingWindow();
#endif
/*
@@ -1,7 +1,7 @@
/* LoadingWindow_Cocoa - Loading window for OSX */
#ifndef LOADING_WINDOW_COCOA
#define LOADING_WINDOW_COCOA
#ifndef LOADING_WINDOW_COCOA_H
#define LOADING_WINDOW_COCOA_H
#include "LoadingWindow.h"
@@ -17,10 +17,9 @@ public:
void Paint() {} /* Not needed */
void SetText( CString str ) { SetCocoaWindowText( str ); }
};
#define USE_LOADING_WINDOW_COCOA
#define HAVE_LOADING_WINDOW_COCOA
#endif /* LOADING_WINDOW_COCOA */
#endif
/*
* (c) 2003-2004 Steve Checkoway
@@ -15,8 +15,7 @@ public:
void SetText(CString str);
void Paint() { }
};
#define HAVE_LOADING_WINDOW_GTK
#define USE_LOADING_WINDOW_GTK
#endif
@@ -11,8 +11,7 @@ public:
void SetText(CString str) { }
void Paint() { }
};
#define HAVE_LOADING_WINDOW_NULL
#define USE_LOADING_WINDOW_NULL
#endif
@@ -14,8 +14,7 @@ public:
void Paint();
};
#define HAVE_LOADING_WINDOW_SDL
#define USE_LOADING_WINDOW_SDL
#endif
@@ -25,8 +25,7 @@ private:
static BOOL CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
};
#define HAVE_LOADING_WINDOW_WIN32
#define USE_LOADING_WINDOW_WIN32
#endif
@@ -21,6 +21,7 @@ protected:
XFONT* font;
bool useImage;
};
#define USE_LOADING_WINDOW_XBOX
#endif
@@ -0,0 +1,54 @@
#ifndef SELECTOR_LOADING_WINDOW_H
#define SELECTOR_LOADING_WINDOW_H
#include "arch/arch_platform.h"
/* LoadingWindow driver selector. */
#ifdef HAVE_COCOA
#include "LoadingWindow_Cocoa.h"
#endif
#ifdef HAVE_GTK
#include "LoadingWindow_Gtk.h"
#endif
#include "LoadingWindow_Null.h"
#ifdef HAVE_SDL
#include "LoadingWindow_SDL.h"
#endif
#ifdef HAVE_WIN32
#include "LoadingWindow_Win32.h"
#endif
#ifdef HAVE_XBOX
#include "LoadingWindow_Xbox.h"
#endif
#endif
/*
* (c) 2005 Ben Anderson
* 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.
*/