Include cleanup, in an attempt to make build process faster.
This commit is contained in:
bgk 2008-09-13 16:35:32 +00:00
parent e8b08761c9
commit 88c9a2ad24
12 changed files with 53 additions and 73 deletions

View File

@ -18,8 +18,6 @@
#include "configfile.h"
#include <string.h>
#include <glibmm/fileutils.h>
#include <glibmm/iochannel.h>

View File

@ -21,9 +21,7 @@
#define __VBA_CONFIGFILE_H__
#include <list>
#include <string>
#include <sstream>
#include <ostream>
namespace VBA
{

View File

@ -16,16 +16,13 @@
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <limits.h>
#include <stdlib.h>
#include <gtkmm/main.h>
#include <gtkmm/window.h>
#include <gtkmm/messagedialog.h>
#include <libglademm.h>
#ifdef USE_OPENGL
#include <gtkglmm.h>
#include <gtkmm/gl/init.h>
#endif // USE_OPENGL
#include "window.h"

View File

@ -18,8 +18,6 @@
#include "screenarea-cairo.h"
#include <string.h>
namespace VBA
{
@ -82,7 +80,7 @@ void ScreenAreaCairo::vDrawPixels(u8 * _puiData)
}
bool ScreenAreaCairo::on_expose_event(GdkEventExpose * _pstEvent)
{
{
DrawingArea::on_expose_event(_pstEvent);
Cairo::RefPtr< Cairo::ImageSurface > poImage;
Cairo::RefPtr< Cairo::SurfacePattern > poPattern;
@ -93,8 +91,8 @@ bool ScreenAreaCairo::on_expose_event(GdkEventExpose * _pstEvent)
poContext = get_window()->create_cairo_context();
poContext->set_identity_matrix();
poContext->scale(m_dScaleFactor, m_dScaleFactor);
poContext->scale(m_dScaleFactor, m_dScaleFactor);
poImage = Cairo::ImageSurface::create((u8 *)m_puiPixels, Cairo::FORMAT_RGB24,
m_iScaledWidth, m_iScaledHeight, iScaledPitch);
@ -104,10 +102,10 @@ bool ScreenAreaCairo::on_expose_event(GdkEventExpose * _pstEvent)
poPattern->set_matrix (oMatrix);
poContext->set_source_rgb(0.0, 0.0, 0.0);
poContext->paint();
poContext->set_source(poPattern);
poContext->paint();
poContext->paint();
return true;
}
@ -131,10 +129,10 @@ void ScreenAreaCairo::vUpdateSize()
{
delete[] m_puiDelta;
}
m_iScaledWidth = m_iFilterScale * m_iWidth;
m_iScaledHeight = m_iFilterScale * m_iHeight;
vOnWidgetResize();
m_puiPixels = new u32[(m_iScaledWidth + 1) * m_iScaledHeight];
@ -157,7 +155,7 @@ void ScreenAreaCairo::vOnWidgetResize()
bool ScreenAreaCairo::on_configure_event(GdkEventConfigure * event)
{
vOnWidgetResize();
return true;
}

View File

@ -18,8 +18,6 @@
#include "screenarea-opengl.h"
#include <string.h>
namespace VBA
{
@ -127,10 +125,10 @@ void ScreenAreaGl::vUpdateSize()
{
delete[] m_puiDelta;
}
m_iScaledWidth = m_iFilterScale * m_iWidth;
m_iScaledHeight = m_iFilterScale * m_iHeight;
vOnWidgetResize();
m_puiPixels = new u32[(m_iScaledWidth + 1) * m_iScaledHeight];
@ -145,7 +143,7 @@ void ScreenAreaGl::vOnWidgetResize()
{
m_dScaleFactor = min<double>(get_height() / (double)m_iScaledHeight, get_width() / (double)m_iScaledWidth);
glViewport(0, 0, get_width(), get_height());
m_dAreaTop = 1 - m_dScaleFactor * m_iScaledHeight / (double)get_height();
m_dAreaLeft = 1 - m_dScaleFactor * m_iScaledWidth / (double)get_width();
}
@ -153,7 +151,7 @@ void ScreenAreaGl::vOnWidgetResize()
bool ScreenAreaGl::on_configure_event(GdkEventConfigure * event)
{
vOnWidgetResize();
return true;
}
@ -173,9 +171,9 @@ bool ScreenAreaGl::on_expose_event(GdkEventExpose * _pstEvent)
glDrawPixels(m_iScaledWidth, m_iScaledHeight, GL_RGBA, GL_UNSIGNED_BYTE, m_puiPixels);
glwindow->swap_buffers();
glwindow->gl_end();
return true;
}

View File

@ -21,7 +21,7 @@
#define __VBA_SCREENAREA_OPENGL_H__
#include "screenarea.h"
#include <gtkglmm.h>
#include <gtkmm/gl/widget.h>
namespace VBA
{

View File

@ -22,7 +22,6 @@
#include <gdk/gdkx.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <string.h>
#include <X11/extensions/Xvlib.h>
@ -52,17 +51,17 @@ ScreenAreaXv::ScreenAreaXv(int _iWidth, int _iHeight, int _iScale) :
GdkWindow *pWindow = poWindow->gobj();
m_pDisplay = gdk_x11_drawable_get_xdisplay(GDK_DRAWABLE(pWindow));
Glib::RefPtr<Gdk::Screen> poScreen = get_screen();
Glib::RefPtr<Gdk::Window> poRoot = poScreen->get_root_window();
pRoot = poRoot->gobj();
m_iXvPortId = -1;
XvQueryAdaptors(m_pDisplay,
GDK_WINDOW_XWINDOW(pRoot),
XvQueryAdaptors(m_pDisplay,
GDK_WINDOW_XWINDOW(pRoot),
&iNumAdaptors,
&pAdaptors);
for (unsigned int i = 0; i < iNumAdaptors; i++)
{
if (pAdaptors[i].type & XvInputMask &&
@ -71,9 +70,9 @@ ScreenAreaXv::ScreenAreaXv(int _iWidth, int _iHeight, int _iScale) :
m_iXvPortId = pAdaptors[i].base_id;
}
}
XvFreeAdaptorInfo(pAdaptors);
if (m_iXvPortId < 0)
{
fprintf (stderr, "Could not open Xv output port.\n");
@ -90,7 +89,7 @@ ScreenAreaXv::ScreenAreaXv(int _iWidth, int _iHeight, int _iScale) :
// Try to find an RGB format
pFormats = XvListImageFormats(m_pDisplay, m_iXvPortId, &iNumFormats);
for (int i = 0; i < iNumFormats; i++)
{
if (pFormats[i].id == 0x3 || pFormats[i].type == XvRGB)
@ -112,9 +111,9 @@ ScreenAreaXv::ScreenAreaXv(int _iWidth, int _iHeight, int _iScale) :
if (!strcmp(pAttr[iAttr].name, "XV_AUTOPAINT_COLORKEY"))
{
Atom oAtom = XInternAtom(m_pDisplay, "XV_AUTOPAINT_COLORKEY", True);
if (oAtom != None)
if (oAtom != None)
XvSetPortAttribute(m_pDisplay, m_iXvPortId, oAtom, 1);
break;
}
}
@ -125,7 +124,7 @@ ScreenAreaXv::ScreenAreaXv(int _iWidth, int _iHeight, int _iScale) :
ScreenAreaXv::~ScreenAreaXv()
{
XShmDetach(m_pDisplay, &m_oShm);
if (m_puiPixels != NULL)
{
delete[] m_puiPixels;
@ -197,7 +196,7 @@ void ScreenAreaXv::vUpdateSize()
{
const int iScaledWidth = m_iFilterScale * m_iWidth;
const int iScaledHeight = m_iFilterScale * m_iHeight;
if (m_puiPixels != NULL)
{
delete[] m_puiPixels;
@ -214,7 +213,7 @@ void ScreenAreaXv::vUpdateSize()
}
vOnWidgetResize();
m_pXvImage = XvShmCreateImage(m_pDisplay,
m_iXvPortId,
m_iFormat,
@ -222,13 +221,13 @@ void ScreenAreaXv::vUpdateSize()
iScaledWidth + 4,
iScaledHeight + 4,
&m_oShm);
m_oShm.shmid = shmget(IPC_PRIVATE, m_pXvImage->data_size, IPC_CREAT | 0777);
m_oShm.shmaddr = (char *) shmat(m_oShm.shmid, 0, 0);
m_oShm.readOnly = FALSE;
m_oShm.readOnly = FALSE;
m_pXvImage->data = m_oShm.shmaddr;
XShmAttach(m_pDisplay, &m_oShm);
m_puiPixels = new u32[iScaledWidth * iScaledHeight];
@ -300,10 +299,10 @@ void ScreenAreaXv::vRGB32toYUY2 (unsigned char* dest_ptr,
void ScreenAreaXv::vOnWidgetResize()
{
double dAspectRatio = m_iWidth / (double)m_iHeight;
m_iAreaHeight = min<int>(get_height(), get_width() / dAspectRatio);
m_iAreaWidth = min<int>(get_width(), get_height() * dAspectRatio);
m_iAreaTop = (get_height() - m_iAreaHeight) / 2;
m_iAreaLeft = (get_width() - m_iAreaWidth) / 2;
}
@ -311,7 +310,7 @@ void ScreenAreaXv::vOnWidgetResize()
bool ScreenAreaXv::on_configure_event(GdkEventConfigure * event)
{
vOnWidgetResize();
return true;
}

View File

@ -18,8 +18,6 @@
#include "screenarea.h"
#include <string.h>
namespace VBA
{
@ -88,13 +86,13 @@ void ScreenArea::vSetScale(int _iScale)
void ScreenArea::vSetFilter2x(EFilter2x _eFilter2x)
{
m_vFilter2x = pvGetFilter2x(_eFilter2x, FilterDepth32);
m_iFilterScale = 1;
m_iFilterScale = 1;
if (m_vFilter2x != NULL)
{
m_iFilterScale = 2;
}
vUpdateSize();
}

View File

@ -16,10 +16,6 @@
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include "../agb/GBA.h"
#include "../dmg/gb.h"
#include "../dmg/gbGlobals.h"

View File

@ -18,10 +18,11 @@
#include "window.h"
#include <sys/stat.h>
#include <gtkmm/stock.h>
#include <gtkmm/alignment.h>
#include <gtkmm/messagedialog.h>
#include <stdio.h>
#include <time.h>
#include <sys/stat.h>
#include <SDL.h>

View File

@ -20,16 +20,13 @@
#ifndef __VBA_WINDOW_H__
#define __VBA_WINDOW_H__
#include <sys/types.h>
#include <stdarg.h>
#include <gtkmm.h>
#include <gtkmm/window.h>
#include <gtkmm/checkmenuitem.h>
#include <gtkmm/filechooserdialog.h>
#include <gtkmm/menubar.h>
#include <gtkmm/recentchoosermenu.h>
#include <libglademm.h>
#include <string>
#include <vector>
#include <list>
#include "../System.h"
#include "../sdl/inputSDL.h"

View File

@ -18,10 +18,10 @@
#include "window.h"
#include <sys/stat.h>
#include <stdio.h>
#include <time.h>
#include <gtkmm/stock.h>
#include <gtkmm/messagedialog.h>
#include <gtkmm/filechooserbutton.h>
#include <gtkmm/aboutdialog.h>
#include <SDL.h>