Developer's diary

Started by SplinterGU, October 19, 2008, 01:05:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SplinterGU

yes, is correct... if you use () in a define, you must include arguments in it...
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Sandman

Quote from: HaCkZJuaNN on November 06, 2008, 05:03:38 PM
You cannot use () on #defines, i think thats the problem with that.
You can and it provides much power.

Quote from: SplinterGU on November 06, 2008, 05:09:16 PM
yes, is correct... if you use () in a define, you must include arguments in it...
Yes, I figured as much. My suggestion is to make FUNC() work as well (like C).
Also, the compiler error doesn't say what you say the error is.
-- Sandman

SplinterGU

maybe... I'll considere it... thanks...
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Sandman

Another one:
- delete_draw() makes bgdi crash on a nonexistent drawID.
-- Sandman

SplinterGU

#19
This is a pointer to struct, if you use an invalid pointer, this hangup... only is test for NULL pointer...
this not is a bug... what happen if you do in C free (nonexistalloc)?
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Sandman

-- Sandman

Sandman

Seems to be something wrong with the ? operator.

import "mod_say"

Process main()
Private
int i;
Begin

i = 0;

if(i)
say("IF says: i is !0");
else
say("IF says: i is 0");
end

say("? says: i is " + (i?"!0":"0") );

End


Result:
QuoteIF says: i is 0
? says: i is !0

So I guess the ? operator needs some tinkering.

I also have a feature request: the support of special float functionality, like NaN.
-- Sandman

SplinterGU

#22
Quote from: Sandman on November 08, 2008, 08:20:48 PM
Seems to be something wrong with the ? operator.

import "mod_say"

Process main()
Private
int i;
Begin

i = 0;

if(i)
say("IF says: i is !0");
else
say("IF says: i is 0");
end

say("? says: i is " + (i?"!0":"0") );

End


Result:
QuoteIF says: i is 0
? says: i is !0

So I guess the ? operator needs some tinkering.


- Fixed... and improved speed when expression is constant... thanks
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

SplinterGU

#23
- Now division by zero are allow in float expresions, new functions are added:
  int isinf(float x);
  int isnan(float x);
  int finite(float x);
- Ternary condition fixed... and improved speed in ternary condition when expression is constant.
- Add core's functions bgdrtm_entry and bgdrtm_exit to bgdrtm...
- Now exit code can be return at finish execution of bgdi
- Lib WM now don't exit when close botton are clicked, only set exit_status to true
- EXIT(...) functions now fixed, and use the params
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

SplinterGU

Download Lastest BennuGD Release: http://www.bennugd.org/node/2

SplinterGU

revision 22 binaries windows and linux for download
http://betatester.bennugd.org/betas/
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Sandman

#26
As a reply to revision 23:

An English translation of the readme:

Bennu Project 1.0
=================

Instructions for compiling the project.
========================================

You need the following packages (which can be installed in any directory of MinGW, Win32 only):

MinGW-5.1.0 (mingw-runtime-3.11.tar.gz
            w32api-3.8.tar.gz
            binutils-2.15.91-20040904-1.tar.gz
            gcc-core-3.4.2-20040916-1.tar.gz
            gcc-g++-3.4.2-20040916-1.tar.gz
            mingw32-make-3.80.0-3.tar.gz)

MSYS-1.0.10.exe

(Valid libraries for UNIX)

libpng-1.2.12.tar.gz
SDL-1.2.11.tar.gz
SDL_mixer-1.2.7.tar.gz
smpeg-0.4.3.tar.gz
zlib-1.2.3.tar.gz


NOTES:
    Although these versions were used at this time, any version of these packages should work correctly.

Steps to compile:

    ./configure
    make

WIN32 NOTES:
    If you have installed MSVC, be sure to eliminate the seven variables of the MSVC compiler (INCLUDE, LIB, etc.) in the MSYS console.
    Copy SDL.dll to the root directory of the project before running configure.

Linux
-----

lib32z1-dev

./configure --target=i386-pc-linux-gnu --host=i386-pc-linux-gnu --build=i386-pc-linux-gnu (Ubuntu 64)


I included a text file of how I compiled Bennu in MSYS. There could be things missing, but it could be helpful.

Btw, ./configure --target=i386-pc-linux-gnu --host=i386-pc-linux-gnu --build=i386-pc-linux-gnu is the same as ./configure --build=i386-pc-linux-gnu by default, but you probably knew that.
-- Sandman

SplinterGU

Download Lastest BennuGD Release: http://www.bennugd.org/node/2

SplinterGU

#28
- Fixed Translucent tables in 8 bits
- Fixed blend operations in 8 bits
- Fixed Translucent+Blend in 8 bits

sample

Program Pruebas;

#ifdef __VERSION__
import "mod_screen";
import "mod_video";
import "mod_map";
import "mod_say";
import "mod_text";
import "mod_rand";
import "mod_mouse";
#endif
import "mod_file";
import "mod_key";
import "mod_draw";
import "mod_proc";
import "mod_math";

#define GR_DEPTH    depth
//#define GR_DEPTH    16

global
   int recta;
   int cubo;
   int fondo;
   int depth = 32;
   int gflags = 0;
   int gangle = 0;
   int gsize = 100;
   int galpha = 255;
   int sw = 0;

begin

    set_fps(0,0);

    action();

    While (NOT key(_esc))
        if (key(_TAB))
            let_me_alone();

            depth /= 2;
            if (depth<8) depth = 32; end

            delete_text(all_text);
            unload_map(0,fondo);
            unload_map(0,cubo);
            unload_map(0,recta);
            unload_map(0,mouse.graph);
            action();
            while (key(_TAB)) frame; end;
         end

        frame;
    end
end



process action()
private
map;
count ;
Begin
//    scale_mode = scale_normal2x;

/*
    dump_type=1;
    restore_type=1;
*/
    set_mode(640,480,GR_DEPTH|WAITVSYNC); // For rgb for graphs

    cubo=new_map(100,100,GR_DEPTH);
    drawing_map(0,cubo);
    drawing_color(rgb(0,0,200));
    draw_box(50,0,100,100);
    drawing_color(rgb(0,100,200));
    draw_box(0,0,50,100);
    drawing_color(rgba(100,0,200,50));
    draw_box(25,0,75,25);
    /* Hole */
    drawing_color(rgba(255,255,0,200));
    draw_box(35,35,65,65);
    drawing_color(rgba(255,0,255,64));
    draw_box(45,45,55,55);

/*
    cubo=new_map(100,100,GR_DEPTH);
    drawing_map(0,cubo);
    drawing_color(rgb(0,0,200));
    draw_fcircle(50,50,50);
    drawing_color(rgb(0,100,200));
    draw_fcircle(50,25,20);
*/

    recta=new_map(5,100,GR_DEPTH);
    drawing_map(0,recta);
    drawing_color(rgb(200,0,0));
    draw_box(0,0,5,100);
    drawing_color(rgb(0,200,0));
    draw_box(0,0,5,5);
    drawing_color(rgb(0,0,200));
    draw_box(5,0,5,100);

    set_mode(640,480,depth);

    mouse.graph=png_load("pngtest.png");

    fondo=new_map(640,480,depth);

    for (y=0;y<480;y++)
        for (x=0;x<640;x++)
             //((y*100/256)<<(((y>>2)%3)<<3))
//            map_put_pixel(0,fondo,x,y,rgb(y*256/480,y*256/480,y*256/480));
            map_put_pixel(0,fondo,x,y,rgb((y&1)?x*256/640:0,(x&1)?x*256/640:0,(y&1)?y*256/480:0));
        end
    end

    put_screen(0,fondo);

    write_int (0,100,10,1,&fps);
    write_int (0,200,10,1,&depth);

    write_int (0,300,10,1,&gangle);
    write_int (0,400,10,1,&gsize);
    write_int (0,500,10,1,&galpha);

    jugador(120,180,cubo,-180000,0);
    jugador(240,180,cubo,-180000,B_HMIRROR);
    jugador(120,300,cubo,-180000,B_VMIRROR);
    jugador(240,300,cubo,-180000,B_HMIRROR|B_VMIRROR);

    jugador(440,180,recta,-180000,0);
    jugador(560,180,recta,-180000,B_HMIRROR);
    jugador(440,300,recta,-180000,B_VMIRROR);
    jugador(560,300,recta,-180000,B_HMIRROR|B_VMIRROR);

    While (NOT key(_esc))
        gangle+=100;

        If (key(_F1)) gflags |= B_TRANSLUCENT; end
        If (key(_F2)) gflags = gflags & ~B_TRANSLUCENT; end
        If (key(_F3)) gflags |= B_ABLEND; end
        If (key(_F4)) gflags = gflags & ~B_ABLEND; end
        If (key(_F5)) gflags |= B_SBLEND; end
        If (key(_F6)) gflags = gflags & ~B_SBLEND; end

        If (key(_minus)) gsize-=10; if (shift_status) while(key(_minus)) frame; end ;end; end
        If (key(_plus))  gsize+=10; if (shift_status) while(key(_plus))  frame; end ;end; end

        If (key(_1) && galpha > 0)   galpha--; if (shift_status) while(key(_1)) frame; end ;end; end
        If (key(_2) && galpha < 255) galpha++; if (shift_status) while(key(_2)) frame; end ;end; end

        If (key(_q)) gangle-=1000;   if (shift_status) while(key(_q)) frame; end ;end; end
        If (key(_w)) gangle+=1000;   if (shift_status) while(key(_w)) frame; end ;end; end
        If (key(_a)) gangle-=100;    if (shift_status) while(key(_a)) frame; end ;end; end
        If (key(_s)) gangle+=100;    if (shift_status) while(key(_s)) frame; end ;end; end
        If (key(_z)) gangle-=10;     if (shift_status) while(key(_z)) frame; end ;end; end
        If (key(_x)) gangle+=10;     if (shift_status) while(key(_x)) frame; end ;end; end

        If (key(_9) && !fading) fade_off(); while(key(_9)) frame; end; end
        If (key(_0) && !fading) fade_on() ; while(key(_0)) frame; end; end

        if ( key( _H ) ) gflags ^= B_HMIRROR; while ( key( _H ) ) frame; end; end
        if ( key( _V ) ) gflags ^= B_VMIRROR; while ( key( _V ) ) frame; end; end

        if ( key(_F10)) map = get_screen(); while(file_exists("capture"+count+".png"));count++;end;save_png(0,map,"capture"+count+".png"); unload_map(0,map);while ( key(_F10)) frame; end; end

        if ( key( _SPACE ) ) gangle = 0; end

        Frame;
    End

    let_me_alone();

End

Process jugador(x,y,graph,angle,iflags)
Private
    int mapa;
Begin
    While (NOT key(_esc))
        alpha = galpha;
        size = gsize;
        angle = gangle;
        flags = gflags ^ iflags;

        Frame;
    End
End
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

SplinterGU

r28 disponible para descargar...
Download Lastest BennuGD Release: http://www.bennugd.org/node/2