vectozavr / GameBoy_arduino

Source code of gameBoy from video on YouTube channel "Vectozavr".
MIT License
44 stars 7 forks source link

could not convert '{(((int)(((signed char)((int)w)) / 2)) + 2), (((int)(((signed char)((int)h)) / 2)) + 2)}' from '<brace-enclosed initializer list>' to 'Point2D_int8_t' #3

Open OldGameBox opened 3 years ago

OldGameBox commented 3 years ago

Arduino: 1.8.11 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

C:\Users\MrKum\Downloads\gameboy_128x64\gameboy_128x64.ino:46:1: warning: 'typedef' was ignored in this declaration

typedef struct obstacle {

^~~

C:\Users\MrKum\Downloads\gameboy_128x64\gameboy_128x64.ino: In function 'void snake()':

gameboy_128x64:373:60: error: could not convert '{(((int)(((signed char)((int)w)) / 2)) + 2), (((int)(((signed char)((int)h)) / 2)) + 2)}' from '' to 'Point2D_int8_t'

Point2D_int8_t P_food = {(int8_t)w/2 + 2, (int8_t)h/2 + 2};

                                                        ^

gameboy_128x64:375:43: error: no match for 'operator=' (operand types are 'Point2D_int8_t' and '')

vec_Snake[0] = {(int8_t)w/2, (int8_t)h/2};

                                       ^

C:\Users\MrKum\Downloads\gameboy_128x64\gameboy_128x64.ino:36:8: note: candidate: Point2D_int8_t& Point2D_int8_t::operator=(const Point2D_int8_t&)

struct Point2D_int8_t {

    ^~~~~~~~~~~~~~

C:\Users\MrKum\Downloads\gameboy_128x64\gameboy_128x64.ino:36:8: note: no known conversion for argument 1 from '' to 'const Point2D_int8_t&'

C:\Users\MrKum\Downloads\gameboy_128x64\gameboy_128x64.ino:36:8: note: candidate: Point2D_int8_t& Point2D_int8_t::operator=(Point2D_int8_t&&)

C:\Users\MrKum\Downloads\gameboy_128x64\gameboy_128x64.ino:36:8: note: no known conversion for argument 1 from '' to 'Point2D_int8_t&&'

exit status 1 could not convert '{(((int)(((signed char)((int)w)) / 2)) + 2), (((int)(((signed char)((int)h)) / 2)) + 2)}' from '' to 'Point2D_int8_t'

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

vectozavr commented 3 years ago

Вижу, протестировал на другой плате (оригинальной) и получил такую же ошибку. Как будет время - разберусь.