Fixed indents

This commit is contained in:
archshift 2014-04-30 20:12:01 -07:00
parent 948cfe6d37
commit 704075f04a
8 changed files with 66 additions and 68 deletions

View File

@ -13,7 +13,7 @@ add_executable(citra ${SRCS} ${HEADS})
if (APPLE) if (APPLE)
target_link_libraries(citra core common video_core iconv pthread ${COREFOUNDATION_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES}) target_link_libraries(citra core common video_core iconv pthread ${COREFOUNDATION_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES})
else() else()
target_link_libraries(citra core common video_core GLEW pthread X11 Xxf86vm Xi Xcursor ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB}) target_link_libraries(citra core common video_core GLEW pthread X11 Xxf86vm Xi Xcursor ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB})
endif() endif()
#install(TARGETS citra RUNTIME DESTINATION ${bindir}) #install(TARGETS citra RUNTIME DESTINATION ${bindir})

View File

@ -28,16 +28,16 @@ EmuWindow_GLFW::EmuWindow_GLFW() {
} }
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth, m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth,
(VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight), (VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight),
m_window_title.c_str(), NULL, NULL); m_window_title.c_str(), NULL, NULL);
if (m_render_window == NULL) { if (m_render_window == NULL) {
printf("Failed to create GLFW window! Exiting..."); printf("Failed to create GLFW window! Exiting...");
exit(1); exit(1);
} }
// Setup callbacks // Setup callbacks
glfwSetWindowUserPointer(m_render_window, this); glfwSetWindowUserPointer(m_render_window, this);

View File

@ -53,7 +53,7 @@ add_executable(citra-qt ${SRCS} ${HEADS} ${MOC_SRCS} ${UI_HDRS})
if (APPLE) if (APPLE)
target_link_libraries(citra-qt core common video_core qhexedit iconv ${COREFOUNDATION_LIBRARY} ${QT_LIBRARIES} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) target_link_libraries(citra-qt core common video_core qhexedit iconv ${COREFOUNDATION_LIBRARY} ${QT_LIBRARIES} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES})
else() else()
target_link_libraries(citra-qt core common video_core qhexedit ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} rt GLEW ${GLFW_LIBRARIES}) target_link_libraries(citra-qt core common video_core qhexedit ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} rt GLEW ${GLFW_LIBRARIES})
endif() endif()
#install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir})

View File

@ -47,7 +47,7 @@ void EmuThread::run()
void EmuThread::Stop() void EmuThread::Stop()
{ {
if (!isRunning()) if (!isRunning())
{ {
INFO_LOG(MASTER_LOG, "EmuThread::Stop called while emu thread wasn't running, returning..."); INFO_LOG(MASTER_LOG, "EmuThread::Stop called while emu thread wasn't running, returning...");
return; return;
@ -62,7 +62,7 @@ void EmuThread::Stop()
terminate(); terminate();
wait(1000); wait(1000);
if (isRunning()) if (isRunning())
WARN_LOG(MASTER_LOG, "EmuThread STILL running, something is wrong here..."); WARN_LOG(MASTER_LOG, "EmuThread STILL running, something is wrong here...");
} }
INFO_LOG(MASTER_LOG, "EmuThread stopped"); INFO_LOG(MASTER_LOG, "EmuThread stopped");
} }
@ -75,8 +75,8 @@ class GGLWidgetInternal : public QGLWidget
public: public:
GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) : QGLWidget(parent) GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) : QGLWidget(parent)
{ {
doneCurrent(); doneCurrent();
parent_ = parent; parent_ = parent;
} }
void paintEvent(QPaintEvent* ev) void paintEvent(QPaintEvent* ev)
@ -102,11 +102,11 @@ EmuThread& GRenderWindow::GetEmuThread()
GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this) GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this)
{ {
// TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose // TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose
QGLFormat fmt; QGLFormat fmt;
fmt.setProfile(QGLFormat::CoreProfile); fmt.setProfile(QGLFormat::CoreProfile);
fmt.setVersion(4,1); fmt.setVersion(4,1);
fmt.setSampleBuffers(true); fmt.setSampleBuffers(true);
fmt.setSamples(4); fmt.setSamples(4);
child = new GGLWidgetInternal(fmt, this); child = new GGLWidgetInternal(fmt, this);
QBoxLayout* layout = new QHBoxLayout(this); QBoxLayout* layout = new QHBoxLayout(this);
@ -148,12 +148,12 @@ void GRenderWindow::DoneCurrent()
void GRenderWindow::PollEvents() { void GRenderWindow::PollEvents() {
// TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title // TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title
// from the main thread, but this should probably be in an event handler... // from the main thread, but this should probably be in an event handler...
/* /*
static char title[128]; static char title[128];
sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(), sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(),
video_core::g_renderer->current_fps()); video_core::g_renderer->current_fps());
setWindowTitle(title); setWindowTitle(title);
*/ */
} }
void GRenderWindow::BackupGeometry() void GRenderWindow::BackupGeometry()
@ -186,26 +186,26 @@ QByteArray GRenderWindow::saveGeometry()
void GRenderWindow::keyPressEvent(QKeyEvent* event) void GRenderWindow::keyPressEvent(QKeyEvent* event)
{ {
/* /*
bool key_processed = false; bool key_processed = false;
for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel) for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel)
if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::PRESSED)) if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::PRESSED))
key_processed = true; key_processed = true;
if (!key_processed) if (!key_processed)
QWidget::keyPressEvent(event); QWidget::keyPressEvent(event);
*/ */
} }
void GRenderWindow::keyReleaseEvent(QKeyEvent* event) void GRenderWindow::keyReleaseEvent(QKeyEvent* event)
{ {
/* /*
bool key_processed = false; bool key_processed = false;
for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel) for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel)
if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::RELEASED)) if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::RELEASED))
key_processed = true; key_processed = true;
if (!key_processed) if (!key_processed)
QWidget::keyPressEvent(event); QWidget::keyPressEvent(event);
*/ */
} }

View File

@ -45,7 +45,7 @@ set(HEADS atomic.h
memory_util.h memory_util.h
msg_handler.h msg_handler.h
platform.h platform.h
scm_rev.h scm_rev.h
std_condition_variable.h std_condition_variable.h
std_mutex.h std_mutex.h
std_thread.h std_thread.h

View File

@ -50,10 +50,10 @@ set(HEADS core.h
arm/mmu/wb.h arm/mmu/wb.h
elf/elf_reader.h elf/elf_reader.h
elf/elf_types.h elf/elf_types.h
file_sys/directory_file_system.h file_sys/directory_file_system.h
file_sys/file_sys.h file_sys/file_sys.h
file_sys/meta_file_system.h file_sys/meta_file_system.h
hle/hle.h hle/hle.h
hle/mrc.h hle/mrc.h
hle/syscall.h hle/syscall.h
hle/function_wrappers.h hle/function_wrappers.h

View File

@ -8,39 +8,37 @@
#include "video_core/utils.h" #include "video_core/utils.h"
namespace VideoCore { namespace VideoCore {
/**
* Dumps a texture to TGA
* @param filename String filename to dump texture to
* @param width Width of texture in pixels
* @param height Height of texture in pixels
* @param raw_data Raw RGBA8 texture data to dump
* @todo This should be moved to some general purpose/common code
*/
void DumpTGA(std::string filename, int width, int height, u8* raw_data) {
TGAHeader hdr;
FILE* fout;
u8 r, g, b;
/** memset(&hdr, 0, sizeof(hdr));
* Dumps a texture to TGA hdr.datatypecode = 2; // uncompressed RGB
* @param filename String filename to dump texture to hdr.bitsperpixel = 24; // 24 bpp
* @param width Width of texture in pixels hdr.width = width;
* @param height Height of texture in pixels hdr.height = height;
* @param raw_data Raw RGBA8 texture data to dump
* @todo This should be moved to some general purpose/common code
*/
void DumpTGA(std::string filename, int width, int height, u8* raw_data) {
TGAHeader hdr;
FILE* fout;
u8 r, g, b;
memset(&hdr, 0, sizeof(hdr));
hdr.datatypecode = 2; // uncompressed RGB
hdr.bitsperpixel = 24; // 24 bpp
hdr.width = width;
hdr.height = height;
fout = fopen(filename.c_str(), "wb");
fwrite(&hdr, sizeof(TGAHeader), 1, fout);
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
b = raw_data[(3 * (i * width)) + (3 * j) + 0];
g = raw_data[(3 * (i * width)) + (3 * j) + 1];
r = raw_data[(3 * (i * width)) + (3 * j) + 2];
putc(b, fout);
putc(g, fout);
putc(r, fout);
}
}
fclose(fout);
}
fout = fopen(filename.c_str(), "wb");
fwrite(&hdr, sizeof(TGAHeader), 1, fout);
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
b = raw_data[(3 * (i * width)) + (3 * j) + 0];
g = raw_data[(3 * (i * width)) + (3 * j) + 1];
r = raw_data[(3 * (i * width)) + (3 * j) + 2];
putc(b, fout);
putc(g, fout);
putc(r, fout);
}
}
fclose(fout);
}
} // namespace } // namespace

View File

@ -30,7 +30,7 @@ void Start() {
/// Initialize the video core /// Initialize the video core
void Init(EmuWindow* emu_window) { void Init(EmuWindow* emu_window) {
glewExperimental = GL_TRUE; glewExperimental = GL_TRUE;
g_emu_window = emu_window; g_emu_window = emu_window;
g_emu_window->MakeCurrent(); g_emu_window->MakeCurrent();