<commit_before>#pragma once

#include <globjects/base/ref_ptr.h>
#include <glm/common.hpp>
#include <glm/gtx/compatibility.hpp>
#include <vector>
#include <gloperate/primitives/PolygonalGeometry.h>
#include <gloperate/primitives/PolygonalDrawable.h>

// number of vertex normals in anorms.h file used for decompressing normals in a md2 file
#define NUMVERTEXNORMALS		162


namespace globjects
{
	class Program;
}

struct VertexKeyframe
{
	glm::vec3 scale;					/* scale factor */
	glm::vec3 translate;				/* translation vector */
	char name[16];						/* frame name */
	struct md2_vertex *vertices;		/* list of frame's vertices */
};

struct md2_vertex
{
	unsigned char position[3];			/* position */
	unsigned char normalIndex;			/* normal vector index */
};

/* MD2 header, source: http://tfc.duke.free.fr/coding/md2-specs-en.html */
struct md2_header
{
	int ident;                  /* magic number: "IDP2" */
	int version;                /* version: must be 8 */

	int skinwidth;              /* texture width */
	int skinheight;             /* texture height */

	int framesize;              /* size in bytes of a frame */

	int num_skins;              /* number of skins */
	int num_vertices;           /* number of vertices per frame */
	int num_st;                 /* number of texture coordinates */
	int num_tris;               /* number of triangles */
	int num_glcmds;             /* number of opengl commands */
	int num_frames;             /* number of frames */

	int offset_skins;           /* offset skin data */
	int offset_st;              /* offset texture coordinate data */
	int offset_tris;            /* offset triangle data */
	int offset_frames;          /* offset frame data */
	int offset_glcmds;          /* offset OpenGL command data */
	int offset_end;             /* offset end of file */
};

class md2Loader
{
public:
	md2Loader() = default;
	~md2Loader();

	gloperate::PolygonalGeometry firstFrame;
	gloperate::PolygonalDrawable firstFrameDrawable;

	md2_header header; //header of the object-file
	FILE* model; //opbject-file

	void loadModel(char* filename);
	void modelToGPU();
	void drawModel();

	std::vector<VertexKeyframe> m_keyframes;
	globjects::ref_ptr<globjects::Program> m_program;

	std::vector< std::vector< glm::vec3 > > FrameVertices; // Vertices extracted for every frame
	std::vector< std::vector< glm::vec3 > > FrameNormals; // Normal indices extracted for every vertex in every frame
	std::vector< int > glCommands; // Rendering OpenGL commands
	std::vector< unsigned int > VaoIndices; // Indices to give to the PolygonalGeometry Object for drawing

	
};
<commit_msg>Problems with the md2-constructor solved<commit_after>#pragma once

#include <globjects/base/ref_ptr.h>
#include <glm/common.hpp>
#include <glm/gtx/compatibility.hpp>
#include <vector>
#include <gloperate/primitives/PolygonalGeometry.h>
#include <gloperate/primitives/PolygonalDrawable.h>

// number of vertex normals in anorms.h file used for decompressing normals in a md2 file
#define NUMVERTEXNORMALS		162


namespace globjects
{
	class Program;
}

struct VertexKeyframe
{
	glm::vec3 scale;					/* scale factor */
	glm::vec3 translate;				/* translation vector */
	char name[16];						/* frame name */
	struct md2_vertex *vertices;		/* list of frame's vertices */
};

struct md2_vertex
{
	unsigned char position[3];			/* position */
	unsigned char normalIndex;			/* normal vector index */
};

/* MD2 header, source: http://tfc.duke.free.fr/coding/md2-specs-en.html */
struct md2_header
{
	int ident;                  /* magic number: "IDP2" */
	int version;                /* version: must be 8 */

	int skinwidth;              /* texture width */
	int skinheight;             /* texture height */

	int framesize;              /* size in bytes of a frame */

	int num_skins;              /* number of skins */
	int num_vertices;           /* number of vertices per frame */
	int num_st;                 /* number of texture coordinates */
	int num_tris;               /* number of triangles */
	int num_glcmds;             /* number of opengl commands */
	int num_frames;             /* number of frames */

	int offset_skins;           /* offset skin data */
	int offset_st;              /* offset texture coordinate data */
	int offset_tris;            /* offset triangle data */
	int offset_frames;          /* offset frame data */
	int offset_glcmds;          /* offset OpenGL command data */
	int offset_end;             /* offset end of file */
};

class md2Loader
{
public:
	md2Loader();
	~md2Loader();

	gloperate::PolygonalGeometry firstFrame;
	//gloperate::PolygonalDrawable firstFrameDrawable;
	globjects::ref_ptr<gloperate::PolygonalDrawable> firstFrameDrawable;


	md2_header header; //header of the object-file
	FILE* model; //opbject-file

	void loadModel(char* filename);
	void modelToGPU();
	void drawModel();

	std::vector<VertexKeyframe> m_keyframes;
	globjects::ref_ptr<globjects::Program> m_program;

	std::vector< std::vector< glm::vec3 > > FrameVertices; // Vertices extracted for every frame
	std::vector< std::vector< glm::vec3 > > FrameNormals; // Normal indices extracted for every vertex in every frame
	std::vector< int > glCommands; // Rendering OpenGL commands
	std::vector< unsigned int > VaoIndices; // Indices to give to the PolygonalGeometry Object for drawing

	
};

{'fraction_non_alphanumeric': 0.10950413223140495, 'fraction_numerical': 0.00845229151014275, 'mean_word_length': 2.847543352601156, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2869895', 'n_tokens_mistral': 1679, 'n_tokens_neox': 1604, 'n_words': 485}