mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-20 23:01:16 +00:00
style fixes
This commit is contained in:
parent
b96850015b
commit
c4a7cbc0e7
@ -4,40 +4,40 @@
|
|||||||
#include "legoutil.h"
|
#include "legoutil.h"
|
||||||
#include "legovideomanager.h"
|
#include "legovideomanager.h"
|
||||||
|
|
||||||
const char *Delimiter = "\t";
|
const char *delimiter = "\t";
|
||||||
const char *set = "set";
|
const char *set = "set";
|
||||||
const char *reset = "reset";
|
const char *reset = "reset";
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x1003bfb0
|
// OFFSET: LEGO1 0x1003bfb0
|
||||||
LegoBackgroundColor::LegoBackgroundColor(const char *name, const char *colorString)
|
LegoBackgroundColor::LegoBackgroundColor(const char *p_name, const char *p_colorString)
|
||||||
{
|
{
|
||||||
m_name = name;
|
m_name = p_name;
|
||||||
m_name.ToUpperCase();
|
m_name.ToUpperCase();
|
||||||
SetColorString(colorString);
|
SetColorString(p_colorString);
|
||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x1003c070
|
// OFFSET: LEGO1 0x1003c070
|
||||||
void LegoBackgroundColor::SetColorString(const char *colorString)
|
void LegoBackgroundColor::SetColorString(const char *p_colorString)
|
||||||
{
|
{
|
||||||
m_string = colorString;
|
m_string = p_colorString;
|
||||||
m_string.ToLowerCase();
|
m_string.ToLowerCase();
|
||||||
|
|
||||||
LegoVideoManager *videomanager = VideoManager();
|
LegoVideoManager *videomanager = VideoManager();
|
||||||
if (!videomanager || !colorString)
|
if (!videomanager || !p_colorString)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float converted_r, converted_g, converted_b;
|
float converted_r, converted_g, converted_b;
|
||||||
char *colorStringCopy = strcpy(new char[strlen(colorString) + 1], colorString);
|
char *colorStringCopy = strcpy(new char[strlen(p_colorString) + 1], p_colorString);
|
||||||
char *colorStringSplit = strtok(colorStringCopy, Delimiter);
|
char *colorStringSplit = strtok(colorStringCopy, delimiter);
|
||||||
|
|
||||||
if (!strcmp(colorStringSplit, set)) {
|
if (!strcmp(colorStringSplit, set)) {
|
||||||
colorStringSplit = strtok(0, Delimiter);
|
colorStringSplit = strtok(0, delimiter);
|
||||||
if (colorStringSplit)
|
if (colorStringSplit)
|
||||||
h = (float) (atoi(colorStringSplit) * 0.01);
|
h = (float) (atoi(colorStringSplit) * 0.01);
|
||||||
colorStringSplit = strtok(0, Delimiter);
|
colorStringSplit = strtok(0, delimiter);
|
||||||
if (colorStringSplit)
|
if (colorStringSplit)
|
||||||
s = (float) (atoi(colorStringSplit) * 0.01);
|
s = (float) (atoi(colorStringSplit) * 0.01);
|
||||||
colorStringSplit = strtok(0, Delimiter);
|
colorStringSplit = strtok(0, delimiter);
|
||||||
if (colorStringSplit)
|
if (colorStringSplit)
|
||||||
v = (float) (atoi(colorStringSplit) * 0.01);
|
v = (float) (atoi(colorStringSplit) * 0.01);
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#ifndef LEGOBACKGROUNDCOLOR_H
|
#ifndef LEGOBACKGROUNDCOLOR_H
|
||||||
#define LEGOBACKGROUNDCOLOR_H
|
#define LEGOBACKGROUNDCOLOR_H
|
||||||
|
|
||||||
#include "mxstring.h"
|
#include "mxstring.h"
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
#include "mxstringvariable.h"
|
#include "mxstringvariable.h"
|
||||||
@ -7,9 +8,10 @@
|
|||||||
class LegoBackgroundColor : public MxStringVariable
|
class LegoBackgroundColor : public MxStringVariable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
__declspec(dllexport) LegoBackgroundColor(const char *, const char *);
|
__declspec(dllexport) LegoBackgroundColor(const char *p_name, const char *p_colorString);
|
||||||
void SetColorString(const char *colorString);
|
void SetColorString(const char *p_colorString);
|
||||||
protected:
|
|
||||||
|
private:
|
||||||
float h;
|
float h;
|
||||||
float s;
|
float s;
|
||||||
float v;
|
float v;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user