Skip to content

Commit

Permalink
Merge branch 'master' of github.com:KhronosGroup/COLLADA2GLTF into lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lasalvavida committed Jun 30, 2020
2 parents c7a6203 + ed89238 commit b37025f
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 56 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ name: CI
on: [push, pull_request]

jobs:
cpplint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- run: pip install cpplint
- run: cpplint --recursive .

build-windows:
name: build-windows
runs-on: windows-latest
needs: cpplint

steps:
- name: Checkout
Expand Down Expand Up @@ -76,19 +85,20 @@ jobs:
build-linux:
name: build-linux
runs-on: ubuntu-latest
needs: cpplint

steps:
- uses: actions/setup-node@v1
with:
node-version: 8
- uses: actions/setup-python@v1

- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive

- name: Lint
uses: actions/setup-python@v1
run: |
pip install cpplint
cpplint --recursive .
Expand Down Expand Up @@ -160,6 +170,7 @@ jobs:
build-osx:
name: build-osx
runs-on: macos-latest
needs: cpplint

steps:
- name: Checkout
Expand Down
7 changes: 4 additions & 3 deletions GLTF/include/Base64.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright 2020 The Khronos® Group Inc.
#pragma once

#include <string>

namespace Base64 {
char* encode(unsigned char* data, size_t length);
std::string decode(std::string uri);
}
char* encode(unsigned char* data, size_t length);
std::string decode(std::string uri);
}
102 changes: 50 additions & 52 deletions GLTF/include/GLTFAccessor.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2020 The Khronos® Group Inc.
#pragma once

#include <string>
Expand All @@ -7,65 +8,62 @@
#include "GLTFObject.h"

namespace GLTF {
class Accessor : public GLTF::Object {
public:
enum class Type {
SCALAR,
VEC2,
VEC3,
VEC4,
MAT2,
MAT3,
MAT4,
UNKNOWN
};
class Accessor : public GLTF::Object {
public:
enum class Type {
SCALAR,
VEC2,
VEC3,
VEC4,
MAT2,
MAT3,
MAT4,
UNKNOWN
};

GLTF::BufferView* bufferView = NULL;
int byteOffset = 0;
GLTF::Constants::WebGL componentType;
int count = 0;
float* max = NULL;
float* min = NULL;
Type type = Type::UNKNOWN;
GLTF::BufferView* bufferView = NULL;
int byteOffset = 0;
GLTF::Constants::WebGL componentType;
int count = 0;
float* max = NULL;
float* min = NULL;
Type type = Type::UNKNOWN;

Accessor(GLTF::Accessor::Type type, GLTF::Constants::WebGL componentType);
Accessor(GLTF::Accessor::Type type, GLTF::Constants::WebGL componentType);

Accessor(GLTF::Accessor::Type type,
GLTF::Constants::WebGL componentType,
unsigned char* data,
int count,
GLTF::Constants::WebGL target
);
Accessor(GLTF::Accessor::Type type,
GLTF::Constants::WebGL componentType,
unsigned char* data,
int count,
GLTF::Constants::WebGL target);

Accessor(GLTF::Accessor::Type type,
GLTF::Constants::WebGL componentType,
unsigned char* data,
int count,
GLTF::BufferView* bufferView
);
Accessor(GLTF::Accessor::Type type,
GLTF::Constants::WebGL componentType,
unsigned char* data,
int count,
GLTF::BufferView* bufferView);

Accessor(GLTF::Accessor::Type type,
GLTF::Constants::WebGL componentType,
int byteOffset,
int count,
GLTF::BufferView* bufferView
);
Accessor(GLTF::Accessor::Type type,
GLTF::Constants::WebGL componentType,
int byteOffset,
int count,
GLTF::BufferView* bufferView);

Accessor(GLTF::Accessor* accessor);
explicit Accessor(GLTF::Accessor* accessor);

static int getComponentByteLength(GLTF::Constants::WebGL componentType);
static int getNumberOfComponents(GLTF::Accessor::Type type);
static int getComponentByteLength(GLTF::Constants::WebGL componentType);
static int getNumberOfComponents(GLTF::Accessor::Type type);

bool computeMinMax();
int getByteStride();
bool getComponentAtIndex(int index, float *component);
bool writeComponentAtIndex(int index, float* component);
int getComponentByteLength();
int getNumberOfComponents();
bool equals(GLTF::Accessor* accessor);
const char* getTypeName();
bool computeMinMax();
int getByteStride();
bool getComponentAtIndex(int index, float *component);
bool writeComponentAtIndex(int index, float* component);
int getComponentByteLength();
int getNumberOfComponents();
bool equals(GLTF::Accessor* accessor);
const char* getTypeName();

virtual std::string typeName();
virtual void writeJSON(void* writer, GLTF::Options* options);
};
virtual std::string typeName();
virtual void writeJSON(void* writer, GLTF::Options* options);
};
}; // namespace GLTF

0 comments on commit b37025f

Please sign in to comment.