Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/osx'
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Mar 5, 2017
2 parents 4608327 + 1538cf6 commit 86a5e33
Show file tree
Hide file tree
Showing 100 changed files with 1,375 additions and 549 deletions.
2 changes: 2 additions & 0 deletions include/imodule.h
Expand Up @@ -333,6 +333,8 @@ namespace module {
#else
#define DARKRADIANT_DLLEXPORT
#endif
#elif defined(__APPLE__)
#define DARKRADIANT_DLLEXPORT __attribute__((visibility("default")))
#else
#define DARKRADIANT_DLLEXPORT
#endif
2 changes: 1 addition & 1 deletion libs/math/FloatTools.h
Expand Up @@ -65,7 +65,7 @@ inline Element float_mid(const Element& self, const Element& other)
template<typename Element>
inline int float_to_integer(const Element& f)
{
return lrint(f);
return static_cast<int>(lrint(f));
}

/// \brief Returns \p f rounded to the nearest multiple of \p snap.
Expand Down
6 changes: 3 additions & 3 deletions libs/picomodel/lwo/clip.c
Expand Up @@ -86,7 +86,7 @@ lwClip *lwGetClip( picoMemStream_t *fp, int cksize )
/* remember where we started */

set_flen( 0 );
pos = _pico_memstream_tell( fp );
pos = (int)_pico_memstream_tell( fp );

/* index */

Expand Down Expand Up @@ -151,7 +151,7 @@ lwClip *lwGetClip( picoMemStream_t *fp, int cksize )

/* end of the CLIP chunk? */

rlen = _pico_memstream_tell( fp ) - pos;
rlen = (int)_pico_memstream_tell( fp ) - pos;
if ( cksize < rlen ) goto Fail;
if ( cksize == rlen )
return clip;
Expand Down Expand Up @@ -238,7 +238,7 @@ lwClip *lwGetClip( picoMemStream_t *fp, int cksize )

/* end of the CLIP chunk? */

rlen = _pico_memstream_tell( fp ) - pos;
rlen = (int)_pico_memstream_tell( fp ) - pos;
if ( cksize < rlen ) goto Fail;
if ( cksize == rlen ) break;

Expand Down
4 changes: 2 additions & 2 deletions libs/picomodel/lwo/envelope.c
Expand Up @@ -61,7 +61,7 @@ lwEnvelope *lwGetEnvelope( picoMemStream_t *fp, int cksize )
/* remember where we started */

set_flen( 0 );
pos = _pico_memstream_tell( fp );
pos = (int)_pico_memstream_tell( fp );

/* index */

Expand Down Expand Up @@ -158,7 +158,7 @@ lwEnvelope *lwGetEnvelope( picoMemStream_t *fp, int cksize )

/* end of the ENVL chunk? */

rlen = _pico_memstream_tell( fp ) - pos;
rlen = (int)_pico_memstream_tell( fp ) - pos;
if ( cksize < rlen ) goto Fail;
if ( cksize == rlen ) break;

Expand Down
2 changes: 1 addition & 1 deletion libs/picomodel/lwo/list.c
Expand Up @@ -40,7 +40,7 @@ Append a node to a list.

void lwListAdd( void **list, void *node )
{
lwNode *head, *tail;
lwNode *head, *tail = NULL;

head = *(( lwNode ** ) list );
if ( !head ) {
Expand Down
2 changes: 1 addition & 1 deletion libs/picomodel/lwo/lwio.c
Expand Up @@ -264,7 +264,7 @@ char *getS0( picoMemStream_t *fp )

if ( flen == FLEN_ERROR ) return NULL;

pos = _pico_memstream_tell( fp );
pos = (int)_pico_memstream_tell( fp );
for ( i = 1; ; i++ ) {
c = _pico_memstream_getc( fp );
if ( c <= 0 ) break;
Expand Down
2 changes: 1 addition & 1 deletion libs/picomodel/lwo/lwo2.c
Expand Up @@ -264,7 +264,7 @@ lwObject *lwGetObject( char *filename, picoMemStream_t *fp, unsigned int *failID
Fail:
if ( failID ) *failID = id;
if ( fp ) {
if ( failpos ) *failpos = _pico_memstream_tell( fp );
if ( failpos ) *failpos = (int)_pico_memstream_tell( fp );
}
lwFreeObject( object );
return NULL;
Expand Down
6 changes: 3 additions & 3 deletions libs/picomodel/lwo/lwob.c
Expand Up @@ -101,7 +101,7 @@ parameters.

static int add_tvel( float pos[], float vel[], lwEnvelope **elist, int *nenvs )
{
lwEnvelope *env;
lwEnvelope *env = NULL;
lwKey *key0, *key1;
int i;

Expand Down Expand Up @@ -219,7 +219,7 @@ lwSurface *lwGetSurface5( picoMemStream_t *fp, int cksize, lwObject *obj )
/* remember where we started */

set_flen( 0 );
pos = _pico_memstream_tell( fp );
pos = (int)_pico_memstream_tell( fp );

/* name */

Expand Down Expand Up @@ -692,7 +692,7 @@ lwObject *lwGetObject5( char *filename, picoMemStream_t *fp, unsigned int *failI
Fail:
if ( failID ) *failID = id;
if ( fp ) {
if ( failpos ) *failpos = _pico_memstream_tell( fp );
if ( failpos ) *failpos = (int)_pico_memstream_tell( fp );
}
lwFreeObject( object );
return NULL;
Expand Down
26 changes: 13 additions & 13 deletions libs/picomodel/lwo/surface.c
Expand Up @@ -109,7 +109,7 @@ int lwGetTHeader( picoMemStream_t *fp, int hsz, lwTexture *tex )
/* remember where we started */

set_flen( 0 );
pos = _pico_memstream_tell( fp );
pos = (int)_pico_memstream_tell( fp );

/* ordinal string */

Expand Down Expand Up @@ -177,7 +177,7 @@ int lwGetTHeader( picoMemStream_t *fp, int hsz, lwTexture *tex )
if ( 6 != get_flen() ) return 0;
}

set_flen( _pico_memstream_tell( fp ) - pos );
set_flen( (int)_pico_memstream_tell( fp ) - pos );
return 1;
}

Expand All @@ -196,7 +196,7 @@ int lwGetTMap( picoMemStream_t *fp, int tmapsz, lwTMap *tmap )
unsigned short sz;
int rlen, pos, i;

pos = _pico_memstream_tell( fp );
pos = (int)_pico_memstream_tell( fp );
id = getU4( fp );
sz = getU2( fp );
if ( 0 > get_flen() ) return 0;
Expand Down Expand Up @@ -266,7 +266,7 @@ int lwGetTMap( picoMemStream_t *fp, int tmapsz, lwTMap *tmap )
if ( 6 != get_flen() ) return 0;
}

set_flen( _pico_memstream_tell( fp ) - pos );
set_flen( (int)_pico_memstream_tell( fp ) - pos );
return 1;
}

Expand All @@ -284,7 +284,7 @@ int lwGetImageMap( picoMemStream_t *fp, int rsz, lwTexture *tex )
unsigned short sz;
int rlen, pos;

pos = _pico_memstream_tell( fp );
pos = (int)_pico_memstream_tell( fp );
id = getU4( fp );
sz = getU2( fp );
if ( 0 > get_flen() ) return 0;
Expand Down Expand Up @@ -375,7 +375,7 @@ int lwGetImageMap( picoMemStream_t *fp, int rsz, lwTexture *tex )
if ( 6 != get_flen() ) return 0;
}

set_flen( _pico_memstream_tell( fp ) - pos );
set_flen( (int)_pico_memstream_tell( fp ) - pos );
return 1;
}

Expand All @@ -393,7 +393,7 @@ int lwGetProcedural( picoMemStream_t *fp, int rsz, lwTexture *tex )
unsigned short sz;
int rlen, pos;

pos = _pico_memstream_tell( fp );
pos = (int)_pico_memstream_tell( fp );
id = getU4( fp );
sz = getU2( fp );
if ( 0 > get_flen() ) return 0;
Expand Down Expand Up @@ -450,7 +450,7 @@ int lwGetProcedural( picoMemStream_t *fp, int rsz, lwTexture *tex )
if ( 6 != get_flen() ) return 0;
}

set_flen( _pico_memstream_tell( fp ) - pos );
set_flen( (int)_pico_memstream_tell( fp ) - pos );
return 1;
}

Expand All @@ -468,7 +468,7 @@ int lwGetGradient( picoMemStream_t *fp, int rsz, lwTexture *tex )
unsigned short sz;
int rlen, pos, i, j, nkeys;

pos = _pico_memstream_tell( fp );
pos = (int)_pico_memstream_tell( fp );
id = getU4( fp );
sz = getU2( fp );
if ( 0 > get_flen() ) return 0;
Expand Down Expand Up @@ -548,7 +548,7 @@ int lwGetGradient( picoMemStream_t *fp, int rsz, lwTexture *tex )
if ( 6 != get_flen() ) return 0;
}

set_flen( _pico_memstream_tell( fp ) - pos );
set_flen( (int)_pico_memstream_tell( fp ) - pos );
return 1;
}

Expand Down Expand Up @@ -618,7 +618,7 @@ lwPlugin *lwGetShader( picoMemStream_t *fp, int bloksz )
shdr = _pico_calloc( 1, sizeof( lwPlugin ));
if ( !shdr ) return NULL;

pos = _pico_memstream_tell( fp );
pos = (int)_pico_memstream_tell( fp );
set_flen( 0 );
hsz = getU2( fp );
shdr->ord = getS0( fp );
Expand Down Expand Up @@ -682,7 +682,7 @@ lwPlugin *lwGetShader( picoMemStream_t *fp, int bloksz )
if ( 6 != get_flen() ) goto Fail;
}

set_flen( _pico_memstream_tell( fp ) - pos );
set_flen( (int)_pico_memstream_tell( fp ) - pos );
return shdr;

Fail:
Expand Down Expand Up @@ -838,7 +838,7 @@ lwSurface *lwGetSurface( picoMemStream_t *fp, int cksize )
/* remember where we started */

set_flen( 0 );
pos = _pico_memstream_tell( fp );
pos = (int)_pico_memstream_tell( fp );

/* names */

Expand Down
4 changes: 2 additions & 2 deletions libs/picomodel/pm_3ds.c
Expand Up @@ -650,7 +650,7 @@ static int DoNextEditorDataChunk (T3dsLoaderPers *pers, long endofs)
#endif
}
/* skip unknown chunk */
pers->cofs = nextofs;
pers->cofs = (int)nextofs;
if (pers->cofs >= pers->maxofs) break;
}
return 1;
Expand Down Expand Up @@ -707,7 +707,7 @@ static int DoNextChunk (T3dsLoaderPers *pers, int endofs)
continue;
}
/* skip unknown chunk */
pers->cofs = nextofs;
pers->cofs = (int)nextofs;
if (pers->cofs >= pers->maxofs) break;
}
return 1;
Expand Down
2 changes: 1 addition & 1 deletion libs/picomodel/pm_ase.c
Expand Up @@ -954,7 +954,7 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD )
float transValue = 0.0f, shineValue = 1.0f;
picoColor_t ambientColor, diffuseColor, specularColor;
char *mapname = NULL;
int subMtlId, subMaterialLevel = -1;
int subMtlId = -1, subMaterialLevel = -1;
float uOffset = 0.0f;
float vOffset = 0.0f;
float uScale = 1.0f;
Expand Down
2 changes: 1 addition & 1 deletion libs/picomodel/pm_fm.c
Expand Up @@ -449,7 +449,7 @@ static picoModel_t *_fm_load( PM_PARAMS_LOAD )
#endif
continue;
}
else if ( (p_index_LUT[triangle->index_xyz[j]].next == NULL) ) // Not equal to Main entry, and no LL entry
else if ( p_index_LUT[triangle->index_xyz[j]].next == NULL ) // Not equal to Main entry, and no LL entry
{ // Add first entry of LL from Main
p_index_LUT2 = (index_LUT_t *)_pico_alloc(sizeof(index_LUT_t));
if (p_index_LUT2 == NULL)
Expand Down
2 changes: 1 addition & 1 deletion libs/picomodel/pm_obj.c
Expand Up @@ -664,7 +664,7 @@ static picoModel_t *_obj_load( PM_PARAMS_LOAD )
picoVec3_t normals[ 4 ];
picoVec2_t coords [ 4 ];

int iv [ 4 ], has_v;
int iv [ 4 ], has_v = 0;
int ivt[ 4 ], has_vt = 0;
int ivn[ 4 ], has_vn = 0;
int have_quad = 0;
Expand Down
2 changes: 1 addition & 1 deletion libs/render/RenderableSpacePartition.h
Expand Up @@ -131,7 +131,7 @@ class RenderableSpacePartition :
}
}

void render(const RenderInfo& info) const
void render(const RenderInfo& info) const override
{
if (_spacePartition != NULL)
{
Expand Down

0 comments on commit 86a5e33

Please sign in to comment.