Fix sprite initing (probably)

And run clang-format
This commit is contained in:
Pk11
2021-01-14 07:40:12 -06:00
parent 08d4c32ad9
commit 5f231849e4
5 changed files with 99 additions and 99 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ private:
bool _visibility; bool _visibility;
u16 *_gfx; u16 *_gfx;
static bool _assigned[2][256]; static bool _assigned[2][127];
public: public:
/** /**
+24 -24
View File
@@ -1,28 +1,28 @@
/* /*
* This file is part of Universal-Core * This file is part of Universal-Core
* Copyright (C) 2021 Universal-Team * Copyright (C) 2021 Universal-Team
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* Additional Terms 7.b and 7.c of GPLv3 apply to this file: * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or * * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal * author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it. * Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material, * * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in * or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version. * reasonable ways as different from the original version.
*/ */
#include "font.hpp" #include "font.hpp"
+24 -24
View File
@@ -1,28 +1,28 @@
/* /*
* This file is part of Universal-Core * This file is part of Universal-Core
* Copyright (C) 2021 Universal-Team * Copyright (C) 2021 Universal-Team
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* Additional Terms 7.b and 7.c of GPLv3 apply to this file: * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or * * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal * author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it. * Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material, * * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in * or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version. * reasonable ways as different from the original version.
*/ */
#include "graphics.hpp" #include "graphics.hpp"
+24 -24
View File
@@ -1,28 +1,28 @@
/* /*
* This file is part of Universal-Core * This file is part of Universal-Core
* Copyright (C) 2021 Universal-Team * Copyright (C) 2021 Universal-Team
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* Additional Terms 7.b and 7.c of GPLv3 apply to this file: * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or * * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal * author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it. * Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material, * * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in * or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version. * reasonable ways as different from the original version.
*/ */
#include "image.hpp" #include "image.hpp"
+26 -26
View File
@@ -1,34 +1,34 @@
/* /*
* This file is part of Universal-Core * This file is part of Universal-Core
* Copyright (C) 2021 Universal-Team * Copyright (C) 2021 Universal-Team
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* Additional Terms 7.b and 7.c of GPLv3 apply to this file: * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
* * Requiring preservation of specified reasonable legal notices or * * Requiring preservation of specified reasonable legal notices or
* author attributions in that material or in the Appropriate Legal * author attributions in that material or in the Appropriate Legal
* Notices displayed by works containing it. * Notices displayed by works containing it.
* * Prohibiting misrepresentation of the origin of that material, * * Prohibiting misrepresentation of the origin of that material,
* or requiring that modified versions of such material be marked in * or requiring that modified versions of such material be marked in
* reasonable ways as different from the original version. * reasonable ways as different from the original version.
*/ */
#include "sprite.hpp" #include "sprite.hpp"
#include "tonccpy.h" #include "tonccpy.h"
bool Sprite::_assigned[2][256]; bool Sprite::_assigned[2][127];
Sprite::Sprite(bool top, SpriteSize size, SpriteColorFormat format, int x, int y, int priority, int id, Sprite::Sprite(bool top, SpriteSize size, SpriteColorFormat format, int x, int y, int priority, int id,
int paletteAlpha, int rotationIndex, bool doubleSize, bool visible, bool vFlip, bool hFlip, bool mosaic) int paletteAlpha, int rotationIndex, bool doubleSize, bool visible, bool vFlip, bool hFlip, bool mosaic)
@@ -39,7 +39,7 @@ Sprite::Sprite(bool top, SpriteSize size, SpriteColorFormat format, int x, int y
for(uint i = 0; i < sizeof(_assigned[top]) / sizeof(_assigned[top][0]); i++) { for(uint i = 0; i < sizeof(_assigned[top]) / sizeof(_assigned[top][0]); i++) {
if(!_assigned[top][i]) { if(!_assigned[top][i]) {
_assigned[top][i] = true; _assigned[top][i] = true;
id = i; _id = i;
break; break;
} }
} }