-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevelLoader.h
More file actions
59 lines (47 loc) · 1.58 KB
/
Copy pathLevelLoader.h
File metadata and controls
59 lines (47 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
#include <cstdint>
#include <string>
#include <vector>
#include "GameCanvas.h"
#include "GameLevel.h"
#include "GamePhysics.h"
#include "TimerOrMotoPartOrMenuElem.h"
class LevelLoader {
private:
std::vector<std::vector<int>> segmentNormals;
int wheelRadiusSq[3];
int wheelInnerRadiusSq[3];
int segmentCapacity = 0;
static int visibleStart;
static int visibleEnd;
public:
static int visibleStartX;
static int visibleEndX;
private:
public:
static bool isEnabledPerspective;
static bool isEnabledShadows;
GameLevel *gameLevel = nullptr;
int maxTrackX;
bool loopApexPassed = false;
int collisionNormalX;
int collisionNormalY;
int maxPassedSegmentX = 0; // Максимальная X координата пройденного сегмента
LevelLoader();
~LevelLoader();
void loadHardcodedLevel();
int getFinishFlagX();
int getStartFlagX();
int getStartPosX();
int getStartPosY();
int getProgressAt(int x);
void prepareLevelData(GameLevel *gameLevel);
// Метод для частичного обновления физики (нормалей) при генерации новых участков
// startPointIndex - индекс точки, с которой начали добавление
void appendLevelData(int startPointIndex);
void setMinMaxX(int minX, int maxX);
void renderTrackNearestLine(GameCanvas *canvas);
void updateVisibleRange(int x1, int x2, int y);
int detectCollision(MotoComponent *part, int wheelType);
void shiftLevel(int shiftX);
};