Update to v1200.
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
@@ -106,6 +107,7 @@
|
||||
<ControlFlowGuard>false</ControlFlowGuard>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
@@ -103,6 +104,7 @@
|
||||
<ControlFlowGuard>false</ControlFlowGuard>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -136,6 +137,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
@@ -104,6 +105,7 @@
|
||||
<ControlFlowGuard>false</ControlFlowGuard>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
@@ -95,6 +96,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
@@ -106,6 +107,7 @@
|
||||
<ControlFlowGuard>false</ControlFlowGuard>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
|
||||
@@ -1361,3 +1361,8 @@ void graphics_link(void(*rtSym)(const char *sym, void *pc)) {
|
||||
rtSym("ShowPointer", bbShowPointer);
|
||||
rtSym("HidePointer", bbHidePointer);
|
||||
}
|
||||
|
||||
// NVidia Optimus
|
||||
extern "C" {
|
||||
_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
|
||||
}
|
||||
@@ -70,6 +70,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
@@ -97,6 +98,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
<ControlFlowGuard>false</ControlFlowGuard>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release\asm_makeinsts.tlb</TypeLibraryName>
|
||||
@@ -96,6 +97,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug\asm_makeinsts.tlb</TypeLibraryName>
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug\blitz.tlb</TypeLibraryName>
|
||||
@@ -100,6 +101,7 @@
|
||||
<ControlFlowGuard>false</ControlFlowGuard>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release\blitz.tlb</TypeLibraryName>
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
@@ -96,6 +97,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
@@ -94,6 +95,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
@@ -95,6 +96,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
<ControlFlowGuard>false</ControlFlowGuard>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
@@ -102,6 +103,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<Midl>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
|
||||
+12
-9
@@ -58,24 +58,27 @@ void PixelFormat::setFormat(const DDPIXELFORMAT &pf) {
|
||||
asm_coder.CodePoint(point_code, depth, amask, rmask, gmask, bmask);
|
||||
}
|
||||
|
||||
static void adjustTexSize(int *width, int *height, IDirect3DDevice7 *dir3dDev) {
|
||||
static void adjustTexSize(int *width, int *height, IDirect3DDevice7 *dir3dDev, bool forcePOT = true) {
|
||||
D3DDEVICEDESC7 ddDesc = { 0 };
|
||||
if (dir3dDev->GetCaps(&ddDesc) < 0) {
|
||||
*width = *height = 256;
|
||||
return;
|
||||
}
|
||||
|
||||
int w = *width, h = *height, min, max;
|
||||
//make power of 2
|
||||
//Try *always* making POW2 size to fix GF6800 non-pow2 tex issue
|
||||
// if( ddDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2 ){
|
||||
|
||||
if( ddDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2 || ddDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL || forcePOT){
|
||||
// DirectX Device doesn't support Non Power-Of-Two Textures.
|
||||
|
||||
for (w = 1; w < *width; w <<= 1) {}
|
||||
for (h = 1; h < *height; h <<= 1) {}
|
||||
// }
|
||||
//make square
|
||||
if (ddDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY) {
|
||||
} else if (ddDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY) {
|
||||
// DirectX Device only supports Square Textures;
|
||||
|
||||
if (w > h) h = w;
|
||||
else w = h;
|
||||
}
|
||||
|
||||
//check aspect ratio
|
||||
if (max = ddDesc.dwMaxTextureAspectRatio) {
|
||||
int asp = w > h ? w / h : h / w;
|
||||
@@ -300,7 +303,7 @@ ddSurf *ddUtil::createSurface(int w, int h, int flags, gxGraphics *gfx) {
|
||||
desc.ddsCaps.dwCaps |= DDSCAPS_COMPLEX;
|
||||
desc.ddsCaps.dwCaps2 |= DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES;
|
||||
}
|
||||
adjustTexSize((int*)&desc.dwWidth, (int*)&desc.dwHeight, gfx->dir3dDev);
|
||||
adjustTexSize((int*)&desc.dwWidth, (int*)&desc.dwHeight, gfx->dir3dDev, !(flags & (gxCanvas::CANVAS_TEX_NPOT)));
|
||||
} else {
|
||||
desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
|
||||
if (flags & gxCanvas::CANVAS_HIGHCOLOR) {
|
||||
@@ -514,7 +517,7 @@ ddSurf *ddUtil::loadSurface(const std::string &f, int flags, gxGraphics *gfx) {
|
||||
}
|
||||
|
||||
int t_w = width, t_h = height;
|
||||
if (flags & gxCanvas::CANVAS_TEXTURE) adjustTexSize(&t_w, &t_h, gfx->dir3dDev);
|
||||
if (flags & gxCanvas::CANVAS_TEXTURE) adjustTexSize(&t_w, &t_h, gfx->dir3dDev, !(flags & (gxCanvas::CANVAS_TEX_NPOT)));
|
||||
copy(dest, 0, 0, t_w, t_h, src, 0, height - 1, width, -height);
|
||||
|
||||
src->Release();
|
||||
|
||||
+13
-12
@@ -39,8 +39,7 @@ static void calcShifts( unsigned mask,unsigned char *shr,unsigned char *shl ){
|
||||
}
|
||||
|
||||
struct Rect : public RECT {
|
||||
Rect(){
|
||||
}
|
||||
Rect() {}
|
||||
Rect(int x, int y, int w, int h) {
|
||||
left = x; top = y; right = x + w; bottom = y + h;
|
||||
}
|
||||
@@ -669,17 +668,17 @@ void gxCanvas::unlock()const{
|
||||
void gxCanvas::setPixel(int x, int y, unsigned argb) {
|
||||
x += origin_x; if (x < viewport.left || x >= viewport.right) return;
|
||||
y += origin_y; if (y < viewport.top || y >= viewport.bottom) return;
|
||||
lock();
|
||||
//lock();
|
||||
setPixelFast(x, y, argb);
|
||||
unlock();
|
||||
//unlock();
|
||||
}
|
||||
|
||||
unsigned gxCanvas::getPixel(int x, int y)const {
|
||||
x += origin_x; if (x < viewport.left || x >= viewport.right) return format.toARGB(mask_surf);
|
||||
y += origin_y; if (y < viewport.top || y >= viewport.bottom) return format.toARGB(mask_surf);
|
||||
lock();
|
||||
//lock();
|
||||
unsigned p = getPixelFast(x, y);
|
||||
unlock();
|
||||
//unlock();
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -689,10 +688,12 @@ void gxCanvas::copyPixelFast( int x,int y,gxCanvas *src,int src_x,int src_y ){
|
||||
*(short*)(locked_surf + y*locked_pitch + x * 2) =
|
||||
*(short*)(src->locked_surf + src_y*src->locked_pitch + src_x * 2);
|
||||
break;
|
||||
case 24:{
|
||||
case 24:
|
||||
{
|
||||
unsigned char *p = locked_surf + y*locked_pitch + x * 3;
|
||||
unsigned char *t = src->locked_surf + src_y*src->locked_pitch + src_x * 3;
|
||||
*(short*)p=*(short*)t;*(char*)(p+2)=*(char*)(t+2);}
|
||||
*(short*)p = *(short*)t; *(char*)(p + 2) = *(char*)(t + 2);
|
||||
}
|
||||
break;
|
||||
case 32:
|
||||
*(int*)(locked_surf + y*locked_pitch + x * 4) =
|
||||
@@ -706,11 +707,11 @@ void gxCanvas::copyPixel( int x,int y,gxCanvas *src,int src_x,int src_y ){
|
||||
y += origin_y; if (y < viewport.top || y >= viewport.bottom) return;
|
||||
src_x += src->origin_x; if (src_x < src->viewport.left || src_x >= src->viewport.right) return;
|
||||
src_y += src->origin_y; if (src_y < src->viewport.top || src_y >= src->viewport.bottom) return;
|
||||
lock();
|
||||
src->lock();
|
||||
//lock();
|
||||
//src->lock();
|
||||
copyPixelFast(x, y, src, src_x, src_y);
|
||||
src->unlock();
|
||||
unlock();
|
||||
//src->unlock();
|
||||
//unlock();
|
||||
}
|
||||
|
||||
void gxCanvas::setCubeMode(int mode) {
|
||||
|
||||
@@ -67,13 +67,14 @@ public:
|
||||
CANVAS_TEX_CUBE = 0x0080,
|
||||
CANVAS_TEX_VIDMEM = 0x0100,
|
||||
CANVAS_TEX_HICOLOR = 0x0200,
|
||||
CANVAS_TEX_NPOT = 0x0400, // 1024
|
||||
|
||||
CANVAS_TEXTURE = 0x10000,
|
||||
CANVAS_NONDISPLAY = 0x20000,
|
||||
CANVAS_HIGHCOLOR = 0x40000,
|
||||
|
||||
CANVAS_3DRENDER = 0x1000,
|
||||
CANVAS_3DZRENDER = 0x2000,
|
||||
CANVAS_3DRENDER = 0x1000, // 4096
|
||||
CANVAS_3DZRENDER = 0x2000, // 8192
|
||||
};
|
||||
|
||||
enum {
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
@@ -96,6 +97,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
@@ -94,6 +95,7 @@
|
||||
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
|
||||
<CallingConvention>StdCall</CallingConvention>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
|
||||
Reference in New Issue
Block a user