1. Post #2121
    AlienCat's Avatar
    October 2011
    508 Posts
    Anyone know any good software for planning code? You know like class diagrams n' shit. Would be great if you knew some.
    I would say paint. I have tried dozens of programs and all of them are hard to make diagrams as you want them. Someday I might make my own program.

    Maybe I am dumb, but I find it a bit hard to use. It is still one of the best programs that you can use for this.

    I'm trying to multiply the value of my chronometer or just try to get the value to be a string.

    Every time I try to make it a string and use toast.show() to view it, my application crashes. I can get the value of my EditText to show up but I can't seem to get my chronometer to work. Both the strings time and fin make it crash. Here's the code:

    Code:
    String hour = String.valueOf(mText.getText());
    String time = String.valueOf(mChronometer.getBase() - stoppedMilliseconds);
    int h = java.lang.Integer.parseInt(hour) / 60;
    int t = java.lang.Integer.parseInt(time) * 1000 / 60;
    int mm = h * t;
    mon.setText(Integer.toString(mm));
    String fin = "" + mm;
    
    
    Toast.makeText(PoopActivity.this,
            "Money made: " + fin, Toast.LENGTH_LONG).show();
    Are you sure, looks like mon is the reason for it to crash. If mon is null, you cannot call setText.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  2. Post #2122
    _ snip _

    Dammit how do I un-snip? :(
    Press your name here:
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Useful Useful x 1 (list)

  3. Post #2123
    AlienCat's Avatar
    October 2011
    508 Posts
    Trying out, hold on...
    That feel when you first think all is good. Then waait there is more pages, I am writing irrelevant stuff! And then, oh, I was on the last page.

    Edited:

    I've been working on a "BIT.TRIP BEAT" Clone and was wondering... How would you guys save the file.

    Essentially I need to store
    - Location
    - Speed
    - Note (A, Ab, D# etc.)
    Save each on its own line. Or make a struct and... save the struct. Don't.

    Edited:

    Press your name here:
    Wow! thank you! I never learn what the words "hold on" means tho.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  4. Post #2124
    Gold Member
    esalaka's Avatar
    July 2007
    10,131 Posts
    Save each on its own line. Or make a struct and... save the struct.
    Writing raw structs into files only makes sense if they're never going to change and even in that case you should serialise them.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  5. Post #2125
    AlienCat's Avatar
    October 2011
    508 Posts
    Thats right, just dumb of me to suggest that.

    Anyone know something about qt3d? I can't for my life get rid of the culling or whatever it is called. When zooming towards a object, it got like eated by a black border. setNearPlane does not help.

    Here is some code:

    Code:
    void simulationRenderer::initializeGL(QGLPainter *painter)
    {
        QGLCamera* cam = new QGLCamera();
    
        cam->setNearPlane(1);
        cam->setFarPlane(1000);
    
        painter->setCamera(cam);
    Here is how the shit looks:

    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  6. Post #2126
    Chrispy_645's Avatar
    November 2010
    449 Posts
    Anyone here good with the HL2 source?

    In gameinterface.cpp, as soon as I do:

    #include <SerialClass.h>

    I get these warnings/errors:

    Code:
    1>  gameinterface.cpp
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winbase.h(59): warning C4005: 'INVALID_HANDLE_VALUE' : macro redefinition
    1>          d:\new folder\mymod\src\common\xbox\xboxstubs.h(97) : see previous definition of 'INVALID_HANDLE_VALUE'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winbase.h(7558): warning C4005: 'GetCommandLine' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(185) : see previous definition of 'GetCommandLine'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\wincon.h(328): warning C4005: 'ReadConsoleInput' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(251) : see previous definition of 'ReadConsoleInput'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(290): warning C4005: 'RegCreateKey' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(233) : see previous definition of 'RegCreateKey'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(324): warning C4005: 'RegCreateKeyEx' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(227) : see previous definition of 'RegCreateKeyEx'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(636): warning C4005: 'RegOpenKey' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(197) : see previous definition of 'RegOpenKey'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(662): warning C4005: 'RegOpenKeyEx' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(191) : see previous definition of 'RegOpenKeyEx'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(756): warning C4005: 'RegQueryValue' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(221) : see previous definition of 'RegQueryValue'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(813): warning C4005: 'RegQueryValueEx' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(215) : see previous definition of 'RegQueryValueEx'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(929): warning C4005: 'RegSetValue' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(209) : see previous definition of 'RegSetValue'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(958): warning C4005: 'RegSetValueEx' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(203) : see previous definition of 'RegSetValueEx'
    1>d:\new folder\mymod\src\game\server\gameinterface.cpp(808): error C2039: 'CreateEventA' : is not a member of 'IGameEventManager2'
    1>          d:\new folder\mymod\src\public\igameevents.h(98) : see declaration of 'IGameEventManager2'
    SerialClass.h, SerialClass.cpp are from here:

    http://arduino.cc/playground/Interfacing/CPPWindows

    Any ideas?
    Reply With Quote Edit / Delete Windows 7 New Zealand Show Events

  7. Post #2127
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    Anyone here good with the HL2 source?

    In gameinterface.cpp, as soon as I do:

    #include <SerialClass.h>

    I get these warnings/errors:

    Code:
    1>  gameinterface.cpp
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winbase.h(59): warning C4005: 'INVALID_HANDLE_VALUE' : macro redefinition
    1>          d:\new folder\mymod\src\common\xbox\xboxstubs.h(97) : see previous definition of 'INVALID_HANDLE_VALUE'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winbase.h(7558): warning C4005: 'GetCommandLine' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(185) : see previous definition of 'GetCommandLine'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\wincon.h(328): warning C4005: 'ReadConsoleInput' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(251) : see previous definition of 'ReadConsoleInput'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(290): warning C4005: 'RegCreateKey' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(233) : see previous definition of 'RegCreateKey'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(324): warning C4005: 'RegCreateKeyEx' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(227) : see previous definition of 'RegCreateKeyEx'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(636): warning C4005: 'RegOpenKey' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(197) : see previous definition of 'RegOpenKey'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(662): warning C4005: 'RegOpenKeyEx' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(191) : see previous definition of 'RegOpenKeyEx'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(756): warning C4005: 'RegQueryValue' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(221) : see previous definition of 'RegQueryValue'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(813): warning C4005: 'RegQueryValueEx' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(215) : see previous definition of 'RegQueryValueEx'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(929): warning C4005: 'RegSetValue' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(209) : see previous definition of 'RegSetValue'
    1>c:\program files\microsoft sdks\windows\v7.0a\include\winreg.h(958): warning C4005: 'RegSetValueEx' : macro redefinition
    1>          d:\new folder\mymod\src\public\tier0\protected_things.h(203) : see previous definition of 'RegSetValueEx'
    1>d:\new folder\mymod\src\game\server\gameinterface.cpp(808): error C2039: 'CreateEventA' : is not a member of 'IGameEventManager2'
    1>          d:\new folder\mymod\src\public\igameevents.h(98) : see declaration of 'IGameEventManager2'
    SerialClass.h, SerialClass.cpp are from here:

    http://arduino.cc/playground/Interfacing/CPPWindows

    Any ideas?
    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <stdlib.h>
    Including these in mod-code is probably fucking it up. Try including those in SerialClass.cpp instead of SerialClass.h
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 1 (list)

  8. Post #2128
    Chrispy_645's Avatar
    November 2010
    449 Posts
    That ends up giving this since the header file doesn't know what I'm talking about:

    Code:
    1>d:\new folder\mymod\src\game\server\serialclass.h(14): error C2146: syntax error : missing ';' before identifier 'status'
    1>d:\new folder\mymod\src\game\server\serialclass.h(14): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>d:\new folder\mymod\src\game\server\serialclass.h(14): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>d:\new folder\mymod\src\game\server\serialclass.h(16): error C2146: syntax error : missing ';' before identifier 'errors'
    1>d:\new folder\mymod\src\game\server\serialclass.h(16): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>d:\new folder\mymod\src\game\server\serialclass.h(16): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    I know this probably doesn't mean shit but I thought including those (windows.h, stdio, stdlib) would be fine since I've seen all 3 of those #includes in other parts of the HL2 code.
    Reply With Quote Edit / Delete Windows 7 New Zealand Show Events

  9. Post #2129
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    That ends up giving this since the header file doesn't know what I'm talking about:

    Code:
    1>d:\new folder\mymod\src\game\server\serialclass.h(14): error C2146: syntax error : missing ';' before identifier 'status'
    1>d:\new folder\mymod\src\game\server\serialclass.h(14): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>d:\new folder\mymod\src\game\server\serialclass.h(14): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>d:\new folder\mymod\src\game\server\serialclass.h(16): error C2146: syntax error : missing ';' before identifier 'errors'
    1>d:\new folder\mymod\src\game\server\serialclass.h(16): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>d:\new folder\mymod\src\game\server\serialclass.h(16): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    I know this probably doesn't mean shit but I thought including those (windows.h, stdio, stdlib) would be fine since I've seen all 3 of those #includes in other parts of the HL2 code.
    Oops. I didn't read through the .h file very well. You can try forward declaring those classes, but don't think it'll work.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  10. Post #2130
    Gold Member
    Over-Run's Avatar
    January 2006
    3,084 Posts
    I have a programming repeat coming up and I really need to pass it.
    Here is the material we covered this year:

    http://www.computing.dcu.ie/~jmorris...indexLect.html

    Anybody have any good resources for learning this sort of stuff? Programming isn't my strongest subject, as much as I wish it was and would love to learn all this stuff
    Reply With Quote Edit / Delete Windows 7 Ireland Show Events

  11. Post #2131
    AlienCat's Avatar
    October 2011
    508 Posts
    The best way is practice really. You can look stuff up by just searching on them and try out the stuff by yourself.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Informative Informative x 1 (list)

  12. Post #2132
    Zyx
    Guest 3855 is lost and can't find the park exit
    Zyx's Avatar
    February 2005
    2,827 Posts
    I'm making a java applet that should connect to a MySQL database.
    It works perfectly when I run the applet locally in a browser. but once I upload it to the ftp server to run it, it can't connect to the database.
    No exceptions, no nothing. Just a non-responding applet.

    I have digitally self signed the applet.
    public static void initConnection(Settings info) throws ClassNotFoundException, SQLException
        {
            Class.forName("com.mysql.jdbc.Driver");
            //Freezes on next line.
            Connection conn = DriverManager.getConnection("jdbc:mysql://" + info.getHost() + ":3306/" + info.getDbName(), info.getUser(), info.getPass());
            stmt = conn.createStatement();
        }
    
    Reply With Quote Edit / Delete Windows 7 Show Events

  13. Post #2133
    boy i sure do love it when my title doesnt fit
    LuaChobo's Avatar
    December 2009
    6,278 Posts
    -snip im dumb-
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Optimistic Optimistic x 1 (list)

  14. Post #2134
    That Dog
    Ehmmett's Avatar
    March 2009
    13,229 Posts
    Just messing about with standalone lua. I've got a .bat that runs the .lua file in 'interactive mode'. How do i go about stopping it from closing when there's an error. Makes debugging one hell of a process.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  15. Post #2135
    Just messing about with standalone lua. I've got a .bat that runs the .lua file in 'interactive mode'. How do i go about stopping it from closing when there's an error. Makes debugging one hell of a process.
    Put pause at the end of the .bat?
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  16. Post #2136
    Gold Member
    BackwardSpy's Avatar
    May 2008
    6,442 Posts
    Alternatively, just run the batch file from a command prompt in the first place.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  17. Post #2137
    Richy19's Avatar
    May 2010
    5,382 Posts
    Trying to optimize my bloom effect.
    I currently have:
    Window 1024x576,
    FBO1 1024x576,
    FBO2 1024x576,
    displayImage 1024x576,
    #version 120
    
    varying vec2 uv;
    uniform sampler2D Texture;
    
    const float rt_w = 1024; // render target width
    const float rt_h = 576; // render target height
    
    const float offset[3] = float[]( 0.0, 1.3846153846, 3.2307692308 );
    const float weight[3] = float[]( 0.2270270270, 0.3162162162, 0.0702702703 );
    
    const int iter = 3;
    
    void main()
    {
      vec4 tc = texture2D(Texture, uv).rgba * weight[0];
    
    
        for (int i=1; i<iter; i++)
        {
          tc += texture2D(Texture, uv + vec2(0.0, offset[i])/rt_h).rgba * weight[i];
          tc += texture2D(Texture, uv - vec2(0.0, offset[i])/rt_h).rgba * weight[i];
        }
      gl_FragColor = tc;
    }
    

    #version 120
    
    varying vec2 uv;
    uniform sampler2D Texture;
    
    const float rt_w = 1024; // render target width
    const float rt_h = 576; // render target height
    
    const int iter = 3;
    
    const float offset[3] = float[]( 0.0, 1.3846153846, 3.2307692308 );
    const float weight[3] = float[]( 0.2270270270, 0.3162162162, 0.0702702703 );
    
    void main()
    {
      vec4 tc = texture2D(Texture, uv).rgba * weight[0];
    
        for (int i=1; i<iter; i++)
        {
          tc += texture2D(Texture, uv + vec2(offset[i])/rt_w, 0.0).rgba * weight[i];
          tc += texture2D(Texture, uv - vec2(offset[i])/rt_w, 0.0).rgba * weight[i];
        }
    
      gl_FragColor = tc;
    }
    

    Notice the rt_w & rt_h variables there.

    and I:
    Draw things to the window,
    Draw things that need blooming to FBO1 with normal shader.
    Draw FBO1 to FBO2 using the first shader.
    Draw FBO2 to window using second shader.



    So my idea was to reduce the size of the FBO's by 4 giving me FBO's of size 256x144 but when I use the same code but simply reducing the FBO size doesnt draw it, can someone help me out with what values the FBO's, Perspective & Ortho matrixes and displayImage's should use in terms of height and width?
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  18. Post #2138
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    I thought you were supposed to render your scene out to the Backbuffer/a Texture2D, downsize it in steps (halving each time until it's a certain size), apply a gaussian blur to the downsampled image, then upscale that and apply it over the original backbuffer with certain blending modes.

    Edit:
    My implementation sounds like cheap bloom.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  19. Post #2139
    Richy19's Avatar
    May 2010
    5,382 Posts
    Yea thaats what im trying to do but i cant get my head around the matrices & coordinates
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Optimistic Optimistic x 1 (list)

  20. Post #2140
    That Dog
    Ehmmett's Avatar
    March 2009
    13,229 Posts
    Put pause at the end of the .bat?
    Worked, thanks. :)
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  21. Post #2141
    Idioms's Avatar
    March 2010
    108 Posts
    Having problems with GLuint and GLint with C++/OpenGL. Just getting errors like,

    GLuint was not declared in this scope
    GLint was not declared in this scope

    Everything else is working perfectly and when I replace GLuint and GLint with unsigned int and int then my program runs (it doesn't work properly but I assume that's something to do with my vertex and fragment shader code being fucked up.) Am I missing some prerequisite library?
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  22. Post #2142
    Richy19's Avatar
    May 2010
    5,382 Posts
    did you include gl.h?
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  23. Post #2143
    Ninja101 is m̶y̶ ̶f̶a̶v̶o̶u̶r̶i̶t̶e̶ ̶m̶o̶d̶ a pancake face
    FreddiRox!'s Avatar
    January 2010
    5,099 Posts
    I'm making a 2D side scroller in XNA as my first ever project and I've fallen at the first hurdle.
    I'd like to make maps in a neat fashion so I can also place crates and buildings on them, however the only way I have been managing to do this is by giving eat block a value (ei 1 = block 0 = air) and filling in a grid, which works to an extent, but its nothing pretty and I can't place anything else on it.

    Code:
    [0],[0],[0]
    [0],[0],[0]
    [1],[1],[1]
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  24. Post #2144
    I'm making a 2D side scroller in XNA as my first ever project and I've fallen at the first hurdle.
    I'd like to make maps in a neat fashion so I can also place crates and buildings on them, however the only way I have been managing to do this is by giving eat block a value (ei 1 = block 0 = air) and filling in a grid, which works to an extent, but its nothing pretty and I can't place anything else on it.

    Code:
    [0],[0],[0]
    [0],[0],[0]
    [1],[1],[1]
    Congratulations, you're making a tile-based game.
    For objects that you can move around / shoot at / are dynamic in any other way I'd recommend making an additional array for them with x and y values.
    If they're just static, use other numbers, like 0 = air, 1 = dirt, 2 = crate, 3 = building-left wall, 4 = building-right wall, 5 = building-top wall etc.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  25. Post #2145
    Ninja101 is m̶y̶ ̶f̶a̶v̶o̶u̶r̶i̶t̶e̶ ̶m̶o̶d̶ a pancake face
    FreddiRox!'s Avatar
    January 2010
    5,099 Posts
    OK, so lets say I still want to make a 2D side scroller, how else could I make the maps for the levels?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  26. Post #2146
    Gold Member
    Armandur's Avatar
    March 2009
    666 Posts
    Would this:

    				bool t = inputs[0]->getConnection()->output();
    
    				for(int i = 1; i < inputs.size(); i++)
    				{
    					if(!inputs[i]->getInverted())
    					{
    						t = t && inputs[i]->getConnection()->output();
    					}
    					else
    					{
    						t = t && !inputs[i]->getConnection()->output();
    					}
    				}
    
    				if(t)
    				{
    					return true;
    				}
    				else
    				{
    					return false;
    				}
    

    work for getting a correct output from an AND gate with 2-Many inputs, which any one of them can be inverted?

    inputs[i]->getConnection()->output();
    

    is used for getting the output of another gate. For testing I have two types of non-standard gates: GateType::HIGH and GateType::LOW. These output true and false respectively.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  27. Post #2147
    Conservative Cunt who fucking loves piss
    Elecbullet's Avatar
    November 2007
    11,602 Posts
    I'm analyzing the source code for a DOS game, specifically, Wolfenstein 3D. It keeps referring to "tics" as a unit of time. DOS does time to a resolution of 1 centisecond, apparently. Is it a good bet that's it?

    I don't know shit about C++.
    Reply With Quote Edit / Delete Linux United States Show Events

  28. Post #2148
    Gold Member
    esalaka's Avatar
    July 2007
    10,131 Posts
    I'm analyzing the source code for a DOS game, specifically, Wolfenstein 3D. It keeps referring to "tics" as a unit of time. DOS does time to a resolution of 1 centisecond, apparently. Is it a good bet that's it?

    I don't know shit about C++.
    One tick generally seems to refer to one time a certain game loop is run.
    Reply With Quote Edit / Delete Linux Finland Show Events Agree Agree x 1 (list)

  29. Post #2149
    Conservative Cunt who fucking loves piss
    Elecbullet's Avatar
    November 2007
    11,602 Posts
    I could be wrong about any of this. I'm an admin on the Wolfenstein Wiki and I'm trying to make animated GIFs of all the enemies moving from extracted sprites. This file seems to give the time for each sprite:

    https://github.com/id-Software/wolf3...FSRC/WL_ACT2.C

    example

    Code:
    statetype s_willstand	= {false,SPR_WILL_W1,0,T_Stand,NULL,&s_willstand};
    
    statetype s_willchase1 	= {false,SPR_WILL_W1,10,T_Will,NULL,&s_willchase1s};
    statetype s_willchase1s	= {false,SPR_WILL_W1,3,NULL,NULL,&s_willchase2};
    statetype s_willchase2 	= {false,SPR_WILL_W2,8,T_Will,NULL,&s_willchase3};
    statetype s_willchase3 	= {false,SPR_WILL_W3,10,T_Will,NULL,&s_willchase3s};
    statetype s_willchase3s	= {false,SPR_WILL_W3,3,NULL,NULL,&s_willchase4};
    statetype s_willchase4 	= {false,SPR_WILL_W4,8,T_Will,NULL,&s_willchase1};
    
    statetype s_willdeathcam	= {false,SPR_WILL_W1,1,NULL,NULL,&s_willdie1};
    
    statetype s_willdie1	= {false,SPR_WILL_W1,1,NULL,A_DeathScream,&s_willdie2};
    statetype s_willdie2	= {false,SPR_WILL_W1,10,NULL,NULL,&s_willdie3};
    statetype s_willdie3	= {false,SPR_WILL_DIE1,10,NULL,NULL,&s_willdie4};
    statetype s_willdie4	= {false,SPR_WILL_DIE2,10,NULL,NULL,&s_willdie5};
    statetype s_willdie5	= {false,SPR_WILL_DIE3,10,NULL,NULL,&s_willdie6};
    statetype s_willdie6	= {false,SPR_WILL_DEAD,20,NULL,NULL,&s_willdie6};
    
    statetype s_willshoot1 	= {false,SPR_WILL_SHOOT1,30,NULL,NULL,&s_willshoot2};
    statetype s_willshoot2 	= {false,SPR_WILL_SHOOT2,10,NULL,T_Launch,&s_willshoot3};
    statetype s_willshoot3 	= {false,SPR_WILL_SHOOT3,10,NULL,T_Shoot,&s_willshoot4};
    statetype s_willshoot4 	= {false,SPR_WILL_SHOOT4,10,NULL,T_Shoot,&s_willshoot5};
    statetype s_willshoot5 	= {false,SPR_WILL_SHOOT3,10,NULL,T_Shoot,&s_willshoot6};
    statetype s_willshoot6 	= {false,SPR_WILL_SHOOT4,10,NULL,T_Shoot,&s_willchase1};
    I interpret the third thing after the equals as a number of units of time. Assuming the unit is one centisecond, it seems too fast!

    Other files have said things about 70 Hertz. I might try that, but it's a weird ass number.

    Edited:

    I shall perform an experiment with 50Hz bases, 60Hz bases, and 70Hz bases to see which is the most fitting to Wolfenstein 3D.

    Edited:

    70Hz seems to fit. Jesus, what an odd number.
    Reply With Quote Edit / Delete Linux United States Show Events Informative Informative x 1 (list)

  30. Post #2150
    Gold Member
    robmaister12's Avatar
    January 2008
    4,969 Posts
    Is there any way to simplify this regex? I'm trying to verify an identifier that's 4 characters long A-Z and allow for padding only at the end with the "." character. The regex string:

    Code:
    ([A-Z]{4})|([A-Z]{3}\.{1})|([A-Z]{2}\.{2})|([A-Z]{1}\.{3})
    Valid:
    Code:
    TEST
    TES.
    TE..
    T...
    Invalid:
    Code:
    test
    TESt
    TEst
    Test
    tEST
    teST
    tesT
    T..T
    T.S.
    .E.T
    .EST
    ..ST
    ...T
    ....
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  31. Post #2151
    Project Lead, Internet Explorer for Linux
    lavacano's Avatar
    October 2008
    14,495 Posts
    Is there an API somewhere for getting current sales tax for my state?

    Edited:

    (I live in the US in case you don't have Overv's Flagdog script for some reason)
    Reply With Quote Edit / Delete Linux United States Show Events

  32. Post #2152
    Conservative Cunt who fucking loves piss
    Elecbullet's Avatar
    November 2007
    11,602 Posts
    Your other icons you've got down there make anything seem dubious you know
    Reply With Quote Edit / Delete Linux United States Show Events Funny Funny x 4 (list)

  33. Post #2153
    Project Lead, Internet Explorer for Linux
    lavacano's Avatar
    October 2008
    14,495 Posts
    Your other icons you've got down there make anything seem dubious you know
    i don't get it
    Reply With Quote Edit / Delete Linux United States Show Events Funny Funny x 2 (list)

  34. Post #2154
    Gold Member
    ShaunOfTheLive's Avatar
    November 2007
    9,824 Posts
    70Hz seems to fit. Jesus, what an odd number.
    Are you sure it's not 75Hz? That was the usual refresh rate of CRTs back in the day.
    Reply With Quote Edit / Delete Windows 8 Canada Show Events

  35. Post #2155
    Ratzz's Avatar
    July 2009
    1,001 Posts
    dickwhacking bagslut
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  36. Post #2156
    ECrownofFire's Avatar
    January 2011
    2,004 Posts
    Is there any way to simplify this regex? I'm trying to verify an identifier that's 4 characters long A-Z and allow for padding only at the end with the "." character. The regex string:

    Code:
    ([A-Z]{4})|([A-Z]{3}\.{1})|([A-Z]{2}\.{2})|([A-Z]{1}\.{3})
    Valid:
    Code:
    TEST
    TES.
    TE..
    T...
    Invalid:
    Code:
    test
    TESt
    TEst
    Test
    tEST
    teST
    tesT
    T..T
    T.S.
    .E.T
    .EST
    ..ST
    ...T
    ....
    ^([A-Z]+)(\.*)$
    Reply With Quote Edit / Delete Windows XP United States Show Events Useful Useful x 1Dumb Dumb x 1 (list)

  37. Post #2157
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    ^([A-Z]+)(\.*)$
    Matches TESTER, which is wrong.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  38. Post #2158
    Gold Member
    esalaka's Avatar
    July 2007
    10,131 Posts
    Also matches EFEXISAPRETTYCOOLGUY
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  39. Post #2159
    I'm learning Java on Android by making a very simple game, but my touch isn't working correctly.
    It only registers the ACTION_DOWN event and nothing else.

    Ideas?

    MainActivity:
    Code:
    package com.novaember.blockrunner;
    
    import android.app.*;
    import android.os.*;
    import android.util.*;
    import android.view.*;
    import android.widget.*;
    
    public class MainActivity extends Activity {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(new MainGamePanel(this));
        }
        
        @Override
        public void onBackPressed() {
            return;
        }
    }
    MainGamePanel:
    Code:
    package com.novaember.blockrunner;
    
    import android.app.*;
    import android.content.*;
    import android.graphics.*;
    import android.os.*;
    import android.util.*;
    import android.view.*;
    import android.widget.*;
    
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    
    public class MainGamePanel extends SurfaceView implements SurfaceHolder.Callback {
    
        private String avgFps;
        public void setAvgFps(String avgFps) {
            this.avgFps = avgFps;
        }
        
        private MainThread thread;;
    
        private Player player;
        private Map map;
        private Menu menu;
    
        public MainGamePanel(Context context) {
            super(context);
            // adding the callback (this) to the surface holder to intercept events
            getHolder().addCallback(this);
            
            player = new Player(BitmapFactory.decodeResource(getResources(), R.drawable.player), 50, 50);
            menu = new MainMenu();
            
            this.thread = new MainThread(getHolder(), this);
            
            // make the GamePanel focusable so it can handle events
            setFocusable(true);
        }
    
        @Override
        public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
            
        }
        
        @Override
        public void surfaceCreated(SurfaceHolder holder) {
            thread.setRunning(true);
            thread.start();
        }
    
        @Override
        public void surfaceDestroyed(SurfaceHolder holder) {
            boolean retry = true;
            while (retry) {
                try {
                    thread.join();
                    retry = false;
                } catch (InterruptedException e) {
                    // try again shutting down the thread
                }
            }
        };
    
        @Override
        public boolean onTouchEvent(MotionEvent event) {
            boolean ret = super.onTouchEvent(event);
    
            int action = event.getAction() & MotionEvent.ACTION_MASK;
            
            float ex = event.getX();
            float ey = event.getY();
    
            Log.d("BR", "Coords: x=" + ex + ",y=" + ey + ",action=" + event.getAction());
    
            switch (action) {
                case MotionEvent.ACTION_DOWN:
                    // thread.setRunning(false);
                    // ((Activity) getContext()).finish();
    
                    try {
                        for(Iterator i = menu.getButtons().iterator(); i.hasNext();) {
                            Button btn = (Button) i.next();
                            Rect rect = btn.getRect();
    
                            if(rect.contains((int) ex, (int) ey)) {
                                if(!btn.isDown()) {
                                    btn.touchDown();
                                }
                            }
                        }
                    } catch (Exception e) {
    
                    }
                break;
                case MotionEvent.ACTION_UP:
                    try {
                        for(Iterator i = menu.getButtons().iterator(); i.hasNext();) {
                            Button btn = (Button) i.next();
                            Rect rect = btn.getRect();
    
                            //if(!rect.contains((int) ex, (int) ey)) {
                                if(btn.isDown()) {
                                    btn.touchUp();
                                }
                            //}
                        }
                    } catch (Exception e) {
    
                    }
                break;
            }
    
            return ret;
        }
    
        @Override
        public boolean onKeyDown(int keyCode, KeyEvent event) {
            try {
    
            } catch(Exception e) {
                
            }
            
            return super.onKeyDown(keyCode, event);
        }
        
        @Override
        public boolean onKeyUp(int keyCode, KeyEvent event) {
            Log.d("BR", "Key "+keyCode);
            try {
    
            } catch(Exception e) {
    
            }
    
            return super.onKeyUp(keyCode, event);
        }
         
        @Override
        protected void onDraw(Canvas canvas) {
            canvas.drawColor(Color.BLACK);
        }
    
        public void update() {
            
        }
    
        public void render(Canvas canvas) {
            canvas.drawColor(Color.BLACK);
            player.draw(canvas);
            menu.draw(canvas);
            displayFps(canvas, avgFps);
        }
         
        private void displayFps(Canvas canvas, String fps) {
            if (canvas != null && fps != null) {
                Paint paint = new Paint();
                paint.setARGB(255, 255, 255, 255);
                canvas.drawText(fps, this.getWidth() - 50, 20, paint);
            }
        }
    }
    Also, some critique on the code in general would be welcome as I'm still learning it.
    Reply With Quote Edit / Delete Windows XP Netherlands Show Events

  40. Post #2160
    Rayjingstorm's Avatar
    June 2010
    1,536 Posts
    This question has probably been asked to death already, but what would be the best combination of libraries/toolkits for a 2d clone of tron for Linux/Windows. I made a couple of small applications with GTK+, and I just started into GLFW but I realized quickly that I was in over my head with OpenGL and before I knew it I was already doing everything bass ackwards (in that deprecated sort of way). Should I just make a simple gui within glfw and forgo trying to integrate GTK with it? Should I look into any other OpenGL helper libraries? And what would be the best place to learn the most up-to-date OpenGL? I have already written a version of the game with NCurses so I just need to translate that to a more graphical interface.
    Reply With Quote Edit / Delete Windows 7 United States Show Events