LoadWorldDressing3D PROC uses ebx esi call LoadTerminalArt3D call LoadJackboxArt3D invoke LoadAnimPack3D,OFFSET worldDressingArt3D,OFFSET worldDressingPath3D invoke ValidateCityPack3D,OFFSET worldDressingArt3D,128,128,3 cmp worldStreetSized3D,0 jne world_dressing_loaded lea esi,cityObjects3D mov ebx,CITY_PROP_COUNT world_size_street: cmp [esi].CityProp3D.asset,OFFSET hallStreetLife3D jne world_size_ground mov eax,[esi].CityProp3D.frame cmp eax,33 jne @F mov [esi].CityProp3D.worldW,FP_1*8/25 mov [esi].CityProp3D.worldH,FP_1*9/20 @@: cmp eax,34 jne @F mov [esi].CityProp3D.worldW,FP_1*9/20 mov [esi].CityProp3D.worldH,FP_1*4/5 @@: cmp eax,35 jne @F mov [esi].CityProp3D.worldW,FP_1*9/20 mov [esi].CityProp3D.worldH,FP_1*13/20 @@: cmp eax,36 jne @F mov [esi].CityProp3D.worldW,FP_1/5 mov [esi].CityProp3D.worldH,FP_1*2/5 @@: cmp eax,38 jne @F mov [esi].CityProp3D.worldW,FP_1*3/10 mov [esi].CityProp3D.worldH,FP_1*4/5 @@: cmp eax,39 jne @F mov [esi].CityProp3D.worldH,FP_1*4/5 @@: world_size_ground: add esi,SIZEOF CityProp3D dec ebx jnz world_size_street mov worldStreetSized3D,1 world_dressing_loaded: call UpdateStreetGround3D ret LoadWorldDressing3D ENDP StreetGroundHeight3D PROC wx:DWORD,wy:DWORD mov eax,wx cmp eax,28*FP_1+FP_HALF jae street_ground_road cmp wy,12*FP_1 jb street_ground_road cmp wy,13*FP_1 jae street_ground_far cmp eax,10*FP_1 jb street_ground_road jmp street_ground_kerb street_ground_far: cmp eax,3*FP_1 jb street_ground_road cmp wy,16*FP_1+FP_1/10 jb street_ground_road cmp wy,17*FP_1 jae street_ground_road street_ground_kerb: mov eax,FP_1*3/50 ret street_ground_road: xor eax,eax ret StreetGroundHeight3D ENDP UpdateStreetGround3D PROC uses esi edi lea esi,cityObjects3D mov edi,CITY_PROP_COUNT street_ground_object: invoke StreetGroundHeight3D,[esi].CityProp3D.posX,[esi].CityProp3D.posY mov [esi].CityProp3D.groundZ,eax add esi,SIZEOF CityProp3D dec edi jnz street_ground_object ret UpdateStreetGround3D ENDP FreeWorldDressing3D PROC call FreeTerminalArt3D call FreeJackboxArt3D invoke FreeAnimPack3D,OFFSET worldDressingArt3D mov hallLightReady3D,0 ret FreeWorldDressing3D ENDP ResolveDressingSurface3D PROC material:DWORD mov eax,material sub eax,115 cmp eax,3 jae world_dressing_surface_missing cmp worldDressingArt3D.pixels,0 je world_dressing_surface_missing shl eax,16 add eax,worldDressingArt3D.pixels mov ecx,128 mov edx,128 ret world_dressing_surface_missing: xor eax,eax ret ResolveDressingSurface3D ENDP RenderHallDressing3D PROC uses ebx esi edi cmp hallLevel3D,0 jne hall_dressing_done call RenderTerminalCabinets3D call RenderJackboxCabinet3D call DrawHallDarts3D lea esi,hallWallArt3D mov edi,WORLD_WALL_ART_COUNT hall_wall_painting: invoke DrawCityVertical3D,[esi],[esi+4],[esi+8],[esi+12],[esi+16],[esi+20],[esi+24] add esi,28 dec edi jnz hall_wall_painting xor esi,esi hall_wall_sconce: cmp esi,1 je hall_wall_secret_lamp invoke DrawHallLantern3D,FP_1*102/100,hallSconceY3D[esi*4],1 hall_wall_secret_lamp: invoke DrawHallLantern3D,FP_1*3098/100,hallSconceY3D[esi*4],-1 inc esi cmp esi,4 jb hall_wall_sconce hall_dressing_done: ret RenderHallDressing3D ENDP RenderStreetDressing3D PROC uses ebx esi edi ; Low kerbs follow the street instead of filling the pavement with billboards. invoke DrawCityBoxSides3D,10*FP_1,28*FP_1+FP_HALF,FP_1*1296/100,13*FP_1,0,FP_1*3/50,72 invoke DrawCityBoxSides3D,3*FP_1,28*FP_1+FP_HALF,16*FP_1,FP_1*1604/100,0,FP_1*3/50,72 ; Each metre gets a separate tile; never stretch paving over the whole street. mov esi,3*FP_1 street_paving: lea edi,[esi+FP_1] cmp edi,28*FP_1+FP_HALF jbe @F mov edi,28*FP_1+FP_HALF @@: invoke DrawCityHorizontal3D,esi,edi,16*FP_1,17*FP_1,FP_1*3/50,72 cmp esi,10*FP_1 jb @F invoke DrawCityHorizontal3D,esi,edi,12*FP_1,13*FP_1,FP_1*3/50,72 @@: add esi,FP_1 cmp esi,28*FP_1+FP_HALF jb street_paving ; Drainage grates sit on the road side of the kerb, not in the walking lane. mov esi,0 street_drain: imul eax,esi,7*FP_1 add eax,12*FP_1 lea ebx,[eax+FP_1*9/20] invoke DrawCityHorizontal3D,eax,ebx,13*FP_1+FP_1/20,13*FP_1+FP_1*7/20,FP_1/200,117 inc esi cmp esi,3 jb street_drain ret RenderStreetDressing3D ENDP