Compile with VS 2015 Express, build assimp on Windows

This commit is contained in:
rdb 2017-04-03 13:57:40 +02:00
parent 97cd007af3
commit f7af155e93
8 changed files with 31 additions and 19 deletions

View File

@ -571,6 +571,10 @@ if (COMPILER == "MSVC"):
#LibName(pkg, 'ddraw.lib') #LibName(pkg, 'ddraw.lib')
LibName(pkg, 'dxguid.lib') LibName(pkg, 'dxguid.lib')
if SDK.get("VISUALSTUDIO_VERSION") == '14.0':
# dxerr needs this for __vsnwprintf definition.
LibName(pkg, 'legacy_stdio_definitions.lib')
if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"): if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2") IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
@ -637,7 +641,6 @@ if (COMPILER == "MSVC"):
if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/rfftw.lib") if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/rfftw.lib")
if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw.lib") if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw.lib")
if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib") if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
if (PkgSkip("ASSIMP")==0): PkgDisable("ASSIMP") # Not yet supported
if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib") if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib") if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib") if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
@ -652,6 +655,9 @@ if (COMPILER == "MSVC"):
if (PkgSkip("FCOLLADA")==0): if (PkgSkip("FCOLLADA")==0):
LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib") LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada") IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
if (PkgSkip("ASSIMP")==0):
LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include/assimp")
if (PkgSkip("SQUISH")==0): if (PkgSkip("SQUISH")==0):
if GetOptimize() <= 2: if GetOptimize() <= 2:
LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib") LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
@ -2875,7 +2881,8 @@ if tp_dir is not None:
CopyFile(GetOutputDir() + "/" + base, tp_lib) CopyFile(GetOutputDir() + "/" + base, tp_lib)
if GetTarget() == 'windows': if GetTarget() == 'windows':
CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/") if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
if not PkgSkip("PYTHON") and not RTDIST: if not PkgSkip("PYTHON") and not RTDIST:
# We need to copy the Python DLL to the bin directory for now. # We need to copy the Python DLL to the bin directory for now.
@ -5575,7 +5582,7 @@ if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx') TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj') TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
TargetAdd('libp3assimp.dll', opts=OPTS) TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB'])
# #
# DIRECTORY: pandatool/src/daeprogs/ # DIRECTORY: pandatool/src/daeprogs/

View File

@ -2384,6 +2384,8 @@ def SetupVisualStudioEnviron():
os.environ["VCINSTALLDIR"] = SDK["VISUALSTUDIO"] + "VC" os.environ["VCINSTALLDIR"] = SDK["VISUALSTUDIO"] + "VC"
os.environ["WindowsSdkDir"] = SDK["MSPLATFORM"] os.environ["WindowsSdkDir"] = SDK["MSPLATFORM"]
winsdk_ver = SDK["MSPLATFORM_VERSION"]
# Determine the directories to look in based on the architecture. # Determine the directories to look in based on the architecture.
arch = GetTargetArch() arch = GetTargetArch()
bindir = "" bindir = ""
@ -2399,9 +2401,16 @@ def SetupVisualStudioEnviron():
# Special version of the tools that run on x86. # Special version of the tools that run on x86.
bindir = 'x86_' + bindir bindir = 'x86_' + bindir
binpath = SDK["VISUALSTUDIO"] + "VC\\bin\\" + bindir vc_binpath = SDK["VISUALSTUDIO"] + "VC\\bin"
if not os.path.isdir(binpath): binpath = os.path.join(vc_binpath, bindir)
exit("Couldn't find compilers in %s. You may need to install the Windows SDK 7.1 and the Visual C++ 2010 SP1 Compiler Update for Windows SDK 7.1." % binpath) if not os.path.isfile(binpath + "\\cl.exe"):
# Try the x86 tools, those should work just as well.
if arch == 'x64' and os.path.isfile(vc_binpath + "\\x86_amd64\\cl.exe"):
binpath = "{0}\\x86_amd64;{0}".format(vc_binpath)
elif winsdk_ver.startswith('10.'):
exit("Couldn't find compilers in %s. You may need to install the Windows SDK 7.1 and the Visual C++ 2010 SP1 Compiler Update for Windows SDK 7.1." % binpath)
else:
exit("Couldn't find compilers in %s." % binpath)
AddToPathEnv("PATH", binpath) AddToPathEnv("PATH", binpath)
AddToPathEnv("PATH", SDK["VISUALSTUDIO"] + "Common7\\IDE") AddToPathEnv("PATH", SDK["VISUALSTUDIO"] + "Common7\\IDE")

View File

@ -265,8 +265,3 @@ init_libdxgsg9() {
PandaSystem *ps = PandaSystem::get_global_ptr(); PandaSystem *ps = PandaSystem::get_global_ptr();
ps->add_system("DirectX9"); ps->add_system("DirectX9");
} }
// Necessary to allow use of dxerr from MSVC 2015
#if _MSC_VER >= 1900
int (WINAPIV * __vsnprintf)(char *, size_t, const char*, va_list) = _vsnprintf;
#endif

View File

@ -164,7 +164,7 @@ munge_format_impl(const GeomVertexFormat *orig,
// Now go through the remaining arrays and make sure they are tightly // Now go through the remaining arrays and make sure they are tightly
// packed. If not, repack them. // packed. If not, repack them.
for (int i = 0; i < new_format->get_num_arrays(); ++i) { for (size_t i = 0; i < new_format->get_num_arrays(); ++i) {
CPT(GeomVertexArrayFormat) orig_a = new_format->get_array(i); CPT(GeomVertexArrayFormat) orig_a = new_format->get_array(i);
if (orig_a->count_unused_space() != 0) { if (orig_a->count_unused_space() != 0) {
PT(GeomVertexArrayFormat) new_a = new GeomVertexArrayFormat; PT(GeomVertexArrayFormat) new_a = new GeomVertexArrayFormat;
@ -267,7 +267,7 @@ premunge_format_impl(const GeomVertexFormat *orig) {
// Now go through the remaining arrays and make sure they are tightly // Now go through the remaining arrays and make sure they are tightly
// packed. If not, repack them. // packed. If not, repack them.
for (int i = 0; i < new_format->get_num_arrays(); ++i) { for (size_t i = 0; i < new_format->get_num_arrays(); ++i) {
CPT(GeomVertexArrayFormat) orig_a = new_format->get_array(i); CPT(GeomVertexArrayFormat) orig_a = new_format->get_array(i);
if (orig_a->count_unused_space() != 0) { if (orig_a->count_unused_space() != 0) {
PT(GeomVertexArrayFormat) new_a = new GeomVertexArrayFormat; PT(GeomVertexArrayFormat) new_a = new GeomVertexArrayFormat;

View File

@ -863,7 +863,7 @@ prepare_display_region(DisplayRegionPipelineReader *dr) {
dr->get_region_pixels_i(l, u, w, h); dr->get_region_pixels_i(l, u, w, h);
// Create the viewport // Create the viewport
D3DVIEWPORT9 vp = { l, u, w, h, 0.0f, 1.0f }; D3DVIEWPORT9 vp = { (DWORD)l, (DWORD)u, (DWORD)w, (DWORD)h, 0.0f, 1.0f };
_current_viewport = vp; _current_viewport = vp;
HRESULT hr = _d3d_device->SetViewport(&_current_viewport); HRESULT hr = _d3d_device->SetViewport(&_current_viewport);
if (FAILED(hr)) { if (FAILED(hr)) {
@ -1185,7 +1185,7 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader,
const TransformTable *table = data_reader->get_transform_table(); const TransformTable *table = data_reader->get_transform_table();
if (table != (TransformTable *)NULL) { if (table != (TransformTable *)NULL) {
for (int i = 0; i < table->get_num_transforms(); i++) { for (size_t i = 0; i < table->get_num_transforms(); ++i) {
LMatrix4 mat; LMatrix4 mat;
table->get_transform(i)->mult_matrix(mat, _internal_transform->get_mat()); table->get_transform(i)->mult_matrix(mat, _internal_transform->get_mat());
const D3DMATRIX *d3d_mat = (const D3DMATRIX *)mat.get_data(); const D3DMATRIX *d3d_mat = (const D3DMATRIX *)mat.get_data();

View File

@ -168,7 +168,7 @@ upload_data(const GeomPrimitivePipelineReader *reader, bool force) {
if (data_pointer == NULL) { if (data_pointer == NULL) {
return false; return false;
} }
int data_size = reader->get_data_size_bytes(); size_t data_size = (size_t)reader->get_data_size_bytes();
if (reader->get_index_type() == GeomEnums::NT_uint8) { if (reader->get_index_type() == GeomEnums::NT_uint8) {
// We widen 8-bits indices to 16-bits. // We widen 8-bits indices to 16-bits.

View File

@ -7,7 +7,8 @@
// //
// Generated from the TEXTINCLUDE 2 resource. // Generated from the TEXTINCLUDE 2 resource.
// //
#include "afxres.h" #include "WinResrc.h"
#define IDC_STATIC -1
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS

View File

@ -7,8 +7,8 @@
// //
// Generated from the TEXTINCLUDE 2 resource. // Generated from the TEXTINCLUDE 2 resource.
// //
#include "afxres.h" #include "WinResrc.h"
#define IDC_STATIC -1
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS