diff options
| author | iCatButler <i.am.catbutler@gmail.com> | 2018-03-19 07:39:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-19 07:39:08 +0000 |
| commit | 6f76041029393c6823973a29426b28c8c2d0b064 (patch) | |
| tree | 13c1bb5215c2510a7c430b59bc22df666cd2fbf3 /plugins/peopsxgl | |
| parent | 768332417644451d38ce1a737465656c7cc75de3 (diff) | |
| parent | 128d6afb179756513860187cf5e31d84d6d8cac4 (diff) | |
| download | pcsxr-6f76041029393c6823973a29426b28c8c2d0b064.tar.gz | |
Merge pull request #7 from loathingKernel/sync-with-codeplex
Sync with codeplex
Diffstat (limited to 'plugins/peopsxgl')
| -rw-r--r-- | plugins/peopsxgl/CMakeLists.txt | 76 | ||||
| -rwxr-xr-x | plugins/peopsxgl/Makefile.am | 57 | ||||
| -rwxr-xr-x | plugins/peopsxgl/draw.c | 1 | ||||
| -rwxr-xr-x | plugins/peopsxgl/gpu.c | 14 | ||||
| -rwxr-xr-x | plugins/peopsxgl/prim.c | 2 | ||||
| -rwxr-xr-x | plugins/peopsxgl/stdafx.h | 2 |
6 files changed, 83 insertions, 69 deletions
diff --git a/plugins/peopsxgl/CMakeLists.txt b/plugins/peopsxgl/CMakeLists.txt new file mode 100644 index 00000000..d622ce6f --- /dev/null +++ b/plugins/peopsxgl/CMakeLists.txt @@ -0,0 +1,76 @@ +message(STATUS "* Configuring peopsxgl") + +include(GlibCompileResourcesSupport) + +#deps + +find_package(GLib REQUIRED) +if(NOT GLib_FOUND) + message(FATAL_ERROR "GLIB2 library not found") +endif(NOT GLib_FOUND) +include_directories(${GLib_INCLUDE_DIRS}) + +find_package(GTK3 REQUIRED) +if(NOT GTK3_FOUND) + message(FATAL_ERROR "GTK3 library not found") +endif(NOT GTK3_FOUND) +include_directories(${GTK3_INCLUDE_DIRS}) +set(GTK_LIBRARIES ${GTK3_LIBRARY} ${GDK3_LIBRARY} ${GDKPixbuf_LIBRARY} ${Pango_LIBRARY} ${Cairo_LIBRARY} ${GObject_LIBRARY} ${GLib_LIBRARY} ${GIO_LIBRARY}) + +find_package(X11 REQUIRED) + +find_package(OpenGL REQUIRED) +if(NOT OPENGL_FOUND) + message(FATAL_ERROR "GL library not found") +endif(NOT OPENGL_FOUND) +include_directories(${OPENGL_INCLUDE_DIR}) + +#defs +add_definitions(-DLOCALE_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/locale/" -DPSEMU_DATA_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/psemu" -DDEF_PLUGIN_DIR="${CMAKE_INSTALL_FULL_LIBDIR}/games/psemu") + +#sources +set(PLUGIN_SRCS + cfg.c + draw.c + fps.c + gpu.c + gte_accuracy.c + key.c + menu.c + prim.c + soft.c + texture.c + pgxp_gpu.c +) + +set(GUI_SRCS + gpucfg/main.c +) + + +#resources +set(RESOURCE_LIST + ${CMAKE_CURRENT_SOURCE_DIR}/gpucfg/peopsxgl.ui +) + + +compile_gresources(RESOURCE_FILE + XML_OUT + TYPE EMBED_C + PREFIX /org/pcsxr/peopsxgl + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gpucfg + RESOURCES ${RESOURCE_LIST}) + +add_custom_target(peopsxgl_resource DEPENDS ${RESOURCE_FILE}) + +include_directories(${CMAKE_SOURCE_DIR}/libpcsxcore ${X11_X11_INCLUDE_PATH} ${X11_xf86vmode_INCLUDE_PATH} ${OPENGL_INCLUDE_DIR}) +add_library(peopsxgl MODULE ${PLUGIN_SRCS}) +target_link_libraries(peopsxgl ${X11_LIBRARIES} ${X11_Xxf86vm_LIB} ${OPENGL_gl_LIBRARY}) + + +add_executable(cfgpeopsxgl ${GUI_SRCS} ${RESOURCE_FILE}) +add_dependencies(cfgpeopsxgl dfinput_resource) +target_link_libraries(cfgpeopsxgl ${GTK_LIBRARIES}) + +install(TARGETS peopsxgl LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/games/psemu) +install(TARGETS cfgpeopsxgl RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/games/psemu) diff --git a/plugins/peopsxgl/Makefile.am b/plugins/peopsxgl/Makefile.am deleted file mode 100755 index 576e140d..00000000 --- a/plugins/peopsxgl/Makefile.am +++ /dev/null @@ -1,57 +0,0 @@ -AM_CPPFLAGS = -DPIXMAPDIR=\"${datadir}/pixmaps/\" \ - -DLOCALE_DIR=\"${datadir}/locale/\" \ - -DDATADIR=\"${datadir}/psemu/\" \ - $(GTK3_CFLAGS) \ - -I$(top_srcdir)/libpcsxcore -I../../include - -bindir = @libdir@/games/psemu/ -libdir = @libdir@/games/psemu/ - -lib_LTLIBRARIES = libpeopsxgl.la - -libpeopsxgl_la_SOURCES = \ - cfg.c cfg.h \ - draw.c draw.h \ - fps.c fps.h \ - gl_ext.h \ - gpu.c gpu.h \ - key.c key.h \ - menu.c menu.h \ - prim.c prim.h \ - soft.c soft.h \ - texture.c texture.h \ - gte_accuracy.c gte_accuracy.h \ - pgxp_gpu.c pgxp_gpu.h -libpeopsxgl_la_LDFLAGS = -module -avoid-version -libpeopsxgl_la_LIBADD = -lX11 -lXxf86vm -lGL -lm - -bin_PROGRAMS = cfgpeopsxgl -cfgpeopsxgl_SOURCES = gpucfg/main.c GtkResources.c GtkResources.h -cfgpeopsxgl_LDADD = $(GTK3_LIBS) - -# gresource.xml is dynamically generated in CMake. Mirror that here in a static way. -define gresource_xml = -<?xml version="1.0" encoding="UTF-8"?> -<gresources> - <gresource prefix="/org/pcsxr/peopsxgl"> - <file>peopsxgl.ui</file> - </gresource> -</gresources> -endef - -peopsxgl.gresource.xml: - $(file >$@,$(gresource_xml)) -peopsxgl_gresource: peopsxgl.gresource.xml - $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir)/gpucfg --generate-dependencies $(srcdir)/$<) -GtkResources.c: peopsxgl.gresource.xml $(peopsxgl_gresource) - $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/gpucfg --generate-source --c-name peopsxgl $< -GtkResources.h: peopsxgl.gresource.xml $(peopsxgl_gresource) - $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/gpucfg --generate-header --c-name peopsxgl $< - - -#glade_DATA = gpucfg/peopsxgl.ui -#gladedir = $(datadir)/psemu/ -EXTRA_DIST = $(glade_DATA) - -CLEANFILES = peopsxgl.gresource.xml GtkResources.c GtkResources.h - diff --git a/plugins/peopsxgl/draw.c b/plugins/peopsxgl/draw.c index c7a778a8..c60d9379 100755 --- a/plugins/peopsxgl/draw.c +++ b/plugins/peopsxgl/draw.c @@ -1020,7 +1020,6 @@ BOOL offsetline(unsigned int* addr) vertex[1].y=(short)((float)y1+px); vertex[2].y=(short)((float)y1+py); - if(vertex[0].x==vertex[3].x && // ortho rect? done vertex[1].x==vertex[2].x && vertex[0].y==vertex[1].y && diff --git a/plugins/peopsxgl/gpu.c b/plugins/peopsxgl/gpu.c index c19dd2b6..12c453b5 100755 --- a/plugins/peopsxgl/gpu.c +++ b/plugins/peopsxgl/gpu.c @@ -35,6 +35,10 @@ static int iOldMode=0; #endif +#if defined(__linux__) +#include <sys/wait.h> +#endif + #define _IN_GPU #include "externals.h" @@ -1088,13 +1092,7 @@ long GPUopen(unsigned long * disp,char * CapText,char * CfgFile) GLinitialize(); // init opengl if(disp) - { -#if defined (_MACGL) - *disp = display; -#else - *disp=(unsigned long *)display; // return display ID to main emu -#endif - } + *disp = (unsigned long)display; // return display ID to main emu if(display) return 0; return -1; @@ -1317,7 +1315,6 @@ void SetScanLines(void) //PGXP_SetMatrix(0, PSXDisplay.DisplayMode.x, PSXDisplay.DisplayMode.y, 0, -1, 1); - if(bKeepRatio) glViewport(rRatioRect.left, iResY-(rRatioRect.top+rRatioRect.bottom), @@ -1895,7 +1892,6 @@ void updateDisplayIfChanged(void) // PGXP_SetMatrix(0, PSXDisplay.DisplayModeNew.x, PSXDisplay.DisplayModeNew.y, 0, -1, 1); - if(bKeepRatio) SetAspectRatio(); } diff --git a/plugins/peopsxgl/prim.c b/plugins/peopsxgl/prim.c index 1af588f0..b03d87d7 100755 --- a/plugins/peopsxgl/prim.c +++ b/plugins/peopsxgl/prim.c @@ -155,7 +155,6 @@ static __inline void PRIMdrawTexturedQuad(OGLVertex* vertex1, OGLVertex* vertex2 if(PGXP_DrawDebugTriQuad(vertex1, vertex2, vertex4, vertex3, COLOUR_NONE, 1)) return; } - glBegin(GL_TRIANGLE_STRIP); glTexCoord2fv(&vertex1->sow); @@ -2553,7 +2552,6 @@ void DrawMultiBlur(void) fx=(float)PSXDisplay.DisplayMode.x/(float)(iResX); fy=(float)PSXDisplay.DisplayMode.y/(float)(iResY); - for (unsigned int i = 0; i < 4; ++i) { vertex[i].PGXP_flag = 999; diff --git a/plugins/peopsxgl/stdafx.h b/plugins/peopsxgl/stdafx.h index b069ba25..ab40002e 100755 --- a/plugins/peopsxgl/stdafx.h +++ b/plugins/peopsxgl/stdafx.h @@ -62,6 +62,8 @@ #include <unistd.h> #include <sys/stat.h> #include <sys/time.h> +#include <sys/types.h> +#include <sys/wait.h> #include <GL/gl.h> #include <GL/glx.h> #include <math.h> |
