Skip to content

Commit

Permalink
more linux porting, but still build failed at 86% in xrCore
Browse files Browse the repository at this point in the history
  • Loading branch information
q4a committed May 15, 2018
1 parent 4af858f commit 79130e1
Show file tree
Hide file tree
Showing 14 changed files with 278 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Externals/NVTT/src/nvcore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SET(CORE_SRCS
Library.h
Library.cpp)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../../include)

# targets
ADD_DEFINITIONS(-DNVCORE_EXPORTS)
Expand Down
2 changes: 2 additions & 0 deletions Externals/NVTT/src/nvcore/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#endif

#if NV_OS_LINUX && defined(HAVE_EXECINFO_H)
# include <sys/types.h>
# include <unistd.h> // getpid
# include <execinfo.h> // backtrace
# if NV_CC_GNUC // defined(HAVE_CXXABI_H)
# include <cxxabi.h>
Expand Down
4 changes: 2 additions & 2 deletions Externals/NVTT/src/nvimage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PROJECT(nvimage)

SET(IMAGE_SRCS
SET(IMAGE_SRCS
nvimage.h
FloatImage.h
FloatImage.cpp
Expand All @@ -27,7 +27,7 @@ SET(IMAGE_SRCS
PsdFile.h
TgaFile.h)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../include ${CMAKE_CURRENT_SOURCE_DIR}/../nvcore ${CMAKE_CURRENT_SOURCE_DIR}/../nvmath)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../../include)

IF(PNG_FOUND)
SET(LIBS ${LIBS} ${PNG_LIBRARIES})
Expand Down
6 changes: 3 additions & 3 deletions Externals/NVTT/src/nvimage/ImageIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ FloatImage * nv::ImageIO::loadFloat(const char * fileName)
StdInputStream stream(fileName);

if (stream.isError()) {
return false;
return NULL;
}

return loadFloat(fileName, stream);
Expand Down Expand Up @@ -233,7 +233,7 @@ Image * nv::ImageIO::loadTGA(Stream & s)
case TGA_TYPE_INDEXED:
if( tga.colormap_type!=1 || tga.colormap_size!=24 || tga.colormap_length>256 ) {
nvDebug( "*** ImageIO::loadTGA: Error, only 24bit paletted images are supported.\n" );
return false;
return NULL;
}
pal = true;
break;
Expand All @@ -254,7 +254,7 @@ Image * nv::ImageIO::loadTGA(Stream & s)

default:
nvDebug( "*** ImageIO::loadTGA: Error, unsupported image type.\n" );
return false;
return NULL;
}

const uint pixel_size = (tga.pixel_size/8);
Expand Down
2 changes: 1 addition & 1 deletion Externals/NVTT/src/nvmath/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SET(MATH_SRCS
Basis.h Basis.cpp
Triangle.h Triangle.cpp TriBox.cpp)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../include ${CMAKE_CURRENT_SOURCE_DIR}/../nvcore)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../../include)

# targets
ADD_DEFINITIONS(-DNVMATH_EXPORTS)
Expand Down
2 changes: 1 addition & 1 deletion Externals/NVTT/src/nvtt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ IF(CUDA_FOUND)
INCLUDE_DIRECTORIES(${CUDA_INCLUDE_PATH})
ENDIF(CUDA_FOUND)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../include ${CMAKE_CURRENT_SOURCE_DIR}/../nvcore ${CMAKE_CURRENT_SOURCE_DIR}/../nvimage ${CMAKE_CURRENT_SOURCE_DIR}/../nvmath)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../../include)

ADD_DEFINITIONS(-DNVTT_EXPORTS)

Expand Down
6 changes: 6 additions & 0 deletions Externals/cximage/ximadef.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,16 @@ typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned int UINT;
typedef const char* LPCTSTR;

typedef DWORD COLORREF;
typedef unsigned int HANDLE;
typedef void* HRGN;
typedef void* HDC;

typedef int boolean;

#define _tfopen fopen

#ifndef BOOL
#define BOOL bool
Expand Down
12 changes: 8 additions & 4 deletions Externals/cximage/ximainfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

#include "ximage.h"

#if !defined(WIN32)
#define _tcsnicmp(a,b,c) strcasecmp(a,b)
#endif

////////////////////////////////////////////////////////////////////////////////
/**
* \return the color used for transparency, and/or for background color
Expand Down Expand Up @@ -538,7 +542,7 @@ void CxImage::SetOffset(long x,long y)
////////////////////////////////////////////////////////////////////////////////
/**
* \sa SetJpegQuality, GetJpegQualityF
* \author [DP]; changes [Stefan Schürmans]
* \author [DP]; changes [Stefan Sch?rmans]
*/
BYTE CxImage::GetJpegQuality() const
{
Expand All @@ -547,7 +551,7 @@ BYTE CxImage::GetJpegQuality() const
////////////////////////////////////////////////////////////////////////////////
/**
* \sa SetJpegQuality, GetJpegQuality
* \author [Stefan Schürmans]
* \author [Stefan Sch?rmans]
*/
float CxImage::GetJpegQualityF() const
{
Expand All @@ -557,7 +561,7 @@ float CxImage::GetJpegQualityF() const
/**
* quality level for JPEG and JPEG2000
* \param q: can be from 0 to 100
* \author [DP]; changes [Stefan Schürmans]
* \author [DP]; changes [Stefan Sch?rmans]
*/
void CxImage::SetJpegQuality(BYTE q){
info.fQuality = (float)q;
Expand All @@ -567,7 +571,7 @@ void CxImage::SetJpegQuality(BYTE q){
* quality level for JPEG and JPEG2000
* necessary for JPEG2000 when quality is between 0.0 and 1.0
* \param q: can be from 0.0 to 100.0
* \author [Stefan Schürmans]
* \author [Stefan Sch?rmans]
*/
void CxImage::SetJpegQualityF(float q){
if (q>0) info.fQuality = q;
Expand Down
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@ Build instructions (Windows): [doc/howto/build.txt](doc/howto/build.txt)
Build instructions (Linux): [doc/howto/build-linux.txt](doc/howto/build-linux.txt)

Current status (Linux):
[ 66%] Building CXX object Externals/cximage/CMakeFiles/cximage.dir/ximaenc.cpp.o
In file included from /home/1/xray-16/Externals/cximage/ximage.h:57:0,
from /home/1/xray-16/Externals/cximage/ximaenc.cpp:6:
/home/1/xray-16/Externals/cximage/xiofile.h:21:12: error: ‘LPCTSTR’ has not been declared
bool Open(LPCTSTR filename, LPCTSTR mode)

Old status (Linux):
Build Failed:
[ 82%] Building CXX object xrCore/CMakeFiles/xrCore.dir/clsid.cpp.o
xray-16/src/xrCore/_types.h:14:24: error: expected initializer before ?s64?
typedef signed __int64 s64;
^~~
[ 86%] Building CXX object src/xrCore/CMakeFiles/xrCore.dir/clsid.cpp.o
xray-16/src/xrCore/_std_extensions.h:82:15: error: ?_fpclass? was not declared in this scope
int cls = _fpclass(double(x));
^~~~~~~~


If you find a bug or have an enhancement request, file an [Issue](https://github.com/openxray/xray-16/issues).
Expand Down
Loading

0 comments on commit 79130e1

Please sign in to comment.