From 3bd383baf6a17e734329e1fc677c7e86283db772 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 26 Oct 2015 22:52:36 +0800 Subject: Added support for relative line numbers. Added instructions for, brk and cont. (They are still untested...) Parser code cleanup. Removed garbage output to stderr. Reorganize the repository structure. Updated BLR2 code move it into archive. Added BLR1 files. --- include/hgecolor.h | 80 ------------------------------------------------------ 1 file changed, 80 deletions(-) delete mode 100644 include/hgecolor.h (limited to 'include/hgecolor.h') diff --git a/include/hgecolor.h b/include/hgecolor.h deleted file mode 100644 index 7cd4d82..0000000 --- a/include/hgecolor.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeColor*** helper classes -*/ - - -#ifndef HGECOLOR_H -#define HGECOLOR_H - - -#include "hge.h" - - -#define hgeColor hgeColorRGB - -inline void ColorClamp(float &x) { if(x<0.0f) x=0.0f; if(x>1.0f) x=1.0f; } - - -class hgeColorRGB -{ -public: - float r,g,b,a; - - hgeColorRGB(float _r, float _g, float _b, float _a) { r=_r; g=_g; b=_b; a=_a; } - hgeColorRGB(DWORD col) { SetHWColor(col); } - hgeColorRGB() { r=g=b=a=0; } - - hgeColorRGB operator- (const hgeColorRGB &c) const { return hgeColorRGB(r-c.r, g-c.g, b-c.b, a-c.a); } - hgeColorRGB operator+ (const hgeColorRGB &c) const { return hgeColorRGB(r+c.r, g+c.g, b+c.b, a+c.a); } - hgeColorRGB operator* (const hgeColorRGB &c) const { return hgeColorRGB(r*c.r, g*c.g, b*c.b, a*c.a); } - hgeColorRGB& operator-= (const hgeColorRGB &c) { r-=c.r; g-=c.g; b-=c.b; a-=c.a; return *this; } - hgeColorRGB& operator+= (const hgeColorRGB &c) { r+=c.r; g+=c.g; b+=c.b; a+=c.a; return *this; } - bool operator== (const hgeColorRGB &c) const { return (r==c.r && g==c.g && b==c.b && a==c.a); } - bool operator!= (const hgeColorRGB &c) const { return (r!=c.r || g!=c.g || b!=c.b || a!=c.a); } - - hgeColorRGB operator/ (const float scalar) const { return hgeColorRGB(r/scalar, g/scalar, b/scalar, a/scalar); } - hgeColorRGB operator* (const float scalar) const { return hgeColorRGB(r*scalar, g*scalar, b*scalar, a*scalar); } - hgeColorRGB& operator*= (const float scalar) { r*=scalar; g*=scalar; b*=scalar; a*=scalar; return *this; } - - void Clamp() { ColorClamp(r); ColorClamp(g); ColorClamp(b); ColorClamp(a); } - void SetHWColor(DWORD col) { a = (col>>24)/255.0f; r = ((col>>16) & 0xFF)/255.0f; g = ((col>>8) & 0xFF)/255.0f; b = (col & 0xFF)/255.0f; } - DWORD GetHWColor() const { return (DWORD(a*255.0f)<<24) + (DWORD(r*255.0f)<<16) + (DWORD(g*255.0f)<<8) + DWORD(b*255.0f); } -}; - -inline hgeColorRGB operator* (const float sc, const hgeColorRGB &c) { return c*sc; } - - -class hgeColorHSV -{ -public: - float h,s,v,a; - - hgeColorHSV(float _h, float _s, float _v, float _a) { h=_h; s=_s; v=_v; a=_a; } - hgeColorHSV(DWORD col) { SetHWColor(col); } - hgeColorHSV() { h=s=v=a=0; } - - hgeColorHSV operator- (const hgeColorHSV &c) const { return hgeColorHSV(h-c.h, s-c.s, v-c.v, a-c.a); } - hgeColorHSV operator+ (const hgeColorHSV &c) const { return hgeColorHSV(h+c.h, s+c.s, v+c.v, a+c.a); } - hgeColorHSV operator* (const hgeColorHSV &c) const { return hgeColorHSV(h*c.h, s*c.s, v*c.v, a*c.a); } - hgeColorHSV& operator-= (const hgeColorHSV &c) { h-=c.h; s-=c.s; v-=c.v; a-=c.a; return *this; } - hgeColorHSV& operator+= (const hgeColorHSV &c) { h+=c.h; s+=c.s; v+=c.v; a+=c.a; return *this; } - bool operator== (const hgeColorHSV &c) const { return (h==c.h && s==c.s && v==c.v && a==c.a); } - bool operator!= (const hgeColorHSV &c) const { return (h!=c.h || s!=c.s || v!=c.v || a!=c.a); } - - hgeColorHSV operator/ (const float scalar) const { return hgeColorHSV(h/scalar, s/scalar, v/scalar, a/scalar); } - hgeColorHSV operator* (const float scalar) const { return hgeColorHSV(h*scalar, s*scalar, v*scalar, a*scalar); } - hgeColorHSV& operator*= (const float scalar) { h*=scalar; s*=scalar; v*=scalar; a*=scalar; return *this; } - - void Clamp() { ColorClamp(h); ColorClamp(s); ColorClamp(v); ColorClamp(a); } - void SetHWColor(DWORD col); - DWORD GetHWColor() const; -}; - -inline hgeColorHSV operator* (const float sc, const hgeColorHSV &c) { return c*sc; } - - -#endif -- cgit v1.2.3