Skip to content

Instantly share code, notes, and snippets.

@TyounanMOTI
Created July 3, 2012 10:11
Show Gist options
  • Save TyounanMOTI/3038890 to your computer and use it in GitHub Desktop.
Save TyounanMOTI/3038890 to your computer and use it in GitHub Desktop.
diff --git angelwrap/addon/addon_dictionary.h angelwrap/addon/addon_dictionary.h
index c5d0166..8873c63 100644
--- angelwrap/addon/addon_dictionary.h
+++ angelwrap/addon/addon_dictionary.h
@@ -5,7 +5,11 @@
// string type must be registered with the engine before registering the
// dictionary type
+#if defined ( __APPLE__ )
+#include <angelscript/angelscript.h>
+#else
#include <angelscript.h>
+#endif
#include <string>
#ifdef _MSC_VER
diff --git client/cl_vid.c client/cl_vid.c
index 2ea7b2e..f287b79 100644
--- client/cl_vid.c
+++ client/cl_vid.c
@@ -153,7 +153,7 @@ qboolean VID_GetModeInfo( int *width, int *height, qboolean *wideScreen, int mod
*
* Find the best matching video mode for given width and height
*/
-static int VID_GetModeNum( int width, int height )
+int VID_GetModeNum( int width, int height )
{
int i;
int dx, dy, dist;
@@ -190,7 +190,7 @@ static void VID_ModeList_f( void )
/*
** VID_NewWindow
*/
-static void VID_NewWindow( int width, int height )
+void VID_NewWindow( int width, int height )
{
viddef.width = width;
viddef.height = height;
diff --git client/vid.h client/vid.h
index 7d6715b..ec6fabb 100644
--- client/vid.h
+++ client/vid.h
@@ -36,3 +36,5 @@ void *VID_GetWindowHandle( void );
void VID_FlashWindow( int count );
qboolean VID_GetScreenSize( int *width, int *height );
qboolean VID_GetModeInfo( int *width, int *height, qboolean *wideScreen, int mode );
+int VID_GetModeNum( int width, int height );
+void VID_NewWindow( int width, int height );
diff --git gameshared/q_math.c gameshared/q_math.c
index cd244a6..8f0552a 100644
--- gameshared/q_math.c
+++ gameshared/q_math.c
@@ -1112,7 +1112,7 @@ void Quat_Quat3( const vec3_t in, quat_t out )
out[0] = in[0];
out[1] = in[1];
out[2] = in[2];
- out[3] = -sqrt(max(1 - in[0]*in[0] - in[1]*in[1] - in[2]*in[2], 0));
+ out[3] = -sqrt(max(1 - in[0]*in[0] - in[1]*in[1] - in[2]*in[2], 0.0f));
}
qboolean Quat_Compare( const quat_t q1, const quat_t q2 )
diff --git ref_gl/r_image.c ref_gl/r_image.c
index 1586a30..5b0817e 100644
--- ref_gl/r_image.c
+++ ref_gl/r_image.c
@@ -21,10 +21,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#if defined ( __MACOSX__ )
#include "libjpeg/jpeglib.h"
+#include "png/png.h"
#else
#include "jpeglib.h"
-#endif
#include "png.h"
+#endif
+
#include <setjmp.h>
diff --git ui/as/asbind.h ui/as/asbind.h
index e9b161d..351e3ee 100644
--- ui/as/asbind.h
+++ ui/as/asbind.h
@@ -998,10 +998,10 @@ template<typename T> struct GetArg<const T*> {
const T * operator()( asIScriptContext *ctx ) { return ctx->GetReturnAddress(); }
};
template<typename T> struct GetArg<T&> {
- T & operator()( asIScriptContext *ctx ) { return *ctx->GetReturnAddress(); }
+ T & operator()( asIScriptContext *ctx ) { return *static_cast<T*>(ctx->GetReturnAddress()); }
};
template<typename T> struct GetArg<const T&> {
- const T & operator()( asIScriptContext *ctx ) { return *ctx->GetReturnAddress(); }
+ const T & operator()( asIScriptContext *ctx ) { return *static_cast<T*>(ctx->GetReturnAddress()); }
};
//====================
diff --git ui/ui_precompiled.h ui/ui_precompiled.h
index 59bff95..79e83d5 100644
--- ui/ui_precompiled.h
+++ ui/ui_precompiled.h
@@ -21,3 +21,6 @@
#include <stdexcept>
#include "kernel/ui_syscalls.h"
+
+using std::max;
+using std::min;
diff --git unix/x11.h unix/x11.h
index de77eca..9c65716 100644
--- unix/x11.h
+++ unix/x11.h
@@ -3,7 +3,9 @@
#include <X11/keysym.h>
#include <X11/cursorfont.h>
+#ifndef __APPLE__
#include <X11/extensions/Xxf86dga.h>
+#endif
#include <X11/extensions/xf86vmode.h>
#include <X11/extensions/Xinerama.h>
#include <X11/extensions/Xrandr.h>
diff --git mac_glw.m mac_glw.m
index f0c63d8..25f4e19 100644
--- mac_glw.m
+++ mac_glw.m
@@ -24,7 +24,7 @@
#include <OpenGL/OpenGL.h>
#include "../ref_gl/r_local.h"
-#include "../client/keys.h"
+#include "../client/client.h"
#include "mac_glw.h"
glwstate_t glw_state = { NULL, qfalse };
@@ -35,19 +35,17 @@ glwstate_t glw_state = { NULL, qfalse };
* @param fullscreen <code>qtrue</code> for a fullscreen mode,
* <code>qfalse</code> otherwise
*/
-int GLimp_SetMode( int mode, qboolean fullscreen )
+rserr_t GLimp_SetMode( int x, int y, int width, int height, qboolean fullscreen, qboolean wideScreen )
{
- int width;
- int height;
int colorbits;
- qboolean wideScreen;
+ /*
if( !VID_GetModeInfo( &width, &height, &wideScreen, mode ) )
{
Com_Printf( " invalid mode\n" );
return rserr_invalid_mode;
}
-
+ */
colorbits = r_colorbits->integer;
#ifdef VIDEOMODE_HACK
@@ -135,7 +133,7 @@ int GLimp_Init( void *hinstance, void *wndproc, void *parenthWnd )
hinstance = NULL;
wndproc = NULL;
parenthWnd = NULL;
- vid_fullscreen->flags &= ~( CVAR_LATCH_VIDEO );
+// vid_fullscreen->flags &= ~( CVAR_LATCH_VIDEO );
Com_Printf( "Display initialization\n" );
const SDL_VideoInfo *info = NULL;
@@ -173,13 +171,14 @@ void GLimp_BeginFrame( void )
void GLimp_EndFrame( void )
{
SDL_GL_SwapBuffers();
-
+ /*
if( vid_fullscreen->modified || ( vid_fullscreen->integer && vid_multiscreen_head->modified ) )
{
Cbuf_ExecuteText( EXEC_APPEND, "vid_restart\n");
vid_fullscreen->modified = qfalse;
vid_multiscreen_head->modified = qfalse;
}
+ */
}
@@ -273,3 +272,5 @@ void Sys_FreeClipboardData( char *data )
{
Q_free( data );
}
+
+void Sys_OpenURLInBrowser( const char *url ) {}
\ No newline at end of file
diff --git mac_vid.c mac_vid.c
new file mode 100644
index 0000000..f4529ad
--- /dev/null
+++ mac_vid.c
@@ -0,0 +1,96 @@
+/*
+ Copyright (C) 1997-2001 Id Software, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ */
+
+#include "../client/client.h"
+#include "x11.h"
+
+static x11display_t *display;
+
+static int VID_WndProc( void *wnd, int ev, int p1, int p2 )
+{
+ display = wnd;
+ return 0;
+}
+
+/*
+ * VID_Sys_Init
+ */
+int VID_Sys_Init( int x, int y, int width, int height, qboolean fullScreen, qboolean wideScreen, qboolean verbose )
+{
+ extern cvar_t *vid_parentwid;
+
+ display = NULL;
+
+ return R_Init( NULL, NULL, (void *)(strtol( vid_parentwid->string, NULL, 0 )),
+ x, y, width, height, fullScreen, wideScreen, verbose );
+}
+
+/*
+ * VID_Front_f
+ */
+void VID_Front_f( void )
+{
+}
+
+/*
+ * VID_UpdateWindowPosAndSize
+ */
+void VID_UpdateWindowPosAndSize( int x, int y )
+{
+}
+
+/*
+ * VID_EnableAltTab
+ */
+void VID_EnableAltTab( qboolean enable )
+{
+}
+
+/*
+ * VID_GetWindowHandle - The sound module may require the handle when using Window's directsound
+ */
+void *VID_GetWindowHandle( void )
+{
+ return ( void * )NULL;
+}
+
+/*
+ * VID_EnableWinKeys
+ */
+void VID_EnableWinKeys( qboolean enable )
+{
+}
+
+/*
+ ** VID_FlashWindow
+ *
+ * Sends a flash message to inactive window
+ */
+void VID_FlashWindow( int count )
+{
+}
+
+/*
+ ** VID_GetScreenSize
+ */
+qboolean VID_GetScreenSize( int *width, int *height )
+{
+ return qfalse;
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment