1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Fix posix compilation errors

This commit is contained in:
Sergey Lipskiy 2014-09-21 12:54:13 +07:00
parent ee4dabbfbb
commit f42357bb39
11 changed files with 58 additions and 52 deletions

View File

@ -42,7 +42,6 @@ if(MUPENPLUSAPI)
MupenPlusPluginAPI.cpp
mupenplus/Config.cpp
mupenplus/CommonAPIImpl_mupenplus.cpp
mupenplus/GLideN64_mupenplus.cpp
mupenplus/MicrocodeDialog.cpp
mupenplus/MupenPlusAPIImpl.cpp
mupenplus/OpenGL_mupenplus.cpp

View File

@ -266,10 +266,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="mupenplus\GLideN64_mupenplus.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="mupenplus\MicrocodeDialog.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>

View File

@ -144,9 +144,6 @@
<ClCompile Include="mupenplus\Config.cpp">
<Filter>Source Files\mupenplus</Filter>
</ClCompile>
<ClCompile Include="mupenplus\GLideN64_mupenplus.cpp">
<Filter>Source Files\mupenplus</Filter>
</ClCompile>
<ClCompile Include="mupenplus\MicrocodeDialog.cpp">
<Filter>Source Files\mupenplus</Filter>
</ClCompile>

View File

@ -27,7 +27,11 @@ extern "C" {
#define PLUGIN_TYPE_GFX 2
#define EXPORT __declspec(dllexport)
#ifdef _WINDOWS
#define CALL __cdecl
#else
#define CALL _cdecl
#endif
/***** Structures *****/
typedef struct {

View File

@ -1,19 +0,0 @@
#include "GLideN64_MupenPlus.h"
ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath = NULL;
ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath = NULL;
/* definitions of pointers to Core video extension functions */
ptr_VidExt_Init CoreVideo_Init = NULL;
ptr_VidExt_Quit CoreVideo_Quit = NULL;
ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes = NULL;
ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode = NULL;
ptr_VidExt_SetCaption CoreVideo_SetCaption = NULL;
ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen = NULL;
ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow = NULL;
ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress = NULL;
ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute = NULL;
ptr_VidExt_GL_GetAttribute CoreVideo_GL_GetAttribute = NULL;
ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers = NULL;
void (*renderCallback)() = NULL;

View File

@ -1,4 +1,4 @@
#include "GLideN64_MupenPlus.h"
#include "GLideN64_mupenplus.h"
#include "../PluginAPI.h"
#include "../GLideN64.h"
#include "../OpenGL.h"
@ -9,6 +9,24 @@
#define DLSYM(a, b) dlsym(a, b)
#endif // _WINDOWS
ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath = NULL;
ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath = NULL;
/* definitions of pointers to Core video extension functions */
ptr_VidExt_Init CoreVideo_Init = NULL;
ptr_VidExt_Quit CoreVideo_Quit = NULL;
ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes = NULL;
ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode = NULL;
ptr_VidExt_SetCaption CoreVideo_SetCaption = NULL;
ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen = NULL;
ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow = NULL;
ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress = NULL;
ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute = NULL;
ptr_VidExt_GL_GetAttribute CoreVideo_GL_GetAttribute = NULL;
ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers = NULL;
void (*renderCallback)() = NULL;
m64p_error PluginAPI::PluginStartup(m64p_dynlib_handle _CoreLibHandle)
{
ConfigGetSharedDataFilepath = (ptr_ConfigGetSharedDataFilepath) DLSYM(_CoreLibHandle, "ConfigGetSharedDataFilepath");

View File

@ -1,8 +1,9 @@
#include "../CommonPluginAPI.h"
#include "../winlnxdefs.h"
#include "../PluginAPI.h"
#include "../OpenGL.h"
#include "../Config.h"
int CommonPluginAPI::InitiateGFX(const GFX_INFO & _gfxInfo)
int PluginAPI::InitiateGFX(const GFX_INFO & _gfxInfo)
{
_initiateGFX(_gfxInfo);

View File

@ -1,21 +1,21 @@
#include "winlnxdefs.h"
#include <SDL.h>
#include "../winlnxdefs.h"
//#include <SDL.h>
#include <errno.h>
#include <gtk/gtk.h>
#include <string.h>
#include "Config.h"
#include "GLideN64.h"
#include "RSP.h"
#include "Textures.h"
#include "OpenGL.h"
#include "../Config.h"
#include "../GLideN64.h"
#include "../RSP.h"
#include "../Textures.h"
#include "../OpenGL.h"
Config config;
static GtkWidget *configWindow = NULL;
//static GtkWidget *bitdepthCombo[2], *resolutionCombo[2];
static GtkWidget *resolutionCombo;
static GtkWidget *enable2xSAICheck, *forceBilinearCheck, *enableFogCheck;
static GtkWidget *depthWriteCheck, *forceBilinearCheck, *enableFogCheck;
static GtkWidget *enableHardwareFBCheck, *enableHardwareLighting;
static GtkWidget *textureDepthCombo;
static GtkWidget *textureCacheEntry;
@ -76,7 +76,7 @@ static void okButton_clicked( GtkWidget *widget, void *data )
config.video.fullscreenHeight = config.video.windowedHeight = i2;
config.texture.forceBilinear = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(forceBilinearCheck) );
config.texture.enable2xSaI = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(enable2xSAICheck) );
config.frameBufferEmulation.copyDepthToRDRAM = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(depthWriteCheck) );
config.enableFog = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(enableFogCheck) );
config.frameBufferEmulation.enable = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(enableHardwareFBCheck) );
config.enableHWLighting = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(enableHardwareLighting) );
@ -87,7 +87,7 @@ static void okButton_clicked( GtkWidget *widget, void *data )
if (!strcmp( depth, textureBitDepth[i] ))
config.texture.textureBitDepth = i;
}
cache.maxBytes = atoi( gtk_entry_get_text( GTK_ENTRY(textureCacheEntry) ) ) * 1048576;
config.texture.maxBytes = atoi( gtk_entry_get_text( GTK_ENTRY(textureCacheEntry) ) ) * 1048576;
// write configuration
if (pluginDir == 0)
@ -111,12 +111,12 @@ static void okButton_clicked( GtkWidget *widget, void *data )
/* fprintf( f, "width=%d\n", OGL.width );
fprintf( f, "height=%d\n", OGL.height );*/
fprintf( f, "force bilinear=%d\n", config.texture.forceBilinear );
fprintf( f, "enable 2xSAI=%d\n", config.texture.enable2xSaI );
fprintf( f, "enable depth buffer write=%d\n", config.frameBufferEmulation.copyDepthToRDRAM );
fprintf( f, "enable fog=%d\n", config.enableFog );
fprintf( f, "enable HardwareFB=%d\n", config.frameBufferEmulation.enable );
fprintf( f, "enable hardware lighting=%d\n", config.enableHWLighting );
fprintf( f, "texture depth=%d\n", config.texture.textureBitDepth );
fprintf( f, "cache size=%d\n", cache.maxBytes / 1048576 );
fprintf( f, "cache size=%d\n", config.texture.maxBytes / 1048576 );
fclose( f );
@ -149,7 +149,7 @@ static void configWindow_show( GtkWidget *widget, void *data )
sprintf( text, "%d x %d", config.video.windowedWidth, config.video.windowedHeight );
gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(resolutionCombo)->entry), text );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enable2xSAICheck), (config.texture.enable2xSaI) );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(depthWriteCheck), (config.frameBufferEmulation.copyDepthToRDRAM) );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(forceBilinearCheck), (config.texture.forceBilinear) );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableFogCheck), (config.enableFog) );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableHardwareLighting), (config.enableHWLighting) );
@ -157,7 +157,7 @@ static void configWindow_show( GtkWidget *widget, void *data )
// textures
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableHardwareFBCheck), (config.frameBufferEmulation.enable) );
gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(textureDepthCombo)->entry), textureBitDepth[config.texture.textureBitDepth] );
sprintf( text, "%d", cache.maxBytes / 1048576 );
sprintf( text, "%d", config.texture.maxBytes / 1048576 );
gtk_entry_set_text( GTK_ENTRY(textureCacheEntry), text );
}
@ -270,7 +270,7 @@ static int Config_CreateWindow()
gtk_combo_set_value_in_list( GTK_COMBO(resolutionCombo), TRUE, FALSE );
gtk_combo_set_popdown_strings( GTK_COMBO(resolutionCombo), resolutionList );
enable2xSAICheck = gtk_check_button_new_with_label( "Enable 2xSAI texture scaling" );
depthWriteCheck = gtk_check_button_new_with_label( "Enable depth buffer writes" );
forceBilinearCheck = gtk_check_button_new_with_label( "Force bilinear filtering" );
enableFogCheck = gtk_check_button_new_with_label( "Enable fog" );
enableHardwareLighting = gtk_check_button_new_with_label( "Enable hardware lighting" );
@ -301,7 +301,7 @@ static int Config_CreateWindow()
gtk_table_attach_defaults( GTK_TABLE(displayTable), forceBilinearCheck, 1, 2, 3, 4 );
// row 4
gtk_table_attach_defaults( GTK_TABLE(displayTable), enable2xSAICheck, 0, 1, 4, 5 );
gtk_table_attach_defaults( GTK_TABLE(displayTable), depthWriteCheck, 0, 1, 4, 5 );
gtk_table_attach_defaults( GTK_TABLE(displayTable), enableHardwareLighting, 1, 2, 4, 5 );
// textures frame
@ -371,12 +371,12 @@ void Config_LoadConfig()
config.video.windowedHeight = 480;
// OGL.windowedBits = 0;
config.texture.forceBilinear = 0;
config.texture.enable2xSaI = 0;
config.frameBufferEmulation.copyDepthToRDRAM = 0;
config.enableFog = 1;
config.texture.textureBitDepth = 1; // normal (16 & 32 bits)
config.frameBufferEmulation.enable = 0;
config.enableHWLighting = 0;
cache.maxBytes = 32 * 1048576;
config.texture.maxBytes = 32 * 1048576;
// read configuration
char filename[PATH_MAX];
@ -436,9 +436,9 @@ void Config_LoadConfig()
{
config.texture.forceBilinear = atoi( val );
}
else if (!strcasecmp( line, "enable 2xSAI" ))
else if (!strcasecmp( line, "enable depth buffer write" ))
{
config.texture.enable2xSaI = atoi( val );
config.frameBufferEmulation.copyDepthToRDRAM = atoi( val );
}
else if (!strcasecmp( line, "enable fog" ))
{
@ -446,7 +446,7 @@ void Config_LoadConfig()
}
else if (!strcasecmp( line, "cache size" ))
{
cache.maxBytes = atoi( val ) * 1048576;
config.texture.maxBytes = atoi( val ) * 1048576;
}
else if (!strcasecmp( line, "enable HardwareFB" ))
{
@ -470,7 +470,6 @@ void Config_LoadConfig()
// manually set frame bufer emulation options
config.frameBufferEmulation.copyToRDRAM = FALSE;
config.frameBufferEmulation.copyDepthToRDRAM = FALSE;
config.frameBufferEmulation.copyFromRDRAM = FALSE;
config.frameBufferEmulation.ignoreCFB = TRUE;
config.frameBufferEmulation.N64DepthCompare = FALSE;

View File

@ -1,10 +1,17 @@
#include <glib.h>
#include <gtk/gtk.h>
#include "../winlnxdefs.h"
#include "../GLideN64.h"
#include "../GBI.h"
static int selectedMicrocode = -1;
static GtkWidget *microcodeWindow = 0;
static GtkWidget *microcodeList = 0;
static const int numMicrocodeTypes = 11;
static unsigned int uc_crc;
static const char * uc_str;
static void okButton_clicked( GtkWidget *widget, void *data )
{
gtk_widget_hide( microcodeWindow );

View File

@ -1,4 +1,7 @@
#include "../winlnxdefs.h"
#include "../GLideN64.h"
#include "../OpenGL.h"
#include "../Config.h"
void OGL_InitGLFunctions()
{

View File

@ -1,3 +1,4 @@
#include "../winlnxdefs.h"
#include "../PluginAPI.h"
#include "../GLideN64.h"
#include "../OpenGL.h"