This repository has been archived by the owner on Feb 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
906 additions
and
897 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,87 @@ | ||
#include "Common.h" | ||
// Cape textures are flipped so you will need to flip both of your cape textures. | ||
static struct ModelPart cape; | ||
|
||
static void CapeModel_MakeParts(void) { | ||
BoxDesc_BuildBox(&cape, &(struct BoxDesc) { | ||
BoxDesc_Tex(0, 0), | ||
BoxDesc_Box(-5,8,3, 5,24,2), | ||
BoxDesc_Rot(0, 23, 0) | ||
}); | ||
} | ||
|
||
static void CapeModel_Draw(struct Entity* e) { | ||
Model_ApplyTexture(e); | ||
Models.uScale = 1/64.0f; | ||
Models.vScale = 1/32.0f; | ||
|
||
Model_DrawRotate(-e->Anim.Swing * (MATH_PI / 3) + e->Anim.LeftArmZ * (1 - e->Anim.Swing), 0, 0, &cape, false); | ||
Model_UpdateVB(); | ||
|
||
Model_SetupState(Models.Human, e); | ||
Models.Human->Draw(e); | ||
} | ||
|
||
static void CapeModel_DrawArm(struct Entity* e) { | ||
Model_SetupState(Models.Human, e); | ||
Models.Human->DrawArm(e); | ||
} | ||
|
||
static struct ModelVertex vertices[MODEL_BOX_VERTICES]; | ||
static void Cape_MakeModel(struct Model* model) { | ||
// copy everything from human model | ||
*model = *Models.Human; | ||
|
||
model->Name = "cape"; | ||
model->defaultTex = &cape_tex; | ||
model->vertices = vertices; | ||
model->MakeParts = CapeModel_MakeParts; | ||
model->Draw = CapeModel_Draw; | ||
model->DrawArm = CapeModel_DrawArm; | ||
} | ||
|
||
static struct Model model; | ||
struct Model* CapeModel_GetInstance(void) { | ||
Cape_MakeModel(&model); | ||
return &model; | ||
} | ||
|
||
static struct Model model_2011; | ||
struct Model* Cape2011Model_GetInstance(void) { | ||
Cape_MakeModel(&model_2011); | ||
model_2011.Name = "cape_2011"; | ||
model_2011.defaultTex = &cape2011_tex; | ||
return &model_2011; | ||
} | ||
|
||
static struct Model model_2012; | ||
struct Model* Cape2012Model_GetInstance(void) { | ||
Cape_MakeModel(&model_2012); | ||
model_2012.Name = "cape_2012"; | ||
model_2012.defaultTex = &cape2012_tex; | ||
return &model_2012; | ||
} | ||
|
||
static struct Model model_2013; | ||
struct Model* Cape2013Model_GetInstance(void) { | ||
Cape_MakeModel(&model_2013); | ||
model_2013.Name = "cape_2013"; | ||
model_2013.defaultTex = &cape2013_tex; | ||
return &model_2013; | ||
} | ||
|
||
static struct Model model_2015; | ||
struct Model* Cape2015Model_GetInstance(void) { | ||
Cape_MakeModel(&model_2015); | ||
model_2015.Name = "cape_2015"; | ||
model_2015.defaultTex = &cape2015_tex; | ||
return &model_2015; | ||
} | ||
|
||
static struct Model model_2016; | ||
struct Model* Cape2016Model_GetInstance(void) { | ||
Cape_MakeModel(&model_2016); | ||
model_2016.Name = "cape_2016"; | ||
model_2016.defaultTex = &cape2016_tex; | ||
return &model_2016; | ||
} | ||
#include "Common.h" | ||
// Cape textures are flipped so you will need to flip both of your cape textures. | ||
static struct ModelPart cape; | ||
|
||
static void CapeModel_MakeParts(void) { | ||
BoxDesc_BuildBox(&cape, &(struct BoxDesc) { | ||
BoxDesc_Tex(0, 0), | ||
BoxDesc_Box(-5,8,3, 5,24,2), | ||
BoxDesc_Rot(0, 23, 0) | ||
}); | ||
} | ||
|
||
static void CapeModel_Draw(struct Entity* e) { | ||
Model_ApplyTexture(e); | ||
Models.uScale = 1/64.0f; | ||
Models.vScale = 1/32.0f; | ||
|
||
Model_DrawRotate(-e->Anim.Swing * (MATH_PI / 3) + e->Anim.LeftArmZ * (1 - e->Anim.Swing), 0, 0, &cape, false); | ||
Model_UpdateVB(); | ||
|
||
Model_SetupState(Models.Human, e); | ||
Models.Human->Draw(e); | ||
} | ||
|
||
static void CapeModel_DrawArm(struct Entity* e) { | ||
Model_SetupState(Models.Human, e); | ||
Models.Human->DrawArm(e); | ||
} | ||
|
||
static struct ModelVertex vertices[MODEL_BOX_VERTICES]; | ||
static void Cape_MakeModel(struct Model* model) { | ||
// copy everything from human model | ||
*model = *Models.Human; | ||
|
||
model->Name = "cape"; | ||
model->defaultTex = &cape_tex; | ||
model->vertices = vertices; | ||
model->MakeParts = CapeModel_MakeParts; | ||
model->Draw = CapeModel_Draw; | ||
model->DrawArm = CapeModel_DrawArm; | ||
} | ||
|
||
static struct Model model; | ||
struct Model* CapeModel_GetInstance(void) { | ||
Cape_MakeModel(&model); | ||
return &model; | ||
} | ||
|
||
static struct Model model_2011; | ||
struct Model* Cape2011Model_GetInstance(void) { | ||
Cape_MakeModel(&model_2011); | ||
model_2011.Name = "cape_2011"; | ||
model_2011.defaultTex = &cape2011_tex; | ||
return &model_2011; | ||
} | ||
|
||
static struct Model model_2012; | ||
struct Model* Cape2012Model_GetInstance(void) { | ||
Cape_MakeModel(&model_2012); | ||
model_2012.Name = "cape_2012"; | ||
model_2012.defaultTex = &cape2012_tex; | ||
return &model_2012; | ||
} | ||
|
||
static struct Model model_2013; | ||
struct Model* Cape2013Model_GetInstance(void) { | ||
Cape_MakeModel(&model_2013); | ||
model_2013.Name = "cape_2013"; | ||
model_2013.defaultTex = &cape2013_tex; | ||
return &model_2013; | ||
} | ||
|
||
static struct Model model_2015; | ||
struct Model* Cape2015Model_GetInstance(void) { | ||
Cape_MakeModel(&model_2015); | ||
model_2015.Name = "cape_2015"; | ||
model_2015.defaultTex = &cape2015_tex; | ||
return &model_2015; | ||
} | ||
|
||
static struct Model model_2016; | ||
struct Model* Cape2016Model_GetInstance(void) { | ||
Cape_MakeModel(&model_2016); | ||
model_2016.Name = "cape_2016"; | ||
model_2016.defaultTex = &cape2016_tex; | ||
return &model_2016; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,40 @@ | ||
#include "Common.h" | ||
static struct Model* chibi; | ||
#define SIT_OFFSET (5/16.0f) | ||
|
||
//static void ChibiSitModel_MakeParts(void) { } | ||
|
||
static void ChibiSitModel_Draw(struct Entity* e) { | ||
e->Anim.LeftLegX = 1.5f; e->Anim.RightLegX = 1.5f; | ||
e->Anim.LeftLegZ = -0.1f; e->Anim.RightLegZ = 0.1f; | ||
Model_SetupState(chibi, e); | ||
chibi->Draw(e); | ||
} | ||
static void ChibiSitModel_GetTransform(struct Entity* e, Vector3 pos, struct Matrix* m) { | ||
pos.Y -= SIT_OFFSET * e->ModelScale.Y; | ||
Entity_GetTransform(e, pos, e->ModelScale, m); | ||
} | ||
static float ChibiSitModel_GetEyeY(struct Entity* e) { return chibi->GetEyeY(e) - SIT_OFFSET; } | ||
|
||
static void ChibiSitModel_GetSize(struct Entity* e) { | ||
chibi->GetCollisionSize(e); e->Size.Y -= SIT_OFFSET; | ||
} | ||
static void ChibiSitModel_GetBounds(struct Entity* e) { | ||
chibi->GetPickingBounds(e); e->ModelAABB.Max.Y -= SIT_OFFSET; | ||
} | ||
|
||
static struct Model model; | ||
struct Model* ChibiSitModel_GetInstance(void) { | ||
// copy everything from chibi model | ||
chibi = Model_Get(&(String)String_FromConst("chibi")); | ||
model = *chibi; | ||
|
||
model.Name = "chibisit"; | ||
//model.MakeParts = ChibiSitModel_MakeParts; | ||
model.Draw = ChibiSitModel_Draw; | ||
model.GetTransform = ChibiSitModel_GetTransform; | ||
// TODO: check chibi sit draw arms | ||
|
||
model.GetEyeY = ChibiSitModel_GetEyeY; | ||
model.GetCollisionSize = ChibiSitModel_GetSize; | ||
model.GetPickingBounds = ChibiSitModel_GetBounds; | ||
return &model; | ||
#include "Common.h" | ||
static struct Model* chibi; | ||
#define SIT_OFFSET (5/16.0f) | ||
|
||
static void ChibiSitModel_Draw(struct Entity* e) { | ||
e->Anim.LeftLegX = 1.5f; e->Anim.RightLegX = 1.5f; | ||
e->Anim.LeftLegZ = -0.1f; e->Anim.RightLegZ = 0.1f; | ||
Model_SetupState(chibi, e); | ||
chibi->Draw(e); | ||
} | ||
static void ChibiSitModel_GetTransform(struct Entity* e, Vector3 pos, struct Matrix* m) { | ||
pos.Y -= SIT_OFFSET * e->ModelScale.Y; | ||
Entity_GetTransform(e, pos, e->ModelScale, m); | ||
} | ||
static float ChibiSitModel_GetEyeY(struct Entity* e) { return chibi->GetEyeY(e) - SIT_OFFSET; } | ||
|
||
static void ChibiSitModel_GetSize(struct Entity* e) { | ||
chibi->GetCollisionSize(e); e->Size.Y -= SIT_OFFSET; | ||
} | ||
static void ChibiSitModel_GetBounds(struct Entity* e) { | ||
chibi->GetPickingBounds(e); e->ModelAABB.Max.Y -= SIT_OFFSET; | ||
} | ||
|
||
static struct Model model; | ||
struct Model* ChibiSitModel_GetInstance(void) { | ||
// copy everything from chibi model | ||
chibi = Model_Get(&(String)String_FromConst("chibi")); | ||
model = *chibi; | ||
|
||
model.Name = "chibisit"; | ||
model.MakeParts = nullfunc; | ||
model.Draw = ChibiSitModel_Draw; | ||
model.GetTransform = ChibiSitModel_GetTransform; | ||
// TODO: check chibi sit draw arms | ||
|
||
model.GetEyeY = ChibiSitModel_GetEyeY; | ||
model.GetCollisionSize = ChibiSitModel_GetSize; | ||
model.GetPickingBounds = ChibiSitModel_GetBounds; | ||
return &model; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
#include "Common.h" | ||
static void TModel_Draw(struct Entity* e) { | ||
// No animation for arms/legs | ||
e->Anim.LeftArmX = 0; e->Anim.RightArmX = 0; | ||
e->Anim.LeftArmZ = -MATH_PI / 2; e->Anim.RightArmZ = MATH_PI / 2; | ||
|
||
e->Anim.LeftLegX = 0; e->Anim.RightLegX = 0; | ||
e->Anim.LeftLegZ = 0; e->Anim.RightLegZ = 0; | ||
|
||
Models.Human->Draw(e); | ||
} | ||
|
||
static struct Model model; | ||
struct Model* TModel_GetInstance(void) { | ||
// copy everything from human model | ||
model = *Models.Human; | ||
|
||
model.Name = "t"; | ||
model.Draw = TModel_Draw; | ||
model.Bobbing = false; | ||
return &model; | ||
#include "Common.h" | ||
static void TModel_Draw(struct Entity* e) { | ||
// No animation for arms/legs | ||
e->Anim.LeftArmX = 0; e->Anim.RightArmX = 0; | ||
e->Anim.LeftArmZ = -MATH_PI / 2; e->Anim.RightArmZ = MATH_PI / 2; | ||
|
||
e->Anim.LeftLegX = 0; e->Anim.RightLegX = 0; | ||
e->Anim.LeftLegZ = 0; e->Anim.RightLegZ = 0; | ||
|
||
Models.Human->Draw(e); | ||
} | ||
|
||
static struct Model model; | ||
struct Model* TModel_GetInstance(void) { | ||
// copy everything from human model | ||
model = *Models.Human; | ||
|
||
model.Name = "t"; | ||
model.MakeParts = nullfunc; | ||
model.Draw = TModel_Draw; | ||
model.Bobbing = false; | ||
return &model; | ||
} |
Oops, something went wrong.