Skip to content

Commit dbca900

Browse files
committed
Merge branch 'master' of https://github.com/raysan5/raylib
2 parents 1061daf + fb5bc42 commit dbca900

File tree

8 files changed

+44
-20
lines changed

8 files changed

+44
-20
lines changed

examples/audio/audio_sound_positioning.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int main(void)
6868
.z = 5.0f*sinf(th)
6969
};
7070

71-
SetSoundPosition(camera, sound, spherePos, 20.0f);
71+
SetSoundPosition(camera, sound, spherePos, 1.0f);
7272

7373
if (!IsSoundPlaying(sound)) PlaySound(sound);
7474
//----------------------------------------------------------------------------------

examples/core/core_2d_camera_platformer.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ int main(void)
148148
DrawText("Controls:", 20, 20, 10, BLACK);
149149
DrawText("- Right/Left to move", 40, 40, 10, DARKGRAY);
150150
DrawText("- Space to jump", 40, 60, 10, DARKGRAY);
151-
DrawText("- Mouse Wheel to Zoom in-out, R to reset zoom", 40, 80, 10, DARKGRAY);
152-
DrawText("- C to change camera mode", 40, 100, 10, DARKGRAY);
153-
DrawText("Current camera mode:", 20, 120, 10, BLACK);
154-
DrawText(cameraDescriptions[cameraOption], 40, 140, 10, DARKGRAY);
151+
DrawText("- Mouse Wheel to Zoom in-out", 40, 80, 10, DARKGRAY);
152+
DrawText("- R to reset position + zoom", 40, 100, 10, DARKGRAY);
153+
DrawText("- C to change camera mode", 40, 120, 10, DARKGRAY);
154+
DrawText("Current camera mode:", 20, 140, 10, BLACK);
155+
DrawText(cameraDescriptions[cameraOption], 40, 160, 10, DARKGRAY);
155156

156157
EndDrawing();
157158
//----------------------------------------------------------------------------------

examples/core/core_input_actions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int main(void)
117117

118118
DrawRectangleV(position, size, releaseAction? BLUE : RED);
119119

120-
DrawText((actionSet == 0)? "Current input set: WASD (default)" : "Current input set: Cursor", 10, 10, 20, WHITE);
120+
DrawText((actionSet == 0)? "Current input set: WASD (default)" : "Current input set: Arrow keys", 10, 10, 20, WHITE);
121121
DrawText("Use TAB key to toggles Actions keyset", 10, 50, 20, GREEN);
122122

123123
EndDrawing();

examples/core/core_input_gamepad.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
// NOTE: Gamepad name ID depends on drivers and OS
2525
#define XBOX_ALIAS_1 "xbox"
2626
#define XBOX_ALIAS_2 "x-box"
27-
#define PS_ALIAS "playstation"
27+
#define PS_ALIAS_1 "playstation"
28+
#define PS_ALIAS_2 "sony"
2829

2930
//------------------------------------------------------------------------------------
3031
// Program main entry point
@@ -148,7 +149,8 @@ int main(void)
148149
//DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK);
149150
//DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(gamepad, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK);
150151
}
151-
else if (TextFindIndex(TextToLower(GetGamepadName(gamepad)), PS_ALIAS) > -1)
152+
else if ((TextFindIndex(TextToLower(GetGamepadName(gamepad)), PS_ALIAS_1) > -1) ||
153+
(TextFindIndex(TextToLower(GetGamepadName(gamepad)), PS_ALIAS_2) > -1))
152154
{
153155
DrawTexture(texPs3Pad, 0, 0, DARKGRAY);
154156

examples/core/core_input_virtual_controls.c

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,31 @@ int main(void)
5151
{ padPosition.x, padPosition.y + buttonRadius*1.5f } // Down
5252
};
5353

54-
const char *buttonLabels[BUTTON_MAX] = {
55-
"Y", // Up
56-
"X", // Left
57-
"B", // Right
58-
"A" // Down
54+
Vector2 arrowTris[4][3] = {
55+
// Up
56+
{
57+
{ buttonPositions[0].x, buttonPositions[0].y - 12 },
58+
{ buttonPositions[0].x - 9, buttonPositions[0].y + 9 },
59+
{ buttonPositions[0].x + 9, buttonPositions[0].y + 9 }
60+
},
61+
// Left
62+
{
63+
{ buttonPositions[1].x + 9, buttonPositions[1].y - 9 },
64+
{ buttonPositions[1].x - 12, buttonPositions[1].y },
65+
{ buttonPositions[1].x + 9, buttonPositions[1].y + 9 }
66+
},
67+
// Right
68+
{
69+
{ buttonPositions[2].x + 12, buttonPositions[2].y },
70+
{ buttonPositions[2].x - 9, buttonPositions[2].y - 9 },
71+
{ buttonPositions[2].x - 9, buttonPositions[2].y + 9 }
72+
},
73+
// Down
74+
{
75+
{ buttonPositions[3].x - 9, buttonPositions[3].y - 9 },
76+
{ buttonPositions[3].x, buttonPositions[3].y + 12 },
77+
{ buttonPositions[3].x + 9, buttonPositions[3].y - 9 }
78+
}
5979
};
6080

6181
Color buttonLabelColors[BUTTON_MAX] = {
@@ -128,9 +148,12 @@ int main(void)
128148
{
129149
DrawCircleV(buttonPositions[i], buttonRadius, (i == pressedButton)? DARKGRAY : BLACK);
130150

131-
DrawText(buttonLabels[i],
132-
(int)buttonPositions[i].x - 7, (int)buttonPositions[i].y - 8,
133-
20, buttonLabelColors[i]);
151+
DrawTriangle(
152+
arrowTris[i][0],
153+
arrowTris[i][1],
154+
arrowTris[i][2],
155+
buttonLabelColors[i]
156+
);
134157
}
135158

136159
DrawText("move the player with D-Pad buttons", 10, 10, 20, DARKGRAY);

examples/core/core_random_sequence.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ int main(void)
9696
{
9797
DrawRectangleRec(rectangles[i].rect, rectangles[i].color);
9898

99-
DrawText("Press SPACE to shuffle the sequence", 10, screenHeight - 96, 20, BLACK);
100-
10199
DrawText("Press SPACE to shuffle the current sequence", 10, screenHeight - 96, 20, BLACK);
102100
DrawText("Press UP to add a rectangle and generate a new sequence", 10, screenHeight - 64, 20, BLACK);
103101
DrawText("Press DOWN to remove a rectangle and generate a new sequence", 10, screenHeight - 32, 20, BLACK);

examples/shapes/shapes_colors_palette.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ int main(void)
4545
for (int i = 0; i < MAX_COLORS_COUNT; i++)
4646
{
4747
colorsRecs[i].x = 20.0f + 100.0f *(i%7) + 10.0f *(i%7);
48-
colorsRecs[i].y = 80.0f + 100.0f *((float)i/7) + 10.0f *((float)i/7);
48+
colorsRecs[i].y = 80.0f + 100.0f *((int)i/7) + 10.0f *((float)i/7);
4949
colorsRecs[i].width = 100.0f;
5050
colorsRecs[i].height = 100.0f;
5151
}

src/rcamera.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ RLAPI Matrix GetCameraProjectionMatrix(Camera *camera, float aspect);
199199
//----------------------------------------------------------------------------------
200200
#define CAMERA_MOVE_SPEED 5.4f // Units per second
201201
#define CAMERA_ROTATION_SPEED 0.03f
202-
#define CAMERA_PAN_SPEED 0.2f
202+
#define CAMERA_PAN_SPEED 2.0f
203203

204204
// Camera mouse movement sensitivity
205205
#define CAMERA_MOUSE_MOVE_SENSITIVITY 0.003f

0 commit comments

Comments
 (0)