mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
array changes
This commit is contained in:
+31
-9
@@ -5,7 +5,7 @@ set(CMAKE_BUILD_TYPE Debug)
|
||||
set(STB_HEADERS external/stb/)
|
||||
#add_subdirectory(src/)
|
||||
set(INCLUDE_DIR include/)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -pedantic")
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
cmake_policy(SET CMP0015 NEW)
|
||||
@@ -32,19 +32,36 @@ set(ASSIMP_DIR external/assimp)
|
||||
set(CPPUNIT_DIR external/CppUnit)
|
||||
|
||||
add_subdirectory(${GLFW_DIR})
|
||||
if(UNIX)
|
||||
set(GLFW_LIB_DIR ${GLFW_DIR})
|
||||
elseif(WIN32)
|
||||
set(GLFW_LIB_DIR ${GLFW_DIR}/src/Debug)
|
||||
endif()
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${GLFW_DIR}/include/GLFW)
|
||||
target_link_directories(${PROJECT_NAME} PUBLIC ${GLFW_DIR})
|
||||
target_link_directories(${PROJECT_NAME} PUBLIC ${GLFW_LIB_DIR})
|
||||
|
||||
add_subdirectory(${ASSIMP_DIR})
|
||||
if(UNIX)
|
||||
set(ASSIMP_LIB_DIR ${ASSIMP_DIR}/bin)
|
||||
elseif(WIN32)
|
||||
set(ASSIMP_LIB_DIR ${ASSIMP_DIR}/bin/Debug)
|
||||
endif()
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${ASSIMP_DIR}/include/assimp)
|
||||
target_link_directories(${PROJECT_NAME} PUBLIC ${ASSIMP_DIR}/bin)
|
||||
target_link_directories(${PROJECT_NAME} PUBLIC ${ASSIMP_LIB_DIR})
|
||||
|
||||
execute_process(COMMAND ${FREETYPE_DIR}/autogen.sh)
|
||||
execute_process(COMMAND ${FREETYPE_DIR}/configure)
|
||||
execute_process(COMMAND make -c ${FREETYPE_DIR})
|
||||
if(UNIX)
|
||||
execute_process(COMMAND ${FREETYPE_DIR}/autogen.sh)
|
||||
execute_process(COMMAND ${FREETYPE_DIR}/configure)
|
||||
execute_process(COMMAND make -c ${FREETYPE_DIR})
|
||||
set(FREETYPE_LIB_DIR ${FREETYPE_DIR}/objs/.lib)
|
||||
elseif(WIN32)
|
||||
execute_process(COMMAND cmake -E build_directory build)
|
||||
execute_process(COMMAND cmake -E chdir build cmake ..)
|
||||
set(FREETYPE_LIB_DIR ${FREETYPE_DIR}/build/Debug)
|
||||
endif()
|
||||
add_subdirectory(${FREETYPE_DIR})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${FREETYPE_DIR}/include)
|
||||
target_link_directories(${PROJECT_NAME} PUBLIC ${FREETYPE_DIR}/objs/.lib)
|
||||
target_link_directories(${PROJECT_NAME} PUBLIC ${FREETYPE_LIB_DIR})
|
||||
|
||||
set(DEPS glfw assimp freetype ${CMAKE_DL_LIBS})
|
||||
|
||||
@@ -58,9 +75,14 @@ set(TEST_SRC main.cpp ${LIB_SRC} ${RENDER_TEST} ${ARMATURE_TEST} ${MODEL_TEST} $
|
||||
|
||||
add_executable(vb01Tests ${TEST_SRC})
|
||||
|
||||
execute_process(COMMAND ${CPPUNIT_DIR}/autogen.sh)
|
||||
if(UNIX)
|
||||
execute_process(COMMAND ${CPPUNIT_DIR}/autogen.sh)
|
||||
set(CPPUNIT_LIB_DIR ${CPPUNIT_DIR})
|
||||
elseif(WIN32)
|
||||
set(CPPUNIT_LIB_DIR ${CPPUNIT_DIR}/Debug)
|
||||
endif()
|
||||
add_subdirectory(${CPPUNIT_DIR})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CPPUNIT_DIR}/include)
|
||||
target_link_directories(${PROJECT_NAME} PUBLIC ${CPPUNIT_DIR})
|
||||
target_link_directories(${PROJECT_NAME} PUBLIC ${CPPUNIT_LIB_DIR})
|
||||
|
||||
target_link_libraries(vb01Tests ${PROJECT_NAME} ${DEPS} cppunit)
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/* ftconfig.h. Generated from ftconfig.h.in by configure. */
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftconfig.h.in
|
||||
*
|
||||
* UNIX-specific configuration file (specification only).
|
||||
*
|
||||
* Copyright (C) 1996-2021 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* This header file contains a number of macro definitions that are used by
|
||||
* the rest of the engine. Most of the macros here are automatically
|
||||
* determined at compile time, and you should not need to change it to port
|
||||
* FreeType, except to compile the library with a non-ANSI compiler.
|
||||
*
|
||||
* Note however that if some specific modifications are needed, we advise
|
||||
* you to place a modified copy in your build directory.
|
||||
*
|
||||
* The build directory is usually `builds/<system>`, and contains
|
||||
* system-specific files that are always included first when building the
|
||||
* library.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FTCONFIG_H_
|
||||
#define FTCONFIG_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_OPTIONS_H
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H
|
||||
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* #undef FT_USE_AUTOCONF_SIZEOF_TYPES */
|
||||
#ifdef FT_USE_AUTOCONF_SIZEOF_TYPES
|
||||
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_LONG 8
|
||||
#define FT_SIZEOF_INT SIZEOF_INT
|
||||
#define FT_SIZEOF_LONG SIZEOF_LONG
|
||||
|
||||
#endif /* FT_USE_AUTOCONF_SIZEOF_TYPES */
|
||||
|
||||
#include <freetype/config/integer-types.h>
|
||||
#include <freetype/config/public-macros.h>
|
||||
#include <freetype/config/mac-support.h>
|
||||
|
||||
#endif /* FTCONFIG_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/* This is a generated file. */
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
|
||||
FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
|
||||
FT_USE_MODULE( FT_Module_Class, autofit_module_class )
|
||||
FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
|
||||
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
|
||||
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
|
||||
FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class )
|
||||
FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class )
|
||||
FT_USE_MODULE( FT_Module_Class, psaux_module_class )
|
||||
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
|
||||
/* EOF */
|
||||
+1030
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -104,7 +104,8 @@ namespace vb01{
|
||||
}
|
||||
|
||||
void Shader::checkCompileErrors(u32 shader, ErrorType type){
|
||||
int success, infoLogLen = 1024;
|
||||
int success;
|
||||
const int infoLogLen = 1024;
|
||||
char infoLog[infoLogLen];
|
||||
switch(type){
|
||||
case PROGRAM_ERROR:
|
||||
|
||||
+2
-1
@@ -45,7 +45,7 @@ namespace vb01{
|
||||
Bone *subBase = (Bone*)ikTarget->getParent();
|
||||
|
||||
Bone **boneChain = getIkBoneChain(ikBone);
|
||||
Vector3 boneIkPos[chainLength];
|
||||
Vector3 *boneIkPos = new Vector3[chainLength];
|
||||
for(int i = chainLength - 1; i >= 0; i--)
|
||||
boneIkPos[i] = subBase->globalToLocalPosition(boneChain[i]->localToGlobalPosition(Vector3::VEC_ZERO));
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace vb01{
|
||||
IkSolver::calculateFabrik(chainLength, boneChain, boneIkPos, targetPos);
|
||||
transformIkChain(chainLength, boneChain, boneIkPos, ikTarget);
|
||||
|
||||
delete[] boneIkPos;
|
||||
delete[] boneChain;
|
||||
}
|
||||
|
||||
|
||||
+6
-4
@@ -171,7 +171,7 @@ namespace vb01{
|
||||
string preColon = line.substr(0, colonId);
|
||||
string postColon = line.substr(colonId + 2);
|
||||
|
||||
int numData = 13;
|
||||
const int numData = 13;
|
||||
string data[numData];
|
||||
getLineData(postColon, data, numData);
|
||||
|
||||
@@ -361,16 +361,17 @@ namespace vb01{
|
||||
){
|
||||
for(string line : meshData){
|
||||
int numData = 6 + numBones;
|
||||
string data[numData];
|
||||
string *data = new string[numData];
|
||||
getLineData(line, data, numData);
|
||||
Vector3 vPos = Vector3(atof(data[0].c_str()), atof(data[2].c_str()), -atof(data[1].c_str()));
|
||||
Vector3 vNorm = Vector3(atof(data[3].c_str()), atof(data[5].c_str()), -atof(data[4].c_str()));
|
||||
vertPos.push_back(vPos);
|
||||
vertNorm.push_back(vNorm);
|
||||
|
||||
float weightCoefs[numBones];
|
||||
float *weightCoefs = new float[numBones];
|
||||
for(int i = 0; i < numBones; i++)
|
||||
weightCoefs[i] = atof(data[6 + i].c_str());
|
||||
delete[] data;
|
||||
|
||||
int numPosWeights = 0;
|
||||
float sumWeightCoefs = 0;
|
||||
@@ -382,6 +383,7 @@ namespace vb01{
|
||||
float root = 1. / sumWeightCoefs;
|
||||
for(int i = 0; i < numBones; i++)
|
||||
vertWeights.push_back(root * weightCoefs[i]);
|
||||
delete[] weightCoefs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +398,7 @@ namespace vb01{
|
||||
u32 *indices
|
||||
){
|
||||
for(int i = 0; i < meshData.size(); i++){
|
||||
int numData = 9;
|
||||
const int numData = 9;
|
||||
string data[numData];
|
||||
getLineData(meshData[i], data, numData);
|
||||
int index = atoi(data[0].c_str());
|
||||
|
||||
Reference in New Issue
Block a user