Skip to content

Commit

Permalink
# - creator mode, gridlock+coalesce
Browse files Browse the repository at this point in the history
  • Loading branch information
en-software committed Nov 26, 2023
1 parent 960dca5 commit 940bfad
Show file tree
Hide file tree
Showing 8 changed files with 442 additions and 197 deletions.
330 changes: 165 additions & 165 deletions ding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,209 +4,209 @@
#include "polypartition.h"
#include "harvard.h"

DingProps GetDingDefaultProps(const Ding ding)
namespace blooDot::Dings
{
switch (ding)
DingProps GetDingDefaultProps(const Ding ding)
{
case Ding::Player1:
case Ding::Player2:
case Ding::Player3:
case Ding::Player4:
case Ding::BarrelIndigo:
case Ding::BarrelWood:
case Ding::BarrelLoaded:
return DingProps::Mob | DingProps::Walls;

case Ding::WallClassic:
return DingProps::Walls;

case Ding::Lettuce:
case Ding::ChelF:
case Ding::Hourflower:
case Ding::Hourflour:
case Ding::Hourpower:
return DingProps::Loot | DingProps::Walls;

case Ding::Schaed:
return DingProps::Mob | DingProps::Walls;

case Ding::RooofMesh:
return DingProps::Rooof;

case Ding::SnaviorMonumentHead:
return DingProps::Rooof;

case Ding::SnaviorMonumentFloor:
return DingProps::Floor;

default:
return DingProps::Floor;
switch (ding)
{
case Ding::Player1:
case Ding::Player2:
case Ding::Player3:
case Ding::Player4:
case Ding::BarrelIndigo:
case Ding::BarrelWood:
case Ding::BarrelLoaded:
return DingProps::Mob | DingProps::Walls;

case Ding::WallClassic:
return DingProps::Walls;

case Ding::Lettuce:
case Ding::ChelF:
case Ding::Hourflower:
case Ding::Hourflour:
case Ding::Hourpower:
return DingProps::Loot | DingProps::Walls;

case Ding::Schaed:
return DingProps::Mob | DingProps::Walls;

case Ding::RooofMesh:
return DingProps::Rooof;

case Ding::SnaviorMonumentHead:
return DingProps::Rooof;

case Ding::SnaviorMonumentFloor:
return DingProps::Floor;

default:
return DingProps::Floor;
}
}
}

bool IsOwnerDrawnDing(const Ding ding)
{
return ding == Ding::WallClassic;
}
bool IsOwnerDrawnDing(const Ding ding)
{
return ding == Ding::WallClassic;
}

int GetDingResourceKey(const Ding ding)
{
switch (ding)
int GetDingResourceKey(const Ding ding)
{
case Ding::Player1:
return CHUNK_KEY_MOBS_PLAYER1;
switch (ding)
{
case Ding::Player1:
return CHUNK_KEY_MOBS_PLAYER1;

case Ding::Player2:
return CHUNK_KEY_MOBS_PLAYER2;
case Ding::Player2:
return CHUNK_KEY_MOBS_PLAYER2;

case Ding::Player3:
return CHUNK_KEY_MOBS_PLAYER3;
case Ding::Player3:
return CHUNK_KEY_MOBS_PLAYER3;

case Ding::Player4:
return CHUNK_KEY_MOBS_PLAYER4;
case Ding::Player4:
return CHUNK_KEY_MOBS_PLAYER4;

case Ding::BarrelIndigo:
return CHUNK_KEY_DINGS_BARREL_INDIGO;
case Ding::BarrelIndigo:
return CHUNK_KEY_DINGS_BARREL_INDIGO;

case Ding::BarrelWood:
return CHUNK_KEY_DINGS_BARREL_WOODEN;
case Ding::BarrelWood:
return CHUNK_KEY_DINGS_BARREL_WOODEN;

case Ding::BarrelLoaded:
return CHUNK_KEY_DINGS_BARREL_LOADED;
case Ding::BarrelLoaded:
return CHUNK_KEY_DINGS_BARREL_LOADED;

case Ding::FloorSlate:
return CHUNK_KEY_DINGS_FLOORSTONETILE_SLATE;
case Ding::FloorSlate:
return CHUNK_KEY_DINGS_FLOORSTONETILE_SLATE;

case Ding::FloorPurple:
return CHUNK_KEY_DINGS_FLOORSTONETILE_PURPLE;
case Ding::FloorPurple:
return CHUNK_KEY_DINGS_FLOORSTONETILE_PURPLE;

case Ding::FloorOchre:
return CHUNK_KEY_DINGS_FLOORSTONETILE_OCHRE;
case Ding::FloorOchre:
return CHUNK_KEY_DINGS_FLOORSTONETILE_OCHRE;

case Ding::FloorRock:
return CHUNK_KEY_DINGS_FLOORROCKTILE;
case Ding::FloorRock:
return CHUNK_KEY_DINGS_FLOORROCKTILE;

case Ding::FloorRockCracked:
return CHUNK_KEY_DINGS_FLOORROCKTILE_CRACKED;
case Ding::FloorRockCracked:
return CHUNK_KEY_DINGS_FLOORROCKTILE_CRACKED;

case Ding::Lettuce:
return CHUNK_KEY_DINGS_LETTUCE;
case Ding::Lettuce:
return CHUNK_KEY_DINGS_LETTUCE;

case Ding::Schaed:
return CHUNK_KEY_DINGS_SCHAED;
case Ding::Schaed:
return CHUNK_KEY_DINGS_SCHAED;

case Ding::Snow:
return CHUNK_KEY_DINGS_SNOW;
case Ding::Snow:
return CHUNK_KEY_DINGS_SNOW;

case Ding::ChelF:
return CHUNK_KEY_DINGS_CHEL_F;
case Ding::ChelF:
return CHUNK_KEY_DINGS_CHEL_F;

case Ding::Grass:
return CHUNK_KEY_DINGS_GRASS;
case Ding::Grass:
return CHUNK_KEY_DINGS_GRASS;

case Ding::RooofMesh:
return CHUNK_KEY_DINGS_ROOOFTILE_MESH;
case Ding::RooofMesh:
return CHUNK_KEY_DINGS_ROOOFTILE_MESH;

case Ding::SnaviorMonumentHead:
return CHUNK_KEY_DINGS_SNURCH_SNAVIOR_HEAD_ROOOF;
case Ding::SnaviorMonumentHead:
return CHUNK_KEY_DINGS_SNURCH_SNAVIOR_HEAD_ROOOF;

case Ding::SnaviorMonumentFloor:
return CHUNK_KEY_DINGS_SNURCH_SNAVIOR_FLOOR;
case Ding::SnaviorMonumentFloor:
return CHUNK_KEY_DINGS_SNURCH_SNAVIOR_FLOOR;

default:
assert(ding != ding);
return -1;
default:
assert(ding != ding);
return -1;
}
}
}

char const* GetDingName(const Ding ding)
{
switch (ding)
char const* GetDingName(const Ding ding)
{
case Ding::Player1:
return literalplayerName1;
switch (ding)
{
case Ding::Player1:
return literalplayerName1;

case Ding::Player2:
return literalplayerName2;
case Ding::Player2:
return literalplayerName2;

case Ding::Player3:
return literalplayerName3;
case Ding::Player3:
return literalplayerName3;

case Ding::Player4:
return literalplayerName4;
case Ding::Player4:
return literalplayerName4;

case Ding::WallClassic:
return literaldingNameWallClassic;
case Ding::WallClassic:
return literaldingNameWallClassic;

case Ding::BarrelIndigo:
return literaldingNameBarrelIndigo;
case Ding::BarrelIndigo:
return literaldingNameBarrelIndigo;

case Ding::BarrelWood:
return literaldingNameBarrelWood;
case Ding::BarrelWood:
return literaldingNameBarrelWood;

case Ding::BarrelLoaded:
return literaldingNameBarrelLoaded;
case Ding::BarrelLoaded:
return literaldingNameBarrelLoaded;

case Ding::FloorSlate:
return literaldingNameFloorSlate;
case Ding::FloorSlate:
return literaldingNameFloorSlate;

case Ding::FloorPurple:
return literaldingNameFloorPurple;
case Ding::FloorPurple:
return literaldingNameFloorPurple;

case Ding::FloorOchre:
return literaldingNameFloorOchre;
case Ding::FloorOchre:
return literaldingNameFloorOchre;

case Ding::FloorRock:
return literaldingNameFloorRock;
case Ding::FloorRock:
return literaldingNameFloorRock;

case Ding::FloorRockCracked:
return literaldingNameFloorRockCracked;
case Ding::FloorRockCracked:
return literaldingNameFloorRockCracked;

case Ding::Lettuce:
return literaldingNameLettuce;
case Ding::Lettuce:
return literaldingNameLettuce;

case Ding::Schaed:
return literaldingNameSchaed;
case Ding::Schaed:
return literaldingNameSchaed;

case Ding::Snow:
return literaldingNameSnow;
case Ding::Snow:
return literaldingNameSnow;

case Ding::ChelF:
return literaldingNameChelF;
case Ding::ChelF:
return literaldingNameChelF;

case Ding::Grass:
return literaldingNameGrass;
case Ding::Grass:
return literaldingNameGrass;

case Ding::RooofMesh:
return literaldingNameRooofMesh;
case Ding::RooofMesh:
return literaldingNameRooofMesh;

case Ding::SnaviorMonumentFloor:
case Ding::SnaviorMonumentHead:
return "";
case Ding::SnaviorMonumentFloor:
case Ding::SnaviorMonumentHead:
return "";

default:
assert(ding != ding);
return nullptr;
default:
assert(ding != ding);
return nullptr;
}
}
}

int GetDingDescriptionsResourceKey(const Ding)
{
return CHUNK_KEY_DING_DESCRIPTIONS_1;
}
int GetDingDescriptionsResourceKey(const Ding)
{
return CHUNK_KEY_DING_DESCRIPTIONS_1;
}

char const* GetDingDescriptionIndexEntry(const Ding _ding)
{
return (char const *)_ding;
}
char const* GetDingDescriptionIndexEntry(const Ding _ding)
{
return (char const*)_ding;
}

BloodotMarkup* GetDingDescription(const Ding _ding)
{
return (BloodotMarkup *)_ding;
}
BloodotMarkup* GetDingDescription(const Ding _ding)
{
return (BloodotMarkup*)_ding;
}

namespace blooDot::Dings
{
std::vector<b2PolygonShape> snaviorCollision;

TPPLPartition* slicer = nullptr;
Expand Down Expand Up @@ -380,23 +380,23 @@ namespace blooDot::Dings

return true;
}
}

void DrawDing(const Ding ding, cairo_t* canvas)
{
switch (ding)
void DrawDing(const Ding ding, cairo_t* canvas)
{
case Ding::WallClassic:
cairo_set_source_rgb(canvas, .3, .3, .3);
cairo_rectangle(canvas, 0, 0, GRIDUNIT, GRIDUNIT);
cairo_fill(canvas);
cairo_set_source_rgb(canvas, .7, .7, .7);
cairo_set_line_width(canvas, 3.);
cairo_rectangle(canvas, 6, 6, GRIDUNIT - 12, GRIDUNIT - 12);
cairo_stroke(canvas);
break;

default:
assert(!"Don't know how to draw/not an ownerdrawn ding");
switch (ding)
{
case Ding::WallClassic:
cairo_set_source_rgb(canvas, .3, .3, .3);
cairo_rectangle(canvas, 0, 0, GRIDUNIT, GRIDUNIT);
cairo_fill(canvas);
cairo_set_source_rgb(canvas, .7, .7, .7);
cairo_set_line_width(canvas, 3.);
cairo_rectangle(canvas, 6, 6, GRIDUNIT - 12, GRIDUNIT - 12);
cairo_stroke(canvas);
break;

default:
assert(!"Don't know how to draw/not an ownerdrawn ding");
}
}
}
Loading

0 comments on commit 940bfad

Please sign in to comment.