Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - RetroX

Pages: « 1 2 3 4 5 »
46
Function Peer Review / Brainstorming
« on: March 21, 2010, 02:02:35 PM »
Here's my idea.

Yes, r4 isn't even released, yet.  But we can still help; I mean, most of us know C++ enough to help make some of the functions.

This includes functions that may be useful and aren't on the list.

If it's already made, then... oh, well, I guess.  Also, it's not official or anything at this point, unless Josh decides to make it that way.

Here's the list that hasn't been updated.

Also, even if you don't know C++ or aren't coding anything, you can still post suggestions.

47
Tips, Tutorials, Examples / lol streams
« on: February 24, 2010, 01:47:59 PM »
Something useful for ENIGMA:

Code: [Select]
std::ostream &operator <<(std::ostream &outstream,__variant &variable)
 {
 if (variable.type)
  {
  return outstream << variable.doubleval;
  }
 return outstream << variable.stringval;
 }
std::istream &operator >>(std::istream &instream,__variant &variable)
 {
 char c,c2;
 c=instream.get();
 if (c>=48 && c<=57)
  {
  instream.putback(c);
  return instream >> variable.doubleval;
  }
 else if (c==46)
  {
  c2=instream.get();
  if (c2>=48 && c2<=57)
   {
   instream.putback(c2);
   instream.putback(c);
   return instream >> variable.doubleval;
   }
  }
 instream.putback(c);
 return instream >> variable.stringval;
 }

You probably should add a typecast operator for var to cast to __variant.

This is from r3's source, though, so, IDK what you've changed.

Also, because I wouldn't know, would this also work for iostream, fstream, and stringstream because they are inherited from istream and ostream, or would it not because this is defined after that?

48
Issues Help Desk / Pointer explosion
« on: November 05, 2009, 07:05:17 PM »
Code: [Select]
// Only include once
#ifndef TYPES_INCLUDED
 #define TYPES_INCLUDED 1

// Include C headers
#include <climits>
#include <cfloat>

// Define 1-bit integer

typedef bool int1;

// Define 8-bit integer
typedef signed char int8;
typedef unsigned char uint8;

// Define 16-bit integer
typedef signed short int int16;
typedef unsigned short int uint16;

// Define 32-bit integer
typedef signed int int32;
typedef unsigned int uint32;

// Define 64-bit integer
typedef signed long long int int64;
typedef unsigned long long int uint64;

 // Size function - returns lowest size in bytes required to set value
uint8 requirement(int64 value)
 {
 if (value>=CHAR_MIN || value<=CHAR_MAX)
  {
  return 1;
  }
 else if (value>=SHRT_MIN || value<=SHRT_MAX)
  {
  return 2;
  }
 else if (value>=INT_MIN || value<=INT_MAX)
  {
  return 4;
  }
 else
  {
  return 8;
  }
 }

// Define variable-sized integer
class varint
 {
 // Make pointer to value
 public: void *value;
 private: uint8 size;

 // Make constructor
 public: varint() { resize(1);set(0); }
 public: varint(int64 x) { resize(requirement(x));set(x); };
 public: varint(int64 x,uint8 size) { resize(size);set(x); };

 // Set function - sets value to *value
 private: void set(int64 x)
  {
  switch (size)
   {
   case 1:
   int8 *value8;value8=(int8*)value;*value8=x;
   break;
   case 2:
   int16 *value16;value16=(int16*)value;*value16=x;
   break;
   case 4:
   int32 *value32;value32=(int32*)value;*value32=x;
   break;
   case 8:
   int64 *value64;value64=(int64*)value;*value64=x;
   break;
   }
  }

 // Get function - gets value of *value
 private: int64 get()
  {
  switch (size)
   {
   case 1:
   int8 *value8=(int8*)value;
   return (int64)*value8;
   break;
   case 2:
   int16 *value16=(int16*)value;
   return (int64)*value16;
   break;
   case 4:
   int32 *value32=(int32*)value;
   return (int32)*value32;
   break;
   case 8:
   int64 *value64=(int64*)value;
   return (int64)*value64;
   break;
   }
  }

 // Resize function
 public: void resize(uint8 bytes)
  {
  // Invalid number of bytes?
  if (bytes!=1 && bytes!=2 && bytes!=4 && bytes!=8)
   {
   return;
   }

  // Resize if lower size is given only if lower == true
  if (sizeof(value)!=bytes)
   {
   void *temp=value;
   delete value;
   switch (bytes)
    {
    case 1:
    void *value=new int8;value=temp;
    break;
    case 2:
    void *value=new int16;value=temp;
    break;
    case 4:
    void *value=new int32;value=temp;
    break;
    case 8:
    void *value=new int64;value=temp;
    break;
    }
   }

  // Set size variable
  size=bytes;
  }

 // Get size function
 public: size_t getsize()
  {
  return (size_t)size;
  }

 // Return operators
 &operator int64() { return get(); }
 &operator int32() { return get(); }
 &operator int16() { return get(); }
 &operator int8() { return get(); }

 // Define operators
 int64 &operator =(int64 x) { if (requirement(x)>sizeof(value)) { resize(sizeof(x)); } set(x);return get(); }
 int32 &operator =(int32 x) { if (requirement(x)>sizeof(value)) { resize(sizeof(x)); } set(x);return get(); }
 int16 &operator =(int16 x) { if (requirement(x)>sizeof(value)) { resize(sizeof(x)); } set(x);return get(); }
 int8 &operator =(int8 x) { if (requirement(x)>sizeof(value)) { resize(sizeof(x)); } set(x);return get(); }
 }

// Define decimals
typedef float dec32;
typedef double dec64;
typedef long double dec96;

// Define special
typedef std::string str;

// End include
#endif

Now, you know what I do when I'm bored. :P

Just in case you didn't pick up what this is, it's a header for various type definitions and aliases.  The one I'm having trouble with is varint.

varint is a variable-sized integer.  Essentially, it'll only be as big as it needs to be.  If I want to make a variable with a value of 0, why do I need more than 1 byte?  If it's 256, however, I'll need it to be 2 bytes.  Of course, you're probably thinking: "why the hell do I care; it's only a few bytes".  Well, err, I don't know what to say.  But, whenever I try to compile this, g++ borks and returns tons of warnings.  Anyone have any idea what I need to do to fix this?  And, just for the record, it's not done; I still have the other operators to do.

49
ALLCAPS BOARD / LINUX IS BAD
« on: October 12, 2009, 06:46:05 PM »
WINDOWS IS CLEARLY BETTER IT HAS WINDOWS LIVE AND INTERNET EXPLODER

50
General ENIGMA / Mixed arrays
« on: August 12, 2009, 02:53:25 PM »
Stupid question.  How will ENIGMA do this?  GM supports this, as I'm aware.

51
Off-Topic / What does ENIGMA stand for?
« on: August 03, 2009, 02:53:07 PM »
Never mind.

After searching a bit, I found one of Josh's blogs that finally revealed the acronym, which I think is the only place it's ever been mentioned.

Extendible
Non
Interpreted
Game
Maker
Augmentation

52
Off-Topic / lol
« on: July 28, 2009, 10:14:33 PM »
http://enigma-dev.org/bugtracker/

You're giving people hope in the fact that they can report bugs, yet you take it away so quickly!

You could just use Bugzilla, but that would be no fun.

53
Issues Help Desk / Wildclass double declaration halts compile
« on: June 14, 2009, 10:10:58 AM »
http://retro.staticfire.co.uk/misc/eyecandy.gmk


I want this to work in ENIGMA, because it's 5 FPS in GM for me. D:

54
Tips, Tutorials, Examples / A random function
« on: June 10, 2009, 06:17:41 PM »
draw_arrow()

Add "int draw_arrow(double x1,double y1,double x2,double y2,double size)" to the fnames.txt file.

Add the following to ENIGMAsystem\SHELL\Graphics_Systems\OpenGL\GMstdraw.h:
int draw_arrow(double x1,double y1,double x2,double y2,double size)
{
        enigma::untexture();
       
      double dir_left=point_direction(x1,y1,x2,y2);
      
        glBegin(GL_LINES);
        glVertex2f(x1, y1);
        glVertex2f(x2, y2);
        glEnd();
      
      double ALx= cos((dir+135)/180.0*pi)*(size/2);
      double ALy=-sin((dir+135)/180.0*pi)*(size/2);
      double ARx= cos((dir+135)/180.0*pi)*(size/2);
      double ARy=-sin((dir+135)/180.0*pi)*(size/2);
      
        glBegin(GL_TRIANGLES);
        glVertex2f(x2, y2);
        glVertex2f(x2+ALx, y2+ALy);
      glVertex2f(x2+ARx, y2+ARy);
        glEnd();
       
        return 0;
}


I looked for a simple and random function in the list that needed to be done, and here it is.

55
Proposals / Before any more of these topics are made
« on: March 31, 2009, 07:26:19 PM »
The ENIGMA developers are not feature fairies.  Wait for ENIGMA to get out of beta (in a valve year), then start complaining.

56
General ENIGMA / XOR DOES NOT WORK
« on: February 21, 2009, 05:59:52 PM »
-6 ERROR; FIX IT NOW.

57
Tips, Tutorials, Examples / How to Play Sounds
« on: February 20, 2009, 07:33:29 PM »
Play Sound:
cpp { PlaySound(soundstr,NULL,SND_FILENAME | SND_ASYNC); }
Where soundstr is the relative path to the WAV sound.

Loop Sound:
cpp { PlaySound(soundstr,NULL,SND_FILENAME | SND_LOOP | SND_ASYNC); }

Stop Sound:
cpp { PlaySound(NULL,0,0); }

Won't allow you to play more than one sound at once, but this works for now.

58
General ENIGMA / Feature Priorities?
« on: December 06, 2008, 11:01:54 AM »
Basically, I was curious - which functions are going to be implemented first?  I'd think the more vital ones, such as sounds and some more drawing functions would be more appropriate.

I mean, there's no point in trying to struggle with some simple functions that are hardly used first.

Here's just a little "priority" list that I made based on the incomplete functions page, and I'd like to ask how accurate you think it is:
- Finish "Computing Things" functions (including those max/min functions)
- "Using DLLs" functions
- "Moving Around" functions (Colligma)
- "Collision Checking" functions (Colligma)
- "Instances" functions
- "Drawing Sprites and Backgrounds" functions
- "Drawing Surfaces" functions
- "Basic Sound Functions" functions
- "Pop-up Messages and Questions" functions (these should probably have an option to be a normal window as opposed to just Game Maker's stylized ones)
- "Fonts and Text" functions
- "Advanced Drawing Functions" functions
- "Deactivating Instances" functions
- "Rooms" functions
- "Generating Events" functions
- "User Interaction" functions
- "Data Structures" functions
- "Miscellaneous Variables and Functions" functions
- "Repainting the Screen" functions
- "Drawing Shapes" functions
- "Files, Registry and Executing Programs" functions
- "The Display" functions
- "The Window" functions
- "Motion Planning" functions
- "Splash Screens" functions
- "Highscore List" functions
- "Sound Effects" functions
- "Creating Particles" functions
- "3D Sound" functions
- "Paths" functions
- "Tiles" functions
- "CD Music" functions
- "Multiplayer Games" functions
- "3D Graphics" functions

Note: "Resources" and "Changing Resources" functions should be implemented when they have functions made to use them.

So, is this a good idea?  I think that these function groups are labeled by importance of getting implemented, and probably the ones on the top should be implemented first.

59
Tips, Tutorials, Examples / Alternate to move_snap
« on: December 01, 2008, 05:25:08 PM »
Since I realized it wasn't there.

Code: [Select]
x=round(x/argument0)*argument0;
y=round(y/argument1)*argument1;

60
General ENIGMA / I think that you'll be pleased to know
« on: November 23, 2008, 12:55:48 PM »
this.

Pages: « 1 2 3 4 5 »