Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

Commit

Permalink
new folder structure + new interface macros
Browse files Browse the repository at this point in the history
  • Loading branch information
aidinabedi committed Dec 16, 2009
1 parent 43565c6 commit cd1f87c
Show file tree
Hide file tree
Showing 29 changed files with 86 additions and 42 deletions.
16 changes: 8 additions & 8 deletions Samples/Advanced/Demo_Advanced.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../../bin/$(ConfigurationName)"
IntermediateDirectory="../../obj/$(ConfigurationName)"
OutputDirectory="../bin/$(ConfigurationName)"
IntermediateDirectory="../obj/$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
Expand All @@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../include"
AdditionalIncludeDirectories="../../Shiny/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Expand All @@ -63,7 +63,7 @@
Name="VCLinkerTool"
AdditionalDependencies="Shiny.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="../../lib/$(ConfigurationName)"
AdditionalLibraryDirectories="../../Shiny/lib/$(ConfigurationName)"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
Expand Down Expand Up @@ -92,8 +92,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../../bin/$(ConfigurationName)"
IntermediateDirectory="../../obj/$(ConfigurationName)"
OutputDirectory="../bin/$(ConfigurationName)"
IntermediateDirectory="../obj/$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
Expand All @@ -117,7 +117,7 @@
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="../../include"
AdditionalIncludeDirectories="../../Shiny/include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
Expand All @@ -138,7 +138,7 @@
Name="VCLinkerTool"
AdditionalDependencies="Shiny.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="../../lib/$(ConfigurationName)"
AdditionalLibraryDirectories="../../Shiny/lib/$(ConfigurationName)"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
Expand Down
16 changes: 8 additions & 8 deletions Samples/MainLoop/Demo_MainLoop.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../../bin/$(ConfigurationName)"
IntermediateDirectory="../../obj/$(ConfigurationName)"
OutputDirectory="../bin/$(ConfigurationName)"
IntermediateDirectory="../obj/$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
Expand All @@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../include"
AdditionalIncludeDirectories="../../Shiny/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Expand All @@ -63,7 +63,7 @@
Name="VCLinkerTool"
AdditionalDependencies="Shiny.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="../../lib/$(ConfigurationName)"
AdditionalLibraryDirectories="../../Shiny/lib/$(ConfigurationName)"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
Expand Down Expand Up @@ -92,8 +92,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../../bin/$(ConfigurationName)"
IntermediateDirectory="../../obj/$(ConfigurationName)"
OutputDirectory="../bin/$(ConfigurationName)"
IntermediateDirectory="../obj/$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
Expand All @@ -117,7 +117,7 @@
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="../../include"
AdditionalIncludeDirectories="../../Shiny/include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
Expand All @@ -138,7 +138,7 @@
Name="VCLinkerTool"
AdditionalDependencies="Shiny.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="../../lib/$(ConfigurationName)"
AdditionalLibraryDirectories="../../Shiny/lib/$(ConfigurationName)"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
Expand Down
16 changes: 8 additions & 8 deletions Samples/Simple/Demo_Simple.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../../bin/$(ConfigurationName)"
IntermediateDirectory="../../obj/$(ConfigurationName)"
OutputDirectory="../bin/$(ConfigurationName)"
IntermediateDirectory="../obj/$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
Expand All @@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../include"
AdditionalIncludeDirectories="../../Shiny/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Expand All @@ -63,7 +63,7 @@
Name="VCLinkerTool"
AdditionalDependencies="Shiny.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="../../lib/$(ConfigurationName)"
AdditionalLibraryDirectories="../../Shiny/lib/$(ConfigurationName)"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
Expand Down Expand Up @@ -92,8 +92,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../../bin/$(ConfigurationName)"
IntermediateDirectory="../../obj/$(ConfigurationName)"
OutputDirectory="../bin/$(ConfigurationName)"
IntermediateDirectory="../obj/$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
Expand All @@ -117,7 +117,7 @@
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="../../include"
AdditionalIncludeDirectories="../../Shiny/include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
Expand All @@ -138,7 +138,7 @@
Name="VCLinkerTool"
AdditionalDependencies="Shiny.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="../../lib/$(ConfigurationName)"
AdditionalLibraryDirectories="../../Shiny/lib/$(ConfigurationName)"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
Expand Down
2 changes: 1 addition & 1 deletion Shiny.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Shiny", "src\Shiny.vcproj", "{D44CCFEB-7FC2-46E6-8290-E0B00D06A636}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Shiny", "Shiny\src\Shiny.vcproj", "{D44CCFEB-7FC2-46E6-8290-E0B00D06A636}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_Simple", "Samples\Simple\Demo_Simple.vcproj", "{CE0B3567-5D70-4AA4-8F7C-29FE8E9CA7A3}"
ProjectSection(ProjectDependencies) = postProject
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
68 changes: 51 additions & 17 deletions include/ShinyMacros.h → Shiny/include/ShinyMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,25 @@ applications, and to alter it and redistribute it freely, subject to the followi
#define PROFILE_UPDATE() \
ShinyManager_update(&Shiny_instance)

#define PROFILE_SET_DAMPING(floatbetween0and1) \
Shiny_instance.damping = (floatbetween0and1);
#define PROFILE_SET_DAMPING(float0to1) \
Shiny_instance.damping = (float0to1);

#define PROFILE_GET_DAMPING() \
(Shiny_instance.damping)

#define PROFILE_OUTPUT_FILE(filename) \
ShinyManager_outputToFile(&Shiny_instance, filename)
ShinyManager_outputToFile(&Shiny_instance, (filename))

#define PROFILE_OUTPUT(stream) \
ShinyManager_outputToStream(&Shiny_instance, stream)
ShinyManager_outputToStream(&Shiny_instance, (stream))

#ifdef __cplusplus
#define PROFILE_GET_TREE_STRING() \
ShinyManager_outputNodesToString(&Shiny_instance)

#define PROFILE_GET_FLAT_STRING() \
ShinyManager_outputZonesToString(&Shiny_instance)
#endif

#define PROFILE_DESTROY() \
ShinyManager_destroy(&Shiny_instance)
Expand All @@ -66,8 +68,47 @@ applications, and to alter it and redistribute it freely, subject to the followi
//-----------------------------------------------------------------------------
// public preprocessor

#define PROFILE_GET_ROOT_DATA() \
Shiny_instance.rootZone.data
#define PROFILE_GET_TOTAL_TICKS_CUR() \
ShinyData_totalTicksCur(&Shiny_instance.rootZone.data)

#define PROFILE_GET_TOTAL_TICKS() \
ShinyData_totalTicksAvg(&Shiny_instance.rootZone.data)

#define PROFILE_GET_PROFILED_TICKS_CUR() \
(Shiny_instance.rootZone.data.selfTicks.cur)

#define PROFILE_GET_PROFILED_TICKS() \
(Shiny_instance.rootZone.data.selfTicks.avg)

#define PROFILE_GET_UNPROFILED_TICKS_CUR() \
(Shiny_instance.rootZone.data.childTicks.cur)

#define PROFILE_GET_UNPROFILED_TICKS() \
(Shiny_instance.rootZone.data.childTicks.avg)

#define PROFILE_GET_SHARED_TOTAL_TICKS_CUR(name) \
ShinyData_totalTicksCur(&(_PROFILE_ID_ZONE_SHARED(name).data))

#define PROFILE_GET_SHARED_TOTAL_TICKS(name) \
ShinyData_totalTicksAvg(&(_PROFILE_ID_ZONE_SHARED(name).data))

#define PROFILE_GET_SHARED_SELF_TICKS_CUR(name) \
(_PROFILE_ID_ZONE_SHARED(name).data.selfTicks.cur)

#define PROFILE_GET_SHARED_SELF_TICKS(name) \
(_PROFILE_ID_ZONE_SHARED(name).data.selfTicks.avg)


//-----------------------------------------------------------------------------
// public preprocessor

#define PROFILE_WATCH_SHARED_SELF(name, float0to1) \
ShinyManager_isSelfZoneGreaterEqual( \
&Shiny_instance, _PROFILE_ID_ZONE_SHARED(name), float0to1)

#define PROFILE_WATCH_SHARED_TOTAL(name, float0to1) \
ShinyManager_isTotalZoneGreaterEqual( \
&Shiny_instance, _PROFILE_ID_ZONE_SHARED(name), float0to1)


//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -111,6 +152,7 @@ applications, and to alter it and redistribute it freely, subject to the followi
// public preprocessor

#define PROFILE_CODE( code ) \
\
do { \
static _PROFILE_ZONE_DEFINE(_PROFILE_ID_ZONE_CODE(), #code); \
_PROFILE_ZONE_BEGIN(_PROFILE_ID_ZONE_CODE()); \
Expand Down Expand Up @@ -153,13 +195,6 @@ applications, and to alter it and redistribute it freely, subject to the followi
_PROFILE_ZONE_BEGIN(_PROFILE_ID_ZONE_SHARED(name))
#endif

//-----------------------------------------------------------------------------
// public preprocessor

#define PROFILE_GET_SHARED_DATA( name ) \
\
_PROFILE_ID_ZONE_SHARED(name).data \


//-----------------------------------------------------------------------------
// public preprocessor
Expand Down Expand Up @@ -211,10 +246,9 @@ applications, and to alter it and redistribute it freely, subject to the followi
// internal preprocessor

#define _PROFILE_ZONE_BEGIN( id ) \
do { \
static ShinyNodeCache cache = \
&_ShinyNode_dummy; \
\
do { \
static ShinyNodeCache cache = &_ShinyNode_dummy; \
ShinyManager_lookupAndBeginNode(&Shiny_instance, &cache, &id); \
} while(0)

Expand All @@ -239,7 +273,7 @@ SHINY_INLINE ShinyData GetEmptyData() {
#define PROFILE_BEGIN(name)
#define PROFILE_BLOCK(name)
#define PROFILE_FUNC()
#define PROFILE_CODE(code) { code; }
#define PROFILE_CODE(code) do { code; } while (0)
#define PROFILE_SHARED_GLOBAL(name)
#define PROFILE_SHARED_MEMBER(name)
#define PROFILE_SHARED_DEFINE(name)
Expand Down
10 changes: 10 additions & 0 deletions include/ShinyManager.h → Shiny/include/ShinyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ SHINY_INLINE std::string ShinyManager_outputZonesToString(ShinyManager *self) {
extern "C" { // end of c++
#endif

SHINY_INLINE int ShinyManager_isSelfZoneGreaterEqual(ShinyManager *self, ShinyZone* a_zone, float a_percentage) {
return a_percentage * (float) self->rootZone.data.childTicks.cur
<= (float) a_zone->data.selfTicks.cur;
}

SHINY_INLINE int ShinyManager_isTotalZoneGreaterEqual(ShinyManager *self, ShinyZone* a_zone, float a_percentage) {
return a_percentage * (float) self->rootZone.data.childTicks.cur
<= (float) ShinyData_totalTicksCur(&a_zone->data);
}

//

SHINY_INLINE void ShinyManager_enumerateNodes(ShinyManager *self, void (*a_func)(const ShinyNode*)) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cd1f87c

Please sign in to comment.