1
0
mirror of https://github.com/rwengine/openrw.git synced 2025-01-31 12:01:38 +01:00

Moved Color structs into new GTATypes header

This commit is contained in:
Timmy Sjöstedt 2013-07-04 07:56:58 +02:00
parent c2ebea6d84
commit 341fbc3422
4 changed files with 44 additions and 31 deletions

View File

@ -59,9 +59,9 @@ bool WeatherLoader::load(const std::string &filename)
return true;
}
GTAData::RGB WeatherLoader::readRGB(std::stringstream &ss)
GTATypes::RGB WeatherLoader::readRGB(std::stringstream &ss)
{
GTAData::RGB color;
GTATypes::RGB color;
std::string r, g, b;
std::getline(ss, r, ' ');

View File

@ -32,24 +32,6 @@ public:
bool archived; /// Is the file inside an IMG or on the filesystem?
std::string path; /// Path to the file containing the file
};
/**
* @struct RGB
* Stores 8 bit RGB data
*/
struct RGB
{
uint8_t r, g, b;
};
/**
* @struct RGBA
* Stores 8 bit RGBA data
*/
struct RGBA
{
uint8_t r, g, b, a;
};
/**
* ctor

View File

@ -0,0 +1,30 @@
#pragma once
#ifndef _GTATYPES_HPP_
#define _GTATYPES_HPP_
#include <cstdint>
namespace GTATypes
{
/**
* @struct RGB
* Stores 8 bit RGB data
*/
struct RGB
{
uint8_t r, g, b;
};
/**
* @struct RGBA
* Stores 8 bit RGBA data
*/
struct RGBA
{
uint8_t r, g, b, a;
};
}
#endif

View File

@ -2,21 +2,22 @@
#ifndef _WEATHERLOADER_HPP_
#define _WEATHERLOADER_HPP_
#include <renderwure/engine/GTAData.hpp>
#include <renderwure/engine/GTATypes.hpp>
#include <string>
#include <sstream>
#include <vector>
class WeatherLoader
{
public:
struct WeatherData {
GTAData::RGB ambientColor;
GTAData::RGB directLightColor;
GTAData::RGB skyTopColor;
GTAData::RGB skyBottomColor;
GTAData::RGB sunCoreColor;
GTAData::RGB sunCoronaColor;
GTATypes::RGB ambientColor;
GTATypes::RGB directLightColor;
GTATypes::RGB skyTopColor;
GTATypes::RGB skyBottomColor;
GTATypes::RGB sunCoreColor;
GTATypes::RGB sunCoronaColor;
float sunCoreSize;
float sunCoronaSize;
float sunBrightness;
@ -26,9 +27,9 @@ public:
float farClipping;
float fogStart;
float amountGroundLight;
GTAData::RGB lowCloudColor;
GTAData::RGB topCloudColor;
GTAData::RGB bottomCloudColor;
GTATypes::RGB lowCloudColor;
GTATypes::RGB topCloudColor;
GTATypes::RGB bottomCloudColor;
uint8_t unknown[4];
};
@ -37,7 +38,7 @@ public:
std::vector<WeatherData> weather;
private:
GTAData::RGB readRGB(std::stringstream &ss);
GTATypes::RGB readRGB(std::stringstream &ss);
};
#endif