Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Tile Map Tutorial Error  (Read 2769 times)

0 Members and 1 Guest are viewing this topic.

Stock

  • Newbie
  • *
  • Posts: 11
    • View Profile
Tile Map Tutorial Error
« on: May 30, 2014, 03:46:30 pm »
I am getting the following error on several lines when I follow the tutorial for a tile map, at first I thought I might have typed something wrong, but after copying a pasting it, I got the same error.

This is the error:
Code: [Select]
1>LoadMain.cpp(36): warning C4244: 'argument' : conversion from 'unsigned int' to 'float', possible loss of data
« Last Edit: May 30, 2014, 03:48:40 pm by Stock »

select_this

  • Full Member
  • ***
  • Posts: 130
  • Current mood: just ate a pinecone
    • View Profile
    • darrenferrie.com
Re: Tile Map Tutorial Error
« Reply #1 on: May 30, 2014, 03:49:00 pm »
Please read this.

Code: [Select]
1>LoadMain.cpp(36): warning C4244: 'argument' : conversion from 'unsigned int' to 'float', possible loss of data

That's not an error, that's a warning that you're implicitly converting one numeric format to another, which could affect the correctness of the number. A quick Google search of the message would have helped you find out more information.
« Last Edit: May 30, 2014, 03:53:55 pm by select_this »
Follow me on Twitter, why don'tcha? @select_this

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Tile Map Tutorial Error
« Reply #2 on: May 30, 2014, 03:50:05 pm »
Well now we have the error, what was the code again?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Stock

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Tile Map Tutorial Error
« Reply #3 on: May 30, 2014, 04:05:08 pm »

That's not an error, that's a warning that you're implicitly converting one numeric format to another, which could affect the correctness of the number. A quick Google search of the message would have helped you find out more information.

Ahhh, ok, thank you. I looked through my Debug Log and found that this is what is actually stopping the build:
Code: [Select]
1>LoadMain.cpp(26): error C2108: subscript is not of integral type

Well now we have the error, what was the code again?

The actual error, shown above, comes on this line:
Code: [Select]
int tileNumber = tiles[i + j * width];

select_this

  • Full Member
  • ***
  • Posts: 130
  • Current mood: just ate a pinecone
    • View Profile
    • darrenferrie.com
Re: Tile Map Tutorial Error
« Reply #4 on: May 30, 2014, 04:10:47 pm »
First result of Google search.

Array indices must be integers. Your i + j * width calculation is producing something other than an integer, most likely a double.
Follow me on Twitter, why don'tcha? @select_this