Ejemplo n.º 1
0
        private void GlControl_Map_RenderDo(object sender, PaintEventArgs e)
        {
            if (!openglControlMapCanUse)
            {
                return;
            }

            if (Settings.CurrentMap != Settings.CurrentMapSwitchTo)
            {
                Settings.CurrentMap = Settings.CurrentMapSwitchTo;
                HelperOpenGL.GlControl_LoadMapTexture(Settings.CurrentMap);
            }

            HelperOpenGL.GlControl_MakeCurrent(openglControlMap);
            HelperOpenGL.GlControl_SetupViewport(openglControlMap.Width, openglControlMap.Height);
            HelperOpenGL.GlControl_DrawStart();
            HelperOpenGL.GlControl_Draw_Map(openglControlMapDragOffsetX, openglControlMapDragOffsetY);

            // Render real or test objects
            if (!Settings.DemoMode)
            {
                GlControl_Map_PrepareObjects();
            }
            else
            {
                GlControl_Map_PrepareTestObjects(openglControlMap);
            }

            GlControl_Map_RenderObjects();
            HelperOpenGL.GlControl_Draw_End(openglControlMap);
            renderMapComplete = true;
        }
Ejemplo n.º 2
0
        public void GlControl_Map_Load(object sender, EventArgs e)
        {
            GL.ClearColor(Color.Black);

            HelperOpenGL.GlControl_LoadTextures();
            HelperOpenGL.GlControl_GenerateFonts();
        }
Ejemplo n.º 3
0
        private void GlControl_Map_RenderObjects()
        {
            // Draw all the geometry.
            HelperOpenGL.OpenglMapText.ForEach(u =>
            {
                HelperOpenGL.GlControl_DrawText(u.structs.Text, u.structs.DrawColor, u.structs.Size, u.structs.MapPosX, u.structs.MapPosZ, u.structs.TextOutline);
            });

            HelperOpenGL.OpenglMapIcons.ForEach(u =>
            {
                HelperOpenGL.GlControl_DrawIcons(u.structs.Text, u.structs.MapPosX, u.structs.MapPosZ, u.structs.DrawColor, u.structs.Rotation);
            });

            HelperOpenGL.OpenglMapGeometry.ForEach(u =>
            {
                switch (u.structs.Text)
                {
                case "line":
                    HelperOpenGL.GlControl_DrawLines(u.structs.Size, u.structs.MapPosX, u.structs.MapPosZ, u.structs.MapPosXend, u.structs.MapPosZend, u.structs.DrawColor);
                    break;

                case "point":
                    HelperOpenGL.GlControl_DrawPoint(u.structs.Size, u.structs.MapPosX, u.structs.MapPosZ, u.structs.DrawColor);
                    break;

                case "linestripple":
                    HelperOpenGL.GlControl_DrawLinesStripped(u.structs.Size, u.structs.MapPosX, u.structs.MapPosZ, u.structs.MapPosXend, u.structs.MapPosZend, u.structs.DrawColor);
                    break;

                case "linestripple_invert":
                    HelperOpenGL.GlControl_DrawLinesStripped(u.structs.Size, u.structs.MapPosX, u.structs.MapPosZ, u.structs.MapPosXend, u.structs.MapPosZend, u.structs.DrawColor, true);
                    break;

                case "circle":
                    HelperOpenGL.GlControl_DrawCircle(u.structs.Size, u.structs.MapPosX, u.structs.MapPosZ, u.structs.DrawColor);
                    break;

                case "circlefill":
                    HelperOpenGL.GlControl_DrawCircleFill(u.structs.Size, u.structs.MapPosX, u.structs.MapPosZ, u.structs.DrawColor);
                    break;

                default:
                    break;
                }
            });

            // And clear as we dont need it anymore.
            HelperOpenGL.OpenglMapGeometry.Clear();
            HelperOpenGL.OpenglMapIcons.Clear();
            HelperOpenGL.OpenglMapText.Clear();
        }
Ejemplo n.º 4
0
 private void GlControl_Map_Resize(object sender, EventArgs e)
 {
     HelperOpenGL.GlControl_Refresh(openglControlMap);
 }
Ejemplo n.º 5
0
        private void RenderTimerTick(object source, ElapsedEventArgs e)
        {
            if (Settings.DemoMode)
            {
                // Force repaint event.
                if (renderMapComplete)
                {
                    renderMapComplete = false;

                    HelperOpenGL.GlControl_Refresh(openglControlMap);
                    RenderOverlay();
                }
            }

            ThreadHelper.SetText(this, textBoxAddressBase, reader.GameBaseAddress.ToString("X"));
            ThreadHelper.SetText(this, textBoxAddressGameWorld, reader.GameWorldPointer.ToString("X"));
            ThreadHelper.SetText(this, textBoxAddressLocalGameWorld, reader.LocalGameWorldPointer.ToString("X"));
            ThreadHelper.SetText(this, textBoxFPSCamera, reader.CameraPointer.ToString("X"));
            ThreadHelper.SetText(this, textBoxPID, Settings.GamePIDCurrent.ToString());

            if (Settings.MapCenterMap && !mouseFormButtonDown)
            {
                myCoordForMapCenterX = (int)Math.Round(Helper.myPosXingame) * Settings.MapZoomLevelFromZoomLevels * openglInvertMap;
                myCoordForMapCenterY = (int)Math.Round(Helper.myPosZingame) * Settings.MapZoomLevelFromZoomLevels * openglInvertMap;

                openglControlMapDragOffsetX          = (int)Math.Round(myCoordForMapCenterX * -1);
                openglControlMapDragOffsetY          = (int)Math.Round(myCoordForMapCenterY * -1);
                openglControlMapMouseDragOffsetTempX = openglControlMapDragOffsetX;
                openglControlMapMouseDragOffsetTempY = openglControlMapDragOffsetY;
            }

            // Aggressive Mode
            if (Aggressive.PlayerTargetsListEquipmentViewNeedsUpdate)
            {
                listViewEquipment.Invoke(new Action(() =>
                {
                    listViewEquipment.Items.Clear();

                    for (int i = Aggressive.PlayerTargetsDictEquipment.Count - 1; i >= 0; i--)
                    {
                        string[] listEntry    = new string[3];
                        listEntry[0]          = Aggressive.PlayerTargetsDictEquipment.ElementAt(i).Value;
                        listEntry[1]          = Aggressive.PlayerTargetsDictEquipment.ElementAt(i).Key.ToString();
                        listEntry[2]          = Aggressive.PlayerTargetsDictProfile.ElementAt(i).Key.ToString();
                        ListViewItem listItem = new ListViewItem(listEntry);
                        listViewEquipment.Items.Add(listItem);
                    }
                }));

                Aggressive.PlayerTargetsListEquipmentViewNeedsUpdate = false;
            }

            // Force repaint event.
            if (HelperOpenGL.PlayerListToRenderComplete)
            {
                HelperOpenGL.PlayerListToRenderFinal.Clear();
                HelperOpenGL.PlayerListToRenderFinal.AddRange(HelperOpenGL.PlayerListToRenderPre);
                HelperOpenGL.PlayerListToRenderComplete = false;
                if (HelperOpenGL.LootListToRenderComplete)
                {
                    HelperOpenGL.LootListToRenderFinal.Clear();
                    HelperOpenGL.LootListToRenderFinal.AddRange(HelperOpenGL.LootListToRenderPre);
                    HelperOpenGL.LootListToRenderComplete = false;
                }

                HelperOpenGL.GlControl_Refresh(openglControlMap);
                RenderOverlay();
            }

            if (buttonStartStop.Text == "Stop")
            {
                renderTimer.Start();
            }
        }