Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
f79c0d66ca
59 changed files with 1485 additions and 1242 deletions
6
.github/workflows/build_android.yml
vendored
6
.github/workflows/build_android.yml
vendored
|
|
@ -84,8 +84,10 @@ jobs:
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.tar.gz
|
name: ${{ env.RELEASE_NAME }}
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
path: |
|
||||||
|
./build/${{ env.RELEASE_NAME }}
|
||||||
|
!./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
|
||||||
- name: Upload Artifact to Release
|
- name: Upload Artifact to Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|
|
||||||
6
.github/workflows/build_linux.yml
vendored
6
.github/workflows/build_linux.yml
vendored
|
|
@ -114,8 +114,10 @@ jobs:
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.tar.gz
|
name: ${{ env.RELEASE_NAME }}
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
path: |
|
||||||
|
./build/${{ env.RELEASE_NAME }}
|
||||||
|
!./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
|
||||||
- name: Upload Artifact to Release
|
- name: Upload Artifact to Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|
|
||||||
6
.github/workflows/build_macos.yml
vendored
6
.github/workflows/build_macos.yml
vendored
|
|
@ -101,8 +101,10 @@ jobs:
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.tar.gz
|
name: ${{ env.RELEASE_NAME }}
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
|
path: |
|
||||||
|
./build/${{ env.RELEASE_NAME }}
|
||||||
|
!./build/${{ env.RELEASE_NAME }}.tar.gz
|
||||||
|
|
||||||
- name: Upload Artifact to Release
|
- name: Upload Artifact to Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|
|
||||||
6
.github/workflows/build_webassembly.yml
vendored
6
.github/workflows/build_webassembly.yml
vendored
|
|
@ -71,8 +71,10 @@ jobs:
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.zip
|
name: ${{ env.RELEASE_NAME }}
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.zip
|
path: |
|
||||||
|
./build/${{ env.RELEASE_NAME }}
|
||||||
|
!./build/${{ env.RELEASE_NAME }}.zip
|
||||||
|
|
||||||
- name: Upload Artifact to Release
|
- name: Upload Artifact to Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|
|
||||||
6
.github/workflows/build_windows.yml
vendored
6
.github/workflows/build_windows.yml
vendored
|
|
@ -142,8 +142,10 @@ jobs:
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.RELEASE_NAME }}.zip
|
name: ${{ env.RELEASE_NAME }}
|
||||||
path: ./build/${{ env.RELEASE_NAME }}.zip
|
path: |
|
||||||
|
./build/${{ env.RELEASE_NAME }}
|
||||||
|
!./build/${{ env.RELEASE_NAME }}.zip
|
||||||
|
|
||||||
- name: Upload Artifact to Release
|
- name: Upload Artifact to Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|
|
||||||
|
|
@ -226,10 +226,10 @@ void UpdateCameraCenterInsideMap(Camera2D *camera, Player *player, EnvItem *envI
|
||||||
Vector2 max = GetWorldToScreen2D((Vector2){ maxX, maxY }, *camera);
|
Vector2 max = GetWorldToScreen2D((Vector2){ maxX, maxY }, *camera);
|
||||||
Vector2 min = GetWorldToScreen2D((Vector2){ minX, minY }, *camera);
|
Vector2 min = GetWorldToScreen2D((Vector2){ minX, minY }, *camera);
|
||||||
|
|
||||||
if (max.x < width) camera->offset.x = width - (max.x - width/2);
|
if (max.x < width) camera->offset.x = width - (max.x - (float)width/2);
|
||||||
if (max.y < height) camera->offset.y = height - (max.y - height/2);
|
if (max.y < height) camera->offset.y = height - (max.y - (float)height/2);
|
||||||
if (min.x > 0) camera->offset.x = width/2 - min.x;
|
if (min.x > 0) camera->offset.x = (float)width/2 - min.x;
|
||||||
if (min.y > 0) camera->offset.y = height/2 - min.y;
|
if (min.y > 0) camera->offset.y = (float)height/2 - min.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateCameraCenterSmoothFollow(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height)
|
void UpdateCameraCenterSmoothFollow(Camera2D *camera, Player *player, EnvItem *envItems, int envItemsLength, float delta, int width, int height)
|
||||||
|
|
|
||||||
|
|
@ -225,10 +225,10 @@ int main(void)
|
||||||
Vector2 max = GetWorldToScreen2D((Vector2){ maxX, maxY }, camera);
|
Vector2 max = GetWorldToScreen2D((Vector2){ maxX, maxY }, camera);
|
||||||
Vector2 min = GetWorldToScreen2D((Vector2){ minX, minY }, camera);
|
Vector2 min = GetWorldToScreen2D((Vector2){ minX, minY }, camera);
|
||||||
|
|
||||||
if (max.x < screenWidth) camera.offset.x = screenWidth - (max.x - screenWidth/2);
|
if (max.x < screenWidth) camera.offset.x = screenWidth - (max.x - (float)screenWidth/2);
|
||||||
if (max.y < screenHeight) camera.offset.y = screenHeight - (max.y - screenHeight/2);
|
if (max.y < screenHeight) camera.offset.y = screenHeight - (max.y - (float)screenHeight/2);
|
||||||
if (min.x > 0) camera.offset.x = screenWidth/2 - min.x;
|
if (min.x > 0) camera.offset.x = (float)screenWidth/2 - min.x;
|
||||||
if (min.y > 0) camera.offset.y = screenHeight/2 - min.y;
|
if (min.y > 0) camera.offset.y = (float)screenHeight/2 - min.y;
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Events management
|
// Events management
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ static void KeepAspectCenteredInteger(int screenWidth, int screenHeight, int gam
|
||||||
|
|
||||||
static void KeepHeightCenteredInteger(int screenWidth, int screenHeight, int gameWidth, int gameHeight, Rectangle *sourceRect, Rectangle *destRect)
|
static void KeepHeightCenteredInteger(int screenWidth, int screenHeight, int gameWidth, int gameHeight, Rectangle *sourceRect, Rectangle *destRect)
|
||||||
{
|
{
|
||||||
const float resizeRatio = (float)(screenHeight/gameHeight);
|
const float resizeRatio = (float)screenHeight/gameHeight;
|
||||||
sourceRect->x = 0.0f;
|
sourceRect->x = 0.0f;
|
||||||
sourceRect->y = 0.0f;
|
sourceRect->y = 0.0f;
|
||||||
sourceRect->width = (float)(int)(screenWidth/resizeRatio);
|
sourceRect->width = (float)(int)(screenWidth/resizeRatio);
|
||||||
|
|
@ -230,7 +230,7 @@ static void KeepHeightCenteredInteger(int screenWidth, int screenHeight, int gam
|
||||||
|
|
||||||
static void KeepWidthCenteredInteger(int screenWidth, int screenHeight, int gameWidth, int gameHeight, Rectangle *sourceRect, Rectangle *destRect)
|
static void KeepWidthCenteredInteger(int screenWidth, int screenHeight, int gameWidth, int gameHeight, Rectangle *sourceRect, Rectangle *destRect)
|
||||||
{
|
{
|
||||||
const float resizeRatio = (float)(screenWidth/gameWidth);
|
const float resizeRatio = (float)screenWidth/gameWidth;
|
||||||
sourceRect->x = 0.0f;
|
sourceRect->x = 0.0f;
|
||||||
sourceRect->y = 0.0f;
|
sourceRect->y = 0.0f;
|
||||||
sourceRect->width = (float)gameWidth;
|
sourceRect->width = (float)gameWidth;
|
||||||
|
|
|
||||||
|
|
@ -413,7 +413,7 @@ static MsfGifBuffer * msf_compress_frame(void * allocContext, int width, int hei
|
||||||
|
|
||||||
//generate palette
|
//generate palette
|
||||||
typedef struct { uint8_t r, g, b; } Color3;
|
typedef struct { uint8_t r, g, b; } Color3;
|
||||||
Color3 table[256] = { {0} };
|
Color3 table[256] = { { 0 } };
|
||||||
int tableIdx = 1; //we start counting at 1 because 0 is the transparent color
|
int tableIdx = 1; //we start counting at 1 because 0 is the transparent color
|
||||||
//transparent is always last in the table
|
//transparent is always last in the table
|
||||||
tlb[tlbSize-1] = 0;
|
tlb[tlbSize-1] = 0;
|
||||||
|
|
@ -550,7 +550,7 @@ static void msf_free_gif_state(MsfGifState * handle) {
|
||||||
|
|
||||||
int msf_gif_begin(MsfGifState * handle, int width, int height) { MsfTimeFunc
|
int msf_gif_begin(MsfGifState * handle, int width, int height) { MsfTimeFunc
|
||||||
//NOTE: we cannot stomp the entire struct to zero because we must preserve `customAllocatorContext`.
|
//NOTE: we cannot stomp the entire struct to zero because we must preserve `customAllocatorContext`.
|
||||||
MsfCookedFrame empty = {0}; //god I hate MSVC...
|
MsfCookedFrame empty = { 0 }; //god I hate MSVC...
|
||||||
handle->previousFrame = empty;
|
handle->previousFrame = empty;
|
||||||
handle->currentFrame = empty;
|
handle->currentFrame = empty;
|
||||||
handle->width = width;
|
handle->width = width;
|
||||||
|
|
@ -614,7 +614,7 @@ int msf_gif_frame(MsfGifState * handle, uint8_t * pixelData, int centiSecondsPer
|
||||||
}
|
}
|
||||||
|
|
||||||
MsfGifResult msf_gif_end(MsfGifState * handle) { MsfTimeFunc
|
MsfGifResult msf_gif_end(MsfGifState * handle) { MsfTimeFunc
|
||||||
if (!handle->listHead) { MsfGifResult empty = {0}; return empty; }
|
if (!handle->listHead) { MsfGifResult empty = { 0 }; return empty; }
|
||||||
|
|
||||||
//first pass: determine total size
|
//first pass: determine total size
|
||||||
size_t total = 1; //1 byte for trailing marker
|
size_t total = 1; //1 byte for trailing marker
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ int main(void)
|
||||||
if (showModel) DrawModel(model, (Vector3){0.0f, 0.0f, 0.0f}, 1.0f, WHITE);
|
if (showModel) DrawModel(model, (Vector3){0.0f, 0.0f, 0.0f}, 1.0f, WHITE);
|
||||||
|
|
||||||
// Draw the decal models
|
// Draw the decal models
|
||||||
for (int i = 0; i < decalCount; i++) DrawModel(decalModels[i], (Vector3){0}, 1.0f, WHITE);
|
for (int i = 0; i < decalCount; i++) DrawModel(decalModels[i], (Vector3){ 0 }, 1.0f, WHITE);
|
||||||
|
|
||||||
// If we hit the mesh, draw the box for the decal
|
// If we hit the mesh, draw the box for the decal
|
||||||
if (collision.hit)
|
if (collision.hit)
|
||||||
|
|
@ -191,7 +191,7 @@ int main(void)
|
||||||
Vector3 origin = Vector3Add(collision.point, Vector3Scale(collision.normal, 1.0f));
|
Vector3 origin = Vector3Add(collision.point, Vector3Scale(collision.normal, 1.0f));
|
||||||
Matrix splat = MatrixLookAt(collision.point, origin, (Vector3){0,1,0});
|
Matrix splat = MatrixLookAt(collision.point, origin, (Vector3){0,1,0});
|
||||||
placementCube.transform = MatrixInvert(splat);
|
placementCube.transform = MatrixInvert(splat);
|
||||||
DrawModel(placementCube, (Vector3){0}, 1.0f, Fade(WHITE, 0.5f));
|
DrawModel(placementCube, (Vector3){ 0 }, 1.0f, Fade(WHITE, 0.5f));
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawGrid(10, 10.0f);
|
DrawGrid(10, 10.0f);
|
||||||
|
|
|
||||||
|
|
@ -148,25 +148,25 @@ void DrawSphereBasic(Color color)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < slices; j++)
|
for (int j = 0; j < slices; j++)
|
||||||
{
|
{
|
||||||
rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*i))*sinf(DEG2RAD*(j*360/slices)),
|
rlVertex3f(cosf(DEG2RAD*(270+(180.0f/(rings + 1))*i))*sinf(DEG2RAD*(j*360.0f/slices)),
|
||||||
sinf(DEG2RAD*(270+(180/(rings + 1))*i)),
|
sinf(DEG2RAD*(270+(180.0f/(rings + 1))*i)),
|
||||||
cosf(DEG2RAD*(270+(180/(rings + 1))*i))*cosf(DEG2RAD*(j*360/slices)));
|
cosf(DEG2RAD*(270+(180.0f/(rings + 1))*i))*cosf(DEG2RAD*(j*360.0f/slices)));
|
||||||
rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360/slices)),
|
rlVertex3f(cosf(DEG2RAD*(270+(180.0f/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360.0f/slices)),
|
||||||
sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))),
|
sinf(DEG2RAD*(270+(180.0f/(rings + 1))*(i+1))),
|
||||||
cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360/slices)));
|
cosf(DEG2RAD*(270+(180.0f/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360.0f/slices)));
|
||||||
rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*(j*360/slices)),
|
rlVertex3f(cosf(DEG2RAD*(270+(180.0f/(rings + 1))*(i+1)))*sinf(DEG2RAD*(j*360.0f/slices)),
|
||||||
sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))),
|
sinf(DEG2RAD*(270+(180.0f/(rings + 1))*(i+1))),
|
||||||
cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*(j*360/slices)));
|
cosf(DEG2RAD*(270+(180.0f/(rings + 1))*(i+1)))*cosf(DEG2RAD*(j*360.0f/slices)));
|
||||||
|
|
||||||
rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*i))*sinf(DEG2RAD*(j*360/slices)),
|
rlVertex3f(cosf(DEG2RAD*(270+(180.0f/(rings + 1))*i))*sinf(DEG2RAD*(j*360.0f/slices)),
|
||||||
sinf(DEG2RAD*(270+(180/(rings + 1))*i)),
|
sinf(DEG2RAD*(270+(180.0f/(rings + 1))*i)),
|
||||||
cosf(DEG2RAD*(270+(180/(rings + 1))*i))*cosf(DEG2RAD*(j*360/slices)));
|
cosf(DEG2RAD*(270+(180.0f/(rings + 1))*i))*cosf(DEG2RAD*(j*360.0f/slices)));
|
||||||
rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i)))*sinf(DEG2RAD*((j+1)*360/slices)),
|
rlVertex3f(cosf(DEG2RAD*(270+(180.0f/(rings + 1))*(i)))*sinf(DEG2RAD*((j+1)*360.0f/slices)),
|
||||||
sinf(DEG2RAD*(270+(180/(rings + 1))*(i))),
|
sinf(DEG2RAD*(270+(180.0f/(rings + 1))*(i))),
|
||||||
cosf(DEG2RAD*(270+(180/(rings + 1))*(i)))*cosf(DEG2RAD*((j+1)*360/slices)));
|
cosf(DEG2RAD*(270+(180.0f/(rings + 1))*(i)))*cosf(DEG2RAD*((j+1)*360.0f/slices)));
|
||||||
rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360/slices)),
|
rlVertex3f(cosf(DEG2RAD*(270+(180.0f/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360.0f/slices)),
|
||||||
sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))),
|
sinf(DEG2RAD*(270+(180.0f/(rings + 1))*(i+1))),
|
||||||
cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360/slices)));
|
cosf(DEG2RAD*(270+(180.0f/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360.0f/slices)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rlEnd();
|
rlEnd();
|
||||||
|
|
|
||||||
|
|
@ -85,9 +85,9 @@ int main(void)
|
||||||
|
|
||||||
// Calculate the cube position
|
// Calculate the cube position
|
||||||
Vector3 cubePos = {
|
Vector3 cubePos = {
|
||||||
(float)(x - numBlocks/2)*(scale*3.0f) + scatter,
|
(float)(x - (float)numBlocks/2)*(scale*3.0f) + scatter,
|
||||||
(float)(y - numBlocks/2)*(scale*2.0f) + scatter,
|
(float)(y - (float)numBlocks/2)*(scale*2.0f) + scatter,
|
||||||
(float)(z - numBlocks/2)*(scale*3.0f) + scatter
|
(float)(z - (float)numBlocks/2)*(scale*3.0f) + scatter
|
||||||
};
|
};
|
||||||
|
|
||||||
// Pick a color with a hue depending on cube position for the rainbow color effect
|
// Pick a color with a hue depending on cube position for the rainbow color effect
|
||||||
|
|
|
||||||
|
|
@ -258,8 +258,8 @@ int main(void)
|
||||||
UnloadImage(pattern);
|
UnloadImage(pattern);
|
||||||
|
|
||||||
mode = MODE_PAUSE;
|
mode = MODE_PAUSE;
|
||||||
offsetX = worldWidth*presetPatterns[preset].position.x - windowWidth/zoom/2.0f;
|
offsetX = worldWidth*presetPatterns[preset].position.x - (float)windowWidth/zoom/2.0f;
|
||||||
offsetY = worldHeight*presetPatterns[preset].position.y - windowHeight/zoom/2.0f;
|
offsetY = worldHeight*presetPatterns[preset].position.y - (float)windowHeight/zoom/2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check window draw inside world limits
|
// Check window draw inside world limits
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ int main(void)
|
||||||
Shader shdrRaster = LoadShader(0, TextFormat("resources/shaders/glsl%i/hybrid_raster.fs", GLSL_VERSION));
|
Shader shdrRaster = LoadShader(0, TextFormat("resources/shaders/glsl%i/hybrid_raster.fs", GLSL_VERSION));
|
||||||
|
|
||||||
// Declare Struct used to store camera locs
|
// Declare Struct used to store camera locs
|
||||||
RayLocs marchLocs = {0};
|
RayLocs marchLocs = { 0 };
|
||||||
|
|
||||||
// Fill the struct with shader locs
|
// Fill the struct with shader locs
|
||||||
marchLocs.camPos = GetShaderLocation(shdrRaymarch, "camPos");
|
marchLocs.camPos = GetShaderLocation(shdrRaymarch, "camPos");
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ int main(void)
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - vertex displacement");
|
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - vertex displacement");
|
||||||
|
|
||||||
// set up camera
|
// set up camera
|
||||||
Camera camera = {0};
|
Camera camera = { 0 };
|
||||||
camera.position = (Vector3) {20.0f, 5.0f, -20.0f};
|
camera.position = (Vector3) {20.0f, 5.0f, -20.0f};
|
||||||
camera.target = (Vector3) {0.0f, 0.0f, 0.0f};
|
camera.target = (Vector3) {0.0f, 0.0f, 0.0f};
|
||||||
camera.up = (Vector3) {0.0f, 1.0f, 0.0f};
|
camera.up = (Vector3) {0.0f, 1.0f, 0.0f};
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ int main(void)
|
||||||
|
|
||||||
int ballCount = 1;
|
int ballCount = 1;
|
||||||
Ball *grabbedBall = NULL; // A pointer to the current ball that is grabbed
|
Ball *grabbedBall = NULL; // A pointer to the current ball that is grabbed
|
||||||
Vector2 pressOffset = {0}; // Mouse press offset relative to the ball that grabbedd
|
Vector2 pressOffset = { 0 }; // Mouse press offset relative to the ball that grabbedd
|
||||||
|
|
||||||
float gravity = 100; // World gravity
|
float gravity = 100; // World gravity
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ int main(void)
|
||||||
for (int i = 0; i < MAX_COLORS_COUNT; i++)
|
for (int i = 0; i < MAX_COLORS_COUNT; i++)
|
||||||
{
|
{
|
||||||
colorsRecs[i].x = 20.0f + 100.0f *(i%7) + 10.0f *(i%7);
|
colorsRecs[i].x = 20.0f + 100.0f *(i%7) + 10.0f *(i%7);
|
||||||
colorsRecs[i].y = 80.0f + 100.0f *(i/7) + 10.0f *(i/7);
|
colorsRecs[i].y = 80.0f + 100.0f *((float)i/7) + 10.0f *((float)i/7);
|
||||||
colorsRecs[i].width = 100.0f;
|
colorsRecs[i].width = 100.0f;
|
||||||
colorsRecs[i].height = 100.0f;
|
colorsRecs[i].height = 100.0f;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ static void DrawDisplaySegment(Vector2 center, int length, int thick, bool verti
|
||||||
(Vector2){ center.x + thick/2.0f, center.y - length/2.0f }, // Point 3
|
(Vector2){ center.x + thick/2.0f, center.y - length/2.0f }, // Point 3
|
||||||
(Vector2){ center.x - thick/2.0f, center.y + length/2.0f }, // Point 4
|
(Vector2){ center.x - thick/2.0f, center.y + length/2.0f }, // Point 4
|
||||||
(Vector2){ center.x + thick/2.0f, center.y + length/2.0f }, // Point 5
|
(Vector2){ center.x + thick/2.0f, center.y + length/2.0f }, // Point 5
|
||||||
(Vector2){ center.x, center.y + length/2 + thick/2.0f }, // Point 6
|
(Vector2){ center.x, center.y + (float)length/2 + thick/2.0f }, // Point 6
|
||||||
};
|
};
|
||||||
|
|
||||||
DrawTriangleStrip(segmentPointsV, 6, color);
|
DrawTriangleStrip(segmentPointsV, 6, color);
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,8 @@ int main(void)
|
||||||
float totalM = m1 + m2;
|
float totalM = m1 + m2;
|
||||||
|
|
||||||
Vector2 previousPosition = CalculateDoublePendulumEndPoint(l1, theta1, l2, theta2);
|
Vector2 previousPosition = CalculateDoublePendulumEndPoint(l1, theta1, l2, theta2);
|
||||||
previousPosition.x += (screenWidth/2);
|
previousPosition.x += ((float)screenWidth/2);
|
||||||
previousPosition.y += (screenHeight/2 - 100);
|
previousPosition.y += ((float)screenHeight/2 - 100);
|
||||||
|
|
||||||
// Scale length
|
// Scale length
|
||||||
float L1 = l1*lengthScaler;
|
float L1 = l1*lengthScaler;
|
||||||
|
|
@ -105,8 +105,8 @@ int main(void)
|
||||||
|
|
||||||
// Calculate position
|
// Calculate position
|
||||||
Vector2 currentPosition = CalculateDoublePendulumEndPoint(l1, theta1, l2, theta2);
|
Vector2 currentPosition = CalculateDoublePendulumEndPoint(l1, theta1, l2, theta2);
|
||||||
currentPosition.x += screenWidth/2;
|
currentPosition.x += (float)screenWidth/2;
|
||||||
currentPosition.y += screenHeight/2 - 100;
|
currentPosition.y += (float)screenHeight/2 - 100;
|
||||||
|
|
||||||
// Draw to render texture
|
// Draw to render texture
|
||||||
BeginTextureMode(target);
|
BeginTextureMode(target);
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,8 @@ int main(void)
|
||||||
bool showPercentages = false;
|
bool showPercentages = false;
|
||||||
bool showDonut = false;
|
bool showDonut = false;
|
||||||
int hoveredSlice = -1;
|
int hoveredSlice = -1;
|
||||||
Rectangle scrollPanelBounds = {0};
|
Rectangle scrollPanelBounds = { 0 };
|
||||||
Vector2 scrollContentOffset = {0};
|
Vector2 scrollContentOffset = { 0 };
|
||||||
Rectangle view = { 0 };
|
Rectangle view = { 0 };
|
||||||
|
|
||||||
// UI layout parameters
|
// UI layout parameters
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue