Skip to content

Commit

Permalink
More W3DView work
Browse files Browse the repository at this point in the history
  • Loading branch information
jonwil committed Jan 7, 2024
1 parent e91f48c commit 711fbad
Show file tree
Hide file tree
Showing 7 changed files with 1,013 additions and 4 deletions.
11 changes: 10 additions & 1 deletion src/game/client/gameclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,13 @@ void GameClient::Add_Drawable_To_Lookup_Table(Drawable *drawable)

m_drawableLUT[id] = drawable;
}
}
}

void GameClient::Flush_Text_Bearing_Drawables()
{
for (auto it = m_drawableTB.begin(); it != m_drawableTB.end(); it++) {
(*it)->Draw_UI_Text();
}

m_drawableTB.clear();
}
3 changes: 3 additions & 0 deletions src/game/client/gameclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ class GameClient : public SubsystemInterface, public SnapShot
void Add_Text_Bearing_Drawable(Drawable *drawable);
void Remove_Drawable_From_Lookup_Table(Drawable *drawable);
void Add_Drawable_To_Lookup_Table(Drawable *drawable);
void Reset_On_Screen_Object_Count() { m_onScreenObjectCount = 0; }
void Add_On_Screen_Object() { m_onScreenObjectCount++; }
void Flush_Text_Bearing_Drawables();

protected:
uint32_t m_frame;
Expand Down
1 change: 1 addition & 0 deletions src/game/client/water.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class WaterTransparencySetting : public Overridable
friend class WaterTracksRenderSystem;
friend class BaseHeightMapRenderObjClass;
friend class W3DDisplay;
friend class W3DView;
};

#ifdef GAME_DLL
Expand Down
32 changes: 32 additions & 0 deletions src/hooker/setuphooks_zh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,38 @@ void Setup_Hooks()
Hook_Any(0x00771C00, W3DView::Pitch_Camera_One_Frame);
Hook_Any(0x00771CA0, W3DView::Move_Along_Waypoint_Path);

Hook_Any(0x0076D5C0, W3DView::Get_3D_Camera_Position);
Hook_Any(0x0076D720, W3DView::Update_View);
Hook_Any(0x0076D730, W3DView::Update);
Hook_Any(0x0076E1D0, W3DView::Get_Axis_Aligned_View_Region);
Hook_Any(0x0076E320, W3DView::Set_3D_Wireframe_Mode);
Hook_Any(0x0076E360, W3DView::Set_View_Filter_Mode);
Hook_Any(0x0076E3B0, W3DView::Set_View_Filter);
Hook_Any(0x0076E4A0, W3DView::Draw_View);
Hook_Any(0x0076E400, W3DView::Calc_Delta_Scroll);
Hook_Any(0x0076E4B0, W3DView::Draw);
Hook_Any(0x0076EDA0, W3DView::Set_Camera_Lock);
Hook_Any(0x0076EDD0, W3DView::Set_Snap_Mode);
Hook_Any(0x0076EDF0, W3DView::Scroll_By);
Hook_Any(0x0076EF30, W3DView::Force_Redraw);
Hook_Any(0x0076EF40, W3DView::Set_Angle);
Hook_Any(0x0076F010, W3DView::Set_Pitch);
Hook_Any(0x0076F050, W3DView::Set_Angle_And_Pitch_To_Default);
Hook_Any(0x0076F070, W3DView::Set_Default_View);
Hook_Any(0x0076F0A0, W3DView::Set_Height_Above_Ground);
Hook_Any(0x0076F110, W3DView::Set_Zoom);
Hook_Any(0x0076F180, W3DView::Set_Zoom_To_Default);
Hook_Any(0x0076F2E0, W3DView::Set_Field_Of_View);
Hook_Any(0x0076F2F0, W3DView::World_To_Screen_Tri_Return);
Hook_Any(0x0076F820, W3DView::Screen_To_Terrain);
Hook_Any(0x0076FB70, W3DView::Look_At);
Hook_Any(0x0076FE50, W3DView::Init_Height_For_Map);
Hook_Any(0x0076FEF0, W3DView::Move_Camera_To);
Hook_Any(0x00771330, W3DView::Setup_Waypoint_Path);
Hook_Any(0x00770000, W3DView::Rotate_Camera);
Hook_Any(0x00771180, W3DView::Is_Camera_Movement_At_Waypoint_Along_Path);
Hook_Any(0x00771190, W3DView::Move_Camera_Along_Waypoint_Path);

// scene.h
Hook_Any(0x00832550, SceneClass::Render);
Hook_Any(0x00832B70, SimpleSceneClass::Add_Render_Object);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/w3dengine/client/w3dscene.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class RTS3DScene : public SimpleSceneClass, public SubsystemInterface
void Update_Player_Color_Passes();

void Draw_Terrain_Only(bool draw) { m_drawTerrainOnly = draw; }
void setCustomScenePassMode(CustomScenePassModes mode) { m_customScenePassMode = mode; }
void Set_Custom_Scene_Pass_Mode(CustomScenePassModes mode) { m_customScenePassMode = mode; }
CustomScenePassModes Get_Custom_Scene_Pass_Mode() { return m_customScenePassMode; }
RefMultiListClass<RenderObjClass> *Get_Dynamic_Lights() { return &m_dynamicLightList; }

Expand Down
Loading

0 comments on commit 711fbad

Please sign in to comment.