Results 1 to 3 of 3

Thread: From C++ to VB

  1. #1
    Guest

    Post

    Do anyone here know anything about C++? If so, could someone tell me how this
    piece of code could be translated to Visual Basic?

    for (render_it_x = 0; render_it_x<num_x_tiles; render_it_x++)

    and this....

    char terrain_texture[] =

    { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,0,11,0,0,11,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,
    0,0,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,
    0,0,1,0,0,0,0,1,0,0,11,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,
    0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,
    0,0,1,11,0,0,0,1,0,0,0,0,0,0,11,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,
    0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,
    0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,
    0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,
    0,0,0,0,0,0,0,1,0,0,11,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,
    0,0,0,0,0,0,0,1,0,0,0,0,0,0,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0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,

    };


  2. #2
    New Member
    Join Date
    Dec 1999
    Location
    Bethlehem, PA US
    Posts
    10

    Post

    Here's how i would do it:

    for render_it_x = 0 to num_x_tiles

    and

    Const terrain_texture As String = "0,0,0,"

  3. #3
    Member
    Join Date
    Nov 1999
    Posts
    63

    Post

    Hello y'all,

    I believe the char data type in C/C++ would be equivilent to the byte data type is Visual Basic. Using the string data type would result in incorrect binary values for the terrain_texture.

    Gerald M.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width