first commit

This commit is contained in:
Jose Caban
2025-06-07 11:34:38 -04:00
commit 0eb2d7c07d
4708 changed files with 1500614 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
#ifndef _CONTENT_H_
#define _CONTENT_H_
#define CKG_CM_MAX_COLORS_PER_ITEM 4
/*!
\brief Item types define where an item is worn.
Due to layering support, multiple items per position can be worn.
*/
typedef enum
{
// Lower 4 bits are sub locations (0 - 3)
CKG_CM_SubItem_BASE = 0,
CKG_CM_SubItem_MASK = 0xF,
CKG_CM_SubItem_Default = CKG_CM_SubItem_BASE,
CKG_CM_SubItem_Upper = (1 << (CKG_CM_SubItem_BASE + 0)),
CKG_CM_SubItem_Middle = (1 << (CKG_CM_SubItem_BASE + 1)),
CKG_CM_SubItem_Lower = (1 << (CKG_CM_SubItem_BASE + 2)),
CKG_CM_SubItem_Unused = (1 << (CKG_CM_SubItem_BASE + 3)),
// Next 8 bits are Patterns (4 - 15)
CKG_CM_Pattern_BASE = 4,
CKG_CM_Pattern_MASK = 0xFF0,
CKG_CM_Pattern_Solid = (1 << (CKG_CM_Pattern_BASE + 0)),
CKG_CM_Pattern_Stripe_Vertical = (1 << (CKG_CM_Pattern_BASE + 1)),
CKG_CM_Pattern_Stripe_Horizontal= (1 << (CKG_CM_Pattern_BASE + 2)),
CKG_CM_Pattern_Stripe_Diagonal = (1 << (CKG_CM_Pattern_BASE + 3)),
CKG_CM_Pattern_Plaid = (1 << (CKG_CM_Pattern_BASE + 4)),
// Upper bits are all primary items (16+)
CKG_CM_Item_BASE = 16,
CKG_CM_Item_MASK = ~(CKG_CM_SubItem_MASK | CKG_CM_Pattern_MASK),
CKG_CM_Item_Type_Head = (1 << (CKG_CM_Item_BASE + 0)), // Headware
CKG_CM_Item_Type_Torso = (1 << (CKG_CM_Item_BASE + 1)), // Torsoware, shirts, bras, etc
CKG_CM_Item_Type_Arm = (1 << (CKG_CM_Item_BASE + 2)), // Arm covers etc (goths)
CKG_CM_Item_Type_Wrist = (1 << (CKG_CM_Item_BASE + 3)), // Watches, bracelets, etc
CKG_CM_Item_Type_Finger = (1 << (CKG_CM_Item_BASE + 4)), // Rings and such
CKG_CM_Item_Type_Pelvic = (1 << (CKG_CM_Item_BASE + 5)), // Underwear
CKG_CM_Item_Type_Leg = (1 << (CKG_CM_Item_BASE + 6)), // Pants, skirts, etc
CKG_CM_Item_Type_Foot = (1 << (CKG_CM_Item_BASE + 7)), // Footwear, etc
} CKG_CM_ItemTypeInfo;
/*!
\brief Color structure is used to define color
*/
typedef struct
{
unsigned int r;
unsigned int g;
unsigned int b;
} CKG_CM_Color;
/*!
\brief Item itself holds the data for each given item
*/
typedef struct
{
CKG_CM_Color color[CKG_CM_MAX_COLORS_PER_ITEM];
CKG_CM_ItemTypeInfo itemTypeInfo;
void *picture;
char numColors;
} CKG_CM_Item;
extern CKG_CM_Item *CKG_CM_InitItem(CKG_CM_Item *item);
#endif

View File

@@ -0,0 +1,38 @@
#ifndef _CONTENT_MANAGEMENT_H_
#define _CONTENT_MANAGEMENT_H_
#include "Content.h"
#define CKG_CM_CATEGORY_NAME_LEN 64
typedef struct CKG_CM_ItemList
{
struct CKG_CM_ItemList *prev;
struct CKG_CM_ItemList *next;
CKG_CM_Item item;
} CKG_CM_ItemList;
typedef struct CKG_CM_ContentCategory
{
char categoryName[CKG_CM_CATEGORY_NAME_LEN];
CKG_CM_ItemList *itemList;
} CKG_CM_ContentCategory;
typedef struct CKG_CM_ContentCategoryList
{
struct CKG_CM_ContentCategoryList *prev;
struct CKG_CM_ContentCategoryList *next;
char categoryName[CKG_CM_CATEGORY_NAME_LEN];
} CKG_CM_ContentCategoryList;
typedef struct CKG_CM_List
{
struct CKG_CM_List *prev;
struct CKG_CM_List *next;
} CKG_CM_List;
extern int CKG_CM_AddItemToList(CKG_CM_List **list, CKG_CM_List *itemToAdd);
extern int CKG_CM_RemoveItemFromList(CKG_CM_List **list, CKG_CM_List *itemToRemove);
#endif

View File

@@ -0,0 +1,13 @@
#ifndef CKG_CM_ERROR_H_
#define CKG_CM_ERROR_H_
/* Error List */
#define CKG_CM_OK 0 // 0 or greater are sucessful
#define CKG_CM_ERROR -1 // negative is failure
#define CKG_CM_INVALIDARG -2 // Invalid arg as in NULL or the like
/* Macros for success/failure */
#define CKG_CM_SUCCESS(x) (CKG_CM_OK <= (x))
#define CKG_CM_FAILED(x) ((x) < CKG_CM_OK)
#endif

View File

@@ -0,0 +1,16 @@
#include "ContentManagement/Content.h"
/*!
\brief Initialize a Content item to defaults
*/
CKG_CM_Item *CKG_CM_InitItem(CKG_CM_Item *item)
{
if (item)
{
memset(item, 0x00, sizeof(*item));
}
return item;
}

View File

@@ -0,0 +1,31 @@
#include "ContentManagement/ContentManagement.h"
#include "ContentManagement/Error.h"
int CKG_CM_AddItemToList(CKG_CM_List **list, CKG_CM_List *itemToAdd)
{
if (list && itemToAdd)
{
CKG_CM_List *oldHead;
oldHead = *list;
*list = itemToAdd;
itemToAdd->next = oldHead;
return CKG_CM_OK;
}
return CKG_CM_INVALIDARG;
}
int CKG_CM_RemoveItemFromList(CKG_CM_List **list, CKG_CM_List *itemToRemove)
{
if (list && itemToRemove)
{
CKG_CM_List *current = *list;
//whole (current)
}
return CKG_CM_INVALIDARG;
}

View File

@@ -0,0 +1,6 @@
#include "../include/ContentManagement/ContentManagement.h"
int main(int argc, char **argv)
{
return 0;
}

View File

@@ -0,0 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ContentManagement", "common\ContentManagement\ContentManagement.vcxproj", "{92190E53-4D4C-4D2A-8AB2-B1C818BE8A60}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ContentManagementTest", "test\ContentManagementTest\ContentManagementTest.vcxproj", "{4A349244-C34E-4C6E-BBB7-77BC74C06002}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{92190E53-4D4C-4D2A-8AB2-B1C818BE8A60}.Debug|Win32.ActiveCfg = Debug|Win32
{92190E53-4D4C-4D2A-8AB2-B1C818BE8A60}.Debug|Win32.Build.0 = Debug|Win32
{92190E53-4D4C-4D2A-8AB2-B1C818BE8A60}.Release|Win32.ActiveCfg = Release|Win32
{92190E53-4D4C-4D2A-8AB2-B1C818BE8A60}.Release|Win32.Build.0 = Release|Win32
{4A349244-C34E-4C6E-BBB7-77BC74C06002}.Debug|Win32.ActiveCfg = Debug|Win32
{4A349244-C34E-4C6E-BBB7-77BC74C06002}.Debug|Win32.Build.0 = Debug|Win32
{4A349244-C34E-4C6E-BBB7-77BC74C06002}.Release|Win32.ActiveCfg = Release|Win32
{4A349244-C34E-4C6E-BBB7-77BC74C06002}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{92190E53-4D4C-4D2A-8AB2-B1C818BE8A60}</ProjectGuid>
<RootNamespace>ContentManagement</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>F:\Dev\Repositories\CKG\closet\trunk\common\ContentManagement\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\common\ContentManagement\include\ContentManagement\Content.h" />
<ClInclude Include="..\..\..\..\common\ContentManagement\include\ContentManagement\ContentManagement.h" />
<ClInclude Include="..\..\..\..\common\ContentManagement\include\ContentManagement\Error.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\common\ContentManagement\source\Content.c" />
<ClCompile Include="..\..\..\..\common\ContentManagement\source\ContentManagement.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\common\ContentManagement\include\ContentManagement\ContentManagement.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\common\ContentManagement\include\ContentManagement\Content.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\common\ContentManagement\include\ContentManagement\Error.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\common\ContentManagement\source\ContentManagement.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\common\ContentManagement\source\Content.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{4A349244-C34E-4C6E-BBB7-77BC74C06002}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ContentManagementTest</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>F:\Dev\SVN Client\closet\trunk\common\ContentManagement\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\common\ContentManagement\test\test.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\common\ContentManagement\ContentManagement.vcxproj">
<Project>{92190e53-4d4c-4d2a-8ab2-b1c818be8a60}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\common\ContentManagement\test\test.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>