Esempio n. 1
0
        /*-------------------------------------------------------------------------
         * 街名と上陸地点名のバッファ作成
         * ---------------------------------------------------------------------------*/
        private void create_city_buffer()
        {
            m_icons1_vb      = create_buffer(m_world.NoSeas.Count);
            m_icons2_vb      = create_buffer(m_world.NoSeas.Count);
            m_city_names1_vb = create_buffer(m_world.NoSeas.Count);
            m_city_names2_vb = create_buffer(m_world.NoSeas.Count);

            sprite_vertex[] icons1_vbo      = new sprite_vertex[m_world.NoSeas.Count * 4];
            sprite_vertex[] icons2_vbo      = new sprite_vertex[m_world.NoSeas.Count * 4];
            sprite_vertex[] city_names1_vbo = new sprite_vertex[m_world.NoSeas.Count * 4];
            sprite_vertex[] city_names2_vbo = new sprite_vertex[m_world.NoSeas.Count * 4];

            int index = 0;

            foreach (GvoWorldInfo.Info i in m_world.NoSeas)
            {
                // アイコン
                set_vbo(ref icons1_vbo, index, i.position, new Point(0, 0), i.IconRect, -1);
                set_vbo(ref icons2_vbo, index, i.position, new Point(0, 0), i.SmallIconRect, -1);
                // 文字
                set_vbo(ref city_names1_vbo, index, i.position, i.StringOffset1, i.NameRect, -1);
                set_vbo(ref city_names2_vbo, index, i.position, i.StringOffset2, i.NameRect, -1);

                index++;
            }
            // 頂点を転送
            m_icons1_vb.SetData <sprite_vertex>(icons1_vbo);
            m_icons2_vb.SetData <sprite_vertex>(icons2_vbo);
            m_city_names1_vb.SetData <sprite_vertex>(city_names1_vbo);
            m_city_names2_vb.SetData <sprite_vertex>(city_names2_vbo);
        }
Esempio n. 2
0
        /*-------------------------------------------------------------------------
         * 해역명と풍향のバッファ작성
         * ---------------------------------------------------------------------------*/
        private void create_sea_buffer()
        {
            m_sea_icons1_vb = create_buffer(m_world.Seas.Count * 3);
            m_sea_icons2_vb = create_buffer(m_world.Seas.Count * 3);
            m_sea_names_vb  = create_buffer(m_world.Seas.Count * 3);

            sprite_vertex[] vbo1 = new sprite_vertex[(m_world.Seas.Count * 3) * 4];
            sprite_vertex[] vbo2 = new sprite_vertex[(m_world.Seas.Count * 3) * 4];
            sprite_vertex[] vbo3 = new sprite_vertex[(m_world.Seas.Count * 3) * 4];

            int   index = 0;
            float scale = this.GetDpiScaleRatio();
            int   diff  = (int)(3 * scale);

            foreach (GvoWorldInfo.Info i in m_world.Seas)
            {
                // 문자 위치
                var pos = new Point(i.position.X, i.position.Y);
                set_vbo(ref vbo3, index, pos, new Point(diff, -diff), m_lib.nameTexture.getRect(i.Name), i.angle, -1);
                index++;
            }

            d3d_sprite_rects.rect windRect = m_lib.icons.GetIcon(icons.icon_index.wind_arrow);

            foreach (GvoWorldInfo.Info i in m_world.Seas)
            {
                // 풍향
                if (i.SeaInfo != null)
                {
                    Point pos = new Point(i.position.X - 1, i.position.Y + 1);

                    // 夏
                    set_vbo(ref vbo1, index, pos, new Point(-diff, diff), windRect, i.SeaInfo.SummerAngle, -1);
                    index++;
                    // 冬
                    set_vbo(ref vbo2, index, pos, new Point(-diff, diff), windRect, i.SeaInfo.WinterAngle, -1);
                    index++;
                }
            }

            // 頂点を전送
            m_sea_icons1_vb.SetData <sprite_vertex>(vbo1);
            m_sea_icons2_vb.SetData <sprite_vertex>(vbo2);
            m_sea_names_vb.SetData <sprite_vertex>(vbo3);
        }
Esempio n. 3
0
        /*-------------------------------------------------------------------------
         * 海域名と風向きのバッファ作成
         * ---------------------------------------------------------------------------*/
        private void create_sea_buffer()
        {
            m_sea_names1_vb = create_buffer(m_world.Seas.Count * 3);
            m_sea_names2_vb = create_buffer(m_world.Seas.Count * 3);
            sprite_vertex[] vbo1 = new sprite_vertex[(m_world.Seas.Count * 3) * 4];
            sprite_vertex[] vbo2 = new sprite_vertex[(m_world.Seas.Count * 3) * 4];

            int   index  = 0;
            float scale  = this.GetDpiScaleRatio();
            int   offset = (int)(6 * scale);

            foreach (GvoWorldInfo.Info i in m_world.Seas)
            {
                // 文字
                var pos = new Point(i.position.X, i.position.Y);
                pos.Y += (int)((pos.Y - i.SeaInfo.WindPos.Y) * scale * 0.2f); // 文字表示位置をちょっとだけ調整するの
                set_vbo(ref vbo1, index, pos, new Point(-offset, 0), m_lib.seainfonameimage.GetRect(index), -1);
                set_vbo(ref vbo2, index, pos, new Point(-offset, 0), m_lib.seainfonameimage.GetRect(index), -1);
                index++;
            }

            foreach (GvoWorldInfo.Info i in m_world.Seas)
            {
                // 風向き
                if (i.SeaInfo != null)
                {
                    Point pos = new Point(i.SeaInfo.WindPos.X - i.position.X,
                                          i.SeaInfo.WindPos.Y - i.position.Y);

                    // 夏
                    set_vbo(ref vbo1, index, i.position, new Point(pos.X - offset, pos.Y), m_lib.seainfonameimage.GetWindArrowIcon(), i.SeaInfo.SummerAngle, -1);
                    set_vbo(ref vbo2, index, i.position, new Point(pos.X - offset, pos.Y), m_lib.seainfonameimage.GetWindArrowIcon(), i.SeaInfo.SummerAngle, WIND_ANGLE_COLOR2);
                    index++;
                    // 冬
                    set_vbo(ref vbo1, index, i.position, new Point(pos.X + offset, pos.Y), m_lib.seainfonameimage.GetWindArrowIcon(), i.SeaInfo.WinterAngle, WIND_ANGLE_COLOR2);
                    set_vbo(ref vbo2, index, i.position, new Point(pos.X + offset, pos.Y), m_lib.seainfonameimage.GetWindArrowIcon(), i.SeaInfo.WinterAngle, -1);
                    index++;
                }
            }

            // 頂点を転送
            m_sea_names1_vb.SetData <sprite_vertex>(vbo1);
            m_sea_names2_vb.SetData <sprite_vertex>(vbo2);
        }
Esempio n. 4
0
        /*-------------------------------------------------------------------------
         * 도시명と상륙지점명のバッファ작성
         * ---------------------------------------------------------------------------*/
        private void create_city_buffer()
        {
            m_icons1_vb = create_buffer(m_world.Cities.Count + m_world.Shores.Count + m_world.NoSeas.Count);
            m_icons2_vb = create_buffer(m_world.Cities.Count + m_world.Shores.Count + m_world.NoSeas.Count);
            m_icons3_vb = create_buffer(m_world.Cities.Count);

            m_city_names1_vb = create_buffer(m_world.Cities.Count);
            m_city_names2_vb = create_buffer(m_world.Cities.Count);
            m_city_names3_vb = create_buffer(m_world.Cities.Count);

            m_shore_names_vb = create_buffer(m_world.Shores.Count);
            m_land_names_vb  = create_buffer(m_world.NoSeas.Count);

            sprite_vertex[] icons1_vbo = new sprite_vertex[(m_world.Cities.Count + m_world.Shores.Count + m_world.NoSeas.Count) * 4];
            sprite_vertex[] icons2_vbo = new sprite_vertex[(m_world.Cities.Count + m_world.Shores.Count + m_world.NoSeas.Count) * 4];
            sprite_vertex[] icons3_vbo = new sprite_vertex[(m_world.Cities.Count) * 4];

            sprite_vertex[] city_names1_vbo = new sprite_vertex[m_world.Cities.Count * 4];
            sprite_vertex[] city_names2_vbo = new sprite_vertex[m_world.Cities.Count * 4];
            sprite_vertex[] city_names3_vbo = new sprite_vertex[m_world.Cities.Count * 4];

            sprite_vertex[] shore_names_vbo = new sprite_vertex[m_world.Shores.Count * 4];
            sprite_vertex[] land_names_vbo  = new sprite_vertex[m_world.NoSeas.Count * 4];

            int index = 0;

            foreach (GvoWorldInfo.Info i in m_world.Cities)
            {
                // 아이콘
                set_vbo(ref icons1_vbo, index, i.position, new Point(0, 0), i.IconRect, 0, -1);
                set_vbo(ref icons2_vbo, index, i.position, new Point(0, 0), i.SmallIconRect, 0, -1);

                // 문자 (도시이름)
                set_vbo(ref city_names1_vbo, index, i.position, i.StringOffset1, i.NameRect, i.angle, -1);
                set_vbo(ref city_names2_vbo, index, i.position, i.StringOffset2, i.NameRect, i.angle, -1);

                // 조합(2)이나 주점아가씨(1)가 존재할 경우, 카리브 영지가 아닌 경우
                if (((i.Sakaba & 2) == 2 || (i.Sakaba & 1) == 1) && (i.AllianceType != GvoWorldInfo.AllianceType.Territory ||
                                                                     (i.CulturalSphere != GvoWorldInfo.CulturalSphere.Caribbean && i.CulturalSphere != GvoWorldInfo.CulturalSphere.EastLatinAmerica)))
                {
                    set_vbo(ref icons3_vbo, index, i.position, new Point(0, 0), i.SmallIconRect, 0, -1);
                    set_vbo(ref city_names3_vbo, index, i.position, i.StringOffset2, i.NameRect, i.angle, -1);
                }

                index++;
            }
            int index2 = 0;

            foreach (GvoWorldInfo.Info i in m_world.Shores)
            {
                // 아이콘
                set_vbo(ref icons1_vbo, index, i.position, new Point(0, 0), i.IconRect, 0, -1);
                set_vbo(ref icons2_vbo, index, i.position, new Point(0, 0), i.SmallIconRect, 0, -1);

                // 문자 (도시이름)
                set_vbo(ref shore_names_vbo, index2, i.position, i.StringOffset2, i.NameRect, i.angle, -1);

                index++;
                index2++;
            }
            int index3 = 0;

            foreach (GvoWorldInfo.Info i in m_world.NoSeas)
            {
                // 아이콘
                set_vbo(ref icons1_vbo, index, i.position, new Point(0, 0), i.IconRect, 0, -1);
                set_vbo(ref icons2_vbo, index, i.position, new Point(0, 0), i.SmallIconRect, 0, -1);

                // 문자 (도시이름)
                set_vbo(ref land_names_vbo, index3, i.position, i.StringOffset2, i.NameRect, i.angle, -1);

                index++;
                index3++;
            }
            // 정점들을 설정
            m_icons1_vb.SetData <sprite_vertex>(icons1_vbo);
            m_icons2_vb.SetData <sprite_vertex>(icons2_vbo);
            m_icons3_vb.SetData <sprite_vertex>(icons3_vbo);

            m_city_names1_vb.SetData <sprite_vertex>(city_names1_vbo);
            m_city_names2_vb.SetData <sprite_vertex>(city_names2_vbo);
            m_city_names3_vb.SetData <sprite_vertex>(city_names3_vbo);

            m_shore_names_vb.SetData <sprite_vertex>(shore_names_vbo);
            m_land_names_vb.SetData <sprite_vertex>(land_names_vbo);
        }