V-Gears 0
Free Final Fantasy VII engine.
VGearsResource.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
18#include <OgreDataStream.h>
19#include <OgreResource.h>
20#include <OgreResourceGroupManager.h>
21#include "common/TypeDefine.h"
22#include "VGearsPrerequisites.h"
23
24namespace VGears{
25
29 class _VGearsExport Resource : public Ogre::Resource{
30
31 public:
32
48 Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle,
49 const String &group, bool manual, Ogre::ManualResourceLoader *loader
50 ): Ogre::Resource(creator, name, handle, group, manual, loader){}
51
55 virtual ~Resource() = default;
56
57 protected:
58
64 virtual Ogre::DataStreamPtr openResource(){
65 // Last parameter to true to throw an exception.
66 // TODO: Change when ready.
67 return Ogre::ResourceGroupManager::getSingleton().openResource(
68 mName, mGroup, this, false
69 );
70 }
71
72 };
73}
74
#define _VGearsExport
This file import prerequisites.
Definition: VGearsPrerequisites.h:35
A resource.
Definition: VGearsResource.h:29
Resource(Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool manual, Ogre::ManualResourceLoader *loader)
Constructor.
Definition: VGearsResource.h:47
virtual ~Resource()=default
Destructor.
virtual Ogre::DataStreamPtr openResource()
Opens the resource.
Definition: VGearsResource.h:64
Definition: FF7NameLookup.h:24
Ogre::String String
Definition: TypeDefine.h:37