1
0
forked from 0ad/0ad

no message

This was SVN commit r213.
This commit is contained in:
Acumen 2004-04-24 16:52:39 +00:00
parent 89e6fdfbaf
commit 6869ffd9a5
5 changed files with 53 additions and 17 deletions

View File

@ -180,21 +180,34 @@ uintptr_t round_up(uintptr_t val, uintptr_t multiple)
}
//u16 addusw(u16 x, u16 y)
//{
// u32 t = x;
// return (u16)MIN(t+y, 0xffff);
//}
//
//
//u16 subusw(u16 x, u16 y)
//{
// long t = x;
// return MAX(t-y, 0);
//}
u16 addusw(u16 x, u16 y)
{
u32 t = x;
return (u16)MIN(t+y, 0xffff);
u32 t = x;
return (u16)MIN(t+y, 0xffff);
}
u16 subusw(u16 x, u16 y)
{
long t = x;
return MAX(t-y, 0);
long t = x;
return (u16)(MAX(t-y, 0));
}
// provide fminf for non-C99 compilers
#ifndef HAVE_C99

View File

@ -472,11 +472,22 @@ static int aio_rw(struct aiocb* cb)
r->ovl.Internal = r->ovl.InternalHigh = 0;
#if _MSC_VER >= 1300
r->ovl.Pointer = (void*)ofs;
#else
r->ovl.Offset = ofs;
#endif
//#if _MSC_VER >= 1300
// r->ovl.Pointer = (void*)ofs;
//#else
// r->ovl.Offset = ofs;
//#endif
// a bit tricky: this should work even if size_t grows to 64 bits.
//
// we don't use OVERLAPPED.Pointer because it's not defined in
// previous platform sdk versions, and i can't figure out how
// determine the sdk version installed. can't just check for the
// vc6/vc7 compiler - vc6 with the old sdk may have been upgraded
// to the vc7.1 compiler.
//
// this assumes little endian, but we're windows-specific here anyway.
*(size_t*)&r->ovl.Offset = ofs;
assert(cb->aio_buf != 0);

View File

@ -649,10 +649,10 @@ fp_freeaddrinfo_t freeaddrinfo;
These are included in the linux C libraries, and in newer platform SDK's, so
should only be needed in VC++6 or earlier.
*/
#if _MSC_VER <= 1200 /* VC++6 or earlier */
//#if _MSC_VER <= 1200 /* VC++6 or earlier */
const struct in6_addr in6addr_any=IN6ADDR_ANY_INIT; /* :: */
const struct in6_addr in6addr_loopback=IN6ADDR_LOOPBACK_INIT; /* ::1 */
#endif
//#endif
/*
void entry(void)
{

View File

@ -420,8 +420,12 @@ struct ip_mreq
// ==== IPv6 ====
#define in6addr_any PS_in6addr_any
#define in6addr_loopback PS_in6addr_loopback
extern const struct in6_addr in6addr_any; /* :: */
extern const struct in6_addr in6addr_loopback; /* ::1 */
#define IN6ADDR_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
#define IN6ADDR_LOOPBACK_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } }
// struct of array => 2 braces.

View File

@ -294,12 +294,20 @@ void InitScene ()
}
// get default texture to apply to terrain
// CTextureEntry* texture=0;
// if (g_TexMan.m_TerrainTextures.size()>0) {
// if (g_TexMan.m_TerrainTextures[0].m_Textures.size()) {
// texture=g_TexMan.m_TerrainTextures[0].m_Textures[0];
// }
// }
CTextureEntry* texture=0;
if (g_TexMan.m_TerrainTextures.size()>0) {
if (g_TexMan.m_TerrainTextures[0].m_Textures.size()) {
texture=g_TexMan.m_TerrainTextures[0].m_Textures[0];
}
}
for (uint ii=0;ii<g_TexMan.m_TerrainTextures.size();ii++) {
if (g_TexMan.m_TerrainTextures[ii].m_Textures.size()) {
texture=g_TexMan.m_TerrainTextures[ii].m_Textures[0];
break;
}
}
// cover entire terrain with default texture
u32 patchesPerSide=g_Terrain.GetPatchesPerSide();