Fix a bug
This commit is contained in:
parent
fb5d9d118e
commit
1454ae446e
3 changed files with 138 additions and 8 deletions
3
TODO.txt
3
TODO.txt
|
@ -2,6 +2,7 @@
|
|||
|
||||
- Consider better input handling in SDL? Currently it just detects presses on
|
||||
the exact frame, so a press can be missed. But how tho?
|
||||
- Try to mess with car weight?
|
||||
- FPS logging for optim
|
||||
- try to add distance fog?
|
||||
- use 332 in SDL with potato?
|
||||
|
@ -60,7 +61,6 @@
|
|||
|
||||
=========== BUGS =================
|
||||
|
||||
- MAP4: one triangle in top section is missing!
|
||||
- very rarely the near plane overflow bug still happens, maybe shift near plane
|
||||
a bit further still?
|
||||
- sometimes during long loading the screen goes black, seems to have appeared
|
||||
|
@ -72,6 +72,7 @@
|
|||
|
||||
=========== HANDLED ==============
|
||||
|
||||
- MAP4: one triangle in top section is missing!
|
||||
- add ifdefs that change car color?
|
||||
- Try progressively slower steering?
|
||||
- compile time option to choose how many maps to include (for platforms with
|
||||
|
|
89
data
89
data
|
@ -31,6 +31,89 @@ bottom section
|
|||
:;41ZJ :fR21 long wall top
|
||||
:;91WL :fJ21 long wall top bottom
|
||||
:xr1V :fa37
|
||||
#RLC1;00LC1;8bd6e314 0000519:0121:00a3:0041:0069:0041:00d9:0081:0049:0081:0059:0021:00d9:0041:0245:0031:0019:01e1:0023:00e1:0029:00b1:0089:0051:0039:0031:0123:0021:0395:0041:01b3:0031:0073:0041:0033:0051:0033:0121:0043:0031:0073:0031:0053:0031:0103:0031:00d9:0011:0339:0021:0109:0011:00b9:0031
|
||||
#BLC1;
|
||||
#RLC1;00LC1;8bd6e314 0000519:0011:0149:0051:0159:0071:00a9:0041:00f9:0021:0123:0021:00b9:0088:0040:00b8:001c:0054:0030:0079:0051:0143:0081:0029:0101:00e9:0041:0099:0051:00a9:0041:0335:0031:0189:0041:00a3:00c1:0033:0031:0013:0071:0043:00b1:00a3:0051:0169:0021:0429:0021:00b3:0031
|
||||
|
||||
:n31W :f121 :=31X :f123 :=01W :f321 corner top left
|
||||
|
||||
diagonal corner top left
|
||||
|
||||
:=30U :f413 :=70V :=50T
|
||||
:A50S :f131 :A60T :f131
|
||||
:A70U :f131 :A80V :f131
|
||||
:A41SI :f121 :A51TI :f121
|
||||
:A61UI :f121 :A71VI :f121
|
||||
:\81WJ| :f121
|
||||
|
||||
top section
|
||||
|
||||
:\w1ZL :f131 :\x1YI| :f131L
|
||||
:nw4Y1L :f121
|
||||
:;w1&J :f421 :f151
|
||||
:=w3Z2 :^w3@2I- :^w4@2 :=w4&2
|
||||
:=w0Y :f514
|
||||
:AA0&L :f131 :AB0@L :f131 :AA1@J :f121 :\B1ZJ :f121
|
||||
:=w0Y :f141 :m664
|
||||
|
||||
small house top
|
||||
|
||||
:-J3Y :f411 :<J3ZI :f411 :,K1Z2J :f211 :^J0ZI :f311
|
||||
:=M1Z2 :f121 :=J0Y1 :m443 :=I0X2 :=J0Y3
|
||||
|
||||
:x514 :f426
|
||||
|
||||
:=D06 :fk21 :nD06I :f121 :=D01 :fp21 :nD11I walls bottom
|
||||
|
||||
:=W06 :f12b :=&01 :f12g
|
||||
|
||||
top right corners
|
||||
|
||||
:AV0ZL :f131 :AW0YL :f131 :AX0XL :f131
|
||||
:AY0WL :f131 :AZ0VL :f131 :A@0UL :f131
|
||||
:A&0TL :f131 :AV1YJ :f121 :AW1XJ :f121
|
||||
:AX1WJ :f121 :AY1VJ :f121 :AZ1UJ :f121
|
||||
:A@1TJ :f121 :AS0VJ :f131 :AT0UJ :f131
|
||||
:AU0TJ :f131 :AV0SJ :f131 :AW0RJ :f131
|
||||
:AT1VL :f121 :AU1UL :f121 :AV1TL :f121
|
||||
:AW1SL :f121 :AX1RL :f121
|
||||
:=U1Z :f121 :\S1WL :f121
|
||||
|
||||
:=X0C2 :f13f :f21f :=&0C2 :f13h :=@0C2 :f11f right walls
|
||||
|
||||
left section
|
||||
:=01P :f127 :=41P :f123 :\01O|L :f121 :\41OJ :f121
|
||||
:\22L|I :m111 :\42G|I :m111 :\22C|I :m111
|
||||
:~11G2
|
||||
:=50y :f212 :A00yJ :A50AL :A60zL :A70yL
|
||||
|
||||
bowl
|
||||
:'60rJ :f117 :^70rL- :f117 :^71rJ :f117 :|72rJ- :f117
|
||||
:|82rL :f117 :|81rL- :f117 :'50rL :f117 :m437
|
||||
|
||||
details
|
||||
|
||||
:;y031J :f311 :;y021L :f311 hole
|
||||
|
||||
:^3212L :^3112L- :-2212 :-2112- arrow
|
||||
|
||||
:=410 :f222
|
||||
:]X1uL :f118
|
||||
:]&1uJ :f118
|
||||
|
||||
:>F01 :f316
|
||||
:>00D :f513
|
||||
|
||||
:=b0W3 :fa14
|
||||
|
||||
:'W02L :f114
|
||||
|
||||
:=60I2 :f236 :^62IJ :f116 :^73IJ :f116 spectator seats
|
||||
:|01z2L :f11e border left
|
||||
|
||||
:\Q121L :f121 :\P121|J :f121 :\Q151|L :f121 :\P151IJ :f121
|
||||
:\Q261L :\P261|J :\Q211|L :\P211IJ
|
||||
|
||||
:=915 :f12f wall
|
||||
:n915J :f121 :n415 :f121
|
||||
|
||||
:-6323 :f212
|
||||
|
||||
:!612 :f212 :+W1V :+21Q :+D13
|
||||
|
|
54
renderer.h
54
renderer.h
|
@ -114,6 +114,49 @@ struct
|
|||
with color stored in this variable. */
|
||||
} LCR_renderer;
|
||||
|
||||
|
||||
void aaa(void)
|
||||
{
|
||||
printf("BAD TRIS (%d):\n",LCR_renderer.mapModel.triangleCount);
|
||||
|
||||
for (int i = 0; i < LCR_renderer.mapModel.triangleCount; ++i)
|
||||
{
|
||||
TPE_Unit sss =
|
||||
TPE_max(
|
||||
TPE_abs(LCR_renderer.mapModel.vertices[
|
||||
LCR_renderer.mapModel.triangles[i * 3] * 3] -
|
||||
LCR_renderer.mapModel.vertices[
|
||||
LCR_renderer.mapModel.triangles[i * 3 + 1] * 3]),
|
||||
TPE_abs(LCR_renderer.mapModel.vertices[
|
||||
LCR_renderer.mapModel.triangles[i * 3 + 1] * 3] -
|
||||
LCR_renderer.mapModel.vertices[
|
||||
LCR_renderer.mapModel.triangles[i * 3 + 2] * 3])
|
||||
);
|
||||
|
||||
if (sss > LCR_RENDERER_UNIT * 2)
|
||||
printf(" - %d (%d %d %d, %d %d %d, %d %d %d) %d %d %d\n",i,
|
||||
LCR_renderer.mapModel.vertices[LCR_renderer.mapModel.triangles[3 * i]],
|
||||
LCR_renderer.mapModel.vertices[LCR_renderer.mapModel.triangles[3 * i] + 1],
|
||||
LCR_renderer.mapModel.vertices[LCR_renderer.mapModel.triangles[3 * i] + 2],
|
||||
LCR_renderer.mapModel.vertices[LCR_renderer.mapModel.triangles[3 * i + 1]],
|
||||
LCR_renderer.mapModel.vertices[LCR_renderer.mapModel.triangles[3 * i + 1] + 1],
|
||||
LCR_renderer.mapModel.vertices[LCR_renderer.mapModel.triangles[3 * i + 1] + 2],
|
||||
LCR_renderer.mapModel.vertices[LCR_renderer.mapModel.triangles[3 * i + 2]],
|
||||
LCR_renderer.mapModel.vertices[LCR_renderer.mapModel.triangles[3 * i + 2] + 1],
|
||||
LCR_renderer.mapModel.vertices[LCR_renderer.mapModel.triangles[3 * i + 2] + 2],
|
||||
|
||||
LCR_renderer.mapModel.triangles[3 * i],
|
||||
LCR_renderer.mapModel.triangles[3 * i + 1],
|
||||
LCR_renderer.mapModel.triangles[3 * i + 2]
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void _LCR_rendererSetModelTransform(S3L_Model3D *model,
|
||||
LCR_GameUnit position[3], LCR_GameUnit rotation[3])
|
||||
{
|
||||
|
@ -923,6 +966,12 @@ uint8_t _LCR_buildMapModel(void)
|
|||
LCR_mapGetBlockShape(blockType,LCR_mapBlockGetTransform(block),
|
||||
blockShapeBytes,&blockShapeByteCount);
|
||||
|
||||
// When nearing limit, cull (can't be inside the loop sadly, trust me).
|
||||
if (
|
||||
LCR_renderer.mapModel.vertexCount >= LCR_SETTING_MAX_MAP_VERTICES - 16 ||
|
||||
LCR_renderer.mapModel.triangleCount >= LCR_SETTING_MAX_MAP_TRIANGLES - 16)
|
||||
_LCR_cullHiddenMapTris();
|
||||
|
||||
for (int i = 0; i < blockShapeByteCount; ++i)
|
||||
{
|
||||
if (vi == 0)
|
||||
|
@ -950,10 +999,6 @@ uint8_t _LCR_buildMapModel(void)
|
|||
vi++;
|
||||
else // 3 indices => create and add triangle
|
||||
{
|
||||
if (LCR_renderer.mapModel.triangleCount >=
|
||||
LCR_SETTING_MAX_MAP_TRIANGLES)
|
||||
_LCR_cullHiddenMapTris();
|
||||
|
||||
// don't add triangles completely at the boundary of the map
|
||||
if (!edgeBits)
|
||||
{
|
||||
|
@ -1040,6 +1085,7 @@ uint8_t _LCR_buildMapModel(void)
|
|||
}
|
||||
|
||||
_LCR_cullHiddenMapTris();
|
||||
|
||||
LCR_LOG1("map model built, verts/tris:");
|
||||
LCR_LOG1_NUM(LCR_renderer.mapModel.vertexCount);
|
||||
LCR_LOG1_NUM(LCR_renderer.mapModel.triangleCount);
|
||||
|
|
Loading…
Reference in a new issue