diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-21 23:11:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-21 23:22:06 +0300 |
commit | 67d5177ef4f5d54ea8edc5403ed20f9ade56e8bf (patch) | |
tree | 0efb80c3cf13e5f859c522da923cf7fddac90bc5 /src/resources | |
parent | 73f36dd1934b3d0cdd52f13cab15480de4d0b9d2 (diff) | |
download | manaverse-67d5177ef4f5d54ea8edc5403ed20f9ade56e8bf.tar.gz manaverse-67d5177ef4f5d54ea8edc5403ed20f9ade56e8bf.tar.bz2 manaverse-67d5177ef4f5d54ea8edc5403ed20f9ade56e8bf.tar.xz manaverse-67d5177ef4f5d54ea8edc5403ed20f9ade56e8bf.zip |
fix code style and some other fixes after auto checks.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/dyecolor.h | 55 | ||||
-rw-r--r-- | src/resources/emotedb.h | 3 | ||||
-rw-r--r-- | src/resources/iteminfo.h | 1 | ||||
-rw-r--r-- | src/resources/palettedb.cpp | 7 |
4 files changed, 61 insertions, 5 deletions
diff --git a/src/resources/dyecolor.h b/src/resources/dyecolor.h new file mode 100644 index 000000000..77351a042 --- /dev/null +++ b/src/resources/dyecolor.h @@ -0,0 +1,55 @@ +/* + * The ManaPlus Client + * Copyright (C) 2013 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef DYECOLOR_H +#define DYECOLOR_H + +#include <SDL_stdinc.h> + +#include "localconsts.h" + +struct DyeColor +{ + DyeColor() + { + value[3] = 255; + } + + DyeColor(const uint8_t r, const uint8_t g, const uint8_t b) + { + value[0] = r; + value[1] = g; + value[2] = b; + value[3] = 255; + } + + DyeColor(const uint8_t r, const uint8_t g, const uint8_t b, + const uint8_t a) + { + value[0] = r; + value[1] = g; + value[2] = b; + value[3] = a; + } + + uint8_t value[4]; +}; + +#endif diff --git a/src/resources/emotedb.h b/src/resources/emotedb.h index d8edb99ec..939b3d667 100644 --- a/src/resources/emotedb.h +++ b/src/resources/emotedb.h @@ -48,7 +48,8 @@ struct EmoteInfo final { EmoteInfo() : sprites(), - particles() + particles(), + time(400) { } A_DELETE_COPY(EmoteInfo) diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 01b5b2e6c..64855bc0a 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -26,7 +26,6 @@ #include "being.h" #include "resources/colordb.h" -#include "resources/soundinfo.h" #include <map> #include <set> diff --git a/src/resources/palettedb.cpp b/src/resources/palettedb.cpp index c770a9cdc..1219601ce 100644 --- a/src/resources/palettedb.cpp +++ b/src/resources/palettedb.cpp @@ -25,8 +25,6 @@ #include "resources/dyecolor.h" #include "resources/resourcemanager.h" -#include "utils/stringvector.h" - #include <map> #include "debug.h" @@ -87,8 +85,11 @@ void PaletteDB::loadPalette() unsigned int g; unsigned int b; - if (sscanf(line.c_str(), "%u %u %u\t%s", &r, &g, &b, name) == 4) + if (sscanf(line.c_str(), "%10u %10u %10u\t%100s", + &r, &g, &b, name) == 4) + { mColors[name] = DyeColor(r, g, b); + } } } |