Skip to content

Commit 1492bc5

Browse files
committed
Added project source
1 parent 03ce9a1 commit 1492bc5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+27137
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
.vscode/
3+
build/

CMakeLists.txt

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
cmake_minimum_required(VERSION 3.23)
2+
3+
project(yamc)
4+
5+
set(CMAKE_CXX_STANDARD 17)
6+
7+
set(SOURCES
8+
src/main.cpp
9+
)
10+
11+
find_library(LIBASSIMP
12+
NAMES assimp-vc143-mt assimp.5
13+
PATHS lib/
14+
)
15+
16+
add_executable(${PROJECT_NAME} ${SOURCES})
17+
18+
target_include_directories(${PROJECT_NAME} PRIVATE include/)
19+
20+
target_link_libraries(${PROJECT_NAME} ${LIBASSIMP})
21+
22+
## Copy files to the build folder
23+
# Assimp
24+
if(WIN32)
25+
add_custom_command(
26+
TARGET ${PROJECT_NAME} POST_BUILD
27+
COMMAND ${CMAKE_COMMAND} -E copy
28+
${CMAKE_CURRENT_SOURCE_DIR}/bin/assimp-vc143-mt.dll
29+
$<TARGET_PROPERTY:${PROJECT_NAME},BINARY_DIR>
30+
)
31+
elseif(APPLE)
32+
add_custom_command(
33+
TARGET ${PROJECT_NAME} POST_BUILD
34+
COMMAND ${CMAKE_COMMAND} -E copy
35+
${CMAKE_CURRENT_SOURCE_DIR}/lib/libassimp.5.dylib
36+
$<TARGET_PROPERTY:${PROJECT_NAME},BINARY_DIR>
37+
)
38+
endif()
39+
40+
# Assimp license
41+
add_custom_command(
42+
TARGET ${PROJECT_NAME} POST_BUILD
43+
COMMAND ${CMAKE_COMMAND} -E copy
44+
${CMAKE_CURRENT_SOURCE_DIR}/bin/LICENSE-Assimp
45+
$<TARGET_PROPERTY:${PROJECT_NAME},BINARY_DIR>
46+
)

README.md

+38-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,39 @@
11
# YAMC
2-
Yet Another Model Converter for GameMaker
2+
> Yet Another Model Converter for GameMaker
3+
4+
[![License](https://img.shields.io/github/license/blueburncz/YAMC)](LICENSE)
5+
[![Discord](https://img.shields.io/discord/298884075585011713?label=Discord)](https://discord.gg/ep2BGPm)
6+
7+
# About
8+
Yet Another Model Converter (YAMC) is a tiny tool that loads a model from one of
9+
[many supported file formats](https://github.com/assimp/assimp/blob/master/doc/Fileformats.md)
10+
and exports it into a binary file that can be simply loaded in GameMaker using
11+
functions [buffer_load](https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Buffers/buffer_load.htm)
12+
and [vertex_create_buffer_from_buffer](https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Drawing/Primitives/vertex_create_buffer_from_buffer.htm).
13+
14+
See file [yamc.gml](utils/yamc.gml) for simple utility functions. The
15+
[utils](utils) folder also includes a shader that you can use as a base for your
16+
custom ones. If you are not familiar with shaders, you can also draw the models
17+
using GameMaker's built-in shaders with [lighting](manual.yoyogames.com/GameMaker_Language/GML_Reference/Drawing/Lighting/Lighting.htm),
18+
[fog](https://manual.yoyogames.com/GameMaker_Language/GML_Reference/Drawing/GPU_Control/gpu_set_fog.htm)
19+
etc. See [examples](examples) for little example projects.
20+
21+
# Usage
22+
Run `yamc -h` to see help message with all arguments and their description.
23+
24+
# Building from source
25+
Requires [CMake](https://cmake.org/) 3.23 at least!
26+
27+
```sh
28+
git clone https://github.com/blueburncz/YAMC.git
29+
cd YAMC
30+
mkdir build
31+
cd build
32+
cmake ..
33+
cmake --build . --config=Release
34+
```
35+
36+
# Links
37+
* [Assimp](https://github.com/assimp/assimp) - Used to load models.
38+
* [BBMOD](https://github.com/blueburncz/BBMOD) - More advanced tool with support \
39+
for animated models and a huge library for advanced 3D rendering in GameMaker.

bin/LICENSE-Assimp

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
Open Asset Import Library (assimp)
2+
3+
Copyright (c) 2006-2021, assimp team
4+
All rights reserved.
5+
6+
Redistribution and use of this software in source and binary forms,
7+
with or without modification, are permitted provided that the
8+
following conditions are met:
9+
10+
* Redistributions of source code must retain the above
11+
copyright notice, this list of conditions and the
12+
following disclaimer.
13+
14+
* Redistributions in binary form must reproduce the above
15+
copyright notice, this list of conditions and the
16+
following disclaimer in the documentation and/or other
17+
materials provided with the distribution.
18+
19+
* Neither the name of the assimp team, nor the names of its
20+
contributors may be used to endorse or promote products
21+
derived from this software without specific prior
22+
written permission of the assimp team.
23+
24+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35+
36+
37+
38+
******************************************************************************
39+
40+
AN EXCEPTION applies to all files in the ./test/models-nonbsd folder.
41+
These are 3d models for testing purposes, from various free sources
42+
on the internet. They are - unless otherwise stated - copyright of
43+
their respective creators, which may impose additional requirements
44+
on the use of their work. For any of these models, see
45+
<model-name>.source.txt for more legal information. Contact us if you
46+
are a copyright holder and believe that we credited you inproperly or
47+
if you don't want your files to appear in the repository.
48+
49+
50+
******************************************************************************
51+
52+
Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
53+
http://code.google.com/p/poly2tri/
54+
55+
All rights reserved.
56+
Redistribution and use in source and binary forms, with or without modification,
57+
are permitted provided that the following conditions are met:
58+
59+
* Redistributions of source code must retain the above copyright notice,
60+
this list of conditions and the following disclaimer.
61+
* Redistributions in binary form must reproduce the above copyright notice,
62+
this list of conditions and the following disclaimer in the documentation
63+
and/or other materials provided with the distribution.
64+
* Neither the name of Poly2Tri nor the names of its contributors may be
65+
used to endorse or promote products derived from this software without specific
66+
prior written permission.
67+
68+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
69+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
70+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
71+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
72+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
73+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
74+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
75+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
76+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
77+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
78+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

bin/assimp-vc143-mt.dll

5.21 MB
Binary file not shown.

include/assimp/.editorconfig

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# See <http://EditorConfig.org> for details
2+
3+
[*.{h,hpp,inl}]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
indent_size = 4
8+
indent_style = space

include/assimp/Base64.hpp

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
---------------------------------------------------------------------------
3+
Open Asset Import Library (assimp)
4+
---------------------------------------------------------------------------
5+
6+
Copyright (c) 2006-2022, assimp team
7+
8+
All rights reserved.
9+
10+
Redistribution and use of this software in source and binary forms,
11+
with or without modification, are permitted provided that the following
12+
conditions are met:
13+
14+
* Redistributions of source code must retain the above
15+
copyright notice, this list of conditions and the
16+
following disclaimer.
17+
18+
* Redistributions in binary form must reproduce the above
19+
copyright notice, this list of conditions and the
20+
following disclaimer in the documentation and/or other
21+
materials provided with the distribution.
22+
23+
* Neither the name of the assimp team, nor the names of its
24+
contributors may be used to endorse or promote products
25+
derived from this software without specific prior
26+
written permission of the assimp team.
27+
28+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39+
---------------------------------------------------------------------------
40+
*/
41+
42+
#pragma once
43+
#ifndef AI_BASE64_HPP_INC
44+
#define AI_BASE64_HPP_INC
45+
46+
#include <stdint.h>
47+
#include <vector>
48+
#include <string>
49+
50+
namespace Assimp {
51+
namespace Base64 {
52+
53+
/// @brief Will encode the given
54+
/// @param in
55+
/// @param inLength
56+
/// @param out
57+
void Encode(const uint8_t *in, size_t inLength, std::string &out);
58+
void Encode(const std::vector<uint8_t>& in, std::string &out);
59+
std::string Encode(const std::vector<uint8_t>& in);
60+
61+
size_t Decode(const char *in, size_t inLength, uint8_t *&out);
62+
size_t Decode(const std::string& in, std::vector<uint8_t>& out);
63+
std::vector<uint8_t> Decode(const std::string& in);
64+
65+
} // namespace Base64
66+
} // namespace Assimp
67+
68+
#endif // AI_BASE64_HPP_INC

0 commit comments

Comments
 (0)