Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function LoadModelBuffer(_fileName, _format) {
- if(!file_exists(_fileName))
- {
- show_debug_message("File not Found: " + string(_fileName));
- return noone;
- }
- var _buff = buffer_load(_fileName);
- var _vBuff = vertex_create_buffer_from_buffer(_buff, _format);
- buffer_delete(_buff);
- return _vBuff;
- }
- function VertexFormatDefault()
- {
- vertex_format_begin();
- vertex_format_add_position_3d();
- vertex_format_add_normal();
- vertex_format_add_color();
- vertex_format_add_texcoord();
- return vertex_format_end();
- }
- // When initializing game
- global.VFormat = VertexFormatDefault();
- // In the actor object
- Mesh = LoadModelBuffer(file.dat, global.VFormat);
- Texture = sprite_get_texture(TextureSprite, 0);
- // Actors drawing
- vertex_submit(Mesh, pr_trianglelist, Texture); // After setting draw matrix etc.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement