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.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 »
1591
Issues Help Desk / Error: multiple definition of
« on: December 26, 2011, 06:30:08 pm »
I ALWAYS get errors like this with ENIGMA when I am making something. And I am never able to fix these. Google search revelaed that is means what it says it means - I have multiple definitions of some structure or the like. This problem arrises when I include the first.h file (where structs are declared) into another second.h file and then include that second.h inside a project where I inclued the first.h then I will have two declarations of the same thing. The twist though, is that I DON'T. I think ENIGMA does include it somewhere, but I don't. The file structure:
include.h
main_code.cpp
I have #include "include.h" inside main_code.cpp. That is it. I don't include that "include.h" anywhere else. This is an extension though, so I have this in the Makefile:
So for the love of anything - WHY the hell it trows this error? I had this problem when I added surfaces as well. That is why it took me more than a year to add that god damn FBO support.
edit: It shows:
.eobjs/Windows/Windows/Run/SHELLmain.o:SHELLmain.cpp:(.text+0x6): first defined here
So ENIGMA includes the include.h inside the SHELLmain.cpp even when I don't ask it to? It would be fine if it did that and I could leave out #include "include.h" in the .cpp, but then it errors that I don't have struct's defined. So I either don't have them defined, or I have defined them twice. I don't really have a choice there.
edit2: I also tried "include guard" technique. So I had:
#ifndef MYFILE_H
#define MYFILE_H
//contents of include.h
#endif
And it still had the same error. This doesn't even make sense, because I can't have included it twice in this case.
include.h
main_code.cpp
I have #include "include.h" inside main_code.cpp. That is it. I don't include that "include.h" anywhere else. This is an extension though, so I have this in the Makefile:
Quote
SOURCES += $(wildcard Universal_System/Extensions/SomeExtension/main_code.cpp)This is it.
ifeq ($(PLATFORM), Win32)
LDLIBS += $(wildcard Universal_System/Extensions/SomeExtension/libs/*.a)
endif
So for the love of anything - WHY the hell it trows this error? I had this problem when I added surfaces as well. That is why it took me more than a year to add that god damn FBO support.
edit: It shows:
.eobjs/Windows/Windows/Run/SHELLmain.o:SHELLmain.cpp:(.text+0x6): first defined here
So ENIGMA includes the include.h inside the SHELLmain.cpp even when I don't ask it to? It would be fine if it did that and I could leave out #include "include.h" in the .cpp, but then it errors that I don't have struct's defined. So I either don't have them defined, or I have defined them twice. I don't really have a choice there.
edit2: I also tried "include guard" technique. So I had:
#ifndef MYFILE_H
#define MYFILE_H
//contents of include.h
#endif
And it still had the same error. This doesn't even make sense, because I can't have included it twice in this case.
1592
Tips, Tutorials, Examples / Re: Using standard c/c++ classes and explicit memory management in ENIGMA
« on: December 26, 2011, 11:18:01 am »Quote
If possible I'd prefer to code in straight c++ using the ENIGMA API functions, rather than scripting in EDL.That's the plan. You will be able to use most if not all C++. EDL will just allow additional cool things to make coding faster and easier. Almost every aspect of C++ is in already.
Quote
Specifically, what exactly is the code equivalent of the drag and drop 'destroy instance' icon in ENIGMA?Just like in GM its: instance_destroy().
Quote
Is the memory freed immediately or simply marked as eligible for reclamation by a GC?I think its freed immediately, although looking at the code it seems to unlink it for GC.
1593
Announcements / Re: Merry Christmas!
« on: December 25, 2011, 03:39:54 pm »
Happy winter holidays to you too. Also happy new year if I am not here to tell that later.
And why do you think I work on anything? I have made a few functions that I haven't committed, but that's because I wanted to have screen_redraw() working. I am doing nothing to fix that though, so if someone else wants to give a shot then have fun.
And why do you think I work on anything? I have made a few functions that I haven't committed, but that's because I wanted to have screen_redraw() working. I am doing nothing to fix that though, so if someone else wants to give a shot then have fun.
1594
Issues Help Desk / Re: Android anyone?
« on: December 22, 2011, 07:35:55 pm »
If there was a specific, fool proof, 100% working way to do this then I would of done it myself ages ago. That would allow creating functions for Android as well, as currently there are almost none. You can draw a basic sprite and that's about it.
1595
Function Peer Review / Re: sprite_create_from_surface
« on: December 17, 2011, 10:37:45 am »Quote
The allocation for the initial sprite count is done in the sprite initialization code. Room for all included sprites is allocated, and the array is zeroed.I will look into that.
Quote
If rendering to surfaces work as they are, don't flip them. Otherwise, by all means.You have to set projections and stuff for rendering on surface, but they don't seem to affect glReadPixels, so I don't know what the hell is up.
1596
Function Peer Review / Re: sprite_create_from_surface
« on: December 16, 2011, 08:35:52 pm »Quote
We don't use PNG, we just zlib raw pixel data.Thats a bummer. We should add png support though (for loading and saving in runtime).
Quote
Anyway, that function of yours shouldn't work at all. The sprite_new_empty function doesn't do spritestructarray allocation; it just allocates a new sprite and assigns it to the existing array. I haven't added one that does all allocation.Isn't this it:
Code: [Select]
sprite *as = new sprite(subc);
spritestructarray[sprid] = as;
? What you do in spriteinit (the code that does the initial sprite loading) is that you go trough all sprites, call sprite_new_empty, and then for every subimage you do sprite_set_subimage, that's it. No additional allocating. So it works and should work just fine, but for some reason it works only for like 4 times.Quote
Bitmap pixels are stored upside-down in the specification. The screen projection is already flipped vertically.I know this, and the only explanation I could think why my code doesn't work is that when I bind surface then I have to flip the projection again.
1597
Issues Help Desk / Re: Installation Woes
« on: December 16, 2011, 07:30:07 pm »
You shouldn't be touching makefiles. All of that should be dealt with automatically.
What platform are you on? I guess I could package a working windows installation. The automatic install is just broken and only newest svn works. So what we should actually do is package working installations in zips or rars and then link to them. You have to install mingw and that's, after running ENIGMA.exe everything should work.
edit: Here is windows link: http://www.filedropper.com/enigmatrunk. It is bigger than should be (because there are some random files in there and all of the .o files and stuff). When I or someone else makes a clean package then it will be smaller. But anyway, this should work. Just extract it to C: or something. Then run it. I have deleted .ey file (its a platform configuration file for ENIGMA) so it will tell you that its the first time you are running ENIGMA. It will find minGW (hopefully) and then ask you to install OpenAL (sound package which is actually optional). Then LGM will launch. At first it will say that enigma is not ready. Just look at the console on what its doing. At some point it will load everything and you will be able to compile. Then just press Enigma>Run inside an empty project. It should compile and show a white screen. If that is happening then everything is ready to go.
What platform are you on? I guess I could package a working windows installation. The automatic install is just broken and only newest svn works. So what we should actually do is package working installations in zips or rars and then link to them. You have to install mingw and that's, after running ENIGMA.exe everything should work.
edit: Here is windows link: http://www.filedropper.com/enigmatrunk. It is bigger than should be (because there are some random files in there and all of the .o files and stuff). When I or someone else makes a clean package then it will be smaller. But anyway, this should work. Just extract it to C: or something. Then run it. I have deleted .ey file (its a platform configuration file for ENIGMA) so it will tell you that its the first time you are running ENIGMA. It will find minGW (hopefully) and then ask you to install OpenAL (sound package which is actually optional). Then LGM will launch. At first it will say that enigma is not ready. Just look at the console on what its doing. At some point it will load everything and you will be able to compile. Then just press Enigma>Run inside an empty project. It should compile and show a white screen. If that is happening then everything is ready to go.
1598
Function Peer Review / sprite_create_from_surface
« on: December 16, 2011, 06:48:55 pm »
Hi. I went back to finish some of the surface functions I was working on, and I still can't figure this one out. I have this code:
So, ideas?
Also, I guess I could put this here as well:
I have made surface_save and surface_save_part functions. The problem is that the output bmp is vertically flipped. I used basically the same function that is used to save the screen and it works right there. This functions is like so:
Also, I would want to know how png's could be saved. ENIGMA already uses zlib for that I think, so maybe we could add two functions like:
save_texture_bmp and save_texture_png. Then saving surfaces, backgrounds and sprites would be identical and would only require a small wrapping function.
Code: [Select]
int sprite_create_from_surface(int id,int x,int y,int w,int h,bool removeback,bool smooth,int xorig,int yorig)
{
enigma::surface* surf=enigma::surface_array[id];
int sprid=enigma::sprite_idmax, full_width=nlpo2dc(w)+1, full_height=nlpo2dc(h)+1;
enigma::sprite_new_empty(sprid, 1, w, h, xorig, yorig, 0, h, 0, w, 1,0);
unsigned sz=full_width*full_height;
unsigned char *surfbuf=new unsigned char[sz*4];
int prevFbo;
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &prevFbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, surf->fbo);
glReadPixels(x,y,w,h,GL_RGBA,GL_UNSIGNED_BYTE,surfbuf);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, prevFbo);
enigma::sprite_set_subimage(sprid, 0, xorig, yorig, w, h, surfbuf);
delete[] surfbuf;
return sprid;
}
Pretty simple, and it works. The problem is that it breaks after certain amount of usage. For me this breaks when I execute it 4 times. Then artifacts appear on the surface (when something is drawn on it). After fifth time the artifacts become more massive (like solid rectangles) and after that the surface just becomes totally solid color. The game doesn't break though (no freezing) so I don't think I overwrite anything important, but I do overwrite something.So, ideas?
Also, I guess I could put this here as well:
I have made surface_save and surface_save_part functions. The problem is that the output bmp is vertically flipped. I used basically the same function that is used to save the screen and it works right there. This functions is like so:
Code: [Select]
int surface_save(int id, string filename)
{
FILE *bmp=fopen(filename.c_str(),"wb");
if(!bmp) return -1;
enigma::surface* surf=enigma::surface_array[id];
unsigned int w=surf->width,h=surf->height,sz=w*h;
char *surfbuf=new char[sz*3];
int prevFbo;
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &prevFbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, surf->fbo);
glReadPixels(0,0,w,h,GL_BGR,GL_UNSIGNED_BYTE,surfbuf);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, prevFbo);
fwrite("BM",2,1,bmp);
sz<<=2;
fwrite(&sz,4,1,bmp);
fwrite("\0\0\0\0\x36\0\0\0\x28\0\0",12,1,bmp);
fwrite(&w,4,1,bmp);
fwrite(&h,4,1,bmp);
fwrite("\1\0\x18\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",28,1,bmp);
if(w&3)
{
size_t pad=w&3;
w*=3;
sz-=sz>>2;
for(unsigned int i=0;i<sz;i+=w)
{
fwrite(surfbuf+i,w,1,bmp);
fwrite("\0\0",pad,1,bmp);
}
} else fwrite(surfbuf,w*3,h,bmp);
fclose(bmp);
delete[] surfbuf;
return 1;
}
Also, I would want to know how png's could be saved. ENIGMA already uses zlib for that I think, so maybe we could add two functions like:
save_texture_bmp and save_texture_png. Then saving surfaces, backgrounds and sprites would be identical and would only require a small wrapping function.
1599
General ENIGMA / YYG Linux
« on: December 08, 2011, 06:23:21 pm »
http://yoyogames.com/news/65
Quote
So as a Friday teaser, here’s a sneak preview of what Scott has been working on: GameMaker running on a PC Linux (Fedora 15) under LXDE window manager.
1600
Announcements / Re: EDL 3 Proposals
« on: December 04, 2011, 07:29:38 pm »GM will have structures and will compile GML before ENIGMA has a parser.Its funny because its true.
1601
Announcements / Re: EDL 3 Proposals
« on: December 02, 2011, 01:38:46 pm »
OOOOOOOOoooooooooooooooooooohhhhhhhhhhhhhhhhhhhh.
1602
Announcements / Re: EDL 3 Proposals
« on: December 02, 2011, 11:52:57 am »
Most of the ideas are great, though making all of that for the parser will take freaking years.
Though about arrays, why does it change arrays into function right now? Like "if(ass[0])" is "if (ass(0))". I know that its probably because they can have dynamic size and they don't have a specific type (variant I guess is a type). Its just that I had problems with some array declaration before. For example, this errors:
edit: Also, btw, this code freezes not only LGM but crashes the whole JAVA VM:
Though about arrays, why does it change arrays into function right now? Like "if(ass[0])" is "if (ass(0))". I know that its probably because they can have dynamic size and they don't have a specific type (variant I guess is a type). Its just that I had problems with some array declaration before. For example, this errors:
Code: [Select]
int some_array[10];
some_array[5]=10;
Quote
Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:37:17: error: 'some_array' cannot be used as a functionWhile this works fine:
Code: [Select]
local int some_array[15];
Also, this errors:Code: [Select]
n=15;
local int some_array[n];
I guess you get the point. So basically, will this get fixed when you change the array system?edit: Also, btw, this code freezes not only LGM but crashes the whole JAVA VM:
Code: [Select]
local int intensity_res=32,
intmap_w=int(room_width/intensity_res),
intmap_h=int(room_height/intensity_res);
local int intensity_map[][];
for (int i=0; i<=intmap_w; i++){
for (int c=0; c<=intmap_h; i++){
intensity_map[i][c]=0;
}
}
I found that a few weeks ago, but I didn't have the time to post, and I just remember about it.
1603
General ENIGMA / Re: FFI F'Up
« on: December 01, 2011, 04:37:52 pm »
I haven't got the time. The semester is going to an end, and so I have a lot of things to do at university. I wanted to update surfaces like more than a month ago, and I finally got around doing something about a week ago, but when I updated svn I got this error, so I can't do anything now.
1605
Proposals / Re: Advanced Code-Based Object Editor
« on: December 01, 2011, 06:04:14 am »
Remove the D&D panel and leave that the double click adds a code block + opens the code editor. And if the user double clicks the event then code editors opens the first code block.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 »