Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
   Copyright (c) 2018 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software
   and associated documentation files (the "Software"), to deal in the Software
   without restriction,
   including without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _DIVIDE_SCENE_LIST_H_
#define _DIVIDE_SCENE_LIST_H_

// Initial application scene (menu, scene transition, etc) :
#include "Scenes/DefaultScene/Headers/DefaultScene.h"

// Factory scenes:
#include "Scenes/MainScene/Headers/MainScene.h"
#include "Scenes/CubeScene/Headers/CubeScene.h"
#include "Scenes/NetworkScene/Headers/NetworkScene.h"
#include "Scenes/PingPongScene/Headers/PingPongScene.h"
#include "Scenes/FlashScene/Headers/FlashScene.h"
#include "Scenes/TenisScene/Headers/TenisScene.h"
#include "Scenes/PhysXScene/Headers/PhysXScene.h"
#include "Scenes/WarScene/Headers/WarScene.h"
#include "Scenes/ShadowScene/Headers/ShadowScene.h"
#include "Scenes/ReflectionScene/Headers/ReflectionScene.h"

#define STRUCT_NAME(M) BOOST_PP_CAT(M, RegisterStruct)
#define VAR_NAME(M) BOOST_PP_CAT(M, RegisterVariable)

 /// usage: REGISTER_SCENE(A) where: - A is the scene's class name scene in the XML files
 /// Call this function after each scene declaration
#define REGISTER_SCENE(scene)                           \
static struct STRUCT_NAME(scene) {                      \
  STRUCT_NAME(scene)();                                 \
} VAR_NAME(scene);                                      \
                                                        \
STRUCT_NAME(scene)::STRUCT_NAME(scene)()  {             \
    g_sceneFactory[#scene]  = boost::factory<scene*>(); \
}

#define INIT_SCENE_FACTORY \
    namespace { \
        typedef std::function<Scene*(PlatformContext& context, ResourceCache& cache, SceneManager& parent, const stringImpl& name)> SceneConstructor; \
        typedef hashMapImpl<stringImpl, SceneConstructor> SceneFactory; \
        SceneFactory g_sceneFactory; \
    };\
    REGISTER_SCENE(DefaultScene)\
    REGISTER_SCENE(MainScene)\
    REGISTER_SCENE(CubeScene)\
    REGISTER_SCENE(NetworkScene)\
    REGISTER_SCENE(PingPongScene)\
    REGISTER_SCENE(FlashScene)\
    REGISTER_SCENE(TenisScene)\
    REGISTER_SCENE(PhysXScene)\
    REGISTER_SCENE(WarScene)\
    REGISTER_SCENE(ShadowScene)\
    REGISTER_SCENE(ReflectionScene)

#endif

Commits for Divide-Framework/trunk/Source Code/SceneList.h

Diff revisions: vs.
Revision Author Commited Message
1029 Diff Diff IonutCava picture IonutCava Tue 30 Jan, 2018 17:28:39 +0000

[Ionut]
- Update copyright notices

890 Diff Diff IonutCava picture IonutCava Sun 14 May, 2017 20:54:59 +0000

[Ionut]
- Add pre-compiled header support
- Initial code for per-stage tessellation computation

863 Diff Diff IonutCava picture IonutCava Wed 15 Feb, 2017 16:27:26 +0000

[IonutCava]
- Split Resource class into Resource and CachedResource
— CachedResource is the only resource held in a ResourceCache and loaded from a ResourceDescriptor
— CachedResource is mapped by its creation descriptor’s hash value, instead of the resource name
-— Multiple cached resources can now exist with the same name if the have different properties, for example.

836 Diff Diff IonutCava picture IonutCava Fri 27 Jan, 2017 14:59:56 +0000

[IonutCava]
- Update copyright notice

804 Diff Diff IonutCava picture IonutCava Thu 01 Dec, 2016 17:20:59 +0000

[IonutCava]
- Singleton elimination update Part I: get it to compile
— The following classes are no longer Singletons: GFXDevice, GL_API, DX_API, SFXWrapper, FmodWrapper, SDLWrapper, ALWrapper, PXDevice, InputInterface, RenderPassManager, SceneManager and ResourceManager;
— Refactor system to a Context / Component based implementation (Pass relevant context to objects: e.g. GFXDevice object to Textures, GUI to GUIElements, etc)
— Make devices and managers components of the kernel
— Allow multiple Resource caches to co-exist. This may prove useful for later when a more fragmented memory model is need (per frame / per scene / global caches / etc)

  • next steps: part II – cleanup/refactor new code, part III – optimise code, part IV – remove remaining Singletons (e.g. Application, ParamHandler, FrameListenerManager, Recast, PostFX and DebugInterface)
801 Diff Diff IonutCava picture IonutCava Sun 27 Nov, 2016 21:28:01 +0000

[IonutCava]
- More performance analysis guided optimizations.
- Some refactoring to allow later removal of Singletons status for: GFXDevice, SFXDevice, PXDevice, GUI and Input.
— Pass a PlatformContext around objects to access these classes.

719 Diff Diff IonutCava picture IonutCava Fri 03 Jun, 2016 16:20:08 +0000

[IonutCava]
- More SceneManager – ScenePool splitting of responsibilities
- DefaultScene will be the first scene loaded by the application. If nothing is specified in XML, it will default to "DefaultScene"

717 Diff Diff IonutCava picture IonutCava Wed 01 Jun, 2016 16:09:11 +0000

[IonutCava]
- Added initial code for 2 test scenes: ShadowScene and ReflectionScene that will be used to fix and update the shadowing and the reflection systems respectively
- More scene switch bug fixes
— XML scene data is now optional. Scenes can be created entirely form code if needed

704 Diff Diff IonutCava picture IonutCava Thu 12 May, 2016 16:24:17 +0000

[IonutCava]
- More work on the DefaultScene:
— Automatically list each available scene as a button that will load the actual desired scene

699 IonutCava picture IonutCava Tue 10 May, 2016 16:16:57 +0000

[IonutCava]
- Initial key binding code with external XML support
— Allow separation of actions and keys
— Specify actions in code by id
— Specify action id for each Key state
— Allow key modifiers: Left/Right Alt, Left/Right Ctrl

- Initial default scene code