memset(&m, 0, sizeof(m));
m.pointer_vertex = brush->points->v;
R_Mesh_State(&m);
- i = ((int)brush) / sizeof(colbrushf_t);
+ i = (int)(((size_t)brush) / sizeof(colbrushf_t));
GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
GL_LockArrays(0, brush->numpoints);
R_Mesh_Draw(brush->numpoints, brush->numtriangles, brush->elements);
memset(&m, 0, sizeof(m));
m.pointer_vertex = face->data_collisionvertex3f;
R_Mesh_State(&m);
- i = ((int)face) / sizeof(q3msurface_t);
+ i = (int)(((size_t)face) / sizeof(q3msurface_t));
GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
GL_LockArrays(0, face->num_collisionvertices);
R_Mesh_Draw(face->num_collisionvertices, face->num_collisiontriangles, face->data_collisionelement3i);
endif
+DP_MACHINE:=$(shell uname -m)
+ifeq ($(DP_MACHINE),x86_64)
+ UNIX_X11LIBPATH:=-L/usr/X11R6/lib64
+else
+ UNIX_X11LIBPATH:=-L/usr/X11R6/lib
+endif
+
+
# Linux configuration
ifeq ($(DP_MAKE_TARGET), linux)
OBJ_SOUND=$(OBJ_LINUXSOUND)
# Command used to delete files
CMD_RM=$(CMD_UNIXRM)
+# FIXME: should support lib64 based on uname -m output
+UNIX_X11LIBPATH=-L/usr/X11R6/lib
# BSD configuration
.if $(DP_MAKE_TARGET) == "bsd"
OBJ_GLX= builddate.c sys_linux.o vid_glx.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
LDFLAGS_UNIXCOMMON=-lm
-LDFLAGS_UNIXCL=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm $(LIB_SOUND)
+#LDFLAGS_UNIXCL=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm $(LIB_SOUND)
+LDFLAGS_UNIXCL=$(UNIX_X11LIBPATH) -lX11 -lXext -lXxf86dga -lXxf86vm $(LIB_SOUND)
LDFLAGS_UNIXSDL=`sdl-config --libs`
EXE_UNIXCL=darkplaces-glx
EXE_UNIXSV=darkplaces-dedicated
void ED_PrintNum (int ent);
#define PR_GetString(num) (pr_strings + num)
-#define PR_SetString(s) ((int) (s) ? (s - pr_strings) : 0)
+#define PR_SetString(s) ((s) != NULL ? (int) (s - pr_strings) : 0)
#endif
#define PRVM_EDICT_NUM(n) (((n) >= 0 && (n) < prog->max_edicts) ? prog->edicts + (n) : PRVM_EDICT_NUM_ERROR(n, __FILE__, __LINE__))
//int NUM_FOR_EDICT_ERROR(edict_t *e);
-#define PRVM_NUM_FOR_EDICT(e) ((prvm_edict_t *)(e) - prog->edicts)
+#define PRVM_NUM_FOR_EDICT(e) ((int)((prvm_edict_t *)(e) - prog->edicts))
//int NUM_FOR_EDICT(edict_t *e);
#define PRVM_NEXT_EDICT(e) ((e) + 1)
void PRVM_ED_PrintNum (int ent);
#define PRVM_GetString(num) (prog->strings + num)
-#define PRVM_SetString(s) ((int) (s) ? (s - prog->strings) : 0)
+#define PRVM_SetString(s) ((s) != NULL ? (int) (s - prog->strings) : 0)
//============================================================================
lighttextures[i] = pic->tex;
}
- for (light = r_shadow_worldlightchain;light;light = light->next)
- R_MeshQueue_AddTransparent(light->origin, R_Shadow_DrawLightSpriteCallback, light, ((int) light) % 5);
+ for (i = 0, light = r_shadow_worldlightchain;light;i++, light = light->next)
+ R_MeshQueue_AddTransparent(light->origin, R_Shadow_DrawLightSpriteCallback, light, i % 5);
R_MeshQueue_AddTransparent(r_editlights_cursorlocation, R_Shadow_DrawCursorCallback, NULL, 0);
}
#endif
}
-int SDL_main (int argc, char *argv[])
+int main (int argc, const char *argv[])
{
double frameoldtime, framenewtime;
break;
case SDL_ACTIVEEVENT:
if( event.active.state == SDL_APPACTIVE )
+ {
if( event.active.gain )
vid_hidden = false;
else
vid_hidden = true;
+ }
break;
case SDL_MOUSEBUTTONDOWN:
if( event.button.button == SDL_BUTTON_MIDDLE )